diff --git a/sdk/resourcemanager/sql/armsql/CHANGELOG.md b/sdk/resourcemanager/sql/armsql/CHANGELOG.md index 984867fb30e7..4d23c13a3b67 100644 --- a/sdk/resourcemanager/sql/armsql/CHANGELOG.md +++ b/sdk/resourcemanager/sql/armsql/CHANGELOG.md @@ -1,5 +1,254 @@ # Release History +## 2.0.0-beta.1 (2023-07-28) +### Breaking Changes + +- Function `*ServerDevOpsAuditSettingsClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, string, ServerDevOpsAuditingSettings, *ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions)` to `(context.Context, string, string, DevOpsAuditingSettingsName, ServerDevOpsAuditingSettings, *ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions)` +- Function `*ServerDevOpsAuditSettingsClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, *ServerDevOpsAuditSettingsClientGetOptions)` to `(context.Context, string, string, DevOpsAuditingSettingsName, *ServerDevOpsAuditSettingsClientGetOptions)` +- Type of `ManagedDatabaseRestoreDetailsProperties.NumberOfFilesDetected` has been changed from `*int64` to `*int32` +- Type of `ManagedDatabaseRestoreDetailsProperties.PercentCompleted` has been changed from `*float64` to `*int32` +- Type of `ManagedDatabaseRestoreDetailsProperties.UnrestorableFiles` has been changed from `[]*string` to `[]*ManagedDatabaseRestoreDetailsUnrestorableFileProperties` +- Type of `ServerProperties.PublicNetworkAccess` has been changed from `*ServerNetworkAccessFlag` to `*ServerPublicNetworkAccessFlag` +- Enum `DNSRefreshConfigurationPropertiesStatus` has been removed +- Operation `*ReplicationLinksClient.Delete` has been changed to LRO, use `*ReplicationLinksClient.BeginDelete` instead. +- Operation `*TransparentDataEncryptionsClient.CreateOrUpdate` has been changed to LRO, use `*TransparentDataEncryptionsClient.BeginCreateOrUpdate` instead. +- Operation `*VirtualClustersClient.UpdateDNSServers` has been changed to LRO, use `*VirtualClustersClient.BeginUpdateDNSServers` instead. +- Struct `DNSRefreshConfigurationProperties` has been removed +- Struct `UpdateManagedInstanceDNSServersOperation` has been removed +- Field `Family`, `MaintenanceConfigurationID` of struct `VirtualClusterProperties` has been removed + +### Features Added + +- New value `ManagedDatabaseStatusDbCopying`, `ManagedDatabaseStatusDbMoving`, `ManagedDatabaseStatusStarting`, `ManagedDatabaseStatusStopped`, `ManagedDatabaseStatusStopping` added to enum type `ManagedDatabaseStatus` +- New value `ReplicationLinkTypeSTANDBY` added to enum type `ReplicationLinkType` +- New value `SecondaryTypeStandby` added to enum type `SecondaryType` +- New enum type `AlwaysEncryptedEnclaveType` with values `AlwaysEncryptedEnclaveTypeDefault`, `AlwaysEncryptedEnclaveTypeVBS` +- New enum type `AvailabilityZoneType` with values `AvailabilityZoneTypeNoPreference`, `AvailabilityZoneTypeOne`, `AvailabilityZoneTypeThree`, `AvailabilityZoneTypeTwo` +- New enum type `BaselineName` with values `BaselineNameDefault` +- New enum type `DNSRefreshOperationStatus` with values `DNSRefreshOperationStatusFailed`, `DNSRefreshOperationStatusInProgress`, `DNSRefreshOperationStatusSucceeded` +- New enum type `DatabaseKeyType` with values `DatabaseKeyTypeAzureKeyVault` +- New enum type `DevOpsAuditingSettingsName` with values `DevOpsAuditingSettingsNameDefault` +- New enum type `DtcName` with values `DtcNameCurrent` +- New enum type `ExternalGovernanceStatus` with values `ExternalGovernanceStatusDisabled`, `ExternalGovernanceStatusEnabled` +- New enum type `ManagedLedgerDigestUploadsName` with values `ManagedLedgerDigestUploadsNameCurrent` +- New enum type `ManagedLedgerDigestUploadsState` with values `ManagedLedgerDigestUploadsStateDisabled`, `ManagedLedgerDigestUploadsStateEnabled` +- New enum type `MoveOperationMode` with values `MoveOperationModeCopy`, `MoveOperationModeMove` +- New enum type `RuleSeverity` with values `RuleSeverityHigh`, `RuleSeverityInformational`, `RuleSeverityLow`, `RuleSeverityMedium`, `RuleSeverityObsolete` +- New enum type `RuleStatus` with values `RuleStatusFinding`, `RuleStatusInternalError`, `RuleStatusNonFinding` +- New enum type `RuleType` with values `RuleTypeBaselineExpected`, `RuleTypeBinary`, `RuleTypeNegativeList`, `RuleTypePositiveList` +- New enum type `SQLVulnerabilityAssessmentName` with values `SQLVulnerabilityAssessmentNameDefault` +- New enum type `SQLVulnerabilityAssessmentState` with values `SQLVulnerabilityAssessmentStateDisabled`, `SQLVulnerabilityAssessmentStateEnabled` +- New enum type `SecondaryInstanceType` with values `SecondaryInstanceTypeGeo`, `SecondaryInstanceTypeStandby` +- New enum type `ServerConfigurationOptionName` with values `ServerConfigurationOptionNameAllowPolybaseExport` +- New enum type `ServerPublicNetworkAccessFlag` with values `ServerPublicNetworkAccessFlagDisabled`, `ServerPublicNetworkAccessFlagEnabled`, `ServerPublicNetworkAccessFlagSecuredByPerimeter` +- New enum type `StartStopScheduleName` with values `StartStopScheduleNameDefault` +- New function `*ClientFactory.NewDatabaseEncryptionProtectorsClient() *DatabaseEncryptionProtectorsClient` +- New function `*ClientFactory.NewDatabaseSQLVulnerabilityAssessmentBaselinesClient() *DatabaseSQLVulnerabilityAssessmentBaselinesClient` +- New function `*ClientFactory.NewDatabaseSQLVulnerabilityAssessmentExecuteScanClient() *DatabaseSQLVulnerabilityAssessmentExecuteScanClient` +- New function `*ClientFactory.NewDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient() *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient` +- New function `*ClientFactory.NewDatabaseSQLVulnerabilityAssessmentScanResultClient() *DatabaseSQLVulnerabilityAssessmentScanResultClient` +- New function `*ClientFactory.NewDatabaseSQLVulnerabilityAssessmentScansClient() *DatabaseSQLVulnerabilityAssessmentScansClient` +- New function `*ClientFactory.NewDatabaseSQLVulnerabilityAssessmentsSettingsClient() *DatabaseSQLVulnerabilityAssessmentsSettingsClient` +- New function `*ClientFactory.NewManagedDatabaseAdvancedThreatProtectionSettingsClient() *ManagedDatabaseAdvancedThreatProtectionSettingsClient` +- New function `*ClientFactory.NewManagedDatabaseMoveOperationsClient() *ManagedDatabaseMoveOperationsClient` +- New function `*ClientFactory.NewManagedInstanceAdvancedThreatProtectionSettingsClient() *ManagedInstanceAdvancedThreatProtectionSettingsClient` +- New function `*ClientFactory.NewManagedInstanceDtcsClient() *ManagedInstanceDtcsClient` +- New function `*ClientFactory.NewManagedLedgerDigestUploadsClient() *ManagedLedgerDigestUploadsClient` +- New function `*ClientFactory.NewManagedServerDNSAliasesClient() *ManagedServerDNSAliasesClient` +- New function `*ClientFactory.NewServerConfigurationOptionsClient() *ServerConfigurationOptionsClient` +- New function `*ClientFactory.NewStartStopManagedInstanceSchedulesClient() *StartStopManagedInstanceSchedulesClient` +- New function `*ClientFactory.NewSynapseLinkWorkspacesClient() *SynapseLinkWorkspacesClient` +- New function `*ClientFactory.NewVulnerabilityAssessmentBaselineClient() *VulnerabilityAssessmentBaselineClient` +- New function `*ClientFactory.NewVulnerabilityAssessmentBaselinesClient() *VulnerabilityAssessmentBaselinesClient` +- New function `*ClientFactory.NewVulnerabilityAssessmentExecuteScanClient() *VulnerabilityAssessmentExecuteScanClient` +- New function `*ClientFactory.NewVulnerabilityAssessmentRuleBaselineClient() *VulnerabilityAssessmentRuleBaselineClient` +- New function `*ClientFactory.NewVulnerabilityAssessmentRuleBaselinesClient() *VulnerabilityAssessmentRuleBaselinesClient` +- New function `*ClientFactory.NewVulnerabilityAssessmentScanResultClient() *VulnerabilityAssessmentScanResultClient` +- New function `*ClientFactory.NewVulnerabilityAssessmentScansClient() *VulnerabilityAssessmentScansClient` +- New function `*ClientFactory.NewVulnerabilityAssessmentsClient() *VulnerabilityAssessmentsClient` +- New function `*ClientFactory.NewVulnerabilityAssessmentsSettingsClient() *VulnerabilityAssessmentsSettingsClient` +- New function `NewDatabaseEncryptionProtectorsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DatabaseEncryptionProtectorsClient, error)` +- New function `*DatabaseEncryptionProtectorsClient.BeginRevalidate(context.Context, string, string, string, EncryptionProtectorName, *DatabaseEncryptionProtectorsClientBeginRevalidateOptions) (*runtime.Poller[DatabaseEncryptionProtectorsClientRevalidateResponse], error)` +- New function `*DatabaseEncryptionProtectorsClient.BeginRevert(context.Context, string, string, string, EncryptionProtectorName, *DatabaseEncryptionProtectorsClientBeginRevertOptions) (*runtime.Poller[DatabaseEncryptionProtectorsClientRevertResponse], error)` +- New function `NewDatabaseSQLVulnerabilityAssessmentBaselinesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DatabaseSQLVulnerabilityAssessmentBaselinesClient, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentBaselinesClient.CreateOrUpdate(context.Context, string, string, string, VulnerabilityAssessmentName, BaselineName, DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput, *DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateOptions) (DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentBaselinesClient.Get(context.Context, string, string, string, VulnerabilityAssessmentName, BaselineName, *DatabaseSQLVulnerabilityAssessmentBaselinesClientGetOptions) (DatabaseSQLVulnerabilityAssessmentBaselinesClientGetResponse, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentBaselinesClient.NewListBySQLVulnerabilityAssessmentPager(string, string, string, VulnerabilityAssessmentName, *DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentOptions) *runtime.Pager[DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse]` +- New function `NewDatabaseSQLVulnerabilityAssessmentExecuteScanClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DatabaseSQLVulnerabilityAssessmentExecuteScanClient, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentExecuteScanClient.BeginExecute(context.Context, string, string, string, VulnerabilityAssessmentName, *DatabaseSQLVulnerabilityAssessmentExecuteScanClientBeginExecuteOptions) (*runtime.Poller[DatabaseSQLVulnerabilityAssessmentExecuteScanClientExecuteResponse], error)` +- New function `NewDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate(context.Context, string, string, string, VulnerabilityAssessmentName, BaselineName, string, DatabaseSQLVulnerabilityAssessmentRuleBaselineInput, *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions) (DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.Delete(context.Context, string, string, string, VulnerabilityAssessmentName, BaselineName, string, *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteOptions) (DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteResponse, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.Get(context.Context, string, string, string, VulnerabilityAssessmentName, BaselineName, string, *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetOptions) (DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetResponse, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.NewListByBaselinePager(string, string, string, VulnerabilityAssessmentName, BaselineName, *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineOptions) *runtime.Pager[DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse]` +- New function `NewDatabaseSQLVulnerabilityAssessmentScanResultClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DatabaseSQLVulnerabilityAssessmentScanResultClient, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentScanResultClient.Get(context.Context, string, string, string, SQLVulnerabilityAssessmentName, string, string, *DatabaseSQLVulnerabilityAssessmentScanResultClientGetOptions) (DatabaseSQLVulnerabilityAssessmentScanResultClientGetResponse, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentScanResultClient.NewListByScanPager(string, string, string, SQLVulnerabilityAssessmentName, string, *DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanOptions) *runtime.Pager[DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse]` +- New function `NewDatabaseSQLVulnerabilityAssessmentScansClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DatabaseSQLVulnerabilityAssessmentScansClient, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentScansClient.Get(context.Context, string, string, string, VulnerabilityAssessmentName, string, *DatabaseSQLVulnerabilityAssessmentScansClientGetOptions) (DatabaseSQLVulnerabilityAssessmentScansClientGetResponse, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentScansClient.NewListBySQLVulnerabilityAssessmentsPager(string, string, string, VulnerabilityAssessmentName, *DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsOptions) *runtime.Pager[DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse]` +- New function `NewDatabaseSQLVulnerabilityAssessmentsSettingsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DatabaseSQLVulnerabilityAssessmentsSettingsClient, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentsSettingsClient.Get(context.Context, string, string, string, SQLVulnerabilityAssessmentName, *DatabaseSQLVulnerabilityAssessmentsSettingsClientGetOptions) (DatabaseSQLVulnerabilityAssessmentsSettingsClientGetResponse, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentsSettingsClient.NewListByDatabasePager(string, string, string, *DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseOptions) *runtime.Pager[DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse]` +- New function `*FailoverGroupsClient.BeginTryPlannedBeforeForcedFailover(context.Context, string, string, string, *FailoverGroupsClientBeginTryPlannedBeforeForcedFailoverOptions) (*runtime.Poller[FailoverGroupsClientTryPlannedBeforeForcedFailoverResponse], error)` +- New function `NewManagedDatabaseAdvancedThreatProtectionSettingsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedDatabaseAdvancedThreatProtectionSettingsClient, error)` +- New function `*ManagedDatabaseAdvancedThreatProtectionSettingsClient.CreateOrUpdate(context.Context, string, string, string, AdvancedThreatProtectionName, ManagedDatabaseAdvancedThreatProtection, *ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateOptions) (ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse, error)` +- New function `*ManagedDatabaseAdvancedThreatProtectionSettingsClient.Get(context.Context, string, string, string, AdvancedThreatProtectionName, *ManagedDatabaseAdvancedThreatProtectionSettingsClientGetOptions) (ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse, error)` +- New function `*ManagedDatabaseAdvancedThreatProtectionSettingsClient.NewListByDatabasePager(string, string, string, *ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseOptions) *runtime.Pager[ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse]` +- New function `NewManagedDatabaseMoveOperationsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedDatabaseMoveOperationsClient, error)` +- New function `*ManagedDatabaseMoveOperationsClient.Get(context.Context, string, string, string, *ManagedDatabaseMoveOperationsClientGetOptions) (ManagedDatabaseMoveOperationsClientGetResponse, error)` +- New function `*ManagedDatabaseMoveOperationsClient.NewListByLocationPager(string, string, *ManagedDatabaseMoveOperationsClientListByLocationOptions) *runtime.Pager[ManagedDatabaseMoveOperationsClientListByLocationResponse]` +- New function `*ManagedDatabasesClient.BeginCancelMove(context.Context, string, string, string, ManagedDatabaseMoveDefinition, *ManagedDatabasesClientBeginCancelMoveOptions) (*runtime.Poller[ManagedDatabasesClientCancelMoveResponse], error)` +- New function `*ManagedDatabasesClient.BeginCompleteMove(context.Context, string, string, string, ManagedDatabaseMoveDefinition, *ManagedDatabasesClientBeginCompleteMoveOptions) (*runtime.Poller[ManagedDatabasesClientCompleteMoveResponse], error)` +- New function `*ManagedDatabasesClient.BeginStartMove(context.Context, string, string, string, ManagedDatabaseStartMoveDefinition, *ManagedDatabasesClientBeginStartMoveOptions) (*runtime.Poller[ManagedDatabasesClientStartMoveResponse], error)` +- New function `NewManagedInstanceAdvancedThreatProtectionSettingsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedInstanceAdvancedThreatProtectionSettingsClient, error)` +- New function `*ManagedInstanceAdvancedThreatProtectionSettingsClient.BeginCreateOrUpdate(context.Context, string, string, AdvancedThreatProtectionName, ManagedInstanceAdvancedThreatProtection, *ManagedInstanceAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedInstanceAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse], error)` +- New function `*ManagedInstanceAdvancedThreatProtectionSettingsClient.Get(context.Context, string, string, AdvancedThreatProtectionName, *ManagedInstanceAdvancedThreatProtectionSettingsClientGetOptions) (ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse, error)` +- New function `*ManagedInstanceAdvancedThreatProtectionSettingsClient.NewListByInstancePager(string, string, *ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceOptions) *runtime.Pager[ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse]` +- New function `NewManagedInstanceDtcsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedInstanceDtcsClient, error)` +- New function `*ManagedInstanceDtcsClient.BeginCreateOrUpdate(context.Context, string, string, DtcName, ManagedInstanceDtc, *ManagedInstanceDtcsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedInstanceDtcsClientCreateOrUpdateResponse], error)` +- New function `*ManagedInstanceDtcsClient.Get(context.Context, string, string, DtcName, *ManagedInstanceDtcsClientGetOptions) (ManagedInstanceDtcsClientGetResponse, error)` +- New function `*ManagedInstanceDtcsClient.NewListByManagedInstancePager(string, string, *ManagedInstanceDtcsClientListByManagedInstanceOptions) *runtime.Pager[ManagedInstanceDtcsClientListByManagedInstanceResponse]` +- New function `*ManagedInstancesClient.NewListOutboundNetworkDependenciesByManagedInstancePager(string, string, *ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceOptions) *runtime.Pager[ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse]` +- New function `*ManagedInstancesClient.BeginStart(context.Context, string, string, *ManagedInstancesClientBeginStartOptions) (*runtime.Poller[ManagedInstancesClientStartResponse], error)` +- New function `*ManagedInstancesClient.BeginStop(context.Context, string, string, *ManagedInstancesClientBeginStopOptions) (*runtime.Poller[ManagedInstancesClientStopResponse], error)` +- New function `NewManagedLedgerDigestUploadsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedLedgerDigestUploadsClient, error)` +- New function `*ManagedLedgerDigestUploadsClient.BeginCreateOrUpdate(context.Context, string, string, string, ManagedLedgerDigestUploadsName, ManagedLedgerDigestUploads, *ManagedLedgerDigestUploadsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedLedgerDigestUploadsClientCreateOrUpdateResponse], error)` +- New function `*ManagedLedgerDigestUploadsClient.BeginDisable(context.Context, string, string, string, ManagedLedgerDigestUploadsName, *ManagedLedgerDigestUploadsClientBeginDisableOptions) (*runtime.Poller[ManagedLedgerDigestUploadsClientDisableResponse], error)` +- New function `*ManagedLedgerDigestUploadsClient.Get(context.Context, string, string, string, ManagedLedgerDigestUploadsName, *ManagedLedgerDigestUploadsClientGetOptions) (ManagedLedgerDigestUploadsClientGetResponse, error)` +- New function `*ManagedLedgerDigestUploadsClient.NewListByDatabasePager(string, string, string, *ManagedLedgerDigestUploadsClientListByDatabaseOptions) *runtime.Pager[ManagedLedgerDigestUploadsClientListByDatabaseResponse]` +- New function `NewManagedServerDNSAliasesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedServerDNSAliasesClient, error)` +- New function `*ManagedServerDNSAliasesClient.BeginAcquire(context.Context, string, string, string, ManagedServerDNSAliasAcquisition, *ManagedServerDNSAliasesClientBeginAcquireOptions) (*runtime.Poller[ManagedServerDNSAliasesClientAcquireResponse], error)` +- New function `*ManagedServerDNSAliasesClient.BeginCreateOrUpdate(context.Context, string, string, string, ManagedServerDNSAliasCreation, *ManagedServerDNSAliasesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedServerDNSAliasesClientCreateOrUpdateResponse], error)` +- New function `*ManagedServerDNSAliasesClient.BeginDelete(context.Context, string, string, string, *ManagedServerDNSAliasesClientBeginDeleteOptions) (*runtime.Poller[ManagedServerDNSAliasesClientDeleteResponse], error)` +- New function `*ManagedServerDNSAliasesClient.Get(context.Context, string, string, string, *ManagedServerDNSAliasesClientGetOptions) (ManagedServerDNSAliasesClientGetResponse, error)` +- New function `*ManagedServerDNSAliasesClient.NewListByManagedInstancePager(string, string, *ManagedServerDNSAliasesClientListByManagedInstanceOptions) *runtime.Pager[ManagedServerDNSAliasesClientListByManagedInstanceResponse]` +- New function `NewServerConfigurationOptionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ServerConfigurationOptionsClient, error)` +- New function `*ServerConfigurationOptionsClient.BeginCreateOrUpdate(context.Context, string, string, ServerConfigurationOptionName, ServerConfigurationOption, *ServerConfigurationOptionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerConfigurationOptionsClientCreateOrUpdateResponse], error)` +- New function `*ServerConfigurationOptionsClient.Get(context.Context, string, string, ServerConfigurationOptionName, *ServerConfigurationOptionsClientGetOptions) (ServerConfigurationOptionsClientGetResponse, error)` +- New function `*ServerConfigurationOptionsClient.NewListByManagedInstancePager(string, string, *ServerConfigurationOptionsClientListByManagedInstanceOptions) *runtime.Pager[ServerConfigurationOptionsClientListByManagedInstanceResponse]` +- New function `*ServersClient.BeginRefreshStatus(context.Context, string, string, *ServersClientBeginRefreshStatusOptions) (*runtime.Poller[ServersClientRefreshStatusResponse], error)` +- New function `NewStartStopManagedInstanceSchedulesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*StartStopManagedInstanceSchedulesClient, error)` +- New function `*StartStopManagedInstanceSchedulesClient.CreateOrUpdate(context.Context, string, string, StartStopScheduleName, StartStopManagedInstanceSchedule, *StartStopManagedInstanceSchedulesClientCreateOrUpdateOptions) (StartStopManagedInstanceSchedulesClientCreateOrUpdateResponse, error)` +- New function `*StartStopManagedInstanceSchedulesClient.Delete(context.Context, string, string, StartStopScheduleName, *StartStopManagedInstanceSchedulesClientDeleteOptions) (StartStopManagedInstanceSchedulesClientDeleteResponse, error)` +- New function `*StartStopManagedInstanceSchedulesClient.Get(context.Context, string, string, StartStopScheduleName, *StartStopManagedInstanceSchedulesClientGetOptions) (StartStopManagedInstanceSchedulesClientGetResponse, error)` +- New function `*StartStopManagedInstanceSchedulesClient.NewListByInstancePager(string, string, *StartStopManagedInstanceSchedulesClientListByInstanceOptions) *runtime.Pager[StartStopManagedInstanceSchedulesClientListByInstanceResponse]` +- New function `NewSynapseLinkWorkspacesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SynapseLinkWorkspacesClient, error)` +- New function `*SynapseLinkWorkspacesClient.NewListByDatabasePager(string, string, string, *SynapseLinkWorkspacesClientListByDatabaseOptions) *runtime.Pager[SynapseLinkWorkspacesClientListByDatabaseResponse]` +- New function `NewVulnerabilityAssessmentBaselineClient(string, azcore.TokenCredential, *arm.ClientOptions) (*VulnerabilityAssessmentBaselineClient, error)` +- New function `*VulnerabilityAssessmentBaselineClient.Get(context.Context, string, string, VulnerabilityAssessmentName, BaselineName, *VulnerabilityAssessmentBaselineClientGetOptions) (VulnerabilityAssessmentBaselineClientGetResponse, error)` +- New function `*VulnerabilityAssessmentBaselineClient.NewListBySQLVulnerabilityAssessmentPager(string, string, VulnerabilityAssessmentName, *VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentOptions) *runtime.Pager[VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse]` +- New function `NewVulnerabilityAssessmentBaselinesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*VulnerabilityAssessmentBaselinesClient, error)` +- New function `*VulnerabilityAssessmentBaselinesClient.CreateOrUpdate(context.Context, string, string, VulnerabilityAssessmentName, BaselineName, DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput, *VulnerabilityAssessmentBaselinesClientCreateOrUpdateOptions) (VulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse, error)` +- New function `NewVulnerabilityAssessmentExecuteScanClient(string, azcore.TokenCredential, *arm.ClientOptions) (*VulnerabilityAssessmentExecuteScanClient, error)` +- New function `*VulnerabilityAssessmentExecuteScanClient.BeginExecute(context.Context, string, string, VulnerabilityAssessmentName, *VulnerabilityAssessmentExecuteScanClientBeginExecuteOptions) (*runtime.Poller[VulnerabilityAssessmentExecuteScanClientExecuteResponse], error)` +- New function `NewVulnerabilityAssessmentRuleBaselineClient(string, azcore.TokenCredential, *arm.ClientOptions) (*VulnerabilityAssessmentRuleBaselineClient, error)` +- New function `*VulnerabilityAssessmentRuleBaselineClient.CreateOrUpdate(context.Context, string, string, VulnerabilityAssessmentName, BaselineName, string, DatabaseSQLVulnerabilityAssessmentRuleBaselineInput, *VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateOptions) (VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateResponse, error)` +- New function `*VulnerabilityAssessmentRuleBaselineClient.Get(context.Context, string, string, VulnerabilityAssessmentName, BaselineName, string, *VulnerabilityAssessmentRuleBaselineClientGetOptions) (VulnerabilityAssessmentRuleBaselineClientGetResponse, error)` +- New function `*VulnerabilityAssessmentRuleBaselineClient.NewListByBaselinePager(string, string, VulnerabilityAssessmentName, BaselineName, *VulnerabilityAssessmentRuleBaselineClientListByBaselineOptions) *runtime.Pager[VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse]` +- New function `NewVulnerabilityAssessmentRuleBaselinesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*VulnerabilityAssessmentRuleBaselinesClient, error)` +- New function `*VulnerabilityAssessmentRuleBaselinesClient.Delete(context.Context, string, string, VulnerabilityAssessmentName, BaselineName, string, *VulnerabilityAssessmentRuleBaselinesClientDeleteOptions) (VulnerabilityAssessmentRuleBaselinesClientDeleteResponse, error)` +- New function `NewVulnerabilityAssessmentScanResultClient(string, azcore.TokenCredential, *arm.ClientOptions) (*VulnerabilityAssessmentScanResultClient, error)` +- New function `*VulnerabilityAssessmentScanResultClient.Get(context.Context, string, string, SQLVulnerabilityAssessmentName, string, string, *VulnerabilityAssessmentScanResultClientGetOptions) (VulnerabilityAssessmentScanResultClientGetResponse, error)` +- New function `*VulnerabilityAssessmentScanResultClient.NewListByScanPager(string, string, SQLVulnerabilityAssessmentName, string, *VulnerabilityAssessmentScanResultClientListByScanOptions) *runtime.Pager[VulnerabilityAssessmentScanResultClientListByScanResponse]` +- New function `NewVulnerabilityAssessmentScansClient(string, azcore.TokenCredential, *arm.ClientOptions) (*VulnerabilityAssessmentScansClient, error)` +- New function `*VulnerabilityAssessmentScansClient.Get(context.Context, string, string, VulnerabilityAssessmentName, string, *VulnerabilityAssessmentScansClientGetOptions) (VulnerabilityAssessmentScansClientGetResponse, error)` +- New function `*VulnerabilityAssessmentScansClient.NewListBySQLVulnerabilityAssessmentsPager(string, string, VulnerabilityAssessmentName, *VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsOptions) *runtime.Pager[VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse]` +- New function `NewVulnerabilityAssessmentsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*VulnerabilityAssessmentsClient, error)` +- New function `*VulnerabilityAssessmentsClient.Delete(context.Context, string, string, VulnerabilityAssessmentName, *VulnerabilityAssessmentsClientDeleteOptions) (VulnerabilityAssessmentsClientDeleteResponse, error)` +- New function `NewVulnerabilityAssessmentsSettingsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*VulnerabilityAssessmentsSettingsClient, error)` +- New function `*VulnerabilityAssessmentsSettingsClient.CreateOrUpdate(context.Context, string, string, VulnerabilityAssessmentName, VulnerabilityAssessment, *VulnerabilityAssessmentsSettingsClientCreateOrUpdateOptions) (VulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse, error)` +- New function `*VulnerabilityAssessmentsSettingsClient.Get(context.Context, string, string, SQLVulnerabilityAssessmentName, *VulnerabilityAssessmentsSettingsClientGetOptions) (VulnerabilityAssessmentsSettingsClientGetResponse, error)` +- New function `*VulnerabilityAssessmentsSettingsClient.NewListByServerPager(string, string, *VulnerabilityAssessmentsSettingsClientListByServerOptions) *runtime.Pager[VulnerabilityAssessmentsSettingsClientListByServerResponse]` +- New struct `Baseline` +- New struct `BaselineAdjustedResult` +- New struct `BenchmarkReference` +- New struct `DatabaseKey` +- New struct `DatabaseSQLVulnerabilityAssessmentBaselineSet` +- New struct `DatabaseSQLVulnerabilityAssessmentBaselineSetListResult` +- New struct `DatabaseSQLVulnerabilityAssessmentBaselineSetProperties` +- New struct `DatabaseSQLVulnerabilityAssessmentRuleBaseline` +- New struct `DatabaseSQLVulnerabilityAssessmentRuleBaselineInput` +- New struct `DatabaseSQLVulnerabilityAssessmentRuleBaselineInputProperties` +- New struct `DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput` +- New struct `DatabaseSQLVulnerabilityAssessmentRuleBaselineListInputProperties` +- New struct `DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult` +- New struct `DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties` +- New struct `EndpointDependency` +- New struct `EndpointDetail` +- New struct `ManagedDatabaseAdvancedThreatProtection` +- New struct `ManagedDatabaseAdvancedThreatProtectionListResult` +- New struct `ManagedDatabaseMoveDefinition` +- New struct `ManagedDatabaseMoveOperationListResult` +- New struct `ManagedDatabaseMoveOperationResult` +- New struct `ManagedDatabaseMoveOperationResultProperties` +- New struct `ManagedDatabaseRestoreDetailsBackupSetProperties` +- New struct `ManagedDatabaseRestoreDetailsUnrestorableFileProperties` +- New struct `ManagedDatabaseStartMoveDefinition` +- New struct `ManagedInstanceAdvancedThreatProtection` +- New struct `ManagedInstanceAdvancedThreatProtectionListResult` +- New struct `ManagedInstanceDtc` +- New struct `ManagedInstanceDtcListResult` +- New struct `ManagedInstanceDtcProperties` +- New struct `ManagedInstanceDtcSecuritySettings` +- New struct `ManagedInstanceDtcTransactionManagerCommunicationSettings` +- New struct `ManagedLedgerDigestUploads` +- New struct `ManagedLedgerDigestUploadsListResult` +- New struct `ManagedLedgerDigestUploadsProperties` +- New struct `ManagedServerDNSAlias` +- New struct `ManagedServerDNSAliasAcquisition` +- New struct `ManagedServerDNSAliasCreation` +- New struct `ManagedServerDNSAliasListResult` +- New struct `ManagedServerDNSAliasProperties` +- New struct `OutboundEnvironmentEndpoint` +- New struct `OutboundEnvironmentEndpointCollection` +- New struct `QueryCheck` +- New struct `RefreshExternalGovernanceStatusOperationResult` +- New struct `RefreshExternalGovernanceStatusOperationResultProperties` +- New struct `Remediation` +- New struct `ScheduleItem` +- New struct `ServerConfigurationOption` +- New struct `ServerConfigurationOptionListResult` +- New struct `ServerConfigurationOptionProperties` +- New struct `StartStopManagedInstanceSchedule` +- New struct `StartStopManagedInstanceScheduleListResult` +- New struct `StartStopManagedInstanceScheduleProperties` +- New struct `SynapseLinkWorkspace` +- New struct `SynapseLinkWorkspaceInfoProperties` +- New struct `SynapseLinkWorkspaceListResult` +- New struct `SynapseLinkWorkspaceProperties` +- New struct `UpdateVirtualClusterDNSServersOperation` +- New struct `VaRule` +- New struct `VirtualClusterDNSServersProperties` +- New struct `VulnerabilityAssessment` +- New struct `VulnerabilityAssessmentListResult` +- New struct `VulnerabilityAssessmentPolicyProperties` +- New struct `VulnerabilityAssessmentScanForSQLError` +- New struct `VulnerabilityAssessmentScanListResult` +- New struct `VulnerabilityAssessmentScanRecordForSQL` +- New struct `VulnerabilityAssessmentScanRecordForSQLListResult` +- New struct `VulnerabilityAssessmentScanRecordForSQLProperties` +- New struct `VulnerabilityAssessmentScanResultProperties` +- New struct `VulnerabilityAssessmentScanResults` +- New field `AvailabilityZone`, `EncryptionProtector`, `Keys`, `ManualCutover`, `PerformCutover`, `PreferredEnclaveType` in struct `DatabaseProperties` +- New field `EncryptionProtector`, `Keys`, `ManualCutover`, `PerformCutover`, `PreferredEnclaveType` in struct `DatabaseUpdateProperties` +- New field `Expand`, `Filter` in struct `DatabasesClientGetOptions` +- New field `AvailabilityZone`, `MinCapacity`, `PreferredEnclaveType` in struct `ElasticPoolProperties` +- New field `AvailabilityZone`, `MinCapacity`, `PreferredEnclaveType` in struct `ElasticPoolUpdateProperties` +- New field `SecondaryType` in struct `InstanceFailoverGroupProperties` +- New field `CrossSubscriptionRestorableDroppedDatabaseID`, `CrossSubscriptionSourceDatabaseID`, `CrossSubscriptionTargetManagedInstanceID`, `IsLedgerOn`, `StorageContainerIdentity` in struct `ManagedDatabaseProperties` +- New field `CurrentBackupType`, `CurrentRestorePlanSizeMB`, `CurrentRestoredSizeMB`, `DiffBackupSets`, `FullBackupSets`, `LogBackupSets`, `NumberOfFilesQueued`, `NumberOfFilesRestored`, `NumberOfFilesRestoring`, `NumberOfFilesSkipped`, `NumberOfFilesUnrestorable`, `Type` in struct `ManagedDatabaseRestoreDetailsProperties` +- New field `GroupIDs` in struct `PrivateEndpointConnectionProperties` +- New field `NextLink` in struct `RecoverableDatabaseListResult` +- New field `Keys` in struct `RecoverableDatabaseProperties` +- New field `Expand`, `Filter` in struct `RecoverableDatabasesClientGetOptions` +- New field `Keys` in struct `RestorableDroppedDatabaseProperties` +- New field `Expand`, `Filter` in struct `RestorableDroppedDatabasesClientGetOptions` +- New field `IsManagedIdentityInUse` in struct `ServerDevOpsAuditSettingsProperties` +- New field `ExternalGovernanceStatus` in struct `ServerProperties` +- New field `Version` in struct `VirtualClusterProperties` + + ## 1.1.0 (2023-03-27) ### Features Added diff --git a/sdk/resourcemanager/sql/armsql/agent_client.go b/sdk/resourcemanager/sql/armsql/agent_client.go index 4f0f56a35193..181a3b7d35b6 100644 --- a/sdk/resourcemanager/sql/armsql/agent_client.go +++ b/sdk/resourcemanager/sql/armsql/agent_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -53,18 +52,21 @@ func NewAgentClient(subscriptionID string, credential azcore.TokenCredential, op // - managedInstanceName - The name of the managed instance. // - options - AgentClientCreateOrUpdateOptions contains the optional parameters for the AgentClient.CreateOrUpdate method. func (client *AgentClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters AgentConfiguration, options *AgentClientCreateOrUpdateOptions) (AgentClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, parameters, options) if err != nil { return AgentClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AgentClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AgentClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AgentClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -90,7 +92,10 @@ func (client *AgentClient) createOrUpdateCreateRequest(ctx context.Context, reso reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -111,18 +116,21 @@ func (client *AgentClient) createOrUpdateHandleResponse(resp *http.Response) (Ag // - managedInstanceName - The name of the managed instance. // - options - AgentClientGetOptions contains the optional parameters for the AgentClient.Get method. func (client *AgentClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, options *AgentClientGetOptions) (AgentClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, options) if err != nil { return AgentClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AgentClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AgentClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AgentClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/agent_client_example_test.go b/sdk/resourcemanager/sql/armsql/agent_client_example_test.go index bc4941ab8d17..8f561ab2a18a 100644 --- a/sdk/resourcemanager/sql/armsql/agent_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/agent_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SqlAgentConfigurationGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -46,7 +46,7 @@ func ExampleAgentClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SqlAgentConfigurationPut.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/autorest.md b/sdk/resourcemanager/sql/armsql/autorest.md index 73938f709d0c..8aedd8bd4b72 100644 --- a/sdk/resourcemanager/sql/armsql/autorest.md +++ b/sdk/resourcemanager/sql/armsql/autorest.md @@ -5,8 +5,9 @@ ``` 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 +- https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.0 +module-version: 2.0.0-beta.1 +tag: package-composite-v5 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/sql/armsql/backupshorttermretentionpolicies_client.go b/sdk/resourcemanager/sql/armsql/backupshorttermretentionpolicies_client.go index 0f0865c9dbc5..e470d3ad4b7c 100644 --- a/sdk/resourcemanager/sql/armsql/backupshorttermretentionpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/backupshorttermretentionpolicies_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -62,7 +61,8 @@ func (client *BackupShortTermRetentionPoliciesClient) BeginCreateOrUpdate(ctx co if err != nil { return nil, err } - return runtime.NewPoller[BackupShortTermRetentionPoliciesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[BackupShortTermRetentionPoliciesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[BackupShortTermRetentionPoliciesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -73,18 +73,20 @@ func (client *BackupShortTermRetentionPoliciesClient) BeginCreateOrUpdate(ctx co // // Generated from API version 2021-02-01-preview func (client *BackupShortTermRetentionPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, policyName ShortTermRetentionPolicyName, parameters BackupShortTermRetentionPolicy, options *BackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, policyName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -118,7 +120,10 @@ func (client *BackupShortTermRetentionPoliciesClient) createOrUpdateCreateReques reqQP.Set("api-version", "2021-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Get - Gets a database's short term retention policy. @@ -133,18 +138,21 @@ func (client *BackupShortTermRetentionPoliciesClient) createOrUpdateCreateReques // - options - BackupShortTermRetentionPoliciesClientGetOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.Get // method. func (client *BackupShortTermRetentionPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, policyName ShortTermRetentionPolicyName, options *BackupShortTermRetentionPoliciesClientGetOptions) (BackupShortTermRetentionPoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, policyName, options) if err != nil { return BackupShortTermRetentionPoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BackupShortTermRetentionPoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BackupShortTermRetentionPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BackupShortTermRetentionPoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -284,7 +292,8 @@ func (client *BackupShortTermRetentionPoliciesClient) BeginUpdate(ctx context.Co if err != nil { return nil, err } - return runtime.NewPoller[BackupShortTermRetentionPoliciesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[BackupShortTermRetentionPoliciesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[BackupShortTermRetentionPoliciesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -295,18 +304,20 @@ func (client *BackupShortTermRetentionPoliciesClient) BeginUpdate(ctx context.Co // // Generated from API version 2021-02-01-preview func (client *BackupShortTermRetentionPoliciesClient) update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, policyName ShortTermRetentionPolicyName, parameters BackupShortTermRetentionPolicy, options *BackupShortTermRetentionPoliciesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, databaseName, policyName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -340,5 +351,8 @@ func (client *BackupShortTermRetentionPoliciesClient) updateCreateRequest(ctx co reqQP.Set("api-version", "2021-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/backupshorttermretentionpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/backupshorttermretentionpolicies_client_example_test.go index d7add7cc4dd2..f0abbd46b0ec 100644 --- a/sdk/resourcemanager/sql/armsql/backupshorttermretentionpolicies_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/backupshorttermretentionpolicies_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/GetShortTermRetentionPolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -47,7 +47,7 @@ func ExampleBackupShortTermRetentionPoliciesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/UpdateShortTermRetentionPolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -85,7 +85,7 @@ func ExampleBackupShortTermRetentionPoliciesClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListShortTermRetentionPoliciesByDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/capabilities_client.go b/sdk/resourcemanager/sql/armsql/capabilities_client.go index 1ef506ef92e8..32412a56cb23 100644 --- a/sdk/resourcemanager/sql/armsql/capabilities_client.go +++ b/sdk/resourcemanager/sql/armsql/capabilities_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -52,18 +51,21 @@ func NewCapabilitiesClient(subscriptionID string, credential azcore.TokenCredent // - options - CapabilitiesClientListByLocationOptions contains the optional parameters for the CapabilitiesClient.ListByLocation // method. func (client *CapabilitiesClient) ListByLocation(ctx context.Context, locationName string, options *CapabilitiesClientListByLocationOptions) (CapabilitiesClientListByLocationResponse, error) { + var err error req, err := client.listByLocationCreateRequest(ctx, locationName, options) if err != nil { return CapabilitiesClientListByLocationResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CapabilitiesClientListByLocationResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CapabilitiesClientListByLocationResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CapabilitiesClientListByLocationResponse{}, err } - return client.listByLocationHandleResponse(resp) + resp, err := client.listByLocationHandleResponse(httpResp) + return resp, err } // listByLocationCreateRequest creates the ListByLocation request. diff --git a/sdk/resourcemanager/sql/armsql/capabilities_client_example_test.go b/sdk/resourcemanager/sql/armsql/capabilities_client_example_test.go index c8e1c03d7e11..4a6ddc2128a0 100644 --- a/sdk/resourcemanager/sql/armsql/capabilities_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/capabilities_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LocationCapabilityListByLocation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/client_factory.go b/sdk/resourcemanager/sql/armsql/client_factory.go index 8a15965a7f85..d2c1496ba904 100644 --- a/sdk/resourcemanager/sql/armsql/client_factory.go +++ b/sdk/resourcemanager/sql/armsql/client_factory.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -38,8 +37,18 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -func (c *ClientFactory) NewRecoverableDatabasesClient() *RecoverableDatabasesClient { - subClient, _ := NewRecoverableDatabasesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAgentClient() *AgentClient { + subClient, _ := NewAgentClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewBackupShortTermRetentionPoliciesClient() *BackupShortTermRetentionPoliciesClient { + subClient, _ := NewBackupShortTermRetentionPoliciesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewCapabilitiesClient() *CapabilitiesClient { + subClient, _ := NewCapabilitiesClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -53,63 +62,83 @@ func (c *ClientFactory) NewDataMaskingRulesClient() *DataMaskingRulesClient { return subClient } -func (c *ClientFactory) NewGeoBackupPoliciesClient() *GeoBackupPoliciesClient { - subClient, _ := NewGeoBackupPoliciesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDataWarehouseUserActivitiesClient() *DataWarehouseUserActivitiesClient { + subClient, _ := NewDataWarehouseUserActivitiesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDatabasesClient() *DatabasesClient { - subClient, _ := NewDatabasesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDatabaseAdvancedThreatProtectionSettingsClient() *DatabaseAdvancedThreatProtectionSettingsClient { + subClient, _ := NewDatabaseAdvancedThreatProtectionSettingsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewElasticPoolsClient() *ElasticPoolsClient { - subClient, _ := NewElasticPoolsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDatabaseAdvisorsClient() *DatabaseAdvisorsClient { + subClient, _ := NewDatabaseAdvisorsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewServerCommunicationLinksClient() *ServerCommunicationLinksClient { - subClient, _ := NewServerCommunicationLinksClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDatabaseAutomaticTuningClient() *DatabaseAutomaticTuningClient { + subClient, _ := NewDatabaseAutomaticTuningClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewServiceObjectivesClient() *ServiceObjectivesClient { - subClient, _ := NewServiceObjectivesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDatabaseBlobAuditingPoliciesClient() *DatabaseBlobAuditingPoliciesClient { + subClient, _ := NewDatabaseBlobAuditingPoliciesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewElasticPoolActivitiesClient() *ElasticPoolActivitiesClient { - subClient, _ := NewElasticPoolActivitiesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDatabaseColumnsClient() *DatabaseColumnsClient { + subClient, _ := NewDatabaseColumnsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewElasticPoolDatabaseActivitiesClient() *ElasticPoolDatabaseActivitiesClient { - subClient, _ := NewElasticPoolDatabaseActivitiesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDatabaseEncryptionProtectorsClient() *DatabaseEncryptionProtectorsClient { + subClient, _ := NewDatabaseEncryptionProtectorsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewServerUsagesClient() *ServerUsagesClient { - subClient, _ := NewServerUsagesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDatabaseExtensionsClient() *DatabaseExtensionsClient { + subClient, _ := NewDatabaseExtensionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDatabaseAdvisorsClient() *DatabaseAdvisorsClient { - subClient, _ := NewDatabaseAdvisorsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDatabaseOperationsClient() *DatabaseOperationsClient { + subClient, _ := NewDatabaseOperationsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDatabaseAutomaticTuningClient() *DatabaseAutomaticTuningClient { - subClient, _ := NewDatabaseAutomaticTuningClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDatabaseRecommendedActionsClient() *DatabaseRecommendedActionsClient { + subClient, _ := NewDatabaseRecommendedActionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDatabaseColumnsClient() *DatabaseColumnsClient { - subClient, _ := NewDatabaseColumnsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDatabaseSQLVulnerabilityAssessmentBaselinesClient() *DatabaseSQLVulnerabilityAssessmentBaselinesClient { + subClient, _ := NewDatabaseSQLVulnerabilityAssessmentBaselinesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDatabaseRecommendedActionsClient() *DatabaseRecommendedActionsClient { - subClient, _ := NewDatabaseRecommendedActionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDatabaseSQLVulnerabilityAssessmentExecuteScanClient() *DatabaseSQLVulnerabilityAssessmentExecuteScanClient { + subClient, _ := NewDatabaseSQLVulnerabilityAssessmentExecuteScanClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient() *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient { + subClient, _ := NewDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewDatabaseSQLVulnerabilityAssessmentScanResultClient() *DatabaseSQLVulnerabilityAssessmentScanResultClient { + subClient, _ := NewDatabaseSQLVulnerabilityAssessmentScanResultClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewDatabaseSQLVulnerabilityAssessmentScansClient() *DatabaseSQLVulnerabilityAssessmentScansClient { + subClient, _ := NewDatabaseSQLVulnerabilityAssessmentScansClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewDatabaseSQLVulnerabilityAssessmentsSettingsClient() *DatabaseSQLVulnerabilityAssessmentsSettingsClient { + subClient, _ := NewDatabaseSQLVulnerabilityAssessmentsSettingsClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -128,13 +157,13 @@ func (c *ClientFactory) NewDatabaseTablesClient() *DatabaseTablesClient { return subClient } -func (c *ClientFactory) NewDatabaseVulnerabilityAssessmentRuleBaselinesClient() *DatabaseVulnerabilityAssessmentRuleBaselinesClient { - subClient, _ := NewDatabaseVulnerabilityAssessmentRuleBaselinesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDatabaseUsagesClient() *DatabaseUsagesClient { + subClient, _ := NewDatabaseUsagesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDatabaseVulnerabilityAssessmentsClient() *DatabaseVulnerabilityAssessmentsClient { - subClient, _ := NewDatabaseVulnerabilityAssessmentsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDatabaseVulnerabilityAssessmentRuleBaselinesClient() *DatabaseVulnerabilityAssessmentRuleBaselinesClient { + subClient, _ := NewDatabaseVulnerabilityAssessmentRuleBaselinesClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -143,8 +172,13 @@ func (c *ClientFactory) NewDatabaseVulnerabilityAssessmentScansClient() *Databas return subClient } -func (c *ClientFactory) NewDataWarehouseUserActivitiesClient() *DataWarehouseUserActivitiesClient { - subClient, _ := NewDataWarehouseUserActivitiesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDatabaseVulnerabilityAssessmentsClient() *DatabaseVulnerabilityAssessmentsClient { + subClient, _ := NewDatabaseVulnerabilityAssessmentsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewDatabasesClient() *DatabasesClient { + subClient, _ := NewDatabasesClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -153,16 +187,51 @@ func (c *ClientFactory) NewDeletedServersClient() *DeletedServersClient { return subClient } +func (c *ClientFactory) NewDistributedAvailabilityGroupsClient() *DistributedAvailabilityGroupsClient { + subClient, _ := NewDistributedAvailabilityGroupsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewElasticPoolActivitiesClient() *ElasticPoolActivitiesClient { + subClient, _ := NewElasticPoolActivitiesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewElasticPoolDatabaseActivitiesClient() *ElasticPoolDatabaseActivitiesClient { + subClient, _ := NewElasticPoolDatabaseActivitiesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewElasticPoolOperationsClient() *ElasticPoolOperationsClient { subClient, _ := NewElasticPoolOperationsClient(c.subscriptionID, c.credential, c.options) return subClient } +func (c *ClientFactory) NewElasticPoolsClient() *ElasticPoolsClient { + subClient, _ := NewElasticPoolsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewEncryptionProtectorsClient() *EncryptionProtectorsClient { subClient, _ := NewEncryptionProtectorsClient(c.subscriptionID, c.credential, c.options) return subClient } +func (c *ClientFactory) NewEndpointCertificatesClient() *EndpointCertificatesClient { + subClient, _ := NewEndpointCertificatesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewExtendedDatabaseBlobAuditingPoliciesClient() *ExtendedDatabaseBlobAuditingPoliciesClient { + subClient, _ := NewExtendedDatabaseBlobAuditingPoliciesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewExtendedServerBlobAuditingPoliciesClient() *ExtendedServerBlobAuditingPoliciesClient { + subClient, _ := NewExtendedServerBlobAuditingPoliciesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewFailoverGroupsClient() *FailoverGroupsClient { subClient, _ := NewFailoverGroupsClient(c.subscriptionID, c.credential, c.options) return subClient @@ -173,6 +242,16 @@ func (c *ClientFactory) NewFirewallRulesClient() *FirewallRulesClient { return subClient } +func (c *ClientFactory) NewGeoBackupPoliciesClient() *GeoBackupPoliciesClient { + subClient, _ := NewGeoBackupPoliciesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewIPv6FirewallRulesClient() *IPv6FirewallRulesClient { + subClient, _ := NewIPv6FirewallRulesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewInstanceFailoverGroupsClient() *InstanceFailoverGroupsClient { subClient, _ := NewInstanceFailoverGroupsClient(c.subscriptionID, c.credential, c.options) return subClient @@ -198,11 +277,6 @@ func (c *ClientFactory) NewJobExecutionsClient() *JobExecutionsClient { return subClient } -func (c *ClientFactory) NewJobsClient() *JobsClient { - subClient, _ := NewJobsClient(c.subscriptionID, c.credential, c.options) - return subClient -} - func (c *ClientFactory) NewJobStepExecutionsClient() *JobStepExecutionsClient { subClient, _ := NewJobStepExecutionsClient(c.subscriptionID, c.credential, c.options) return subClient @@ -228,8 +302,23 @@ func (c *ClientFactory) NewJobVersionsClient() *JobVersionsClient { return subClient } -func (c *ClientFactory) NewCapabilitiesClient() *CapabilitiesClient { - subClient, _ := NewCapabilitiesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewJobsClient() *JobsClient { + subClient, _ := NewJobsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewLedgerDigestUploadsClient() *LedgerDigestUploadsClient { + subClient, _ := NewLedgerDigestUploadsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewLongTermRetentionBackupsClient() *LongTermRetentionBackupsClient { + subClient, _ := NewLongTermRetentionBackupsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewLongTermRetentionManagedInstanceBackupsClient() *LongTermRetentionManagedInstanceBackupsClient { + subClient, _ := NewLongTermRetentionManagedInstanceBackupsClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -253,23 +342,33 @@ func (c *ClientFactory) NewManagedBackupShortTermRetentionPoliciesClient() *Mana return subClient } +func (c *ClientFactory) NewManagedDatabaseAdvancedThreatProtectionSettingsClient() *ManagedDatabaseAdvancedThreatProtectionSettingsClient { + subClient, _ := NewManagedDatabaseAdvancedThreatProtectionSettingsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewManagedDatabaseColumnsClient() *ManagedDatabaseColumnsClient { subClient, _ := NewManagedDatabaseColumnsClient(c.subscriptionID, c.credential, c.options) return subClient } +func (c *ClientFactory) NewManagedDatabaseMoveOperationsClient() *ManagedDatabaseMoveOperationsClient { + subClient, _ := NewManagedDatabaseMoveOperationsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewManagedDatabaseQueriesClient() *ManagedDatabaseQueriesClient { subClient, _ := NewManagedDatabaseQueriesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewManagedDatabaseRestoreDetailsClient() *ManagedDatabaseRestoreDetailsClient { - subClient, _ := NewManagedDatabaseRestoreDetailsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewManagedDatabaseRecommendedSensitivityLabelsClient() *ManagedDatabaseRecommendedSensitivityLabelsClient { + subClient, _ := NewManagedDatabaseRecommendedSensitivityLabelsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewManagedDatabasesClient() *ManagedDatabasesClient { - subClient, _ := NewManagedDatabasesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewManagedDatabaseRestoreDetailsClient() *ManagedDatabaseRestoreDetailsClient { + subClient, _ := NewManagedDatabaseRestoreDetailsClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -288,6 +387,11 @@ func (c *ClientFactory) NewManagedDatabaseSecurityEventsClient() *ManagedDatabas return subClient } +func (c *ClientFactory) NewManagedDatabaseSensitivityLabelsClient() *ManagedDatabaseSensitivityLabelsClient { + subClient, _ := NewManagedDatabaseSensitivityLabelsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewManagedDatabaseTablesClient() *ManagedDatabaseTablesClient { subClient, _ := NewManagedDatabaseTablesClient(c.subscriptionID, c.credential, c.options) return subClient @@ -303,13 +407,18 @@ func (c *ClientFactory) NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesCl return subClient } +func (c *ClientFactory) NewManagedDatabaseVulnerabilityAssessmentScansClient() *ManagedDatabaseVulnerabilityAssessmentScansClient { + subClient, _ := NewManagedDatabaseVulnerabilityAssessmentScansClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewManagedDatabaseVulnerabilityAssessmentsClient() *ManagedDatabaseVulnerabilityAssessmentsClient { subClient, _ := NewManagedDatabaseVulnerabilityAssessmentsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewManagedDatabaseVulnerabilityAssessmentScansClient() *ManagedDatabaseVulnerabilityAssessmentScansClient { - subClient, _ := NewManagedDatabaseVulnerabilityAssessmentScansClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewManagedDatabasesClient() *ManagedDatabasesClient { + subClient, _ := NewManagedDatabasesClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -318,11 +427,21 @@ func (c *ClientFactory) NewManagedInstanceAdministratorsClient() *ManagedInstanc return subClient } +func (c *ClientFactory) NewManagedInstanceAdvancedThreatProtectionSettingsClient() *ManagedInstanceAdvancedThreatProtectionSettingsClient { + subClient, _ := NewManagedInstanceAdvancedThreatProtectionSettingsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewManagedInstanceAzureADOnlyAuthenticationsClient() *ManagedInstanceAzureADOnlyAuthenticationsClient { subClient, _ := NewManagedInstanceAzureADOnlyAuthenticationsClient(c.subscriptionID, c.credential, c.options) return subClient } +func (c *ClientFactory) NewManagedInstanceDtcsClient() *ManagedInstanceDtcsClient { + subClient, _ := NewManagedInstanceDtcsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewManagedInstanceEncryptionProtectorsClient() *ManagedInstanceEncryptionProtectorsClient { subClient, _ := NewManagedInstanceEncryptionProtectorsClient(c.subscriptionID, c.credential, c.options) return subClient @@ -363,11 +482,26 @@ func (c *ClientFactory) NewManagedInstanceVulnerabilityAssessmentsClient() *Mana return subClient } +func (c *ClientFactory) NewManagedInstancesClient() *ManagedInstancesClient { + subClient, _ := NewManagedInstancesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewManagedLedgerDigestUploadsClient() *ManagedLedgerDigestUploadsClient { + subClient, _ := NewManagedLedgerDigestUploadsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient() *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient { subClient, _ := NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient(c.subscriptionID, c.credential, c.options) return subClient } +func (c *ClientFactory) NewManagedServerDNSAliasesClient() *ManagedServerDNSAliasesClient { + subClient, _ := NewManagedServerDNSAliasesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewManagedServerSecurityAlertPoliciesClient() *ManagedServerSecurityAlertPoliciesClient { subClient, _ := NewManagedServerSecurityAlertPoliciesClient(c.subscriptionID, c.credential, c.options) return subClient @@ -378,6 +512,11 @@ func (c *ClientFactory) NewOperationsClient() *OperationsClient { return subClient } +func (c *ClientFactory) NewOutboundFirewallRulesClient() *OutboundFirewallRulesClient { + subClient, _ := NewOutboundFirewallRulesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) return subClient @@ -388,272 +527,257 @@ func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesCli return subClient } -func (c *ClientFactory) NewRecoverableManagedDatabasesClient() *RecoverableManagedDatabasesClient { - subClient, _ := NewRecoverableManagedDatabasesClient(c.subscriptionID, c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewRestorePointsClient() *RestorePointsClient { - subClient, _ := NewRestorePointsClient(c.subscriptionID, c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewServerAdvisorsClient() *ServerAdvisorsClient { - subClient, _ := NewServerAdvisorsClient(c.subscriptionID, c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewServerAutomaticTuningClient() *ServerAutomaticTuningClient { - subClient, _ := NewServerAutomaticTuningClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewRecommendedSensitivityLabelsClient() *RecommendedSensitivityLabelsClient { + subClient, _ := NewRecommendedSensitivityLabelsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewServerAzureADAdministratorsClient() *ServerAzureADAdministratorsClient { - subClient, _ := NewServerAzureADAdministratorsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewRecoverableDatabasesClient() *RecoverableDatabasesClient { + subClient, _ := NewRecoverableDatabasesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewServerAzureADOnlyAuthenticationsClient() *ServerAzureADOnlyAuthenticationsClient { - subClient, _ := NewServerAzureADOnlyAuthenticationsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewRecoverableManagedDatabasesClient() *RecoverableManagedDatabasesClient { + subClient, _ := NewRecoverableManagedDatabasesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewServerDevOpsAuditSettingsClient() *ServerDevOpsAuditSettingsClient { - subClient, _ := NewServerDevOpsAuditSettingsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewReplicationLinksClient() *ReplicationLinksClient { + subClient, _ := NewReplicationLinksClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewServerDNSAliasesClient() *ServerDNSAliasesClient { - subClient, _ := NewServerDNSAliasesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewRestorableDroppedDatabasesClient() *RestorableDroppedDatabasesClient { + subClient, _ := NewRestorableDroppedDatabasesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewServerKeysClient() *ServerKeysClient { - subClient, _ := NewServerKeysClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewRestorableDroppedManagedDatabasesClient() *RestorableDroppedManagedDatabasesClient { + subClient, _ := NewRestorableDroppedManagedDatabasesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewServerOperationsClient() *ServerOperationsClient { - subClient, _ := NewServerOperationsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewRestorePointsClient() *RestorePointsClient { + subClient, _ := NewRestorePointsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewServerSecurityAlertPoliciesClient() *ServerSecurityAlertPoliciesClient { - subClient, _ := NewServerSecurityAlertPoliciesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSensitivityLabelsClient() *SensitivityLabelsClient { + subClient, _ := NewSensitivityLabelsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewServerTrustGroupsClient() *ServerTrustGroupsClient { - subClient, _ := NewServerTrustGroupsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewServerAdvancedThreatProtectionSettingsClient() *ServerAdvancedThreatProtectionSettingsClient { + subClient, _ := NewServerAdvancedThreatProtectionSettingsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewServerVulnerabilityAssessmentsClient() *ServerVulnerabilityAssessmentsClient { - subClient, _ := NewServerVulnerabilityAssessmentsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewServerAdvisorsClient() *ServerAdvisorsClient { + subClient, _ := NewServerAdvisorsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAgentClient() *AgentClient { - subClient, _ := NewAgentClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewServerAutomaticTuningClient() *ServerAutomaticTuningClient { + subClient, _ := NewServerAutomaticTuningClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSubscriptionUsagesClient() *SubscriptionUsagesClient { - subClient, _ := NewSubscriptionUsagesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewServerAzureADAdministratorsClient() *ServerAzureADAdministratorsClient { + subClient, _ := NewServerAzureADAdministratorsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSyncAgentsClient() *SyncAgentsClient { - subClient, _ := NewSyncAgentsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewServerAzureADOnlyAuthenticationsClient() *ServerAzureADOnlyAuthenticationsClient { + subClient, _ := NewServerAzureADOnlyAuthenticationsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSyncGroupsClient() *SyncGroupsClient { - subClient, _ := NewSyncGroupsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewServerBlobAuditingPoliciesClient() *ServerBlobAuditingPoliciesClient { + subClient, _ := NewServerBlobAuditingPoliciesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSyncMembersClient() *SyncMembersClient { - subClient, _ := NewSyncMembersClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewServerCommunicationLinksClient() *ServerCommunicationLinksClient { + subClient, _ := NewServerCommunicationLinksClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewTdeCertificatesClient() *TdeCertificatesClient { - subClient, _ := NewTdeCertificatesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewServerConfigurationOptionsClient() *ServerConfigurationOptionsClient { + subClient, _ := NewServerConfigurationOptionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewTimeZonesClient() *TimeZonesClient { - subClient, _ := NewTimeZonesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewServerConnectionPoliciesClient() *ServerConnectionPoliciesClient { + subClient, _ := NewServerConnectionPoliciesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewVirtualClustersClient() *VirtualClustersClient { - subClient, _ := NewVirtualClustersClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewServerDNSAliasesClient() *ServerDNSAliasesClient { + subClient, _ := NewServerDNSAliasesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewVirtualNetworkRulesClient() *VirtualNetworkRulesClient { - subClient, _ := NewVirtualNetworkRulesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewServerDevOpsAuditSettingsClient() *ServerDevOpsAuditSettingsClient { + subClient, _ := NewServerDevOpsAuditSettingsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewWorkloadClassifiersClient() *WorkloadClassifiersClient { - subClient, _ := NewWorkloadClassifiersClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewServerKeysClient() *ServerKeysClient { + subClient, _ := NewServerKeysClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewWorkloadGroupsClient() *WorkloadGroupsClient { - subClient, _ := NewWorkloadGroupsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewServerOperationsClient() *ServerOperationsClient { + subClient, _ := NewServerOperationsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewTransparentDataEncryptionsClient() *TransparentDataEncryptionsClient { - subClient, _ := NewTransparentDataEncryptionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewServerSecurityAlertPoliciesClient() *ServerSecurityAlertPoliciesClient { + subClient, _ := NewServerSecurityAlertPoliciesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewBackupShortTermRetentionPoliciesClient() *BackupShortTermRetentionPoliciesClient { - subClient, _ := NewBackupShortTermRetentionPoliciesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewServerTrustCertificatesClient() *ServerTrustCertificatesClient { + subClient, _ := NewServerTrustCertificatesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDatabaseExtensionsClient() *DatabaseExtensionsClient { - subClient, _ := NewDatabaseExtensionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewServerTrustGroupsClient() *ServerTrustGroupsClient { + subClient, _ := NewServerTrustGroupsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDatabaseOperationsClient() *DatabaseOperationsClient { - subClient, _ := NewDatabaseOperationsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewServerUsagesClient() *ServerUsagesClient { + subClient, _ := NewServerUsagesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDatabaseUsagesClient() *DatabaseUsagesClient { - subClient, _ := NewDatabaseUsagesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewServerVulnerabilityAssessmentsClient() *ServerVulnerabilityAssessmentsClient { + subClient, _ := NewServerVulnerabilityAssessmentsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewLedgerDigestUploadsClient() *LedgerDigestUploadsClient { - subClient, _ := NewLedgerDigestUploadsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewServersClient() *ServersClient { + subClient, _ := NewServersClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewOutboundFirewallRulesClient() *OutboundFirewallRulesClient { - subClient, _ := NewOutboundFirewallRulesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewServiceObjectivesClient() *ServiceObjectivesClient { + subClient, _ := NewServiceObjectivesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewServersClient() *ServersClient { - subClient, _ := NewServersClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewStartStopManagedInstanceSchedulesClient() *StartStopManagedInstanceSchedulesClient { + subClient, _ := NewStartStopManagedInstanceSchedulesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewUsagesClient() *UsagesClient { - subClient, _ := NewUsagesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSubscriptionUsagesClient() *SubscriptionUsagesClient { + subClient, _ := NewSubscriptionUsagesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewLongTermRetentionBackupsClient() *LongTermRetentionBackupsClient { - subClient, _ := NewLongTermRetentionBackupsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSynapseLinkWorkspacesClient() *SynapseLinkWorkspacesClient { + subClient, _ := NewSynapseLinkWorkspacesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewLongTermRetentionManagedInstanceBackupsClient() *LongTermRetentionManagedInstanceBackupsClient { - subClient, _ := NewLongTermRetentionManagedInstanceBackupsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSyncAgentsClient() *SyncAgentsClient { + subClient, _ := NewSyncAgentsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewManagedInstancesClient() *ManagedInstancesClient { - subClient, _ := NewManagedInstancesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSyncGroupsClient() *SyncGroupsClient { + subClient, _ := NewSyncGroupsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewRestorableDroppedDatabasesClient() *RestorableDroppedDatabasesClient { - subClient, _ := NewRestorableDroppedDatabasesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSyncMembersClient() *SyncMembersClient { + subClient, _ := NewSyncMembersClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewRestorableDroppedManagedDatabasesClient() *RestorableDroppedManagedDatabasesClient { - subClient, _ := NewRestorableDroppedManagedDatabasesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewTdeCertificatesClient() *TdeCertificatesClient { + subClient, _ := NewTdeCertificatesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewServerConnectionPoliciesClient() *ServerConnectionPoliciesClient { - subClient, _ := NewServerConnectionPoliciesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewTimeZonesClient() *TimeZonesClient { + subClient, _ := NewTimeZonesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDistributedAvailabilityGroupsClient() *DistributedAvailabilityGroupsClient { - subClient, _ := NewDistributedAvailabilityGroupsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewTransparentDataEncryptionsClient() *TransparentDataEncryptionsClient { + subClient, _ := NewTransparentDataEncryptionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewServerTrustCertificatesClient() *ServerTrustCertificatesClient { - subClient, _ := NewServerTrustCertificatesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewUsagesClient() *UsagesClient { + subClient, _ := NewUsagesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewIPv6FirewallRulesClient() *IPv6FirewallRulesClient { - subClient, _ := NewIPv6FirewallRulesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVirtualClustersClient() *VirtualClustersClient { + subClient, _ := NewVirtualClustersClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewEndpointCertificatesClient() *EndpointCertificatesClient { - subClient, _ := NewEndpointCertificatesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVirtualNetworkRulesClient() *VirtualNetworkRulesClient { + subClient, _ := NewVirtualNetworkRulesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewReplicationLinksClient() *ReplicationLinksClient { - subClient, _ := NewReplicationLinksClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVulnerabilityAssessmentBaselineClient() *VulnerabilityAssessmentBaselineClient { + subClient, _ := NewVulnerabilityAssessmentBaselineClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewManagedDatabaseSensitivityLabelsClient() *ManagedDatabaseSensitivityLabelsClient { - subClient, _ := NewManagedDatabaseSensitivityLabelsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVulnerabilityAssessmentBaselinesClient() *VulnerabilityAssessmentBaselinesClient { + subClient, _ := NewVulnerabilityAssessmentBaselinesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewManagedDatabaseRecommendedSensitivityLabelsClient() *ManagedDatabaseRecommendedSensitivityLabelsClient { - subClient, _ := NewManagedDatabaseRecommendedSensitivityLabelsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVulnerabilityAssessmentExecuteScanClient() *VulnerabilityAssessmentExecuteScanClient { + subClient, _ := NewVulnerabilityAssessmentExecuteScanClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSensitivityLabelsClient() *SensitivityLabelsClient { - subClient, _ := NewSensitivityLabelsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVulnerabilityAssessmentRuleBaselineClient() *VulnerabilityAssessmentRuleBaselineClient { + subClient, _ := NewVulnerabilityAssessmentRuleBaselineClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewRecommendedSensitivityLabelsClient() *RecommendedSensitivityLabelsClient { - subClient, _ := NewRecommendedSensitivityLabelsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVulnerabilityAssessmentRuleBaselinesClient() *VulnerabilityAssessmentRuleBaselinesClient { + subClient, _ := NewVulnerabilityAssessmentRuleBaselinesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewServerBlobAuditingPoliciesClient() *ServerBlobAuditingPoliciesClient { - subClient, _ := NewServerBlobAuditingPoliciesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVulnerabilityAssessmentScanResultClient() *VulnerabilityAssessmentScanResultClient { + subClient, _ := NewVulnerabilityAssessmentScanResultClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDatabaseBlobAuditingPoliciesClient() *DatabaseBlobAuditingPoliciesClient { - subClient, _ := NewDatabaseBlobAuditingPoliciesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVulnerabilityAssessmentScansClient() *VulnerabilityAssessmentScansClient { + subClient, _ := NewVulnerabilityAssessmentScansClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewExtendedDatabaseBlobAuditingPoliciesClient() *ExtendedDatabaseBlobAuditingPoliciesClient { - subClient, _ := NewExtendedDatabaseBlobAuditingPoliciesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVulnerabilityAssessmentsClient() *VulnerabilityAssessmentsClient { + subClient, _ := NewVulnerabilityAssessmentsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewExtendedServerBlobAuditingPoliciesClient() *ExtendedServerBlobAuditingPoliciesClient { - subClient, _ := NewExtendedServerBlobAuditingPoliciesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVulnerabilityAssessmentsSettingsClient() *VulnerabilityAssessmentsSettingsClient { + subClient, _ := NewVulnerabilityAssessmentsSettingsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDatabaseAdvancedThreatProtectionSettingsClient() *DatabaseAdvancedThreatProtectionSettingsClient { - subClient, _ := NewDatabaseAdvancedThreatProtectionSettingsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewWorkloadClassifiersClient() *WorkloadClassifiersClient { + subClient, _ := NewWorkloadClassifiersClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewServerAdvancedThreatProtectionSettingsClient() *ServerAdvancedThreatProtectionSettingsClient { - subClient, _ := NewServerAdvancedThreatProtectionSettingsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewWorkloadGroupsClient() *WorkloadGroupsClient { + subClient, _ := NewWorkloadGroupsClient(c.subscriptionID, c.credential, c.options) return subClient } diff --git a/sdk/resourcemanager/sql/armsql/constants.go b/sdk/resourcemanager/sql/armsql/constants.go index efdb70297eed..1225437f0bd4 100644 --- a/sdk/resourcemanager/sql/armsql/constants.go +++ b/sdk/resourcemanager/sql/armsql/constants.go @@ -3,15 +3,14 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql const ( moduleName = "armsql" - moduleVersion = "v1.1.0" + moduleVersion = "v2.0.0-beta.1" ) type AdministratorName string @@ -59,17 +58,17 @@ func PossibleAdvancedThreatProtectionNameValues() []AdvancedThreatProtectionName type AdvancedThreatProtectionState string const ( - AdvancedThreatProtectionStateNew AdvancedThreatProtectionState = "New" - AdvancedThreatProtectionStateEnabled AdvancedThreatProtectionState = "Enabled" AdvancedThreatProtectionStateDisabled AdvancedThreatProtectionState = "Disabled" + AdvancedThreatProtectionStateEnabled AdvancedThreatProtectionState = "Enabled" + AdvancedThreatProtectionStateNew AdvancedThreatProtectionState = "New" ) // PossibleAdvancedThreatProtectionStateValues returns the possible values for the AdvancedThreatProtectionState const type. func PossibleAdvancedThreatProtectionStateValues() []AdvancedThreatProtectionState { return []AdvancedThreatProtectionState{ - AdvancedThreatProtectionStateNew, - AdvancedThreatProtectionStateEnabled, AdvancedThreatProtectionStateDisabled, + AdvancedThreatProtectionStateEnabled, + AdvancedThreatProtectionStateNew, } } @@ -79,18 +78,18 @@ type AdvisorStatus string const ( AdvisorStatusGA AdvisorStatus = "GA" - AdvisorStatusPublicPreview AdvisorStatus = "PublicPreview" AdvisorStatusLimitedPublicPreview AdvisorStatus = "LimitedPublicPreview" AdvisorStatusPrivatePreview AdvisorStatus = "PrivatePreview" + AdvisorStatusPublicPreview AdvisorStatus = "PublicPreview" ) // PossibleAdvisorStatusValues returns the possible values for the AdvisorStatus const type. func PossibleAdvisorStatusValues() []AdvisorStatus { return []AdvisorStatus{ AdvisorStatusGA, - AdvisorStatusPublicPreview, AdvisorStatusLimitedPublicPreview, AdvisorStatusPrivatePreview, + AdvisorStatusPublicPreview, } } @@ -115,6 +114,22 @@ func PossibleAggregationFunctionTypeValues() []AggregationFunctionType { } } +// AlwaysEncryptedEnclaveType - Type of enclave requested on the database i.e. Default or VBS enclaves. +type AlwaysEncryptedEnclaveType string + +const ( + AlwaysEncryptedEnclaveTypeDefault AlwaysEncryptedEnclaveType = "Default" + AlwaysEncryptedEnclaveTypeVBS AlwaysEncryptedEnclaveType = "VBS" +) + +// PossibleAlwaysEncryptedEnclaveTypeValues returns the possible values for the AlwaysEncryptedEnclaveType const type. +func PossibleAlwaysEncryptedEnclaveTypeValues() []AlwaysEncryptedEnclaveType { + return []AlwaysEncryptedEnclaveType{ + AlwaysEncryptedEnclaveTypeDefault, + AlwaysEncryptedEnclaveTypeVBS, + } +} + type AuthenticationName string const ( @@ -133,17 +148,17 @@ func PossibleAuthenticationNameValues() []AuthenticationName { type AutoExecuteStatus string const ( - AutoExecuteStatusEnabled AutoExecuteStatus = "Enabled" - AutoExecuteStatusDisabled AutoExecuteStatus = "Disabled" AutoExecuteStatusDefault AutoExecuteStatus = "Default" + AutoExecuteStatusDisabled AutoExecuteStatus = "Disabled" + AutoExecuteStatusEnabled AutoExecuteStatus = "Enabled" ) // PossibleAutoExecuteStatusValues returns the possible values for the AutoExecuteStatus const type. func PossibleAutoExecuteStatusValues() []AutoExecuteStatus { return []AutoExecuteStatus{ - AutoExecuteStatusEnabled, - AutoExecuteStatusDisabled, AutoExecuteStatusDefault, + AutoExecuteStatusDisabled, + AutoExecuteStatusEnabled, } } @@ -153,21 +168,21 @@ func PossibleAutoExecuteStatusValues() []AutoExecuteStatus { type AutoExecuteStatusInheritedFrom string const ( + AutoExecuteStatusInheritedFromDatabase AutoExecuteStatusInheritedFrom = "Database" AutoExecuteStatusInheritedFromDefault AutoExecuteStatusInheritedFrom = "Default" - AutoExecuteStatusInheritedFromSubscription AutoExecuteStatusInheritedFrom = "Subscription" - AutoExecuteStatusInheritedFromServer AutoExecuteStatusInheritedFrom = "Server" AutoExecuteStatusInheritedFromElasticPool AutoExecuteStatusInheritedFrom = "ElasticPool" - AutoExecuteStatusInheritedFromDatabase AutoExecuteStatusInheritedFrom = "Database" + AutoExecuteStatusInheritedFromServer AutoExecuteStatusInheritedFrom = "Server" + AutoExecuteStatusInheritedFromSubscription AutoExecuteStatusInheritedFrom = "Subscription" ) // PossibleAutoExecuteStatusInheritedFromValues returns the possible values for the AutoExecuteStatusInheritedFrom const type. func PossibleAutoExecuteStatusInheritedFromValues() []AutoExecuteStatusInheritedFrom { return []AutoExecuteStatusInheritedFrom{ + AutoExecuteStatusInheritedFromDatabase, AutoExecuteStatusInheritedFromDefault, - AutoExecuteStatusInheritedFromSubscription, - AutoExecuteStatusInheritedFromServer, AutoExecuteStatusInheritedFromElasticPool, - AutoExecuteStatusInheritedFromDatabase, + AutoExecuteStatusInheritedFromServer, + AutoExecuteStatusInheritedFromSubscription, } } @@ -175,25 +190,25 @@ func PossibleAutoExecuteStatusInheritedFromValues() []AutoExecuteStatusInherited type AutomaticTuningDisabledReason string const ( + AutomaticTuningDisabledReasonAutoConfigured AutomaticTuningDisabledReason = "AutoConfigured" AutomaticTuningDisabledReasonDefault AutomaticTuningDisabledReason = "Default" AutomaticTuningDisabledReasonDisabled AutomaticTuningDisabledReason = "Disabled" - AutomaticTuningDisabledReasonAutoConfigured AutomaticTuningDisabledReason = "AutoConfigured" AutomaticTuningDisabledReasonInheritedFromServer AutomaticTuningDisabledReason = "InheritedFromServer" + AutomaticTuningDisabledReasonNotSupported AutomaticTuningDisabledReason = "NotSupported" AutomaticTuningDisabledReasonQueryStoreOff AutomaticTuningDisabledReason = "QueryStoreOff" AutomaticTuningDisabledReasonQueryStoreReadOnly AutomaticTuningDisabledReason = "QueryStoreReadOnly" - AutomaticTuningDisabledReasonNotSupported AutomaticTuningDisabledReason = "NotSupported" ) // PossibleAutomaticTuningDisabledReasonValues returns the possible values for the AutomaticTuningDisabledReason const type. func PossibleAutomaticTuningDisabledReasonValues() []AutomaticTuningDisabledReason { return []AutomaticTuningDisabledReason{ + AutomaticTuningDisabledReasonAutoConfigured, AutomaticTuningDisabledReasonDefault, AutomaticTuningDisabledReasonDisabled, - AutomaticTuningDisabledReasonAutoConfigured, AutomaticTuningDisabledReasonInheritedFromServer, + AutomaticTuningDisabledReasonNotSupported, AutomaticTuningDisabledReasonQueryStoreOff, AutomaticTuningDisabledReasonQueryStoreReadOnly, - AutomaticTuningDisabledReasonNotSupported, } } @@ -201,18 +216,18 @@ func PossibleAutomaticTuningDisabledReasonValues() []AutomaticTuningDisabledReas type AutomaticTuningMode string const ( - AutomaticTuningModeInherit AutomaticTuningMode = "Inherit" - AutomaticTuningModeCustom AutomaticTuningMode = "Custom" AutomaticTuningModeAuto AutomaticTuningMode = "Auto" + AutomaticTuningModeCustom AutomaticTuningMode = "Custom" + AutomaticTuningModeInherit AutomaticTuningMode = "Inherit" AutomaticTuningModeUnspecified AutomaticTuningMode = "Unspecified" ) // PossibleAutomaticTuningModeValues returns the possible values for the AutomaticTuningMode const type. func PossibleAutomaticTuningModeValues() []AutomaticTuningMode { return []AutomaticTuningMode{ - AutomaticTuningModeInherit, - AutomaticTuningModeCustom, AutomaticTuningModeAuto, + AutomaticTuningModeCustom, + AutomaticTuningModeInherit, AutomaticTuningModeUnspecified, } } @@ -237,17 +252,17 @@ func PossibleAutomaticTuningOptionModeActualValues() []AutomaticTuningOptionMode type AutomaticTuningOptionModeDesired string const ( + AutomaticTuningOptionModeDesiredDefault AutomaticTuningOptionModeDesired = "Default" AutomaticTuningOptionModeDesiredOff AutomaticTuningOptionModeDesired = "Off" AutomaticTuningOptionModeDesiredOn AutomaticTuningOptionModeDesired = "On" - AutomaticTuningOptionModeDesiredDefault AutomaticTuningOptionModeDesired = "Default" ) // PossibleAutomaticTuningOptionModeDesiredValues returns the possible values for the AutomaticTuningOptionModeDesired const type. func PossibleAutomaticTuningOptionModeDesiredValues() []AutomaticTuningOptionModeDesired { return []AutomaticTuningOptionModeDesired{ + AutomaticTuningOptionModeDesiredDefault, AutomaticTuningOptionModeDesiredOff, AutomaticTuningOptionModeDesiredOn, - AutomaticTuningOptionModeDesiredDefault, } } @@ -255,16 +270,16 @@ func PossibleAutomaticTuningOptionModeDesiredValues() []AutomaticTuningOptionMod type AutomaticTuningServerMode string const ( - AutomaticTuningServerModeCustom AutomaticTuningServerMode = "Custom" AutomaticTuningServerModeAuto AutomaticTuningServerMode = "Auto" + AutomaticTuningServerModeCustom AutomaticTuningServerMode = "Custom" AutomaticTuningServerModeUnspecified AutomaticTuningServerMode = "Unspecified" ) // PossibleAutomaticTuningServerModeValues returns the possible values for the AutomaticTuningServerMode const type. func PossibleAutomaticTuningServerModeValues() []AutomaticTuningServerMode { return []AutomaticTuningServerMode{ - AutomaticTuningServerModeCustom, AutomaticTuningServerModeAuto, + AutomaticTuningServerModeCustom, AutomaticTuningServerModeUnspecified, } } @@ -273,21 +288,41 @@ func PossibleAutomaticTuningServerModeValues() []AutomaticTuningServerMode { type AutomaticTuningServerReason string const ( + AutomaticTuningServerReasonAutoConfigured AutomaticTuningServerReason = "AutoConfigured" AutomaticTuningServerReasonDefault AutomaticTuningServerReason = "Default" AutomaticTuningServerReasonDisabled AutomaticTuningServerReason = "Disabled" - AutomaticTuningServerReasonAutoConfigured AutomaticTuningServerReason = "AutoConfigured" ) // PossibleAutomaticTuningServerReasonValues returns the possible values for the AutomaticTuningServerReason const type. func PossibleAutomaticTuningServerReasonValues() []AutomaticTuningServerReason { return []AutomaticTuningServerReason{ + AutomaticTuningServerReasonAutoConfigured, AutomaticTuningServerReasonDefault, AutomaticTuningServerReasonDisabled, - AutomaticTuningServerReasonAutoConfigured, } } -// BackupStorageRedundancy - The storage account type used to store backups for this database. +// AvailabilityZoneType - Specifies the availability zone the database is pinned to. +type AvailabilityZoneType string + +const ( + AvailabilityZoneTypeNoPreference AvailabilityZoneType = "NoPreference" + AvailabilityZoneTypeOne AvailabilityZoneType = "1" + AvailabilityZoneTypeThree AvailabilityZoneType = "3" + AvailabilityZoneTypeTwo AvailabilityZoneType = "2" +) + +// PossibleAvailabilityZoneTypeValues returns the possible values for the AvailabilityZoneType const type. +func PossibleAvailabilityZoneTypeValues() []AvailabilityZoneType { + return []AvailabilityZoneType{ + AvailabilityZoneTypeNoPreference, + AvailabilityZoneTypeOne, + AvailabilityZoneTypeThree, + AvailabilityZoneTypeTwo, + } +} + +// BackupStorageRedundancy - The storage redundancy type of the copied backup type BackupStorageRedundancy string const ( @@ -307,20 +342,33 @@ func PossibleBackupStorageRedundancyValues() []BackupStorageRedundancy { } } +type BaselineName string + +const ( + BaselineNameDefault BaselineName = "default" +) + +// PossibleBaselineNameValues returns the possible values for the BaselineName const type. +func PossibleBaselineNameValues() []BaselineName { + return []BaselineName{ + BaselineNameDefault, + } +} + // BlobAuditingPolicyState - Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled // are required. type BlobAuditingPolicyState string const ( - BlobAuditingPolicyStateEnabled BlobAuditingPolicyState = "Enabled" BlobAuditingPolicyStateDisabled BlobAuditingPolicyState = "Disabled" + BlobAuditingPolicyStateEnabled BlobAuditingPolicyState = "Enabled" ) // PossibleBlobAuditingPolicyStateValues returns the possible values for the BlobAuditingPolicyState const type. func PossibleBlobAuditingPolicyStateValues() []BlobAuditingPolicyState { return []BlobAuditingPolicyState{ - BlobAuditingPolicyStateEnabled, BlobAuditingPolicyStateDisabled, + BlobAuditingPolicyStateEnabled, } } @@ -349,19 +397,19 @@ func PossibleCapabilityGroupValues() []CapabilityGroup { type CapabilityStatus string const ( - CapabilityStatusVisible CapabilityStatus = "Visible" CapabilityStatusAvailable CapabilityStatus = "Available" CapabilityStatusDefault CapabilityStatus = "Default" CapabilityStatusDisabled CapabilityStatus = "Disabled" + CapabilityStatusVisible CapabilityStatus = "Visible" ) // PossibleCapabilityStatusValues returns the possible values for the CapabilityStatus const type. func PossibleCapabilityStatusValues() []CapabilityStatus { return []CapabilityStatus{ - CapabilityStatusVisible, CapabilityStatusAvailable, CapabilityStatusDefault, CapabilityStatusDisabled, + CapabilityStatusVisible, } } @@ -386,15 +434,15 @@ func PossibleCatalogCollationTypeValues() []CatalogCollationType { type CheckNameAvailabilityReason string const ( - CheckNameAvailabilityReasonInvalid CheckNameAvailabilityReason = "Invalid" CheckNameAvailabilityReasonAlreadyExists CheckNameAvailabilityReason = "AlreadyExists" + CheckNameAvailabilityReasonInvalid CheckNameAvailabilityReason = "Invalid" ) // PossibleCheckNameAvailabilityReasonValues returns the possible values for the CheckNameAvailabilityReason const type. func PossibleCheckNameAvailabilityReasonValues() []CheckNameAvailabilityReason { return []CheckNameAvailabilityReason{ - CheckNameAvailabilityReasonInvalid, CheckNameAvailabilityReasonAlreadyExists, + CheckNameAvailabilityReasonInvalid, } } @@ -561,19 +609,21 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } -// DNSRefreshConfigurationPropertiesStatus - The status of the DNS refresh operation. -type DNSRefreshConfigurationPropertiesStatus string +// DNSRefreshOperationStatus - The status of the DNS refresh operation. +type DNSRefreshOperationStatus string const ( - DNSRefreshConfigurationPropertiesStatusFailed DNSRefreshConfigurationPropertiesStatus = "Failed" - DNSRefreshConfigurationPropertiesStatusSucceeded DNSRefreshConfigurationPropertiesStatus = "Succeeded" + DNSRefreshOperationStatusFailed DNSRefreshOperationStatus = "Failed" + DNSRefreshOperationStatusInProgress DNSRefreshOperationStatus = "InProgress" + DNSRefreshOperationStatusSucceeded DNSRefreshOperationStatus = "Succeeded" ) -// PossibleDNSRefreshConfigurationPropertiesStatusValues returns the possible values for the DNSRefreshConfigurationPropertiesStatus const type. -func PossibleDNSRefreshConfigurationPropertiesStatusValues() []DNSRefreshConfigurationPropertiesStatus { - return []DNSRefreshConfigurationPropertiesStatus{ - DNSRefreshConfigurationPropertiesStatusFailed, - DNSRefreshConfigurationPropertiesStatusSucceeded, +// PossibleDNSRefreshOperationStatusValues returns the possible values for the DNSRefreshOperationStatus const type. +func PossibleDNSRefreshOperationStatusValues() []DNSRefreshOperationStatus { + return []DNSRefreshOperationStatus{ + DNSRefreshOperationStatusFailed, + DNSRefreshOperationStatusInProgress, + DNSRefreshOperationStatusSucceeded, } } @@ -581,8 +631,8 @@ func PossibleDNSRefreshConfigurationPropertiesStatusValues() []DNSRefreshConfigu type DataMaskingFunction string const ( - DataMaskingFunctionDefault DataMaskingFunction = "Default" DataMaskingFunctionCCN DataMaskingFunction = "CCN" + DataMaskingFunctionDefault DataMaskingFunction = "Default" DataMaskingFunctionEmail DataMaskingFunction = "Email" DataMaskingFunctionNumber DataMaskingFunction = "Number" DataMaskingFunctionSSN DataMaskingFunction = "SSN" @@ -592,8 +642,8 @@ const ( // PossibleDataMaskingFunctionValues returns the possible values for the DataMaskingFunction const type. func PossibleDataMaskingFunctionValues() []DataMaskingFunction { return []DataMaskingFunction{ - DataMaskingFunctionDefault, DataMaskingFunctionCCN, + DataMaskingFunctionDefault, DataMaskingFunctionEmail, DataMaskingFunctionNumber, DataMaskingFunctionSSN, @@ -664,6 +714,20 @@ func PossibleDatabaseIdentityTypeValues() []DatabaseIdentityType { } } +// DatabaseKeyType - The database key type. Only supported value is 'AzureKeyVault'. +type DatabaseKeyType string + +const ( + DatabaseKeyTypeAzureKeyVault DatabaseKeyType = "AzureKeyVault" +) + +// PossibleDatabaseKeyTypeValues returns the possible values for the DatabaseKeyType const type. +func PossibleDatabaseKeyTypeValues() []DatabaseKeyType { + return []DatabaseKeyType{ + DatabaseKeyTypeAzureKeyVault, + } +} + // DatabaseLicenseType - The license type to apply for this database. LicenseIncluded if you need a license, or BasePrice // if you have a license and are eligible for the Azure Hybrid Benefit. type DatabaseLicenseType string @@ -802,6 +866,19 @@ func PossibleDayOfWeekValues() []DayOfWeek { } } +type DevOpsAuditingSettingsName string + +const ( + DevOpsAuditingSettingsNameDefault DevOpsAuditingSettingsName = "Default" +) + +// PossibleDevOpsAuditingSettingsNameValues returns the possible values for the DevOpsAuditingSettingsName const type. +func PossibleDevOpsAuditingSettingsNameValues() []DevOpsAuditingSettingsName { + return []DevOpsAuditingSettingsName{ + DevOpsAuditingSettingsNameDefault, + } +} + // DiffBackupIntervalInHours - The differential backup interval in hours. This is how many interval hours between each differential // backup will be supported. This is only applicable to live databases but not dropped databases. type DiffBackupIntervalInHours int32 @@ -819,6 +896,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 @@ -866,6 +956,22 @@ func PossibleEncryptionProtectorNameValues() []EncryptionProtectorName { } } +// ExternalGovernanceStatus - Status of external governance. +type ExternalGovernanceStatus string + +const ( + ExternalGovernanceStatusDisabled ExternalGovernanceStatus = "Disabled" + ExternalGovernanceStatusEnabled ExternalGovernanceStatus = "Enabled" +) + +// PossibleExternalGovernanceStatusValues returns the possible values for the ExternalGovernanceStatus const type. +func PossibleExternalGovernanceStatusValues() []ExternalGovernanceStatus { + return []ExternalGovernanceStatus{ + ExternalGovernanceStatusDisabled, + ExternalGovernanceStatusEnabled, + } +} + // FailoverGroupReplicationRole - Local replication role of the failover group instance. type FailoverGroupReplicationRole string @@ -936,15 +1042,15 @@ func PossibleIdentityTypeValues() []IdentityType { type ImplementationMethod string const ( - ImplementationMethodTSQL ImplementationMethod = "TSql" ImplementationMethodAzurePowerShell ImplementationMethod = "AzurePowerShell" + ImplementationMethodTSQL ImplementationMethod = "TSql" ) // PossibleImplementationMethodValues returns the possible values for the ImplementationMethod const type. func PossibleImplementationMethodValues() []ImplementationMethod { return []ImplementationMethod{ - ImplementationMethodTSQL, ImplementationMethodAzurePowerShell, + ImplementationMethodTSQL, } } @@ -985,15 +1091,15 @@ func PossibleInstancePoolLicenseTypeValues() []InstancePoolLicenseType { type IsRetryable string const ( - IsRetryableYes IsRetryable = "Yes" IsRetryableNo IsRetryable = "No" + IsRetryableYes IsRetryable = "Yes" ) // PossibleIsRetryableValues returns the possible values for the IsRetryable const type. func PossibleIsRetryableValues() []IsRetryable { return []IsRetryable{ - IsRetryableYes, IsRetryableNo, + IsRetryableYes, } } @@ -1113,15 +1219,15 @@ func PossibleJobStepOutputTypeValues() []JobStepOutputType { type JobTargetGroupMembershipType string const ( - JobTargetGroupMembershipTypeInclude JobTargetGroupMembershipType = "Include" JobTargetGroupMembershipTypeExclude JobTargetGroupMembershipType = "Exclude" + JobTargetGroupMembershipTypeInclude JobTargetGroupMembershipType = "Include" ) // PossibleJobTargetGroupMembershipTypeValues returns the possible values for the JobTargetGroupMembershipType const type. func PossibleJobTargetGroupMembershipTypeValues() []JobTargetGroupMembershipType { return []JobTargetGroupMembershipType{ - JobTargetGroupMembershipTypeInclude, JobTargetGroupMembershipTypeExclude, + JobTargetGroupMembershipTypeInclude, } } @@ -1164,15 +1270,15 @@ func PossibleLedgerDigestUploadsNameValues() []LedgerDigestUploadsName { type LedgerDigestUploadsState string const ( - LedgerDigestUploadsStateEnabled LedgerDigestUploadsState = "Enabled" LedgerDigestUploadsStateDisabled LedgerDigestUploadsState = "Disabled" + LedgerDigestUploadsStateEnabled LedgerDigestUploadsState = "Enabled" ) // PossibleLedgerDigestUploadsStateValues returns the possible values for the LedgerDigestUploadsState const type. func PossibleLedgerDigestUploadsStateValues() []LedgerDigestUploadsState { return []LedgerDigestUploadsState{ - LedgerDigestUploadsStateEnabled, LedgerDigestUploadsStateDisabled, + LedgerDigestUploadsStateEnabled, } } @@ -1244,11 +1350,16 @@ type ManagedDatabaseStatus string const ( ManagedDatabaseStatusCreating ManagedDatabaseStatus = "Creating" + ManagedDatabaseStatusDbCopying ManagedDatabaseStatus = "DbCopying" + ManagedDatabaseStatusDbMoving ManagedDatabaseStatus = "DbMoving" ManagedDatabaseStatusInaccessible ManagedDatabaseStatus = "Inaccessible" ManagedDatabaseStatusOffline ManagedDatabaseStatus = "Offline" ManagedDatabaseStatusOnline ManagedDatabaseStatus = "Online" ManagedDatabaseStatusRestoring ManagedDatabaseStatus = "Restoring" ManagedDatabaseStatusShutdown ManagedDatabaseStatus = "Shutdown" + ManagedDatabaseStatusStarting ManagedDatabaseStatus = "Starting" + ManagedDatabaseStatusStopped ManagedDatabaseStatus = "Stopped" + ManagedDatabaseStatusStopping ManagedDatabaseStatus = "Stopping" ManagedDatabaseStatusUpdating ManagedDatabaseStatus = "Updating" ) @@ -1256,11 +1367,16 @@ const ( func PossibleManagedDatabaseStatusValues() []ManagedDatabaseStatus { return []ManagedDatabaseStatus{ ManagedDatabaseStatusCreating, + ManagedDatabaseStatusDbCopying, + ManagedDatabaseStatusDbMoving, ManagedDatabaseStatusInaccessible, ManagedDatabaseStatusOffline, ManagedDatabaseStatusOnline, ManagedDatabaseStatusRestoring, ManagedDatabaseStatusShutdown, + ManagedDatabaseStatusStarting, + ManagedDatabaseStatusStopped, + ManagedDatabaseStatusStopping, ManagedDatabaseStatusUpdating, } } @@ -1368,6 +1484,35 @@ func PossibleManagedInstanceProxyOverrideValues() []ManagedInstanceProxyOverride } } +type ManagedLedgerDigestUploadsName string + +const ( + ManagedLedgerDigestUploadsNameCurrent ManagedLedgerDigestUploadsName = "current" +) + +// PossibleManagedLedgerDigestUploadsNameValues returns the possible values for the ManagedLedgerDigestUploadsName const type. +func PossibleManagedLedgerDigestUploadsNameValues() []ManagedLedgerDigestUploadsName { + return []ManagedLedgerDigestUploadsName{ + ManagedLedgerDigestUploadsNameCurrent, + } +} + +// ManagedLedgerDigestUploadsState - Specifies the state of ledger digest upload. +type ManagedLedgerDigestUploadsState string + +const ( + ManagedLedgerDigestUploadsStateDisabled ManagedLedgerDigestUploadsState = "Disabled" + ManagedLedgerDigestUploadsStateEnabled ManagedLedgerDigestUploadsState = "Enabled" +) + +// PossibleManagedLedgerDigestUploadsStateValues returns the possible values for the ManagedLedgerDigestUploadsState const type. +func PossibleManagedLedgerDigestUploadsStateValues() []ManagedLedgerDigestUploadsState { + return []ManagedLedgerDigestUploadsState{ + ManagedLedgerDigestUploadsStateDisabled, + ManagedLedgerDigestUploadsStateEnabled, + } +} + // ManagedServerCreateMode - Specifies the mode of database creation. // Default: Regular instance creation. // Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId @@ -1465,6 +1610,22 @@ func PossibleMetricTypeValues() []MetricType { } } +// MoveOperationMode - 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 @@ -1766,30 +1927,30 @@ func PossibleRecommendedActionCurrentStateValues() []RecommendedActionCurrentSta type RecommendedActionInitiatedBy string const ( - RecommendedActionInitiatedByUser RecommendedActionInitiatedBy = "User" RecommendedActionInitiatedBySystem RecommendedActionInitiatedBy = "System" + RecommendedActionInitiatedByUser RecommendedActionInitiatedBy = "User" ) // PossibleRecommendedActionInitiatedByValues returns the possible values for the RecommendedActionInitiatedBy const type. func PossibleRecommendedActionInitiatedByValues() []RecommendedActionInitiatedBy { return []RecommendedActionInitiatedBy{ - RecommendedActionInitiatedByUser, RecommendedActionInitiatedBySystem, + RecommendedActionInitiatedByUser, } } type RecommendedSensitivityLabelUpdateKind string const ( - RecommendedSensitivityLabelUpdateKindEnable RecommendedSensitivityLabelUpdateKind = "enable" RecommendedSensitivityLabelUpdateKindDisable RecommendedSensitivityLabelUpdateKind = "disable" + RecommendedSensitivityLabelUpdateKindEnable RecommendedSensitivityLabelUpdateKind = "enable" ) // PossibleRecommendedSensitivityLabelUpdateKindValues returns the possible values for the RecommendedSensitivityLabelUpdateKind const type. func PossibleRecommendedSensitivityLabelUpdateKindValues() []RecommendedSensitivityLabelUpdateKind { return []RecommendedSensitivityLabelUpdateKind{ - RecommendedSensitivityLabelUpdateKindEnable, RecommendedSensitivityLabelUpdateKindDisable, + RecommendedSensitivityLabelUpdateKindEnable, } } @@ -1808,12 +1969,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. @@ -1821,6 +1983,7 @@ func PossibleReplicationLinkTypeValues() []ReplicationLinkType { return []ReplicationLinkType{ ReplicationLinkTypeGEO, ReplicationLinkTypeNAMED, + ReplicationLinkTypeSTANDBY, } } @@ -1844,21 +2007,21 @@ func PossibleReplicationModeValues() []ReplicationMode { type ReplicationRole string const ( + ReplicationRoleCopy ReplicationRole = "Copy" + ReplicationRoleNonReadableSecondary ReplicationRole = "NonReadableSecondary" ReplicationRolePrimary ReplicationRole = "Primary" ReplicationRoleSecondary ReplicationRole = "Secondary" - ReplicationRoleNonReadableSecondary ReplicationRole = "NonReadableSecondary" ReplicationRoleSource ReplicationRole = "Source" - ReplicationRoleCopy ReplicationRole = "Copy" ) // PossibleReplicationRoleValues returns the possible values for the ReplicationRole const type. func PossibleReplicationRoleValues() []ReplicationRole { return []ReplicationRole{ + ReplicationRoleCopy, + ReplicationRoleNonReadableSecondary, ReplicationRolePrimary, ReplicationRoleSecondary, - ReplicationRoleNonReadableSecondary, ReplicationRoleSource, - ReplicationRoleCopy, } } @@ -1911,6 +2074,66 @@ func PossibleRestorePointTypeValues() []RestorePointType { } } +// RuleSeverity - SQL Vulnerability Assessment rule severity. +type RuleSeverity string + +const ( + RuleSeverityHigh RuleSeverity = "High" + RuleSeverityInformational RuleSeverity = "Informational" + RuleSeverityLow RuleSeverity = "Low" + RuleSeverityMedium RuleSeverity = "Medium" + RuleSeverityObsolete RuleSeverity = "Obsolete" +) + +// PossibleRuleSeverityValues returns the possible values for the RuleSeverity const type. +func PossibleRuleSeverityValues() []RuleSeverity { + return []RuleSeverity{ + RuleSeverityHigh, + RuleSeverityInformational, + RuleSeverityLow, + RuleSeverityMedium, + RuleSeverityObsolete, + } +} + +// RuleStatus - SQL Vulnerability Assessment baseline status +type RuleStatus string + +const ( + RuleStatusFinding RuleStatus = "Finding" + RuleStatusInternalError RuleStatus = "InternalError" + RuleStatusNonFinding RuleStatus = "NonFinding" +) + +// PossibleRuleStatusValues returns the possible values for the RuleStatus const type. +func PossibleRuleStatusValues() []RuleStatus { + return []RuleStatus{ + RuleStatusFinding, + RuleStatusInternalError, + RuleStatusNonFinding, + } +} + +// RuleType - SQL Vulnerability Assessment rule type. +type RuleType string + +const ( + RuleTypeBaselineExpected RuleType = "BaselineExpected" + RuleTypeBinary RuleType = "Binary" + RuleTypeNegativeList RuleType = "NegativeList" + RuleTypePositiveList RuleType = "PositiveList" +) + +// PossibleRuleTypeValues returns the possible values for the RuleType const type. +func PossibleRuleTypeValues() []RuleType { + return []RuleType{ + RuleTypeBaselineExpected, + RuleTypeBinary, + RuleTypeNegativeList, + RuleTypePositiveList, + } +} + // SQLAgentConfigurationPropertiesState - The state of Sql Agent. type SQLAgentConfigurationPropertiesState string @@ -1927,6 +2150,36 @@ func PossibleSQLAgentConfigurationPropertiesStateValues() []SQLAgentConfiguratio } } +type SQLVulnerabilityAssessmentName string + +const ( + SQLVulnerabilityAssessmentNameDefault SQLVulnerabilityAssessmentName = "default" +) + +// PossibleSQLVulnerabilityAssessmentNameValues returns the possible values for the SQLVulnerabilityAssessmentName const type. +func PossibleSQLVulnerabilityAssessmentNameValues() []SQLVulnerabilityAssessmentName { + return []SQLVulnerabilityAssessmentName{ + SQLVulnerabilityAssessmentNameDefault, + } +} + +// SQLVulnerabilityAssessmentState - Specifies the state of the SQL Vulnerability Assessment, whether it is enabled or disabled +// or a state has not been applied yet on the specific database or server. +type SQLVulnerabilityAssessmentState string + +const ( + SQLVulnerabilityAssessmentStateDisabled SQLVulnerabilityAssessmentState = "Disabled" + SQLVulnerabilityAssessmentStateEnabled SQLVulnerabilityAssessmentState = "Enabled" +) + +// PossibleSQLVulnerabilityAssessmentStateValues returns the possible values for the SQLVulnerabilityAssessmentState const type. +func PossibleSQLVulnerabilityAssessmentStateValues() []SQLVulnerabilityAssessmentState { + return []SQLVulnerabilityAssessmentState{ + SQLVulnerabilityAssessmentStateDisabled, + SQLVulnerabilityAssessmentStateEnabled, + } +} + // SampleName - The name of the sample schema to apply when creating this database. type SampleName string @@ -1945,12 +2198,29 @@ func PossibleSampleNameValues() []SampleName { } } -// SecondaryType - The secondary type of the database if it is a secondary. Valid values are Geo and Named. +// SecondaryInstanceType - Type of the geo-secondary instance. Set 'Standby' if the instance is used as a DR option only. +type SecondaryInstanceType string + +const ( + SecondaryInstanceTypeGeo SecondaryInstanceType = "Geo" + SecondaryInstanceTypeStandby SecondaryInstanceType = "Standby" +) + +// PossibleSecondaryInstanceTypeValues returns the possible values for the SecondaryInstanceType const type. +func PossibleSecondaryInstanceTypeValues() []SecondaryInstanceType { + return []SecondaryInstanceType{ + SecondaryInstanceTypeGeo, + SecondaryInstanceTypeStandby, + } +} + +// 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. @@ -1958,6 +2228,7 @@ func PossibleSecondaryTypeValues() []SecondaryType { return []SecondaryType{ SecondaryTypeGeo, SecondaryTypeNamed, + SecondaryTypeStandby, } } @@ -1979,17 +2250,17 @@ func PossibleSecurityAlertPolicyNameValues() []SecurityAlertPolicyName { type SecurityAlertPolicyState string const ( - SecurityAlertPolicyStateNew SecurityAlertPolicyState = "New" - SecurityAlertPolicyStateEnabled SecurityAlertPolicyState = "Enabled" SecurityAlertPolicyStateDisabled SecurityAlertPolicyState = "Disabled" + SecurityAlertPolicyStateEnabled SecurityAlertPolicyState = "Enabled" + SecurityAlertPolicyStateNew SecurityAlertPolicyState = "New" ) // PossibleSecurityAlertPolicyStateValues returns the possible values for the SecurityAlertPolicyState const type. func PossibleSecurityAlertPolicyStateValues() []SecurityAlertPolicyState { return []SecurityAlertPolicyState{ - SecurityAlertPolicyStateNew, - SecurityAlertPolicyStateEnabled, SecurityAlertPolicyStateDisabled, + SecurityAlertPolicyStateEnabled, + SecurityAlertPolicyStateNew, } } @@ -1998,15 +2269,15 @@ func PossibleSecurityAlertPolicyStateValues() []SecurityAlertPolicyState { type SecurityAlertsPolicyState string const ( - SecurityAlertsPolicyStateEnabled SecurityAlertsPolicyState = "Enabled" SecurityAlertsPolicyStateDisabled SecurityAlertsPolicyState = "Disabled" + SecurityAlertsPolicyStateEnabled SecurityAlertsPolicyState = "Enabled" ) // PossibleSecurityAlertsPolicyStateValues returns the possible values for the SecurityAlertsPolicyState const type. func PossibleSecurityAlertsPolicyStateValues() []SecurityAlertsPolicyState { return []SecurityAlertsPolicyState{ - SecurityAlertsPolicyStateEnabled, SecurityAlertsPolicyStateDisabled, + SecurityAlertsPolicyStateEnabled, } } @@ -2014,38 +2285,38 @@ func PossibleSecurityAlertsPolicyStateValues() []SecurityAlertsPolicyState { type SecurityEventType string const ( - SecurityEventTypeUndefined SecurityEventType = "Undefined" - SecurityEventTypeSQLInjectionVulnerability SecurityEventType = "SqlInjectionVulnerability" SecurityEventTypeSQLInjectionExploit SecurityEventType = "SqlInjectionExploit" + SecurityEventTypeSQLInjectionVulnerability SecurityEventType = "SqlInjectionVulnerability" + SecurityEventTypeUndefined SecurityEventType = "Undefined" ) // PossibleSecurityEventTypeValues returns the possible values for the SecurityEventType const type. func PossibleSecurityEventTypeValues() []SecurityEventType { return []SecurityEventType{ - SecurityEventTypeUndefined, - SecurityEventTypeSQLInjectionVulnerability, SecurityEventTypeSQLInjectionExploit, + SecurityEventTypeSQLInjectionVulnerability, + SecurityEventTypeUndefined, } } type SensitivityLabelRank string const ( - SensitivityLabelRankNone SensitivityLabelRank = "None" + SensitivityLabelRankCritical SensitivityLabelRank = "Critical" + SensitivityLabelRankHigh SensitivityLabelRank = "High" SensitivityLabelRankLow SensitivityLabelRank = "Low" SensitivityLabelRankMedium SensitivityLabelRank = "Medium" - SensitivityLabelRankHigh SensitivityLabelRank = "High" - SensitivityLabelRankCritical SensitivityLabelRank = "Critical" + SensitivityLabelRankNone SensitivityLabelRank = "None" ) // PossibleSensitivityLabelRankValues returns the possible values for the SensitivityLabelRank const type. func PossibleSensitivityLabelRankValues() []SensitivityLabelRank { return []SensitivityLabelRank{ - SensitivityLabelRankNone, + SensitivityLabelRankCritical, + SensitivityLabelRankHigh, SensitivityLabelRankLow, SensitivityLabelRankMedium, - SensitivityLabelRankHigh, - SensitivityLabelRankCritical, + SensitivityLabelRankNone, } } @@ -2067,15 +2338,28 @@ func PossibleSensitivityLabelSourceValues() []SensitivityLabelSource { type SensitivityLabelUpdateKind string const ( - SensitivityLabelUpdateKindSet SensitivityLabelUpdateKind = "set" SensitivityLabelUpdateKindRemove SensitivityLabelUpdateKind = "remove" + SensitivityLabelUpdateKindSet SensitivityLabelUpdateKind = "set" ) // PossibleSensitivityLabelUpdateKindValues returns the possible values for the SensitivityLabelUpdateKind const type. func PossibleSensitivityLabelUpdateKindValues() []SensitivityLabelUpdateKind { return []SensitivityLabelUpdateKind{ - SensitivityLabelUpdateKindSet, SensitivityLabelUpdateKindRemove, + SensitivityLabelUpdateKindSet, + } +} + +type ServerConfigurationOptionName string + +const ( + ServerConfigurationOptionNameAllowPolybaseExport ServerConfigurationOptionName = "allowPolybaseExport" +) + +// PossibleServerConfigurationOptionNameValues returns the possible values for the ServerConfigurationOptionName const type. +func PossibleServerConfigurationOptionNameValues() []ServerConfigurationOptionName { + return []ServerConfigurationOptionName{ + ServerConfigurationOptionNameAllowPolybaseExport, } } @@ -2113,8 +2397,8 @@ func PossibleServerKeyTypeValues() []ServerKeyType { } } -// ServerNetworkAccessFlag - Whether or not public endpoint access is allowed for this server. Value is optional but if passed -// in, must be 'Enabled' or 'Disabled' +// ServerNetworkAccessFlag - Whether or not to restrict outbound network access for this server. Value is optional but if +// passed in, must be 'Enabled' or 'Disabled' type ServerNetworkAccessFlag string const ( @@ -2130,6 +2414,25 @@ func PossibleServerNetworkAccessFlagValues() []ServerNetworkAccessFlag { } } +// ServerPublicNetworkAccessFlag - Whether or not public endpoint access is allowed for this server. Value is optional but +// if passed in, must be 'Enabled' or 'Disabled' or 'SecuredByPerimeter' +type ServerPublicNetworkAccessFlag string + +const ( + ServerPublicNetworkAccessFlagDisabled ServerPublicNetworkAccessFlag = "Disabled" + ServerPublicNetworkAccessFlagEnabled ServerPublicNetworkAccessFlag = "Enabled" + ServerPublicNetworkAccessFlagSecuredByPerimeter ServerPublicNetworkAccessFlag = "SecuredByPerimeter" +) + +// PossibleServerPublicNetworkAccessFlagValues returns the possible values for the ServerPublicNetworkAccessFlag const type. +func PossibleServerPublicNetworkAccessFlagValues() []ServerPublicNetworkAccessFlag { + return []ServerPublicNetworkAccessFlag{ + ServerPublicNetworkAccessFlagDisabled, + ServerPublicNetworkAccessFlagEnabled, + ServerPublicNetworkAccessFlagSecuredByPerimeter, + } +} + type ServerTrustGroupPropertiesTrustScopesItem string const ( @@ -2332,6 +2635,19 @@ func PossibleShortTermRetentionPolicyNameValues() []ShortTermRetentionPolicyName } } +type StartStopScheduleName string + +const ( + StartStopScheduleNameDefault StartStopScheduleName = "default" +) + +// PossibleStartStopScheduleNameValues returns the possible values for the StartStopScheduleName const type. +func PossibleStartStopScheduleNameValues() []StartStopScheduleName { + return []StartStopScheduleName{ + StartStopScheduleNameDefault, + } +} + // StorageCapabilityStorageAccountType - The storage account type for the database's backups. type StorageCapabilityStorageAccountType string @@ -2578,15 +2894,15 @@ func PossibleTransparentDataEncryptionNameValues() []TransparentDataEncryptionNa type TransparentDataEncryptionState string const ( - TransparentDataEncryptionStateEnabled TransparentDataEncryptionState = "Enabled" TransparentDataEncryptionStateDisabled TransparentDataEncryptionState = "Disabled" + TransparentDataEncryptionStateEnabled TransparentDataEncryptionState = "Enabled" ) // PossibleTransparentDataEncryptionStateValues returns the possible values for the TransparentDataEncryptionState const type. func PossibleTransparentDataEncryptionStateValues() []TransparentDataEncryptionState { return []TransparentDataEncryptionState{ - TransparentDataEncryptionStateEnabled, TransparentDataEncryptionStateDisabled, + TransparentDataEncryptionStateEnabled, } } @@ -2701,15 +3017,15 @@ func PossibleVulnerabilityAssessmentNameValues() []VulnerabilityAssessmentName { type VulnerabilityAssessmentPolicyBaselineName string const ( - VulnerabilityAssessmentPolicyBaselineNameMaster VulnerabilityAssessmentPolicyBaselineName = "master" VulnerabilityAssessmentPolicyBaselineNameDefault VulnerabilityAssessmentPolicyBaselineName = "default" + VulnerabilityAssessmentPolicyBaselineNameMaster VulnerabilityAssessmentPolicyBaselineName = "master" ) // PossibleVulnerabilityAssessmentPolicyBaselineNameValues returns the possible values for the VulnerabilityAssessmentPolicyBaselineName const type. func PossibleVulnerabilityAssessmentPolicyBaselineNameValues() []VulnerabilityAssessmentPolicyBaselineName { return []VulnerabilityAssessmentPolicyBaselineName{ - VulnerabilityAssessmentPolicyBaselineNameMaster, VulnerabilityAssessmentPolicyBaselineNameDefault, + VulnerabilityAssessmentPolicyBaselineNameMaster, } } diff --git a/sdk/resourcemanager/sql/armsql/databaseadvancedthreatprotectionsettings_client.go b/sdk/resourcemanager/sql/armsql/databaseadvancedthreatprotectionsettings_client.go index 9b2664e416aa..13545b1724f3 100644 --- a/sdk/resourcemanager/sql/armsql/databaseadvancedthreatprotectionsettings_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseadvancedthreatprotectionsettings_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -57,18 +56,21 @@ func NewDatabaseAdvancedThreatProtectionSettingsClient(subscriptionID string, cr // - options - DatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateOptions contains the optional parameters for the // DatabaseAdvancedThreatProtectionSettingsClient.CreateOrUpdate method. func (client *DatabaseAdvancedThreatProtectionSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advancedThreatProtectionName AdvancedThreatProtectionName, parameters DatabaseAdvancedThreatProtection, options *DatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateOptions) (DatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, advancedThreatProtectionName, parameters, options) if err != nil { return DatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return DatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return DatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -102,7 +104,10 @@ func (client *DatabaseAdvancedThreatProtectionSettingsClient) createOrUpdateCrea 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) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -126,18 +131,21 @@ func (client *DatabaseAdvancedThreatProtectionSettingsClient) createOrUpdateHand // - options - DatabaseAdvancedThreatProtectionSettingsClientGetOptions contains the optional parameters for the DatabaseAdvancedThreatProtectionSettingsClient.Get // method. func (client *DatabaseAdvancedThreatProtectionSettingsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advancedThreatProtectionName AdvancedThreatProtectionName, options *DatabaseAdvancedThreatProtectionSettingsClientGetOptions) (DatabaseAdvancedThreatProtectionSettingsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, advancedThreatProtectionName, options) if err != nil { return DatabaseAdvancedThreatProtectionSettingsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseAdvancedThreatProtectionSettingsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabaseAdvancedThreatProtectionSettingsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseAdvancedThreatProtectionSettingsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/databaseadvancedthreatprotectionsettings_client_example_test.go b/sdk/resourcemanager/sql/armsql/databaseadvancedthreatprotectionsettings_client_example_test.go index 0cde12449deb..75c22d158faf 100644 --- a/sdk/resourcemanager/sql/armsql/databaseadvancedthreatprotectionsettings_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/databaseadvancedthreatprotectionsettings_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsListByDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -63,7 +63,7 @@ func ExampleDatabaseAdvancedThreatProtectionSettingsClient_NewListByDatabasePage } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -100,7 +100,7 @@ func ExampleDatabaseAdvancedThreatProtectionSettingsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsCreateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsCreateMax.json func ExampleDatabaseAdvancedThreatProtectionSettingsClient_CreateOrUpdate_updateADatabasesAdvancedThreatProtectionSettingsWithAllParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -141,7 +141,7 @@ func ExampleDatabaseAdvancedThreatProtectionSettingsClient_CreateOrUpdate_update // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsCreateMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsCreateMin.json func ExampleDatabaseAdvancedThreatProtectionSettingsClient_CreateOrUpdate_updateADatabasesAdvancedThreatProtectionSettingsWithMinimalParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/sql/armsql/databaseadvisors_client.go b/sdk/resourcemanager/sql/armsql/databaseadvisors_client.go index e72518d4c382..b6383a005106 100644 --- a/sdk/resourcemanager/sql/armsql/databaseadvisors_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseadvisors_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -55,18 +54,21 @@ func NewDatabaseAdvisorsClient(subscriptionID string, credential azcore.TokenCre // - advisorName - The name of the Database Advisor. // - options - DatabaseAdvisorsClientGetOptions contains the optional parameters for the DatabaseAdvisorsClient.Get method. func (client *DatabaseAdvisorsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advisorName string, options *DatabaseAdvisorsClientGetOptions) (DatabaseAdvisorsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, advisorName, options) if err != nil { return DatabaseAdvisorsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseAdvisorsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabaseAdvisorsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseAdvisorsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -123,18 +125,21 @@ func (client *DatabaseAdvisorsClient) getHandleResponse(resp *http.Response) (Da // - options - DatabaseAdvisorsClientListByDatabaseOptions contains the optional parameters for the DatabaseAdvisorsClient.ListByDatabase // method. func (client *DatabaseAdvisorsClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabaseAdvisorsClientListByDatabaseOptions) (DatabaseAdvisorsClientListByDatabaseResponse, error) { + var err error req, err := client.listByDatabaseCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { return DatabaseAdvisorsClientListByDatabaseResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseAdvisorsClientListByDatabaseResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabaseAdvisorsClientListByDatabaseResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseAdvisorsClientListByDatabaseResponse{}, err } - return client.listByDatabaseHandleResponse(resp) + resp, err := client.listByDatabaseHandleResponse(httpResp) + return resp, err } // listByDatabaseCreateRequest creates the ListByDatabase request. @@ -191,18 +196,21 @@ func (client *DatabaseAdvisorsClient) listByDatabaseHandleResponse(resp *http.Re // - parameters - The requested advisor resource state. // - options - DatabaseAdvisorsClientUpdateOptions contains the optional parameters for the DatabaseAdvisorsClient.Update method. func (client *DatabaseAdvisorsClient) Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advisorName string, parameters Advisor, options *DatabaseAdvisorsClientUpdateOptions) (DatabaseAdvisorsClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, databaseName, advisorName, parameters, options) if err != nil { return DatabaseAdvisorsClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseAdvisorsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabaseAdvisorsClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseAdvisorsClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -236,7 +244,10 @@ func (client *DatabaseAdvisorsClient) updateCreateRequest(ctx context.Context, r reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/sql/armsql/databaseadvisors_client_example_test.go b/sdk/resourcemanager/sql/armsql/databaseadvisors_client_example_test.go index 91211a2a89cd..6800f25e0568 100644 --- a/sdk/resourcemanager/sql/armsql/databaseadvisors_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/databaseadvisors_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAdvisorList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAdvisorList.json func ExampleDatabaseAdvisorsClient_ListByDatabase_listOfDatabaseAdvisors() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -107,7 +107,7 @@ func ExampleDatabaseAdvisorsClient_ListByDatabase_listOfDatabaseAdvisors() { // }} } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionListExpand.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionListExpand.json func ExampleDatabaseAdvisorsClient_ListByDatabase_listOfDatabaseRecommendedActionsForAllAdvisors() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -748,7 +748,7 @@ func ExampleDatabaseAdvisorsClient_ListByDatabase_listOfDatabaseRecommendedActio // }} } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAdvisorGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -779,7 +779,7 @@ func ExampleDatabaseAdvisorsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAdvisorUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/databaseautomatictuning_client.go b/sdk/resourcemanager/sql/armsql/databaseautomatictuning_client.go index a3322a9790fa..774809ec7e1e 100644 --- a/sdk/resourcemanager/sql/armsql/databaseautomatictuning_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseautomatictuning_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -55,18 +54,21 @@ func NewDatabaseAutomaticTuningClient(subscriptionID string, credential azcore.T // - options - DatabaseAutomaticTuningClientGetOptions contains the optional parameters for the DatabaseAutomaticTuningClient.Get // method. func (client *DatabaseAutomaticTuningClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabaseAutomaticTuningClientGetOptions) (DatabaseAutomaticTuningClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { return DatabaseAutomaticTuningClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseAutomaticTuningClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabaseAutomaticTuningClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseAutomaticTuningClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -120,18 +122,21 @@ func (client *DatabaseAutomaticTuningClient) getHandleResponse(resp *http.Respon // - options - DatabaseAutomaticTuningClientUpdateOptions contains the optional parameters for the DatabaseAutomaticTuningClient.Update // method. func (client *DatabaseAutomaticTuningClient) Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseAutomaticTuning, options *DatabaseAutomaticTuningClientUpdateOptions) (DatabaseAutomaticTuningClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { return DatabaseAutomaticTuningClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseAutomaticTuningClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabaseAutomaticTuningClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseAutomaticTuningClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -161,7 +166,10 @@ func (client *DatabaseAutomaticTuningClient) updateCreateRequest(ctx context.Con reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/sql/armsql/databaseautomatictuning_client_example_test.go b/sdk/resourcemanager/sql/armsql/databaseautomatictuning_client_example_test.go index 635a4d9358d5..7a43e39b9934 100644 --- a/sdk/resourcemanager/sql/armsql/databaseautomatictuning_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/databaseautomatictuning_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAutomaticTuningGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -73,7 +73,7 @@ func ExampleDatabaseAutomaticTuningClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAutomaticTuningUpdateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAutomaticTuningUpdateMax.json func ExampleDatabaseAutomaticTuningClient_Update_updatesDatabaseAutomaticTuningSettingsWithAllProperties() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -139,7 +139,7 @@ func ExampleDatabaseAutomaticTuningClient_Update_updatesDatabaseAutomaticTuningS // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAutomaticTuningUpdateMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAutomaticTuningUpdateMin.json func ExampleDatabaseAutomaticTuningClient_Update_updatesDatabaseAutomaticTuningSettingsWithMinimalProperties() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/sql/armsql/databaseblobauditingpolicies_client.go b/sdk/resourcemanager/sql/armsql/databaseblobauditingpolicies_client.go index 832005fd4e72..b1db184e9293 100644 --- a/sdk/resourcemanager/sql/armsql/databaseblobauditingpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseblobauditingpolicies_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -56,18 +55,21 @@ func NewDatabaseBlobAuditingPoliciesClient(subscriptionID string, credential azc // - options - DatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions contains the optional parameters for the DatabaseBlobAuditingPoliciesClient.CreateOrUpdate // method. func (client *DatabaseBlobAuditingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseBlobAuditingPolicy, options *DatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions) (DatabaseBlobAuditingPoliciesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { return DatabaseBlobAuditingPoliciesClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseBlobAuditingPoliciesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return DatabaseBlobAuditingPoliciesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return DatabaseBlobAuditingPoliciesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -98,7 +100,10 @@ func (client *DatabaseBlobAuditingPoliciesClient) createOrUpdateCreateRequest(ct 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) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -121,18 +126,21 @@ func (client *DatabaseBlobAuditingPoliciesClient) createOrUpdateHandleResponse(r // - options - DatabaseBlobAuditingPoliciesClientGetOptions contains the optional parameters for the DatabaseBlobAuditingPoliciesClient.Get // method. func (client *DatabaseBlobAuditingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabaseBlobAuditingPoliciesClientGetOptions) (DatabaseBlobAuditingPoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { return DatabaseBlobAuditingPoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseBlobAuditingPoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabaseBlobAuditingPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseBlobAuditingPoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/databaseblobauditingpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/databaseblobauditingpolicies_client_example_test.go index e0605fecd624..0c716870a7bd 100644 --- a/sdk/resourcemanager/sql/armsql/databaseblobauditingpolicies_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/databaseblobauditingpolicies_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAuditingSettingsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -62,7 +62,7 @@ func ExampleDatabaseBlobAuditingPoliciesClient_NewListByDatabasePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseBlobAuditingGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -98,7 +98,7 @@ func ExampleDatabaseBlobAuditingPoliciesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAzureMonitorAuditingCreateMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAzureMonitorAuditingCreateMin.json func ExampleDatabaseBlobAuditingPoliciesClient_CreateOrUpdate_createOrUpdateADatabasesAzureMonitorAuditingPolicyWithMinimalParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -139,7 +139,7 @@ func ExampleDatabaseBlobAuditingPoliciesClient_CreateOrUpdate_createOrUpdateADat // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseBlobAuditingCreateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseBlobAuditingCreateMax.json func ExampleDatabaseBlobAuditingPoliciesClient_CreateOrUpdate_createOrUpdateADatabasesBlobAuditingPolicyWithAllParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -193,7 +193,7 @@ func ExampleDatabaseBlobAuditingPoliciesClient_CreateOrUpdate_createOrUpdateADat // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseBlobAuditingCreateMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseBlobAuditingCreateMin.json func ExampleDatabaseBlobAuditingPoliciesClient_CreateOrUpdate_createOrUpdateADatabasesBlobAuditingPolicyWithMinimalParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/sql/armsql/databasecolumns_client.go b/sdk/resourcemanager/sql/armsql/databasecolumns_client.go index 493bfdb51af9..139a1843b87c 100644 --- a/sdk/resourcemanager/sql/armsql/databasecolumns_client.go +++ b/sdk/resourcemanager/sql/armsql/databasecolumns_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -57,18 +56,21 @@ func NewDatabaseColumnsClient(subscriptionID string, credential azcore.TokenCred // - columnName - The name of the column. // - options - DatabaseColumnsClientGetOptions contains the optional parameters for the DatabaseColumnsClient.Get method. func (client *DatabaseColumnsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, options *DatabaseColumnsClientGetOptions) (DatabaseColumnsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, options) if err != nil { return DatabaseColumnsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseColumnsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabaseColumnsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseColumnsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/databasecolumns_client_example_test.go b/sdk/resourcemanager/sql/armsql/databasecolumns_client_example_test.go index 782bce6f21be..e1206bb4c5ae 100644 --- a/sdk/resourcemanager/sql/armsql/databasecolumns_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/databasecolumns_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnsListByDatabaseMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnsListByDatabaseMax.json func ExampleDatabaseColumnsClient_NewListByDatabasePager_filterDatabaseColumns() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -68,7 +68,7 @@ func ExampleDatabaseColumnsClient_NewListByDatabasePager_filterDatabaseColumns() } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnsListByDatabaseMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnsListByDatabaseMin.json func ExampleDatabaseColumnsClient_NewListByDatabasePager_listDatabaseColumns() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -123,7 +123,7 @@ func ExampleDatabaseColumnsClient_NewListByDatabasePager_listDatabaseColumns() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseColumnListByTable.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -173,7 +173,7 @@ func ExampleDatabaseColumnsClient_NewListByTablePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseColumnGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/databaseencryptionprotectors_client.go b/sdk/resourcemanager/sql/armsql/databaseencryptionprotectors_client.go new file mode 100644 index 000000000000..c80c09da37e2 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/databaseencryptionprotectors_client.go @@ -0,0 +1,204 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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" +) + +// DatabaseEncryptionProtectorsClient contains the methods for the DatabaseEncryptionProtectors group. +// Don't use this type directly, use NewDatabaseEncryptionProtectorsClient() instead. +type DatabaseEncryptionProtectorsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewDatabaseEncryptionProtectorsClient creates a new instance of DatabaseEncryptionProtectorsClient 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 NewDatabaseEncryptionProtectorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseEncryptionProtectorsClient, error) { + cl, err := arm.NewClient(moduleName+".DatabaseEncryptionProtectorsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DatabaseEncryptionProtectorsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginRevalidate - Revalidates an existing encryption protector for a particular database. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-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. +// - encryptionProtectorName - The name of the encryption protector to be updated. +// - options - DatabaseEncryptionProtectorsClientBeginRevalidateOptions contains the optional parameters for the DatabaseEncryptionProtectorsClient.BeginRevalidate +// method. +func (client *DatabaseEncryptionProtectorsClient) BeginRevalidate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, encryptionProtectorName EncryptionProtectorName, options *DatabaseEncryptionProtectorsClientBeginRevalidateOptions) (*runtime.Poller[DatabaseEncryptionProtectorsClientRevalidateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.revalidate(ctx, resourceGroupName, serverName, databaseName, encryptionProtectorName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DatabaseEncryptionProtectorsClientRevalidateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[DatabaseEncryptionProtectorsClientRevalidateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Revalidate - Revalidates an existing encryption protector for a particular database. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01-preview +func (client *DatabaseEncryptionProtectorsClient) revalidate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, encryptionProtectorName EncryptionProtectorName, options *DatabaseEncryptionProtectorsClientBeginRevalidateOptions) (*http.Response, error) { + var err error + req, err := client.revalidateCreateRequest(ctx, resourceGroupName, serverName, databaseName, encryptionProtectorName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// revalidateCreateRequest creates the Revalidate request. +func (client *DatabaseEncryptionProtectorsClient) revalidateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, encryptionProtectorName EncryptionProtectorName, options *DatabaseEncryptionProtectorsClientBeginRevalidateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/encryptionProtector/{encryptionProtectorName}/revalidate" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if encryptionProtectorName == "" { + return nil, errors.New("parameter encryptionProtectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{encryptionProtectorName}", url.PathEscape(string(encryptionProtectorName))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// BeginRevert - Reverts an existing encryption protector for a particular database. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-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. +// - encryptionProtectorName - The name of the encryption protector to be updated. +// - options - DatabaseEncryptionProtectorsClientBeginRevertOptions contains the optional parameters for the DatabaseEncryptionProtectorsClient.BeginRevert +// method. +func (client *DatabaseEncryptionProtectorsClient) BeginRevert(ctx context.Context, resourceGroupName string, serverName string, databaseName string, encryptionProtectorName EncryptionProtectorName, options *DatabaseEncryptionProtectorsClientBeginRevertOptions) (*runtime.Poller[DatabaseEncryptionProtectorsClientRevertResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.revert(ctx, resourceGroupName, serverName, databaseName, encryptionProtectorName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DatabaseEncryptionProtectorsClientRevertResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[DatabaseEncryptionProtectorsClientRevertResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Revert - Reverts an existing encryption protector for a particular database. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01-preview +func (client *DatabaseEncryptionProtectorsClient) revert(ctx context.Context, resourceGroupName string, serverName string, databaseName string, encryptionProtectorName EncryptionProtectorName, options *DatabaseEncryptionProtectorsClientBeginRevertOptions) (*http.Response, error) { + var err error + req, err := client.revertCreateRequest(ctx, resourceGroupName, serverName, databaseName, encryptionProtectorName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// revertCreateRequest creates the Revert request. +func (client *DatabaseEncryptionProtectorsClient) revertCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, encryptionProtectorName EncryptionProtectorName, options *DatabaseEncryptionProtectorsClientBeginRevertOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/encryptionProtector/{encryptionProtectorName}/revert" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if encryptionProtectorName == "" { + return nil, errors.New("parameter encryptionProtectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{encryptionProtectorName}", url.PathEscape(string(encryptionProtectorName))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} diff --git a/sdk/resourcemanager/sql/armsql/databaseencryptionprotectors_client_example_test.go b/sdk/resourcemanager/sql/armsql/databaseencryptionprotectors_client_example_test.go new file mode 100644 index 000000000000..082e0f2d734b --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/databaseencryptionprotectors_client_example_test.go @@ -0,0 +1,60 @@ +//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_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/DatabaseEncryptionProtectorRevalidate.json +func ExampleDatabaseEncryptionProtectorsClient_BeginRevalidate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewDatabaseEncryptionProtectorsClient().BeginRevalidate(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", "sqlcrudtestdb-2342", 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/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/DatabaseEncryptionProtectorRevert.json +func ExampleDatabaseEncryptionProtectorsClient_BeginRevert() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewDatabaseEncryptionProtectorsClient().BeginRevert(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", "sqlcrudtestdb-2342", 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/databaseextensions_client.go b/sdk/resourcemanager/sql/armsql/databaseextensions_client.go index 2c0aa1aeea94..4699e40a9a9e 100644 --- a/sdk/resourcemanager/sql/armsql/databaseextensions_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseextensions_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -61,7 +60,8 @@ func (client *DatabaseExtensionsClient) BeginCreateOrUpdate(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[DatabaseExtensionsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DatabaseExtensionsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DatabaseExtensionsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *DatabaseExtensionsClient) BeginCreateOrUpdate(ctx context.Context, // // Generated from API version 2021-02-01-preview func (client *DatabaseExtensionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, extensionName string, parameters DatabaseExtensions, options *DatabaseExtensionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, extensionName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -117,7 +119,10 @@ func (client *DatabaseExtensionsClient) createOrUpdateCreateRequest(ctx context. reqQP.Set("api-version", "2021-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Get - Gets a database extension. This will return resource not found as it is not supported. @@ -130,16 +135,18 @@ func (client *DatabaseExtensionsClient) createOrUpdateCreateRequest(ctx context. // - databaseName - The name of the database. // - options - DatabaseExtensionsClientGetOptions contains the optional parameters for the DatabaseExtensionsClient.Get method. func (client *DatabaseExtensionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, extensionName string, options *DatabaseExtensionsClientGetOptions) (DatabaseExtensionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, extensionName, options) if err != nil { return DatabaseExtensionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseExtensionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabaseExtensionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseExtensionsClientGetResponse{}, err } return DatabaseExtensionsClientGetResponse{}, nil } diff --git a/sdk/resourcemanager/sql/armsql/databaseextensions_client_example_test.go b/sdk/resourcemanager/sql/armsql/databaseextensions_client_example_test.go index cd74e6b56e12..8b7997aacfee 100644 --- a/sdk/resourcemanager/sql/armsql/databaseextensions_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/databaseextensions_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/GetDatabaseExtensions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -35,7 +35,7 @@ func ExampleDatabaseExtensionsClient_Get() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CreateOrUpdateDatabaseExtensions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -79,7 +79,7 @@ func ExampleDatabaseExtensionsClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListDatabaseExtensions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/databaseoperations_client.go b/sdk/resourcemanager/sql/armsql/databaseoperations_client.go index 6f744d5979c6..de1ea3632b0f 100644 --- a/sdk/resourcemanager/sql/armsql/databaseoperations_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseoperations_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -56,16 +55,18 @@ func NewDatabaseOperationsClient(subscriptionID string, credential azcore.TokenC // - options - DatabaseOperationsClientCancelOptions contains the optional parameters for the DatabaseOperationsClient.Cancel // method. func (client *DatabaseOperationsClient) Cancel(ctx context.Context, resourceGroupName string, serverName string, databaseName string, operationID string, options *DatabaseOperationsClientCancelOptions) (DatabaseOperationsClientCancelResponse, error) { + var err error req, err := client.cancelCreateRequest(ctx, resourceGroupName, serverName, databaseName, operationID, options) if err != nil { return DatabaseOperationsClientCancelResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseOperationsClientCancelResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabaseOperationsClientCancelResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseOperationsClientCancelResponse{}, err } return DatabaseOperationsClientCancelResponse{}, nil } diff --git a/sdk/resourcemanager/sql/armsql/databaseoperations_client_example_test.go b/sdk/resourcemanager/sql/armsql/databaseoperations_client_example_test.go index 99be0592e2ec..19c58eaa577a 100644 --- a/sdk/resourcemanager/sql/armsql/databaseoperations_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/databaseoperations_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CancelDatabaseOperation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -34,7 +34,7 @@ func ExampleDatabaseOperationsClient_Cancel() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListDatabaseOperations.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/databaserecommendedactions_client.go b/sdk/resourcemanager/sql/armsql/databaserecommendedactions_client.go index b387e0fee677..537ff91dcc62 100644 --- a/sdk/resourcemanager/sql/armsql/databaserecommendedactions_client.go +++ b/sdk/resourcemanager/sql/armsql/databaserecommendedactions_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -57,18 +56,21 @@ func NewDatabaseRecommendedActionsClient(subscriptionID string, credential azcor // - options - DatabaseRecommendedActionsClientGetOptions contains the optional parameters for the DatabaseRecommendedActionsClient.Get // method. func (client *DatabaseRecommendedActionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advisorName string, recommendedActionName string, options *DatabaseRecommendedActionsClientGetOptions) (DatabaseRecommendedActionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, advisorName, recommendedActionName, options) if err != nil { return DatabaseRecommendedActionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseRecommendedActionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabaseRecommendedActionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseRecommendedActionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -130,18 +132,21 @@ func (client *DatabaseRecommendedActionsClient) getHandleResponse(resp *http.Res // - options - DatabaseRecommendedActionsClientListByDatabaseAdvisorOptions contains the optional parameters for the DatabaseRecommendedActionsClient.ListByDatabaseAdvisor // method. func (client *DatabaseRecommendedActionsClient) ListByDatabaseAdvisor(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advisorName string, options *DatabaseRecommendedActionsClientListByDatabaseAdvisorOptions) (DatabaseRecommendedActionsClientListByDatabaseAdvisorResponse, error) { + var err error req, err := client.listByDatabaseAdvisorCreateRequest(ctx, resourceGroupName, serverName, databaseName, advisorName, options) if err != nil { return DatabaseRecommendedActionsClientListByDatabaseAdvisorResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseRecommendedActionsClientListByDatabaseAdvisorResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabaseRecommendedActionsClientListByDatabaseAdvisorResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseRecommendedActionsClientListByDatabaseAdvisorResponse{}, err } - return client.listByDatabaseAdvisorHandleResponse(resp) + resp, err := client.listByDatabaseAdvisorHandleResponse(httpResp) + return resp, err } // listByDatabaseAdvisorCreateRequest creates the ListByDatabaseAdvisor request. @@ -201,18 +206,21 @@ func (client *DatabaseRecommendedActionsClient) listByDatabaseAdvisorHandleRespo // - options - DatabaseRecommendedActionsClientUpdateOptions contains the optional parameters for the DatabaseRecommendedActionsClient.Update // method. func (client *DatabaseRecommendedActionsClient) Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advisorName string, recommendedActionName string, parameters RecommendedAction, options *DatabaseRecommendedActionsClientUpdateOptions) (DatabaseRecommendedActionsClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, databaseName, advisorName, recommendedActionName, parameters, options) if err != nil { return DatabaseRecommendedActionsClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseRecommendedActionsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabaseRecommendedActionsClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseRecommendedActionsClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -250,7 +258,10 @@ func (client *DatabaseRecommendedActionsClient) updateCreateRequest(ctx context. reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/sql/armsql/databaserecommendedactions_client_example_test.go b/sdk/resourcemanager/sql/armsql/databaserecommendedactions_client_example_test.go index 085fd0367146..6c925ab13ab2 100644 --- a/sdk/resourcemanager/sql/armsql/databaserecommendedactions_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/databaserecommendedactions_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -224,7 +224,7 @@ func ExampleDatabaseRecommendedActionsClient_ListByDatabaseAdvisor() { // }} } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -293,7 +293,7 @@ func ExampleDatabaseRecommendedActionsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/databases_client.go b/sdk/resourcemanager/sql/armsql/databases_client.go index 0bb66bd3a0ed..b8707e14f342 100644 --- a/sdk/resourcemanager/sql/armsql/databases_client.go +++ b/sdk/resourcemanager/sql/armsql/databases_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -47,7 +46,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-08-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. @@ -61,7 +60,10 @@ func (client *DatabasesClient) BeginCreateOrUpdate(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller[DatabasesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DatabasesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err } else { return runtime.NewPollerFromResumeToken[DatabasesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,20 +72,22 @@ 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-08-01-preview func (client *DatabasesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database, options *DatabasesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -110,16 +114,19 @@ 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-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // 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-08-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. @@ -131,7 +138,10 @@ func (client *DatabasesClient) BeginDelete(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - return runtime.NewPoller[DatabasesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DatabasesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err } else { return runtime.NewPollerFromResumeToken[DatabasesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -140,20 +150,22 @@ 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-08-01-preview func (client *DatabasesClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -180,7 +192,7 @@ 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-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -188,7 +200,7 @@ func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resource // 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-08-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. @@ -201,7 +213,8 @@ func (client *DatabasesClient) BeginExport(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - return runtime.NewPoller[DatabasesClientExportResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DatabasesClientExportResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DatabasesClientExportResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -210,20 +223,22 @@ 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-08-01-preview func (client *DatabasesClient) export(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ExportDatabaseDefinition, options *DatabasesClientBeginExportOptions) (*http.Response, error) { + var err error req, err := client.exportCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // exportCreateRequest creates the Export request. @@ -250,16 +265,19 @@ 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-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // 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-08-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. @@ -271,7 +289,8 @@ func (client *DatabasesClient) BeginFailover(ctx context.Context, resourceGroupN if err != nil { return nil, err } - return runtime.NewPoller[DatabasesClientFailoverResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DatabasesClientFailoverResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DatabasesClientFailoverResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -280,20 +299,22 @@ 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-08-01-preview func (client *DatabasesClient) failover(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginFailoverOptions) (*http.Response, error) { + var err error req, err := client.failoverCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // failoverCreateRequest creates the Failover request. @@ -323,7 +344,7 @@ 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-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -331,25 +352,28 @@ func (client *DatabasesClient) failoverCreateRequest(ctx context.Context, resour // 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-08-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 - DatabasesClientGetOptions contains the optional parameters for the DatabasesClient.Get method. func (client *DatabasesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientGetOptions) (DatabasesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { return DatabasesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabasesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabasesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabasesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -376,7 +400,13 @@ func (client *DatabasesClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -394,7 +424,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-08-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. @@ -407,7 +437,8 @@ func (client *DatabasesClient) BeginImport(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - return runtime.NewPoller[DatabasesClientImportResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DatabasesClientImportResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DatabasesClientImportResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -416,20 +447,22 @@ 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-08-01-preview func (client *DatabasesClient) importOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ImportExistingDatabaseDefinition, options *DatabasesClientBeginImportOptions) (*http.Response, error) { + var err error req, err := client.importCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // importCreateRequest creates the Import request. @@ -456,15 +489,18 @@ 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-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // NewListByElasticPoolPager - Gets a list of databases in an elastic pool. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-08-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. @@ -523,7 +559,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-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -540,7 +576,7 @@ func (client *DatabasesClient) listByElasticPoolHandleResponse(resp *http.Respon // NewListByServerPager - Gets a list of databases. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-08-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. @@ -597,7 +633,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-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -614,7 +650,7 @@ func (client *DatabasesClient) listByServerHandleResponse(resp *http.Response) ( // NewListInaccessibleByServerPager - Gets a list of inaccessible databases in a logical server // -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-08-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. @@ -668,7 +704,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-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -828,7 +864,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-08-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. @@ -840,7 +876,8 @@ func (client *DatabasesClient) BeginPause(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[DatabasesClientPauseResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DatabasesClientPauseResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DatabasesClientPauseResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -849,20 +886,22 @@ 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-08-01-preview func (client *DatabasesClient) pause(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginPauseOptions) (*http.Response, error) { + var err error req, err := client.pauseCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // pauseCreateRequest creates the Pause request. @@ -889,7 +928,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-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -898,7 +937,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-08-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. @@ -906,16 +945,18 @@ func (client *DatabasesClient) pauseCreateRequest(ctx context.Context, resourceG // - parameters - The resource move definition for renaming this database. // - options - DatabasesClientRenameOptions contains the optional parameters for the DatabasesClient.Rename method. func (client *DatabasesClient) Rename(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ResourceMoveDefinition, options *DatabasesClientRenameOptions) (DatabasesClientRenameResponse, error) { + var err error req, err := client.renameCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { return DatabasesClientRenameResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabasesClientRenameResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabasesClientRenameResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabasesClientRenameResponse{}, err } return DatabasesClientRenameResponse{}, nil } @@ -944,15 +985,18 @@ 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-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // 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-08-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. @@ -964,7 +1008,8 @@ func (client *DatabasesClient) BeginResume(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - return runtime.NewPoller[DatabasesClientResumeResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DatabasesClientResumeResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DatabasesClientResumeResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -973,20 +1018,22 @@ 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-08-01-preview func (client *DatabasesClient) resume(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginResumeOptions) (*http.Response, error) { + var err error req, err := client.resumeCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // resumeCreateRequest creates the Resume request. @@ -1013,7 +1060,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-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1022,7 +1069,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-08-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. @@ -1035,7 +1082,10 @@ func (client *DatabasesClient) BeginUpdate(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - return runtime.NewPoller[DatabasesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DatabasesClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err } else { return runtime.NewPollerFromResumeToken[DatabasesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -1044,20 +1094,22 @@ 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-08-01-preview func (client *DatabasesClient) update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseUpdate, options *DatabasesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -1084,16 +1136,19 @@ 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-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // 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-08-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. @@ -1106,7 +1161,8 @@ func (client *DatabasesClient) BeginUpgradeDataWarehouse(ctx context.Context, re if err != nil { return nil, err } - return runtime.NewPoller[DatabasesClientUpgradeDataWarehouseResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DatabasesClientUpgradeDataWarehouseResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DatabasesClientUpgradeDataWarehouseResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -1115,20 +1171,22 @@ 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-08-01-preview func (client *DatabasesClient) upgradeDataWarehouse(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginUpgradeDataWarehouseOptions) (*http.Response, error) { + var err error req, err := client.upgradeDataWarehouseCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // upgradeDataWarehouseCreateRequest creates the UpgradeDataWarehouse request. @@ -1155,7 +1213,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-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/databases_client_example_test.go b/sdk/resourcemanager/sql/armsql/databases_client_example_test.go index 55ad192566c6..61e097f013da 100644 --- a/sdk/resourcemanager/sql/armsql/databases_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/databases_client_example_test.go @@ -17,10 +17,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DatabaseMetricsListWithFilter.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DatabaseMetricsListWithFilter.json func ExampleDatabasesClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -83,7 +83,7 @@ func ExampleDatabasesClient_NewListMetricsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DatabaseMetricsDefinitionsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DatabaseMetricsDefinitionsList.json func ExampleDatabasesClient_NewListMetricDefinitionsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -481,8 +481,8 @@ func ExampleDatabasesClient_NewListMetricDefinitionsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ListVCoreDatabasesByServer.json -func ExampleDatabasesClient_NewListByServerPager() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ListVCoreDatabasesEnclaveTypeByServer.json +func ExampleDatabasesClient_NewListByServerPager_getsAListOfDatabasesConfiguredWithEnclaveType() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -530,6 +530,7 @@ func ExampleDatabasesClient_NewListByServerPager() { // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), // MaxLogSizeBytes: to.Ptr[int64](104857600), // MaxSizeBytes: to.Ptr[int64](268435456000), + // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault), // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyZone), // RequestedServiceObjectiveName: to.Ptr("BC_Gen4_2"), @@ -564,6 +565,7 @@ func ExampleDatabasesClient_NewListByServerPager() { // IsInfraEncryptionEnabled: to.Ptr(false), // IsLedgerOn: to.Ptr(false), // MaxSizeBytes: to.Ptr[int64](32212254720), + // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS), // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyLocal), // RequestedServiceObjectiveName: to.Ptr("System0"), @@ -580,8 +582,8 @@ func ExampleDatabasesClient_NewListByServerPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/GetVCoreDatabase.json -func ExampleDatabasesClient_Get() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ListVCoreDatabasesByServer.json +func ExampleDatabasesClient_NewListByServerPager_getsAListOfDatabases() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -591,7 +593,108 @@ func ExampleDatabasesClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewDatabasesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", nil) + pager := clientFactory.NewDatabasesClient().NewListByServerPager("Default-SQL-SouthEastAsia", "testsvr", &armsql.DatabasesClientListByServerOptions{SkipToken: nil}) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.DatabaseListResult = armsql.DatabaseListResult{ + // Value: []*armsql.Database{ + // { + // Name: to.Ptr("testdb"), + // Type: to.Ptr("Microsoft.Sql/servers/databases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), + // Location: to.Ptr("southeastasia"), + // Kind: to.Ptr("v12.0,user,vcore"), + // Properties: &armsql.DatabaseProperties{ + // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), + // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), + // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyZone), + // CurrentServiceObjectiveName: to.Ptr("BC_Gen4_2"), + // CurrentSKU: &armsql.SKU{ + // Name: to.Ptr("BC_Gen4"), + // Capacity: to.Ptr[int32](2), + // Tier: to.Ptr("BusinessCritical"), + // }, + // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), + // DefaultSecondaryLocation: to.Ptr("North Europe"), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), + // IsInfraEncryptionEnabled: to.Ptr(false), + // IsLedgerOn: to.Ptr(false), + // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), + // MaxLogSizeBytes: to.Ptr[int64](104857600), + // MaxSizeBytes: to.Ptr[int64](268435456000), + // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), + // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyZone), + // RequestedServiceObjectiveName: to.Ptr("BC_Gen4_2"), + // Status: to.Ptr(armsql.DatabaseStatusOnline), + // ZoneRedundant: to.Ptr(false), + // }, + // SKU: &armsql.SKU{ + // Name: to.Ptr("BC_Gen4"), + // Capacity: to.Ptr[int32](2), + // Tier: to.Ptr("BusinessCritical"), + // }, + // }, + // { + // Name: to.Ptr("master"), + // Type: to.Ptr("Microsoft.Sql/servers/databases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/master"), + // Location: to.Ptr("southeastasia"), + // Kind: to.Ptr("v12.0,system"), + // Properties: &armsql.DatabaseProperties{ + // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), + // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:23:42.537Z"); return t}()), + // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyLocal), + // CurrentServiceObjectiveName: to.Ptr("System0"), + // CurrentSKU: &armsql.SKU{ + // Name: to.Ptr("System0"), + // Capacity: to.Ptr[int32](0), + // Tier: to.Ptr("System"), + // }, + // DatabaseID: to.Ptr("e6be351f-2cc9-4604-9e52-b0b28b2710b0"), + // DefaultSecondaryLocation: to.Ptr("North Europe"), + // IsInfraEncryptionEnabled: to.Ptr(false), + // IsLedgerOn: to.Ptr(false), + // MaxSizeBytes: to.Ptr[int64](32212254720), + // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), + // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyLocal), + // RequestedServiceObjectiveName: to.Ptr("System0"), + // Status: to.Ptr(armsql.DatabaseStatusOnline), + // ZoneRedundant: to.Ptr(false), + // }, + // SKU: &armsql.SKU{ + // Name: to.Ptr("System0"), + // Capacity: to.Ptr[int32](0), + // Tier: to.Ptr("System"), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetVCoreDatabaseDefaultEnclave.json +func ExampleDatabasesClient_Get_getsADatabaseConfiguredWithDefaultEnclaveType() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDatabasesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", &armsql.DatabasesClientGetOptions{Expand: nil, + Filter: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -624,6 +727,7 @@ func ExampleDatabasesClient_Get() { // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"), // MaxLogSizeBytes: to.Ptr[int64](104857600), // MaxSizeBytes: to.Ptr[int64](268435456000), + // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault), // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), // RequestedServiceObjectiveName: to.Ptr("BC_Gen5_2"), @@ -638,8 +742,8 @@ func ExampleDatabasesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/CreateVCoreDatabaseByServiceObjective.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsAVCoreDatabaseBySpecifyingServiceObjectiveName() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetVCoreDatabaseVBSEnclave.json +func ExampleDatabasesClient_Get_getsADatabaseConfiguredWithVbsEnclaveType() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -649,20 +753,72 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsAVCoreDatabaseBySpecifyin if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewDatabasesClient().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) + res, err := clientFactory.NewDatabasesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", &armsql.DatabasesClientGetOptions{Expand: nil, + Filter: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.Database = armsql.Database{ + // Name: to.Ptr("testdb"), + // Type: to.Ptr("Microsoft.Sql/servers/databases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), + // Location: to.Ptr("southeastasia"), + // Kind: to.Ptr("v12.0,user,vcore"), + // Properties: &armsql.DatabaseProperties{ + // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), + // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), + // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // CurrentServiceObjectiveName: to.Ptr("BC_Gen5_2"), + // CurrentSKU: &armsql.SKU{ + // Name: to.Ptr("BC_Gen5"), + // Capacity: to.Ptr[int32](2), + // Tier: to.Ptr("BusinessCritical"), + // }, + // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), + // DefaultSecondaryLocation: to.Ptr("North Europe"), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), + // IsInfraEncryptionEnabled: to.Ptr(false), + // IsLedgerOn: to.Ptr(false), + // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), + // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"), + // MaxLogSizeBytes: to.Ptr[int64](104857600), + // MaxSizeBytes: to.Ptr[int64](268435456000), + // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS), + // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), + // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // RequestedServiceObjectiveName: to.Ptr("BC_Gen5_2"), + // Status: to.Ptr(armsql.DatabaseStatusOnline), + // ZoneRedundant: to.Ptr(false), + // }, + // SKU: &armsql.SKU{ + // Name: to.Ptr("BC_Gen5"), + // Capacity: to.Ptr[int32](2), + // Tier: to.Ptr("BusinessCritical"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetDatabaseWithAvailabilityZone.json +func ExampleDatabasesClient_Get_getsADatabaseWithAvailabilityZoneSpecified() { + cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDatabasesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", &armsql.DatabasesClientGetOptions{Expand: nil, + Filter: nil, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res @@ -674,40 +830,835 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsAVCoreDatabaseBySpecifyin // Location: to.Ptr("southeastasia"), // Kind: to.Ptr("v12.0,user"), // Properties: &armsql.DatabaseProperties{ + // AvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne), // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("BC_Gen4_2"), + // CurrentServiceObjectiveName: to.Ptr("S0"), // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen4"), + // Name: to.Ptr("Standard"), + // Capacity: to.Ptr[int32](10), + // Tier: to.Ptr("Standard"), + // }, + // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), + // DefaultSecondaryLocation: to.Ptr("North Europe"), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), + // IsInfraEncryptionEnabled: to.Ptr(false), + // IsLedgerOn: to.Ptr(false), + // MaxSizeBytes: to.Ptr[int64](1073741824), + // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), + // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // RequestedServiceObjectiveName: to.Ptr("S0"), + // Status: to.Ptr(armsql.DatabaseStatusOnline), + // ZoneRedundant: to.Ptr(false), + // }, + // SKU: &armsql.SKU{ + // Name: to.Ptr("S0"), + // Capacity: to.Ptr[int32](10), + // Tier: to.Ptr("Standard"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetVCoreDatabaseWithExpandEqualsKeys.json +func ExampleDatabasesClient_Get_getsADatabaseWithDatabaseLevelKeysExpanded() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDatabasesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", &armsql.DatabasesClientGetOptions{Expand: to.Ptr("keys"), + Filter: nil, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.Database = armsql.Database{ + // Name: to.Ptr("testdb"), + // Type: to.Ptr("Microsoft.Sql/servers/databases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), + // Location: to.Ptr("southeastasia"), + // Kind: to.Ptr("v12.0,user,vcore"), + // Properties: &armsql.DatabaseProperties{ + // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), + // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), + // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // CurrentServiceObjectiveName: to.Ptr("BC_Gen5_2"), + // CurrentSKU: &armsql.SKU{ + // Name: to.Ptr("BC_Gen5"), // Capacity: to.Ptr[int32](2), // Tier: to.Ptr("BusinessCritical"), // }, // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), // DefaultSecondaryLocation: to.Ptr("North Europe"), // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), + // EncryptionProtector: to.Ptr("https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion"), // IsInfraEncryptionEnabled: to.Ptr(false), // IsLedgerOn: to.Ptr(false), + // Keys: map[string]*armsql.DatabaseKey{ + // "https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion": &armsql.DatabaseKey{ + // }, + // "https://your-key-vault-name.vault.azure.net/yourKey2/yourKey2Version": &armsql.DatabaseKey{ + // }, + // }, // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), + // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"), // MaxLogSizeBytes: to.Ptr[int64](104857600), - // MaxSizeBytes: to.Ptr[int64](1073741824), + // MaxSizeBytes: to.Ptr[int64](268435456000), // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // RequestedServiceObjectiveName: to.Ptr("BC_Gen5_2"), + // Status: to.Ptr(armsql.DatabaseStatusOnline), + // ZoneRedundant: to.Ptr(false), + // }, + // SKU: &armsql.SKU{ + // Name: to.Ptr("BC_Gen5"), + // Capacity: to.Ptr[int32](2), + // Tier: to.Ptr("BusinessCritical"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetVCoreDatabase.json +func ExampleDatabasesClient_Get_getsADatabase() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDatabasesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", &armsql.DatabasesClientGetOptions{Expand: nil, + Filter: nil, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.Database = armsql.Database{ + // Name: to.Ptr("testdb"), + // Type: to.Ptr("Microsoft.Sql/servers/databases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), + // Location: to.Ptr("southeastasia"), + // Kind: to.Ptr("v12.0,user,vcore"), + // Properties: &armsql.DatabaseProperties{ + // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), + // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), + // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // CurrentServiceObjectiveName: to.Ptr("BC_Gen5_2"), + // CurrentSKU: &armsql.SKU{ + // Name: to.Ptr("BC_Gen5"), + // Capacity: to.Ptr[int32](2), + // Tier: to.Ptr("BusinessCritical"), + // }, + // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), + // DefaultSecondaryLocation: to.Ptr("North Europe"), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), + // IsInfraEncryptionEnabled: to.Ptr(false), + // IsLedgerOn: to.Ptr(false), + // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), + // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"), + // MaxLogSizeBytes: to.Ptr[int64](104857600), + // MaxSizeBytes: to.Ptr[int64](268435456000), + // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), + // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // RequestedServiceObjectiveName: to.Ptr("BC_Gen5_2"), + // Status: to.Ptr(armsql.DatabaseStatusOnline), + // ZoneRedundant: to.Ptr(false), + // }, + // SKU: &armsql.SKU{ + // Name: to.Ptr("BC_Gen5"), + // Capacity: to.Ptr[int32](2), + // Tier: to.Ptr("BusinessCritical"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateVCoreDatabaseByServiceObjective.json +func ExampleDatabasesClient_BeginCreateOrUpdate_createsAVCoreDatabaseBySpecifyingServiceObjectiveName() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewDatabasesClient().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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.Database = armsql.Database{ + // Name: to.Ptr("testdb"), + // Type: to.Ptr("Microsoft.Sql/servers/databases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), + // Location: to.Ptr("southeastasia"), + // Kind: to.Ptr("v12.0,user"), + // Properties: &armsql.DatabaseProperties{ + // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), + // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), + // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // CurrentServiceObjectiveName: to.Ptr("BC_Gen4_2"), + // CurrentSKU: &armsql.SKU{ + // Name: to.Ptr("BC_Gen4"), + // Capacity: to.Ptr[int32](2), + // Tier: to.Ptr("BusinessCritical"), + // }, + // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), + // DefaultSecondaryLocation: to.Ptr("North Europe"), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), + // IsInfraEncryptionEnabled: to.Ptr(false), + // IsLedgerOn: to.Ptr(false), + // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), + // MaxLogSizeBytes: to.Ptr[int64](104857600), + // MaxSizeBytes: to.Ptr[int64](1073741824), + // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), + // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // Status: to.Ptr(armsql.DatabaseStatusOnline), + // ZoneRedundant: to.Ptr(false), + // }, + // SKU: &armsql.SKU{ + // Name: to.Ptr("BC_Gen4"), + // Capacity: to.Ptr[int32](2), + // Family: to.Ptr("Gen4"), + // Tier: to.Ptr("BusinessCritical"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateVCoreDatabaseBySkuNameCapacity.json +func ExampleDatabasesClient_BeginCreateOrUpdate_createsAVCoreDatabaseBySpecifyingSkuNameAndCapacity() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ + Location: to.Ptr("southeastasia"), + SKU: &armsql.SKU{ + Name: to.Ptr("BC_Gen4"), + Capacity: to.Ptr[int32](2), + }, + }, 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.Database = armsql.Database{ + // Name: to.Ptr("testdb"), + // Type: to.Ptr("Microsoft.Sql/servers/databases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), + // Location: to.Ptr("southeastasia"), + // Kind: to.Ptr("v12.0,user"), + // Properties: &armsql.DatabaseProperties{ + // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), + // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), + // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // CurrentServiceObjectiveName: to.Ptr("BC_Gen4_2"), + // CurrentSKU: &armsql.SKU{ + // Name: to.Ptr("BC_Gen4"), + // Capacity: to.Ptr[int32](2), + // Tier: to.Ptr("BusinessCritical"), + // }, + // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), + // DefaultSecondaryLocation: to.Ptr("North Europe"), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), + // IsInfraEncryptionEnabled: to.Ptr(false), + // IsLedgerOn: to.Ptr(false), + // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), + // MaxLogSizeBytes: to.Ptr[int64](104857600), + // MaxSizeBytes: to.Ptr[int64](1073741824), + // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), + // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // Status: to.Ptr(armsql.DatabaseStatusOnline), + // ZoneRedundant: to.Ptr(false), + // }, + // SKU: &armsql.SKU{ + // Name: to.Ptr("BC_Gen4"), + // Capacity: to.Ptr[int32](2), + // Family: to.Ptr("Gen4"), + // Tier: to.Ptr("BusinessCritical"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDwDatabaseCrossSubscriptionRestore.json +func ExampleDatabasesClient_BeginCreateOrUpdate_createsADataWarehouseDatabaseAsACrossSubscriptionRestoreFromABackupOfADroppedDatabase() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdw", armsql.Database{ + Location: to.Ptr("southeastasia"), + Properties: &armsql.DatabaseProperties{ + CreateMode: to.Ptr(armsql.CreateModeRestore), + SourceResourceID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/srcsvr/restorableDroppedDatabases/srcdw,131403269876900000"), + }, + }, 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.Database = armsql.Database{ + // Name: to.Ptr("testdw"), + // Type: to.Ptr("Microsoft.Sql/servers/databases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdw"), + // Location: to.Ptr("southeastasia"), + // Kind: to.Ptr("v12.0,user,datawarehouse,gen2"), + // Properties: &armsql.DatabaseProperties{ + // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), + // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-24T06:46:14.99Z"); return t}()), + // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // CurrentServiceObjectiveName: to.Ptr("DW1000c"), + // CurrentSKU: &armsql.SKU{ + // Name: to.Ptr("DataWarehouse"), + // Capacity: to.Ptr[int32](9000), + // Tier: to.Ptr("DataWarehouse"), + // }, + // DatabaseID: to.Ptr("188784c9-d602-4684-86cf-e67b6f03551a"), + // DefaultSecondaryLocation: to.Ptr("eastus"), + // MaxSizeBytes: to.Ptr[int64](263882790666240), + // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), + // RequestedServiceObjectiveName: to.Ptr("DW1000c"), + // Status: to.Ptr(armsql.DatabaseStatusOnline), + // }, + // SKU: &armsql.SKU{ + // Name: to.Ptr("DataWarehouse"), + // Capacity: to.Ptr[int32](9000), + // Tier: to.Ptr("DataWarehouse"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDwDatabaseCrossSubscriptionRecovery.json +func ExampleDatabasesClient_BeginCreateOrUpdate_createsADataWarehouseDatabaseAsACrossSubscriptionRestoreFromAGeoBackup() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-WestUS", "testsvr", "testdw", armsql.Database{ + Location: to.Ptr("westus"), + Properties: &armsql.DatabaseProperties{ + CreateMode: to.Ptr(armsql.CreateModeRecovery), + SourceResourceID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-SQL-EastUS/providers/Microsoft.Sql/servers/srcsvr/recoverabledatabases/srcdw"), + }, + }, 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.Database = armsql.Database{ + // Name: to.Ptr("testdw"), + // Type: to.Ptr("Microsoft.Sql/servers/databases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-WestUS/providers/Microsoft.Sql/servers/testsvr/databases/testdw"), + // Location: to.Ptr("westus"), + // Kind: to.Ptr("v12.0,user,datawarehouse,gen2"), + // Properties: &armsql.DatabaseProperties{ + // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), + // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-24T06:46:14.99Z"); return t}()), + // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // CurrentServiceObjectiveName: to.Ptr("DW1000c"), + // CurrentSKU: &armsql.SKU{ + // Name: to.Ptr("DataWarehouse"), + // Capacity: to.Ptr[int32](9000), + // Tier: to.Ptr("DataWarehouse"), + // }, + // DatabaseID: to.Ptr("188784c9-d602-4684-86cf-e67b6f03551a"), + // DefaultSecondaryLocation: to.Ptr("eastus"), + // MaxSizeBytes: to.Ptr[int64](263882790666240), + // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), + // RequestedServiceObjectiveName: to.Ptr("DW1000c"), + // Status: to.Ptr(armsql.DatabaseStatusOnline), + // }, + // SKU: &armsql.SKU{ + // Name: to.Ptr("DataWarehouse"), + // Capacity: to.Ptr[int32](9000), + // Tier: to.Ptr("DataWarehouse"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDwDatabaseCrossSubscriptionPITR.json +func ExampleDatabasesClient_BeginCreateOrUpdate_createsADataWarehouseDatabaseAsACrossSubscriptionRestoreFromARestorePointOfAnExistingDatabase() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdw", armsql.Database{ + Location: to.Ptr("southeastasia"), + Properties: &armsql.DatabaseProperties{ + CreateMode: to.Ptr(armsql.CreateModePointInTimeRestore), + RestorePointInTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-22T05:35:31.503Z"); return t }()), + SourceResourceID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/srcsvr/databases/srcdw"), + }, + }, 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.Database = armsql.Database{ + // Name: to.Ptr("testdw"), + // Type: to.Ptr("Microsoft.Sql/servers/databases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdw"), + // Location: to.Ptr("southeastasia"), + // Kind: to.Ptr("v12.0,user,datawarehouse,gen2"), + // Properties: &armsql.DatabaseProperties{ + // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), + // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-24T06:46:14.99Z"); return t}()), + // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // CurrentServiceObjectiveName: to.Ptr("DW1000c"), + // CurrentSKU: &armsql.SKU{ + // Name: to.Ptr("DataWarehouse"), + // Capacity: to.Ptr[int32](9000), + // Tier: to.Ptr("DataWarehouse"), + // }, + // DatabaseID: to.Ptr("188784c9-d602-4684-86cf-e67b6f03551a"), + // DefaultSecondaryLocation: to.Ptr("eastus"), + // MaxSizeBytes: to.Ptr[int64](263882790666240), + // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), + // RequestedServiceObjectiveName: to.Ptr("DW1000c"), + // Status: to.Ptr(armsql.DatabaseStatusOnline), + // }, + // SKU: &armsql.SKU{ + // Name: to.Ptr("DataWarehouse"), + // Capacity: to.Ptr[int32](9000), + // Tier: to.Ptr("DataWarehouse"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseCopyMode.json +func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseAsACopy() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "dbcopy", armsql.Database{ + Location: to.Ptr("southeastasia"), + Properties: &armsql.DatabaseProperties{ + CreateMode: to.Ptr(armsql.CreateModeCopy), + SourceDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), + }, + SKU: &armsql.SKU{ + Name: to.Ptr("S0"), + Tier: to.Ptr("Standard"), + }, + }, 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.Database = armsql.Database{ + // Name: to.Ptr("dbcopy"), + // Type: to.Ptr("Microsoft.Sql/servers/databases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/dbcopy"), + // Location: to.Ptr("southeastasia"), + // Kind: to.Ptr("v12.0,user"), + // Properties: &armsql.DatabaseProperties{ + // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), + // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), + // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // CurrentServiceObjectiveName: to.Ptr("S0"), + // CurrentSKU: &armsql.SKU{ + // Name: to.Ptr("Standard"), + // Capacity: to.Ptr[int32](10), + // Tier: to.Ptr("Standard"), + // }, + // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), + // DefaultSecondaryLocation: to.Ptr("North Europe"), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), + // IsInfraEncryptionEnabled: to.Ptr(false), + // IsLedgerOn: to.Ptr(false), + // MaxSizeBytes: to.Ptr[int64](268435456000), + // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), + // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // RequestedServiceObjectiveName: to.Ptr("S0"), + // Status: to.Ptr(armsql.DatabaseStatusOnline), + // ZoneRedundant: to.Ptr(false), + // }, + // SKU: &armsql.SKU{ + // Name: to.Ptr("Standard"), + // Capacity: to.Ptr[int32](10), + // Tier: to.Ptr("Standard"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseStandbyMode.json +func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseAsAStandbySecondary() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ + Location: to.Ptr("southeastasia"), + Properties: &armsql.DatabaseProperties{ + CreateMode: to.Ptr(armsql.CreateModeSecondary), + SecondaryType: to.Ptr(armsql.SecondaryTypeStandby), + SourceDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/testdb"), + }, + SKU: &armsql.SKU{ + Name: to.Ptr("S0"), + Tier: to.Ptr("Standard"), + }, + }, 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.Database = armsql.Database{ + // Name: to.Ptr("testdb"), + // Type: to.Ptr("Microsoft.Sql/servers/databases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), + // Location: to.Ptr("southeastasia"), + // Kind: to.Ptr("v12.0,user"), + // Properties: &armsql.DatabaseProperties{ + // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), + // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), + // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // CurrentServiceObjectiveName: to.Ptr("S0"), + // CurrentSKU: &armsql.SKU{ + // Name: to.Ptr("Standard"), + // Capacity: to.Ptr[int32](10), + // Tier: to.Ptr("Standard"), + // }, + // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), + // DefaultSecondaryLocation: to.Ptr("North Europe"), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), + // IsInfraEncryptionEnabled: to.Ptr(false), + // IsLedgerOn: to.Ptr(false), + // MaxSizeBytes: to.Ptr[int64](268435456000), + // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), + // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // RequestedServiceObjectiveName: to.Ptr("S0"), + // SecondaryType: to.Ptr(armsql.SecondaryTypeStandby), + // Status: to.Ptr(armsql.DatabaseStatusOnline), + // ZoneRedundant: to.Ptr(false), + // }, + // SKU: &armsql.SKU{ + // Name: to.Ptr("Standard"), + // Capacity: to.Ptr[int32](10), + // Tier: to.Ptr("Standard"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseSecondaryMode.json +func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseAsAnOnLineSecondary() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ + Location: to.Ptr("southeastasia"), + Properties: &armsql.DatabaseProperties{ + CreateMode: to.Ptr(armsql.CreateModeSecondary), + SecondaryType: to.Ptr(armsql.SecondaryTypeGeo), + SourceDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/testdb"), + }, + SKU: &armsql.SKU{ + Name: to.Ptr("S0"), + Tier: to.Ptr("Standard"), + }, + }, 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.Database = armsql.Database{ + // Name: to.Ptr("testdb"), + // Type: to.Ptr("Microsoft.Sql/servers/databases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), + // Location: to.Ptr("southeastasia"), + // Kind: to.Ptr("v12.0,user"), + // Properties: &armsql.DatabaseProperties{ + // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), + // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), + // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // CurrentServiceObjectiveName: to.Ptr("S0"), + // CurrentSKU: &armsql.SKU{ + // Name: to.Ptr("Standard"), + // Capacity: to.Ptr[int32](10), + // Tier: to.Ptr("Standard"), + // }, + // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), + // DefaultSecondaryLocation: to.Ptr("North Europe"), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), + // IsInfraEncryptionEnabled: to.Ptr(false), + // IsLedgerOn: to.Ptr(false), + // MaxSizeBytes: to.Ptr[int64](268435456000), + // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), + // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // RequestedServiceObjectiveName: to.Ptr("S0"), + // SecondaryType: to.Ptr(armsql.SecondaryTypeGeo), + // Status: to.Ptr(armsql.DatabaseStatusOnline), + // ZoneRedundant: to.Ptr(false), + // }, + // SKU: &armsql.SKU{ + // Name: to.Ptr("Standard"), + // Capacity: to.Ptr[int32](10), + // Tier: to.Ptr("Standard"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseNamedReplica.json +func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseAsNamedReplicaSecondary() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ + Location: to.Ptr("southeastasia"), + Properties: &armsql.DatabaseProperties{ + CreateMode: to.Ptr(armsql.CreateModeSecondary), + SecondaryType: to.Ptr(armsql.SecondaryTypeNamed), + SourceDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/primarydb"), + }, + SKU: &armsql.SKU{ + Name: to.Ptr("HS_Gen4"), + Capacity: to.Ptr[int32](2), + Tier: to.Ptr("Hyperscale"), + }, + }, 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.Database = armsql.Database{ + // Name: to.Ptr("testdb"), + // Type: to.Ptr("Microsoft.Sql/servers/databases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), + // Location: to.Ptr("southeastasia"), + // Kind: to.Ptr("v12.0,user,vcore,hyperscale"), + // Properties: &armsql.DatabaseProperties{ + // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), + // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), + // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // CurrentServiceObjectiveName: to.Ptr("HS_Gen4_2"), + // CurrentSKU: &armsql.SKU{ + // Name: to.Ptr("HS_Gen4"), + // Capacity: to.Ptr[int32](2), + // Family: to.Ptr("Gen4"), + // Tier: to.Ptr("Hyperscale"), + // }, + // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), + // DefaultSecondaryLocation: to.Ptr("North Europe"), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), + // HighAvailabilityReplicaCount: to.Ptr[int32](0), + // IsInfraEncryptionEnabled: to.Ptr(false), + // IsLedgerOn: to.Ptr(false), + // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), + // MaxSizeBytes: to.Ptr[int64](-1), + // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), + // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // RequestedServiceObjectiveName: to.Ptr("HS_Gen4_2"), + // SecondaryType: to.Ptr(armsql.SecondaryTypeNamed), + // Status: to.Ptr(armsql.DatabaseStatusOnline), + // ZoneRedundant: to.Ptr(false), + // }, + // SKU: &armsql.SKU{ + // Name: to.Ptr("HS_Gen4"), + // Capacity: to.Ptr[int32](2), + // Family: to.Ptr("Gen4"), + // Tier: to.Ptr("Hyperscale"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabasePITRMode.json +func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseFromPointInTimeRestore() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "dbpitr", armsql.Database{ + Location: to.Ptr("southeastasia"), + Properties: &armsql.DatabaseProperties{ + CreateMode: to.Ptr(armsql.CreateModePointInTimeRestore), + RestorePointInTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-22T05:35:31.503Z"); return t }()), + SourceDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SoutheastAsia/providers/Microsoft.Sql/servers/testsvr/databases/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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.Database = armsql.Database{ + // Name: to.Ptr("dbpitr"), + // Type: to.Ptr("Microsoft.Sql/servers/databases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SoutheastAsia/providers/Microsoft.Sql/servers/testsvr/databases/dbpitr"), + // Location: to.Ptr("SoutheastAsia"), + // Kind: to.Ptr("v12.0,user"), + // Properties: &armsql.DatabaseProperties{ + // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), + // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-23T20:31:35.807Z"); return t}()), + // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // CurrentServiceObjectiveName: to.Ptr("S0"), + // CurrentSKU: &armsql.SKU{ + // Name: to.Ptr("Standard"), + // Capacity: to.Ptr[int32](10), + // Tier: to.Ptr("Standard"), + // }, + // DatabaseID: to.Ptr("2463ef48-53e2-4c26-9781-2d7138080bfd"), + // DefaultSecondaryLocation: to.Ptr("SoutheastAsia"), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-23T20:47:37Z"); return t}()), + // IsInfraEncryptionEnabled: to.Ptr(false), + // IsLedgerOn: to.Ptr(false), + // MaxSizeBytes: to.Ptr[int64](268435456000), + // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), + // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // RequestedServiceObjectiveName: to.Ptr("S0"), // Status: to.Ptr(armsql.DatabaseStatusOnline), // ZoneRedundant: to.Ptr(false), // }, // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen4"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("BusinessCritical"), + // Name: to.Ptr("Standard"), + // Capacity: to.Ptr[int32](10), + // Tier: to.Ptr("Standard"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/CreateVCoreDatabaseBySkuNameCapacity.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsAVCoreDatabaseBySpecifyingSkuNameAndCapacity() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseDefaultEnclave.json +func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithDefaultEnclaveType() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -719,9 +1670,8 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsAVCoreDatabaseBySpecifyin } poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ Location: to.Ptr("southeastasia"), - SKU: &armsql.SKU{ - Name: to.Ptr("BC_Gen4"), - Capacity: to.Ptr[int32](2), + Properties: &armsql.DatabaseProperties{ + PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault), }, }, nil) if err != nil { @@ -745,36 +1695,33 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsAVCoreDatabaseBySpecifyin // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("BC_Gen4_2"), + // CurrentServiceObjectiveName: to.Ptr("S0"), // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen4"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("BusinessCritical"), + // Name: to.Ptr("Standard"), + // Capacity: to.Ptr[int32](10), + // Tier: to.Ptr("Standard"), // }, // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), // DefaultSecondaryLocation: to.Ptr("North Europe"), // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), - // MaxLogSizeBytes: to.Ptr[int64](104857600), - // MaxSizeBytes: to.Ptr[int64](1073741824), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), + // MaxSizeBytes: to.Ptr[int64](268435456000), + // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault), + // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // RequestedServiceObjectiveName: to.Ptr("S0"), // Status: to.Ptr(armsql.DatabaseStatusOnline), // ZoneRedundant: to.Ptr(false), // }, // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen4"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("BusinessCritical"), + // Name: to.Ptr("Standard"), + // Capacity: to.Ptr[int32](10), + // Tier: to.Ptr("Standard"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/CreateDwDatabaseCrossSubscriptionRestore.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADataWarehouseDatabaseAsACrossSubscriptionRestoreFromABackupOfADroppedDatabase() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseVBSEnclave.json +func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithVbsEnclaveType() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -784,11 +1731,10 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADataWarehouseDatabaseAsA if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdw", armsql.Database{ + poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ Location: to.Ptr("southeastasia"), Properties: &armsql.DatabaseProperties{ - CreateMode: to.Ptr(armsql.CreateModeRestore), - SourceResourceID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/srcsvr/restorableDroppedDatabases/srcdw,131403269876900000"), + PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS), }, }, nil) if err != nil { @@ -802,39 +1748,43 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADataWarehouseDatabaseAsA _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Database = armsql.Database{ - // Name: to.Ptr("testdw"), + // Name: to.Ptr("testdb"), // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdw"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user,datawarehouse,gen2"), + // Kind: to.Ptr("v12.0,user"), // Properties: &armsql.DatabaseProperties{ // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-24T06:46:14.99Z"); return t}()), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("DW1000c"), + // CurrentServiceObjectiveName: to.Ptr("S0"), // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("DataWarehouse"), - // Capacity: to.Ptr[int32](9000), - // Tier: to.Ptr("DataWarehouse"), + // Name: to.Ptr("Standard"), + // Capacity: to.Ptr[int32](10), + // Tier: to.Ptr("Standard"), // }, - // DatabaseID: to.Ptr("188784c9-d602-4684-86cf-e67b6f03551a"), - // DefaultSecondaryLocation: to.Ptr("eastus"), - // MaxSizeBytes: to.Ptr[int64](263882790666240), + // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), + // DefaultSecondaryLocation: to.Ptr("North Europe"), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), + // MaxSizeBytes: to.Ptr[int64](268435456000), + // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS), // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedServiceObjectiveName: to.Ptr("DW1000c"), + // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // RequestedServiceObjectiveName: to.Ptr("S0"), // Status: to.Ptr(armsql.DatabaseStatusOnline), + // ZoneRedundant: to.Ptr(false), // }, // SKU: &armsql.SKU{ - // Name: to.Ptr("DataWarehouse"), - // Capacity: to.Ptr[int32](9000), - // Tier: to.Ptr("DataWarehouse"), + // Name: to.Ptr("Standard"), + // Capacity: to.Ptr[int32](10), + // Tier: to.Ptr("Standard"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/CreateDwDatabaseCrossSubscriptionRecovery.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADataWarehouseDatabaseAsACrossSubscriptionRestoreFromAGeoBackup() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseWithAvailabilityZone.json +func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithAvailabilityZoneSpecified() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -844,11 +1794,17 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADataWarehouseDatabaseAsA if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-WestUS", "testsvr", "testdw", armsql.Database{ - Location: to.Ptr("westus"), + poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ + Location: to.Ptr("southeastasia"), Properties: &armsql.DatabaseProperties{ - CreateMode: to.Ptr(armsql.CreateModeRecovery), - SourceResourceID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-SQL-EastUS/providers/Microsoft.Sql/servers/srcsvr/recoverabledatabases/srcdw"), + AvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne), + Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), + CreateMode: to.Ptr(armsql.CreateModeDefault), + MaxSizeBytes: to.Ptr[int64](1073741824), + }, + SKU: &armsql.SKU{ + Name: to.Ptr("S0"), + Tier: to.Ptr("Standard"), }, }, nil) if err != nil { @@ -862,39 +1818,45 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADataWarehouseDatabaseAsA _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Database = armsql.Database{ - // Name: to.Ptr("testdw"), + // Name: to.Ptr("testdb"), // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-WestUS/providers/Microsoft.Sql/servers/testsvr/databases/testdw"), - // Location: to.Ptr("westus"), - // Kind: to.Ptr("v12.0,user,datawarehouse,gen2"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), + // Location: to.Ptr("southeastasia"), + // Kind: to.Ptr("v12.0,user"), // Properties: &armsql.DatabaseProperties{ + // AvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne), // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-24T06:46:14.99Z"); return t}()), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("DW1000c"), + // CurrentServiceObjectiveName: to.Ptr("S0"), // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("DataWarehouse"), - // Capacity: to.Ptr[int32](9000), - // Tier: to.Ptr("DataWarehouse"), + // Name: to.Ptr("Standard"), + // Capacity: to.Ptr[int32](10), + // Tier: to.Ptr("Standard"), // }, - // DatabaseID: to.Ptr("188784c9-d602-4684-86cf-e67b6f03551a"), - // DefaultSecondaryLocation: to.Ptr("eastus"), - // MaxSizeBytes: to.Ptr[int64](263882790666240), + // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), + // DefaultSecondaryLocation: to.Ptr("North Europe"), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), + // IsInfraEncryptionEnabled: to.Ptr(false), + // IsLedgerOn: to.Ptr(false), + // MaxSizeBytes: to.Ptr[int64](1073741824), // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedServiceObjectiveName: to.Ptr("DW1000c"), + // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // RequestedServiceObjectiveName: to.Ptr("S0"), // Status: to.Ptr(armsql.DatabaseStatusOnline), + // ZoneRedundant: to.Ptr(false), // }, // SKU: &armsql.SKU{ - // Name: to.Ptr("DataWarehouse"), - // Capacity: to.Ptr[int32](9000), - // Tier: to.Ptr("DataWarehouse"), + // Name: to.Ptr("S0"), + // Capacity: to.Ptr[int32](10), + // Tier: to.Ptr("Standard"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/CreateDwDatabaseCrossSubscriptionPITR.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADataWarehouseDatabaseAsACrossSubscriptionRestoreFromARestorePointOfAnExistingDatabase() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseDefaultModeWithKeysAndEncryptionProtector.json +func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithDatabaseLevelCustomerManagedKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -904,12 +1866,27 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADataWarehouseDatabaseAsA if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdw", armsql.Database{ + poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ Location: to.Ptr("southeastasia"), + Identity: &armsql.DatabaseIdentity{ + Type: to.Ptr(armsql.DatabaseIdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armsql.DatabaseUserIdentity{ + "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.ManagedIdentity/userAssignedIdentities/umi": {}, + }, + }, Properties: &armsql.DatabaseProperties{ - CreateMode: to.Ptr(armsql.CreateModePointInTimeRestore), - RestorePointInTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-22T05:35:31.503Z"); return t }()), - SourceResourceID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/srcsvr/databases/srcdw"), + Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), + CreateMode: to.Ptr(armsql.CreateModeDefault), + EncryptionProtector: to.Ptr("https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion"), + Keys: map[string]*armsql.DatabaseKey{ + "https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion": {}, + "https://your-key-vault-name.vault.azure.net/yourKey2/yourKey2Version": {}, + }, + MaxSizeBytes: to.Ptr[int64](1073741824), + }, + SKU: &armsql.SKU{ + Name: to.Ptr("S0"), + Tier: to.Ptr("Standard"), }, }, nil) if err != nil { @@ -923,39 +1900,44 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADataWarehouseDatabaseAsA _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Database = armsql.Database{ - // Name: to.Ptr("testdw"), + // Name: to.Ptr("testdb"), // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdw"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user,datawarehouse,gen2"), + // Kind: to.Ptr("v12.0,user"), // Properties: &armsql.DatabaseProperties{ // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-24T06:46:14.99Z"); return t}()), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("DW1000c"), + // CurrentServiceObjectiveName: to.Ptr("S0"), // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("DataWarehouse"), - // Capacity: to.Ptr[int32](9000), - // Tier: to.Ptr("DataWarehouse"), + // Name: to.Ptr("Standard"), + // Capacity: to.Ptr[int32](10), + // Tier: to.Ptr("Standard"), // }, - // DatabaseID: to.Ptr("188784c9-d602-4684-86cf-e67b6f03551a"), - // DefaultSecondaryLocation: to.Ptr("eastus"), - // MaxSizeBytes: to.Ptr[int64](263882790666240), + // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), + // DefaultSecondaryLocation: to.Ptr("North Europe"), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), + // IsInfraEncryptionEnabled: to.Ptr(false), + // IsLedgerOn: to.Ptr(false), + // MaxSizeBytes: to.Ptr[int64](1073741824), // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedServiceObjectiveName: to.Ptr("DW1000c"), + // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // RequestedServiceObjectiveName: to.Ptr("S0"), // Status: to.Ptr(armsql.DatabaseStatusOnline), + // ZoneRedundant: to.Ptr(false), // }, // SKU: &armsql.SKU{ - // Name: to.Ptr("DataWarehouse"), - // Capacity: to.Ptr[int32](9000), - // Tier: to.Ptr("DataWarehouse"), + // Name: to.Ptr("S0"), + // Capacity: to.Ptr[int32](10), + // Tier: to.Ptr("Standard"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/CreateDatabaseCopyMode.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseAsACopy() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseDefaultMode.json +func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithDefaultMode() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -965,11 +1947,12 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseAsACopy() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "dbcopy", armsql.Database{ + poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ Location: to.Ptr("southeastasia"), Properties: &armsql.DatabaseProperties{ - CreateMode: to.Ptr(armsql.CreateModeCopy), - SourceDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), + Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), + CreateMode: to.Ptr(armsql.CreateModeDefault), + MaxSizeBytes: to.Ptr[int64](1073741824), }, SKU: &armsql.SKU{ Name: to.Ptr("S0"), @@ -987,9 +1970,9 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseAsACopy() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Database = armsql.Database{ - // Name: to.Ptr("dbcopy"), + // Name: to.Ptr("testdb"), // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/dbcopy"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), // Location: to.Ptr("southeastasia"), // Kind: to.Ptr("v12.0,user"), // Properties: &armsql.DatabaseProperties{ @@ -1008,7 +1991,7 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseAsACopy() { // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), // IsInfraEncryptionEnabled: to.Ptr(false), // IsLedgerOn: to.Ptr(false), - // MaxSizeBytes: to.Ptr[int64](268435456000), + // MaxSizeBytes: to.Ptr[int64](1073741824), // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), // RequestedServiceObjectiveName: to.Ptr("S0"), @@ -1016,15 +1999,15 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseAsACopy() { // ZoneRedundant: to.Ptr(false), // }, // SKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), + // Name: to.Ptr("S0"), // Capacity: to.Ptr[int32](10), // Tier: to.Ptr("Standard"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/CreateDatabaseSecondaryMode.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseAsAnOnLineSecondary() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseLedger.json +func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithLedgerOn() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1037,13 +2020,7 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseAsAnOnLineSecond poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ Location: to.Ptr("southeastasia"), Properties: &armsql.DatabaseProperties{ - CreateMode: to.Ptr(armsql.CreateModeSecondary), - SecondaryType: to.Ptr(armsql.SecondaryTypeGeo), - SourceDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/testdb"), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("S0"), - Tier: to.Ptr("Standard"), + IsLedgerOn: to.Ptr(true), }, }, nil) if err != nil { @@ -1076,13 +2053,11 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseAsAnOnLineSecond // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), // DefaultSecondaryLocation: to.Ptr("North Europe"), // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), + // IsLedgerOn: to.Ptr(true), // MaxSizeBytes: to.Ptr[int64](268435456000), // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), // RequestedServiceObjectiveName: to.Ptr("S0"), - // SecondaryType: to.Ptr(armsql.SecondaryTypeGeo), // Status: to.Ptr(armsql.DatabaseStatusOnline), // ZoneRedundant: to.Ptr(false), // }, @@ -1094,8 +2069,8 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseAsAnOnLineSecond // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/CreateDatabaseNamedReplica.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseAsNamedReplicaSecondary() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseMin.json +func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithMinimumNumberOfParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1107,16 +2082,6 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseAsNamedReplicaSe } poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ Location: to.Ptr("southeastasia"), - Properties: &armsql.DatabaseProperties{ - CreateMode: to.Ptr(armsql.CreateModeSecondary), - SecondaryType: to.Ptr(armsql.SecondaryTypeNamed), - SourceDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/primarydb"), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("HS_Gen4"), - Capacity: to.Ptr[int32](2), - Tier: to.Ptr("Hyperscale"), - }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -1133,45 +2098,40 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseAsNamedReplicaSe // Type: to.Ptr("Microsoft.Sql/servers/databases"), // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user,vcore,hyperscale"), + // Kind: to.Ptr("v12.0,user"), // Properties: &armsql.DatabaseProperties{ // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("HS_Gen4_2"), + // CurrentServiceObjectiveName: to.Ptr("S0"), // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen4"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("Hyperscale"), + // Name: to.Ptr("Standard"), + // Capacity: to.Ptr[int32](10), + // Tier: to.Ptr("Standard"), // }, // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), // DefaultSecondaryLocation: to.Ptr("North Europe"), // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // HighAvailabilityReplicaCount: to.Ptr[int32](0), // IsInfraEncryptionEnabled: to.Ptr(false), // IsLedgerOn: to.Ptr(false), - // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), - // MaxSizeBytes: to.Ptr[int64](-1), + // MaxSizeBytes: to.Ptr[int64](268435456000), // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("HS_Gen4_2"), - // SecondaryType: to.Ptr(armsql.SecondaryTypeNamed), + // RequestedServiceObjectiveName: to.Ptr("S0"), // Status: to.Ptr(armsql.DatabaseStatusOnline), // ZoneRedundant: to.Ptr(false), // }, // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen4"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("Hyperscale"), + // Name: to.Ptr("Standard"), + // Capacity: to.Ptr[int32](10), + // Tier: to.Ptr("Standard"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/CreateDatabasePITRMode.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseFromPointInTimeRestore() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseMaintenanceConfiguration.json +func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithPreferredMaintenanceWindow() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1181,12 +2141,17 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseFromPointInTimeR if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "dbpitr", armsql.Database{ + poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ Location: to.Ptr("southeastasia"), Properties: &armsql.DatabaseProperties{ - CreateMode: to.Ptr(armsql.CreateModePointInTimeRestore), - RestorePointInTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-22T05:35:31.503Z"); return t }()), - SourceDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SoutheastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), + Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), + CreateMode: to.Ptr(armsql.CreateModeDefault), + MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"), + MaxSizeBytes: to.Ptr[int64](1073741824), + }, + SKU: &armsql.SKU{ + Name: to.Ptr("S2"), + Tier: to.Ptr("Standard"), }, }, nil) if err != nil { @@ -1200,44 +2165,43 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseFromPointInTimeR _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Database = armsql.Database{ - // Name: to.Ptr("dbpitr"), + // Name: to.Ptr("testdb"), // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SoutheastAsia/providers/Microsoft.Sql/servers/testsvr/databases/dbpitr"), - // Location: to.Ptr("SoutheastAsia"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), + // Location: to.Ptr("southeastasia"), // Kind: to.Ptr("v12.0,user"), // Properties: &armsql.DatabaseProperties{ // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-23T20:31:35.807Z"); return t}()), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("S0"), + // CurrentServiceObjectiveName: to.Ptr("S2"), // CurrentSKU: &armsql.SKU{ // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), + // Capacity: to.Ptr[int32](50), // Tier: to.Ptr("Standard"), // }, - // DatabaseID: to.Ptr("2463ef48-53e2-4c26-9781-2d7138080bfd"), - // DefaultSecondaryLocation: to.Ptr("SoutheastAsia"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-23T20:47:37Z"); return t}()), + // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), + // DefaultSecondaryLocation: to.Ptr("North Europe"), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-08-29T06:41:18.283Z"); return t}()), // IsInfraEncryptionEnabled: to.Ptr(false), // IsLedgerOn: to.Ptr(false), - // MaxSizeBytes: to.Ptr[int64](268435456000), + // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"), + // MaxSizeBytes: to.Ptr[int64](1073741824), // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("S0"), // Status: to.Ptr(armsql.DatabaseStatusOnline), // ZoneRedundant: to.Ptr(false), // }, // SKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), + // Name: to.Ptr("S2"), // Tier: to.Ptr("Standard"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/CreateDatabaseDefaultMode.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithDefaultMode() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseConfiguredBackupStorageRedundancy.json +func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithSpecifiedBackupStorageRedundancy() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1250,13 +2214,7 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithDefaultMode( poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ Location: to.Ptr("southeastasia"), Properties: &armsql.DatabaseProperties{ - Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - CreateMode: to.Ptr(armsql.CreateModeDefault), - MaxSizeBytes: to.Ptr[int64](1073741824), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("S0"), - Tier: to.Ptr("Standard"), + RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyZone), }, }, nil) if err != nil { @@ -1279,7 +2237,7 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithDefaultMode( // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyZone), // CurrentServiceObjectiveName: to.Ptr("S0"), // CurrentSKU: &armsql.SKU{ // Name: to.Ptr("Standard"), @@ -1291,23 +2249,23 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithDefaultMode( // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), // IsInfraEncryptionEnabled: to.Ptr(false), // IsLedgerOn: to.Ptr(false), - // MaxSizeBytes: to.Ptr[int64](1073741824), + // MaxSizeBytes: to.Ptr[int64](268435456000), // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyZone), // RequestedServiceObjectiveName: to.Ptr("S0"), // Status: to.Ptr(armsql.DatabaseStatusOnline), // ZoneRedundant: to.Ptr(false), // }, // SKU: &armsql.SKU{ - // Name: to.Ptr("S0"), + // Name: to.Ptr("Standard"), // Capacity: to.Ptr[int32](10), // Tier: to.Ptr("Standard"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/CreateDatabaseLedger.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithLedgerOn() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/UpdateDatabaseHyperscaleMigrationWithManualCutover.json +func ExampleDatabasesClient_BeginCreateOrUpdate_updatesADatabaseToHyperscaleSloWithManualCutover() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1319,8 +2277,19 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithLedgerOn() { } poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ Location: to.Ptr("southeastasia"), + Identity: &armsql.DatabaseIdentity{ + Type: to.Ptr(armsql.DatabaseIdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armsql.DatabaseUserIdentity{ + "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/userAssignedIdentities/umi": {}, + "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/userAssignedIdentities/umiToDelete": nil, + }, + }, Properties: &armsql.DatabaseProperties{ - IsLedgerOn: to.Ptr(true), + ManualCutover: to.Ptr(true), + }, + SKU: &armsql.SKU{ + Name: to.Ptr("HS_Gen5_2"), + Tier: to.Ptr("Hyperscale"), }, }, nil) if err != nil { @@ -1338,39 +2307,45 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithLedgerOn() { // Type: to.Ptr("Microsoft.Sql/servers/databases"), // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user"), + // Kind: to.Ptr("v12.0,user,vcore"), // Properties: &armsql.DatabaseProperties{ // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-08T12:41:23.953Z"); return t}()), // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("S0"), + // CurrentServiceObjectiveName: to.Ptr("GP_Gen5_2"), // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), + // Name: to.Ptr("GP_Gen5"), + // Capacity: to.Ptr[int32](2), + // Family: to.Ptr("Gen5"), + // Tier: to.Ptr("GeneralPurpose"), // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), + // DatabaseID: to.Ptr("dad50ee1-9fbb-4fb9-bd2b-5786d175ce3c"), // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsLedgerOn: to.Ptr(true), - // MaxSizeBytes: to.Ptr[int64](268435456000), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-08T12:42:00Z"); return t}()), + // IsInfraEncryptionEnabled: to.Ptr(false), + // IsLedgerOn: to.Ptr(false), + // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), + // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"), + // MaxLogSizeBytes: to.Ptr[int64](193273528320), + // MaxSizeBytes: to.Ptr[int64](34359738368), + // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("S0"), + // RequestedServiceObjectiveName: to.Ptr("HS_Gen5_2"), // Status: to.Ptr(armsql.DatabaseStatusOnline), // ZoneRedundant: to.Ptr(false), // }, // SKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), + // Name: to.Ptr("HS_Gen5"), + // Capacity: to.Ptr[int32](2), + // Family: to.Ptr("Gen5"), + // Tier: to.Ptr("Hyperscale"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/CreateDatabaseMin.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithMinimumNumberOfParameters() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/UpdateDatabaseHyperscaleMigrationPerformCutover.json +func ExampleDatabasesClient_BeginCreateOrUpdate_updatesADatabaseToHyperscaleTierByTriggeringManualCutoverDuringMigrationWorkflow() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1382,6 +2357,16 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithMinimumNumbe } poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ Location: to.Ptr("southeastasia"), + Identity: &armsql.DatabaseIdentity{ + Type: to.Ptr(armsql.DatabaseIdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armsql.DatabaseUserIdentity{ + "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/userAssignedIdentities/umi": {}, + "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/userAssignedIdentities/umiToDelete": nil, + }, + }, + Properties: &armsql.DatabaseProperties{ + PerformCutover: to.Ptr(true), + }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -1398,40 +2383,45 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithMinimumNumbe // Type: to.Ptr("Microsoft.Sql/servers/databases"), // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user"), + // Kind: to.Ptr("v12.0,user,vcore"), // Properties: &armsql.DatabaseProperties{ // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-08T12:41:23.953Z"); return t}()), // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("S0"), + // CurrentServiceObjectiveName: to.Ptr("GP_Gen5_2"), // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), + // Name: to.Ptr("GP_Gen5"), + // Capacity: to.Ptr[int32](2), + // Family: to.Ptr("Gen5"), + // Tier: to.Ptr("GeneralPurpose"), // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), + // DatabaseID: to.Ptr("dad50ee1-9fbb-4fb9-bd2b-5786d175ce3c"), // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-08T12:42:00Z"); return t}()), // IsInfraEncryptionEnabled: to.Ptr(false), // IsLedgerOn: to.Ptr(false), - // MaxSizeBytes: to.Ptr[int64](268435456000), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), + // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), + // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"), + // MaxLogSizeBytes: to.Ptr[int64](193273528320), + // MaxSizeBytes: to.Ptr[int64](34359738368), + // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("S0"), + // RequestedServiceObjectiveName: to.Ptr("HS_Gen5_2"), // Status: to.Ptr(armsql.DatabaseStatusOnline), // ZoneRedundant: to.Ptr(false), // }, // SKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), + // Name: to.Ptr("HS_Gen5"), + // Capacity: to.Ptr[int32](2), + // Family: to.Ptr("Gen5"), + // Tier: to.Ptr("Hyperscale"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/CreateDatabaseMaintenanceConfiguration.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithPreferredMaintenanceWindow() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-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) @@ -1441,17 +2431,33 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithPreferredMai if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.DatabaseProperties{ - Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - CreateMode: to.Ptr(armsql.CreateModeDefault), + poller, err := clientFactory.NewDatabasesClient().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/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PatchVCoreDatabaseAssignMaintenanceConfiguration.json +func ExampleDatabasesClient_BeginUpdate_assignsMaintenanceWindowToADatabase() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewDatabasesClient().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"), - MaxSizeBytes: to.Ptr[int64](1073741824), }, SKU: &armsql.SKU{ - Name: to.Ptr("S2"), - Tier: to.Ptr("Standard"), + Name: to.Ptr("BC_Gen5_4"), }, }, nil) if err != nil { @@ -1469,39 +2475,43 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithPreferredMai // Type: to.Ptr("Microsoft.Sql/servers/databases"), // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user"), + // Kind: to.Ptr("v12.0,user,vcore"), // Properties: &armsql.DatabaseProperties{ // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("S2"), + // CurrentServiceObjectiveName: to.Ptr("BC_Gen5_2"), // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](50), - // Tier: to.Ptr("Standard"), + // Name: to.Ptr("BC_Gen5"), + // Capacity: to.Ptr[int32](4), + // Tier: to.Ptr("BusinessCritical"), // }, // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-08-29T06:41:18.283Z"); return t}()), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), // IsInfraEncryptionEnabled: to.Ptr(false), // IsLedgerOn: to.Ptr(false), + // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"), + // MaxLogSizeBytes: to.Ptr[int64](104857600), // MaxSizeBytes: to.Ptr[int64](1073741824), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), + // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // RequestedServiceObjectiveName: to.Ptr("BC_Gen5_2"), // Status: to.Ptr(armsql.DatabaseStatusOnline), // ZoneRedundant: to.Ptr(false), // }, // SKU: &armsql.SKU{ - // Name: to.Ptr("S2"), - // Tier: to.Ptr("Standard"), + // Name: to.Ptr("BC_Gen5"), + // Capacity: to.Ptr[int32](4), + // Tier: to.Ptr("BusinessCritical"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/CreateDatabaseConfiguredBackupStorageRedundancy.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithSpecifiedBackupStorageRedundancy() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PatchDatabaseVBSEnclave.json +func ExampleDatabasesClient_BeginUpdate_createsADatabaseWithVbsEnclaveType() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1511,10 +2521,9 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithSpecifiedBac if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.DatabaseProperties{ - RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyZone), + poller, err := clientFactory.NewDatabasesClient().BeginUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.DatabaseUpdate{ + Properties: &armsql.DatabaseUpdateProperties{ + PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS), }, }, nil) if err != nil { @@ -1537,7 +2546,7 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithSpecifiedBac // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyZone), + // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), // CurrentServiceObjectiveName: to.Ptr("S0"), // CurrentSKU: &armsql.SKU{ // Name: to.Ptr("Standard"), @@ -1547,11 +2556,10 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithSpecifiedBac // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), // DefaultSecondaryLocation: to.Ptr("North Europe"), // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), // MaxSizeBytes: to.Ptr[int64](268435456000), + // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS), // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyZone), + // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), // RequestedServiceObjectiveName: to.Ptr("S0"), // Status: to.Ptr(armsql.DatabaseStatusOnline), // ZoneRedundant: to.Ptr(false), @@ -1564,8 +2572,8 @@ func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithSpecifiedBac // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/DeleteDatabase.json -func ExampleDatabasesClient_BeginDelete() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PatchVCoreDatabaseWithKeysAndEncryptionProtector.json +func ExampleDatabasesClient_BeginUpdate_patchADatabaseWithDatabaseLevelCustomerManagedKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1575,18 +2583,77 @@ func ExampleDatabasesClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewDatabasesClient().BeginDelete(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", nil) + poller, err := clientFactory.NewDatabasesClient().BeginUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.DatabaseUpdate{ + Identity: &armsql.DatabaseIdentity{ + Type: to.Ptr(armsql.DatabaseIdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armsql.DatabaseUserIdentity{ + "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.ManagedIdentity/userAssignedIdentities/umi": {}, + "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.ManagedIdentity/userAssignedIdentities/umiToDelete": nil, + }, + }, + Properties: &armsql.DatabaseUpdateProperties{ + EncryptionProtector: to.Ptr("https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion"), + Keys: map[string]*armsql.DatabaseKey{ + "https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion": {}, + "https://your-key-vault-name.vault.azure.net/yourKey2/yourKey2VersionToDelete": nil, + }, + }, + SKU: &armsql.SKU{ + Name: to.Ptr("S0"), + Tier: to.Ptr("Standard"), + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.Database = armsql.Database{ + // Name: to.Ptr("testdb"), + // Type: to.Ptr("Microsoft.Sql/servers/databases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), + // Location: to.Ptr("southeastasia"), + // Kind: to.Ptr("v12.0,user,vcore"), + // Properties: &armsql.DatabaseProperties{ + // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), + // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), + // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // CurrentServiceObjectiveName: to.Ptr("BC_Gen4_2"), + // CurrentSKU: &armsql.SKU{ + // Name: to.Ptr("BC_Gen4"), + // Capacity: to.Ptr[int32](4), + // Tier: to.Ptr("BusinessCritical"), + // }, + // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), + // DefaultSecondaryLocation: to.Ptr("North Europe"), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), + // IsInfraEncryptionEnabled: to.Ptr(false), + // IsLedgerOn: to.Ptr(false), + // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), + // MaxLogSizeBytes: to.Ptr[int64](104857600), + // MaxSizeBytes: to.Ptr[int64](1073741824), + // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), + // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyLocal), + // RequestedServiceObjectiveName: to.Ptr("BC_Gen4_2"), + // Status: to.Ptr(armsql.DatabaseStatusOnline), + // ZoneRedundant: to.Ptr(false), + // }, + // SKU: &armsql.SKU{ + // Name: to.Ptr("BC_Gen4"), + // Capacity: to.Ptr[int32](4), + // Tier: to.Ptr("BusinessCritical"), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/PatchVCoreDatabaseAssignMaintenanceConfiguration.json -func ExampleDatabasesClient_BeginUpdate_assignsMaintenanceWindowToADatabase() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PatchVCoreDatabaseResetMaintenanceConfiguration.json +func ExampleDatabasesClient_BeginUpdate_resetsMaintenanceWindowOfADatabaseToDefault() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1598,7 +2665,7 @@ func ExampleDatabasesClient_BeginUpdate_assignsMaintenanceWindowToADatabase() { } poller, err := clientFactory.NewDatabasesClient().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"), + MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"), }, SKU: &armsql.SKU{ Name: to.Ptr("BC_Gen5_4"), @@ -1625,7 +2692,7 @@ func ExampleDatabasesClient_BeginUpdate_assignsMaintenanceWindowToADatabase() { // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("BC_Gen5_2"), + // CurrentServiceObjectiveName: to.Ptr("BC_Gen5_4"), // CurrentSKU: &armsql.SKU{ // Name: to.Ptr("BC_Gen5"), // Capacity: to.Ptr[int32](4), @@ -1637,12 +2704,11 @@ func ExampleDatabasesClient_BeginUpdate_assignsMaintenanceWindowToADatabase() { // IsInfraEncryptionEnabled: to.Ptr(false), // IsLedgerOn: to.Ptr(false), // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"), // MaxLogSizeBytes: to.Ptr[int64](104857600), // MaxSizeBytes: to.Ptr[int64](1073741824), // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("BC_Gen5_2"), + // RequestedServiceObjectiveName: to.Ptr("BC_Gen5_4"), // Status: to.Ptr(armsql.DatabaseStatusOnline), // ZoneRedundant: to.Ptr(false), // }, @@ -1654,8 +2720,8 @@ func ExampleDatabasesClient_BeginUpdate_assignsMaintenanceWindowToADatabase() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/PatchVCoreDatabaseResetMaintenanceConfiguration.json -func ExampleDatabasesClient_BeginUpdate_resetsMaintenanceWindowOfADatabaseToDefault() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PatchDatabaseDefaultEnclave.json +func ExampleDatabasesClient_BeginUpdate_updatesADatabaseWithDefaultEnclaveType() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1667,10 +2733,7 @@ func ExampleDatabasesClient_BeginUpdate_resetsMaintenanceWindowOfADatabaseToDefa } poller, err := clientFactory.NewDatabasesClient().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_Default"), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("BC_Gen5_4"), + PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault), }, }, nil) if err != nil { @@ -1688,41 +2751,38 @@ func ExampleDatabasesClient_BeginUpdate_resetsMaintenanceWindowOfADatabaseToDefa // Type: to.Ptr("Microsoft.Sql/servers/databases"), // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user,vcore"), + // Kind: to.Ptr("v12.0,user"), // Properties: &armsql.DatabaseProperties{ // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("BC_Gen5_4"), + // CurrentServiceObjectiveName: to.Ptr("S0"), // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen5"), - // Capacity: to.Ptr[int32](4), - // Tier: to.Ptr("BusinessCritical"), + // Name: to.Ptr("Standard"), + // Capacity: to.Ptr[int32](10), + // Tier: to.Ptr("Standard"), // }, // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), // DefaultSecondaryLocation: to.Ptr("North Europe"), // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), - // MaxLogSizeBytes: to.Ptr[int64](104857600), - // MaxSizeBytes: to.Ptr[int64](1073741824), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), + // MaxSizeBytes: to.Ptr[int64](268435456000), + // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault), + // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("BC_Gen5_4"), + // RequestedServiceObjectiveName: to.Ptr("S0"), // Status: to.Ptr(armsql.DatabaseStatusOnline), // ZoneRedundant: to.Ptr(false), // }, // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen5"), - // Capacity: to.Ptr[int32](4), - // Tier: to.Ptr("BusinessCritical"), + // Name: to.Ptr("Standard"), + // Capacity: to.Ptr[int32](10), + // Tier: to.Ptr("Standard"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/PatchVCoreDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PatchVCoreDatabase.json func ExampleDatabasesClient_BeginUpdate_updatesADatabase() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1791,7 +2851,7 @@ func ExampleDatabasesClient_BeginUpdate_updatesADatabase() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ExportDatabaseWithNetworkIsolation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ExportDatabaseWithNetworkIsolation.json func ExampleDatabasesClient_BeginExport_exportsADatabaseUsingPrivateLinkToCommunicateWithSqlServerAndStorageAccount() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1841,7 +2901,7 @@ func ExampleDatabasesClient_BeginExport_exportsADatabaseUsingPrivateLinkToCommun // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ExportDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ExportDatabase.json func ExampleDatabasesClient_BeginExport_exportsADatabase() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1887,7 +2947,7 @@ func ExampleDatabasesClient_BeginExport_exportsADatabase() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/FailoverDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/FailoverDatabase.json func ExampleDatabasesClient_BeginFailover() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1908,7 +2968,7 @@ func ExampleDatabasesClient_BeginFailover() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ImportDatabaseWithNetworkIsolation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ImportDatabaseWithNetworkIsolation.json func ExampleDatabasesClient_BeginImport_importsToAnExistingEmptyDatabaseUsingPrivateLinkToCommunicateWithSqlServerAndStorageAccount() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1958,7 +3018,7 @@ func ExampleDatabasesClient_BeginImport_importsToAnExistingEmptyDatabaseUsingPri // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ImportDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ImportDatabase.json func ExampleDatabasesClient_BeginImport_importsToAnExistingEmptyDatabase() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2004,7 +3064,7 @@ func ExampleDatabasesClient_BeginImport_importsToAnExistingEmptyDatabase() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/RenameDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/RenameDatabase.json func ExampleDatabasesClient_Rename() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2023,7 +3083,7 @@ func ExampleDatabasesClient_Rename() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/PauseDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PauseDatabase.json func ExampleDatabasesClient_BeginPause() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2067,7 +3127,7 @@ func ExampleDatabasesClient_BeginPause() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResumeDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ResumeDatabase.json func ExampleDatabasesClient_BeginResume() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2111,7 +3171,7 @@ func ExampleDatabasesClient_BeginResume() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/UpgradeDataWarehouse.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/UpgradeDataWarehouse.json func ExampleDatabasesClient_BeginUpgradeDataWarehouse() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2132,7 +3192,7 @@ func ExampleDatabasesClient_BeginUpgradeDataWarehouse() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ListDatabasesByElasticPool.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ListDatabasesByElasticPool.json func ExampleDatabasesClient_NewListByElasticPoolPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2204,7 +3264,7 @@ func ExampleDatabasesClient_NewListByElasticPoolPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ListVCoreInaccessibleDatabasesByServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ListVCoreInaccessibleDatabasesByServer.json func ExampleDatabasesClient_NewListInaccessibleByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/sql/armsql/databaseschemas_client.go b/sdk/resourcemanager/sql/armsql/databaseschemas_client.go index a928250857e8..52e2cb4715bf 100644 --- a/sdk/resourcemanager/sql/armsql/databaseschemas_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseschemas_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -55,18 +54,21 @@ func NewDatabaseSchemasClient(subscriptionID string, credential azcore.TokenCred // - schemaName - The name of the schema. // - options - DatabaseSchemasClientGetOptions contains the optional parameters for the DatabaseSchemasClient.Get method. func (client *DatabaseSchemasClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, options *DatabaseSchemasClientGetOptions) (DatabaseSchemasClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, schemaName, options) if err != nil { return DatabaseSchemasClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseSchemasClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabaseSchemasClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseSchemasClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/databaseschemas_client_example_test.go b/sdk/resourcemanager/sql/armsql/databaseschemas_client_example_test.go index 47af2a422e72..f34b7bba7aa6 100644 --- a/sdk/resourcemanager/sql/armsql/databaseschemas_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/databaseschemas_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSchemaListByDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -55,7 +55,7 @@ func ExampleDatabaseSchemasClient_NewListByDatabasePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSchemaGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/databasesecurityalertpolicies_client.go b/sdk/resourcemanager/sql/armsql/databasesecurityalertpolicies_client.go index 796f62fe8352..0f82a143a205 100644 --- a/sdk/resourcemanager/sql/armsql/databasesecurityalertpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/databasesecurityalertpolicies_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -57,18 +56,21 @@ func NewDatabaseSecurityAlertPoliciesClient(subscriptionID string, credential az // - options - DatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions contains the optional parameters for the DatabaseSecurityAlertPoliciesClient.CreateOrUpdate // method. func (client *DatabaseSecurityAlertPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, securityAlertPolicyName SecurityAlertPolicyName, parameters DatabaseSecurityAlertPolicy, options *DatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions) (DatabaseSecurityAlertPoliciesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, securityAlertPolicyName, parameters, options) if err != nil { return DatabaseSecurityAlertPoliciesClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseSecurityAlertPoliciesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return DatabaseSecurityAlertPoliciesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return DatabaseSecurityAlertPoliciesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -102,7 +104,10 @@ func (client *DatabaseSecurityAlertPoliciesClient) createOrUpdateCreateRequest(c reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -126,18 +131,21 @@ func (client *DatabaseSecurityAlertPoliciesClient) createOrUpdateHandleResponse( // - options - DatabaseSecurityAlertPoliciesClientGetOptions contains the optional parameters for the DatabaseSecurityAlertPoliciesClient.Get // method. func (client *DatabaseSecurityAlertPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, securityAlertPolicyName SecurityAlertPolicyName, options *DatabaseSecurityAlertPoliciesClientGetOptions) (DatabaseSecurityAlertPoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, securityAlertPolicyName, options) if err != nil { return DatabaseSecurityAlertPoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseSecurityAlertPoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabaseSecurityAlertPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseSecurityAlertPoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/databasesecurityalertpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/databasesecurityalertpolicies_client_example_test.go index 09ae18053ada..f722188eb92d 100644 --- a/sdk/resourcemanager/sql/armsql/databasesecurityalertpolicies_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/databasesecurityalertpolicies_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -63,7 +63,7 @@ func ExampleDatabaseSecurityAlertPoliciesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertCreateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertCreateMax.json func ExampleDatabaseSecurityAlertPoliciesClient_CreateOrUpdate_updateADatabasesThreatDetectionPolicyWithAllParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -123,7 +123,7 @@ func ExampleDatabaseSecurityAlertPoliciesClient_CreateOrUpdate_updateADatabasesT // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertCreateMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertCreateMin.json func ExampleDatabaseSecurityAlertPoliciesClient_CreateOrUpdate_updateADatabasesThreatDetectionPolicyWithMinimalParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -171,7 +171,7 @@ func ExampleDatabaseSecurityAlertPoliciesClient_CreateOrUpdate_updateADatabasesT // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertListByDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentbaselines_client.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentbaselines_client.go new file mode 100644 index 000000000000..4c574f9a4714 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentbaselines_client.go @@ -0,0 +1,281 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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" +) + +// DatabaseSQLVulnerabilityAssessmentBaselinesClient contains the methods for the DatabaseSQLVulnerabilityAssessmentBaselines group. +// Don't use this type directly, use NewDatabaseSQLVulnerabilityAssessmentBaselinesClient() instead. +type DatabaseSQLVulnerabilityAssessmentBaselinesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewDatabaseSQLVulnerabilityAssessmentBaselinesClient creates a new instance of DatabaseSQLVulnerabilityAssessmentBaselinesClient 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 NewDatabaseSQLVulnerabilityAssessmentBaselinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseSQLVulnerabilityAssessmentBaselinesClient, error) { + cl, err := arm.NewClient(moduleName+".DatabaseSQLVulnerabilityAssessmentBaselinesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DatabaseSQLVulnerabilityAssessmentBaselinesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Add a database's vulnerability assessment rule baseline list. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - parameters - The requested rule baseline resource. +// - options - DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateOptions contains the optional parameters for the +// DatabaseSQLVulnerabilityAssessmentBaselinesClient.CreateOrUpdate method. +func (client *DatabaseSQLVulnerabilityAssessmentBaselinesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, parameters DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput, options *DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateOptions) (DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, baselineName, parameters, options) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *DatabaseSQLVulnerabilityAssessmentBaselinesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, parameters DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput, options *DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if baselineName == "" { + return nil, errors.New("parameter baselineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baselineName}", url.PathEscape(string(baselineName))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *DatabaseSQLVulnerabilityAssessmentBaselinesClient) createOrUpdateHandleResponse(resp *http.Response) (DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse, error) { + result := DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseSQLVulnerabilityAssessmentBaselineSet); err != nil { + return DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Get - Gets a list of database's sql vulnerability assessment rule baselines. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - DatabaseSQLVulnerabilityAssessmentBaselinesClientGetOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentBaselinesClient.Get +// method. +func (client *DatabaseSQLVulnerabilityAssessmentBaselinesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, options *DatabaseSQLVulnerabilityAssessmentBaselinesClientGetOptions) (DatabaseSQLVulnerabilityAssessmentBaselinesClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, baselineName, options) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentBaselinesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentBaselinesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseSQLVulnerabilityAssessmentBaselinesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *DatabaseSQLVulnerabilityAssessmentBaselinesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, options *DatabaseSQLVulnerabilityAssessmentBaselinesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if baselineName == "" { + return nil, errors.New("parameter baselineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baselineName}", url.PathEscape(string(baselineName))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *DatabaseSQLVulnerabilityAssessmentBaselinesClient) getHandleResponse(resp *http.Response) (DatabaseSQLVulnerabilityAssessmentBaselinesClientGetResponse, error) { + result := DatabaseSQLVulnerabilityAssessmentBaselinesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseSQLVulnerabilityAssessmentBaselineSet); err != nil { + return DatabaseSQLVulnerabilityAssessmentBaselinesClientGetResponse{}, err + } + return result, nil +} + +// NewListBySQLVulnerabilityAssessmentPager - Gets a list of database's sql vulnerability assessment rule baselines. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentOptions contains the optional +// parameters for the DatabaseSQLVulnerabilityAssessmentBaselinesClient.NewListBySQLVulnerabilityAssessmentPager method. +func (client *DatabaseSQLVulnerabilityAssessmentBaselinesClient) NewListBySQLVulnerabilityAssessmentPager(resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentOptions) *runtime.Pager[DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse] { + return runtime.NewPager(runtime.PagingHandler[DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse]{ + More: func(page DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse) (DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySQLVulnerabilityAssessmentCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse{}, runtime.NewResponseError(resp) + } + return client.listBySQLVulnerabilityAssessmentHandleResponse(resp) + }, + }) +} + +// listBySQLVulnerabilityAssessmentCreateRequest creates the ListBySQLVulnerabilityAssessment request. +func (client *DatabaseSQLVulnerabilityAssessmentBaselinesClient) listBySQLVulnerabilityAssessmentCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySQLVulnerabilityAssessmentHandleResponse handles the ListBySQLVulnerabilityAssessment response. +func (client *DatabaseSQLVulnerabilityAssessmentBaselinesClient) listBySQLVulnerabilityAssessmentHandleResponse(resp *http.Response) (DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse, error) { + result := DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseSQLVulnerabilityAssessmentBaselineSetListResult); err != nil { + return DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentbaselines_client_example_test.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentbaselines_client_example_test.go new file mode 100644 index 000000000000..c0b53590884b --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentbaselines_client_example_test.go @@ -0,0 +1,324 @@ +//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_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/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineListBySqlVulnerabilityAssessment.json +func ExampleDatabaseSQLVulnerabilityAssessmentBaselinesClient_NewListBySQLVulnerabilityAssessmentPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewDatabaseSQLVulnerabilityAssessmentBaselinesClient().NewListBySQLVulnerabilityAssessmentPager("vulnerabilityaseessmenttest-4711", "vulnerabilityaseessmenttest-6411", "testdb", armsql.VulnerabilityAssessmentNameDefault, nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.DatabaseSQLVulnerabilityAssessmentBaselineSetListResult = armsql.DatabaseSQLVulnerabilityAssessmentBaselineSetListResult{ + // Value: []*armsql.DatabaseSQLVulnerabilityAssessmentBaselineSet{ + // { + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/baselines"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/sqlVulnerabilityAssessments/Default/baselines/Default"), + // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentBaselineSetProperties{ + // Results: map[string][][]*string{ + // "VA1020": [][]*string{ + // }, + // "VA1054": [][]*string{ + // }, + // "VA1095": [][]*string{ + // }, + // "VA1096": [][]*string{ + // }, + // "VA1097": [][]*string{ + // }, + // "VA1099": [][]*string{ + // }, + // "VA1143": [][]*string{ + // []*string{ + // to.Ptr("True")}}, + // "VA1219": [][]*string{ + // []*string{ + // to.Ptr("False")}}, + // "VA1221": [][]*string{ + // }, + // "VA1223": [][]*string{ + // }, + // "VA1224": [][]*string{ + // }, + // "VA1246": [][]*string{ + // }, + // "VA1248": [][]*string{ + // }, + // "VA1258": [][]*string{ + // }, + // "VA1281": [][]*string{ + // }, + // "VA1282": [][]*string{ + // }, + // "VA2020": [][]*string{ + // }, + // "VA2033": [][]*string{ + // }, + // "VA2062": [][]*string{ + // }, + // "VA2064": [][]*string{ + // }, + // "VA2108": [][]*string{ + // }, + // "VA2109": [][]*string{ + // }, + // "VA2129": [][]*string{ + // }, + // "VA2130": [][]*string{ + // }, + // }, + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineGet.json +func ExampleDatabaseSQLVulnerabilityAssessmentBaselinesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDatabaseSQLVulnerabilityAssessmentBaselinesClient().Get(ctx, "vulnerabilityaseessmenttest-4711", "vulnerabilityaseessmenttest-6411", "testdb", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.DatabaseSQLVulnerabilityAssessmentBaselineSet = armsql.DatabaseSQLVulnerabilityAssessmentBaselineSet{ + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/baselines"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/sqlVulnerabilityAssessments/Default/baselines/Default"), + // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentBaselineSetProperties{ + // Results: map[string][][]*string{ + // "VA1020": [][]*string{ + // }, + // "VA1054": [][]*string{ + // }, + // "VA1095": [][]*string{ + // }, + // "VA1096": [][]*string{ + // }, + // "VA1097": [][]*string{ + // }, + // "VA1099": [][]*string{ + // }, + // "VA1143": [][]*string{ + // []*string{ + // to.Ptr("True")}}, + // "VA1219": [][]*string{ + // []*string{ + // to.Ptr("False")}}, + // "VA1221": [][]*string{ + // }, + // "VA1223": [][]*string{ + // }, + // "VA1224": [][]*string{ + // }, + // "VA1246": [][]*string{ + // }, + // "VA1248": [][]*string{ + // }, + // "VA1258": [][]*string{ + // }, + // "VA1281": [][]*string{ + // }, + // "VA1282": [][]*string{ + // }, + // "VA2020": [][]*string{ + // }, + // "VA2033": [][]*string{ + // }, + // "VA2062": [][]*string{ + // }, + // "VA2064": [][]*string{ + // }, + // "VA2108": [][]*string{ + // }, + // "VA2109": [][]*string{ + // }, + // "VA2129": [][]*string{ + // }, + // "VA2130": [][]*string{ + // }, + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineAddLatest.json +func ExampleDatabaseSQLVulnerabilityAssessmentBaselinesClient_CreateOrUpdate_addADatabasesVulnerabilityAssessmentRuleBaselineFromTheLatestScanResult() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDatabaseSQLVulnerabilityAssessmentBaselinesClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput{ + Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineListInputProperties{ + LatestScan: to.Ptr(true), + Results: map[string][][]*string{}, + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.DatabaseSQLVulnerabilityAssessmentBaselineSet = armsql.DatabaseSQLVulnerabilityAssessmentBaselineSet{ + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/baselines"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/sqlVulnerabilityAssessments/Default/baselines/Default"), + // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentBaselineSetProperties{ + // Results: map[string][][]*string{ + // "VA1020": [][]*string{ + // }, + // "VA1054": [][]*string{ + // }, + // "VA1095": [][]*string{ + // }, + // "VA1096": [][]*string{ + // }, + // "VA1097": [][]*string{ + // }, + // "VA1099": [][]*string{ + // }, + // "VA1143": [][]*string{ + // []*string{ + // to.Ptr("True")}}, + // "VA1219": [][]*string{ + // []*string{ + // to.Ptr("False")}}, + // "VA1221": [][]*string{ + // }, + // "VA1223": [][]*string{ + // }, + // "VA1224": [][]*string{ + // }, + // "VA1246": [][]*string{ + // }, + // "VA1248": [][]*string{ + // }, + // "VA1258": [][]*string{ + // }, + // "VA1281": [][]*string{ + // }, + // "VA1282": [][]*string{ + // }, + // "VA2020": [][]*string{ + // }, + // "VA2033": [][]*string{ + // }, + // "VA2062": [][]*string{ + // }, + // "VA2064": [][]*string{ + // }, + // "VA2108": [][]*string{ + // }, + // "VA2109": [][]*string{ + // }, + // "VA2129": [][]*string{ + // }, + // "VA2130": [][]*string{ + // }, + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineAdd.json +func ExampleDatabaseSQLVulnerabilityAssessmentBaselinesClient_CreateOrUpdate_addADatabasesVulnerabilityAssessmentRuleBaselineList() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDatabaseSQLVulnerabilityAssessmentBaselinesClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput{ + Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineListInputProperties{ + LatestScan: to.Ptr(false), + Results: map[string][][]*string{ + "VA2063": { + { + to.Ptr("AllowAll"), + to.Ptr("0.0.0.0"), + to.Ptr("255.255.255.255")}}, + "VA2065": { + { + to.Ptr("AllowAll"), + to.Ptr("0.0.0.0"), + to.Ptr("255.255.255.255")}}, + }, + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.DatabaseSQLVulnerabilityAssessmentBaselineSet = armsql.DatabaseSQLVulnerabilityAssessmentBaselineSet{ + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/baselines"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/sqlVulnerabilityAssessments/Default/baselines/Default"), + // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentBaselineSetProperties{ + // Results: map[string][][]*string{ + // "VA2063": [][]*string{ + // []*string{ + // to.Ptr("AllowAll"), + // to.Ptr("0.0.0.0"), + // to.Ptr("255.255.255.255")}}, + // "VA2065": [][]*string{ + // []*string{ + // to.Ptr("AllowAll"), + // to.Ptr("0.0.0.0"), + // to.Ptr("255.255.255.255")}}, + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentexecutescan_client.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentexecutescan_client.go new file mode 100644 index 000000000000..ae489769ccfb --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentexecutescan_client.go @@ -0,0 +1,122 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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" +) + +// DatabaseSQLVulnerabilityAssessmentExecuteScanClient contains the methods for the DatabaseSQLVulnerabilityAssessmentExecuteScan group. +// Don't use this type directly, use NewDatabaseSQLVulnerabilityAssessmentExecuteScanClient() instead. +type DatabaseSQLVulnerabilityAssessmentExecuteScanClient struct { + internal *arm.Client + subscriptionID string +} + +// NewDatabaseSQLVulnerabilityAssessmentExecuteScanClient creates a new instance of DatabaseSQLVulnerabilityAssessmentExecuteScanClient 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 NewDatabaseSQLVulnerabilityAssessmentExecuteScanClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseSQLVulnerabilityAssessmentExecuteScanClient, error) { + cl, err := arm.NewClient(moduleName+".DatabaseSQLVulnerabilityAssessmentExecuteScanClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DatabaseSQLVulnerabilityAssessmentExecuteScanClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginExecute - Executes a Vulnerability Assessment database scan. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - DatabaseSQLVulnerabilityAssessmentExecuteScanClientBeginExecuteOptions contains the optional parameters for the +// DatabaseSQLVulnerabilityAssessmentExecuteScanClient.BeginExecute method. +func (client *DatabaseSQLVulnerabilityAssessmentExecuteScanClient) BeginExecute(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *DatabaseSQLVulnerabilityAssessmentExecuteScanClientBeginExecuteOptions) (*runtime.Poller[DatabaseSQLVulnerabilityAssessmentExecuteScanClientExecuteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.execute(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller[DatabaseSQLVulnerabilityAssessmentExecuteScanClientExecuteResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[DatabaseSQLVulnerabilityAssessmentExecuteScanClientExecuteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Execute - Executes a Vulnerability Assessment database scan. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *DatabaseSQLVulnerabilityAssessmentExecuteScanClient) execute(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *DatabaseSQLVulnerabilityAssessmentExecuteScanClientBeginExecuteOptions) (*http.Response, error) { + var err error + req, err := client.executeCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// executeCreateRequest creates the Execute request. +func (client *DatabaseSQLVulnerabilityAssessmentExecuteScanClient) executeCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *DatabaseSQLVulnerabilityAssessmentExecuteScanClientBeginExecuteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentexecutescan_client_example_test.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentexecutescan_client_example_test.go new file mode 100644 index 000000000000..5a0448e96d80 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentexecutescan_client_example_test.go @@ -0,0 +1,39 @@ +//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_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentScansExecute.json +func ExampleDatabaseSQLVulnerabilityAssessmentExecuteScanClient_BeginExecute() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewDatabaseSQLVulnerabilityAssessmentExecuteScanClient().BeginExecute(ctx, "vulnerabilityassessmenttest-4711", "vulnerabilityassessmenttest-6411", "testdb", armsql.VulnerabilityAssessmentNameDefault, 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/databasesqlvulnerabilityassessmentrulebaselines_client.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentrulebaselines_client.go new file mode 100644 index 000000000000..f49c8efcb321 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentrulebaselines_client.go @@ -0,0 +1,365 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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" +) + +// DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient contains the methods for the DatabaseSQLVulnerabilityAssessmentRuleBaselines group. +// Don't use this type directly, use NewDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient() instead. +type DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient creates a new instance of DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient 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 NewDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient, error) { + cl, err := arm.NewClient(moduleName+".DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates a database's vulnerability assessment rule baseline. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - ruleID - The vulnerability assessment rule ID. +// - parameters - The requested rule baseline resource. +// - options - DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions contains the optional parameters for +// the DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate method. +func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, ruleID string, parameters DatabaseSQLVulnerabilityAssessmentRuleBaselineInput, options *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions) (DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, baselineName, ruleID, parameters, options) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, ruleID string, parameters DatabaseSQLVulnerabilityAssessmentRuleBaselineInput, options *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if baselineName == "" { + return nil, errors.New("parameter baselineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baselineName}", url.PathEscape(string(baselineName))) + if ruleID == "" { + return nil, errors.New("parameter ruleID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) createOrUpdateHandleResponse(resp *http.Response) (DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse, error) { + result := DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseSQLVulnerabilityAssessmentRuleBaseline); err != nil { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Removes the database's vulnerability assessment rule baseline. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - ruleID - The vulnerability assessment rule ID. +// - options - DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.Delete +// method. +func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, ruleID string, options *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteOptions) (DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteResponse, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, baselineName, ruleID, options) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, err + } + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, ruleID string, options *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if baselineName == "" { + return nil, errors.New("parameter baselineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baselineName}", url.PathEscape(string(baselineName))) + if ruleID == "" { + return nil, errors.New("parameter ruleID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// Get - Gets a database's sql vulnerability assessment rule baseline. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - ruleID - The vulnerability assessment rule ID. +// - options - DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.Get +// method. +func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, ruleID string, options *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetOptions) (DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, baselineName, ruleID, options) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, ruleID string, options *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if baselineName == "" { + return nil, errors.New("parameter baselineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baselineName}", url.PathEscape(string(baselineName))) + if ruleID == "" { + return nil, errors.New("parameter ruleID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) getHandleResponse(resp *http.Response) (DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetResponse, error) { + result := DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseSQLVulnerabilityAssessmentRuleBaseline); err != nil { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetResponse{}, err + } + return result, nil +} + +// NewListByBaselinePager - Gets a list of database's sql vulnerability assessment rule baselines. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineOptions contains the optional parameters for +// the DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.NewListByBaselinePager method. +func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) NewListByBaselinePager(resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, options *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineOptions) *runtime.Pager[DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse] { + return runtime.NewPager(runtime.PagingHandler[DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse]{ + More: func(page DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse) (DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByBaselineCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, baselineName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse{}, runtime.NewResponseError(resp) + } + return client.listByBaselineHandleResponse(resp) + }, + }) +} + +// listByBaselineCreateRequest creates the ListByBaseline request. +func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) listByBaselineCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, options *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if baselineName == "" { + return nil, errors.New("parameter baselineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baselineName}", url.PathEscape(string(baselineName))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByBaselineHandleResponse handles the ListByBaseline response. +func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) listByBaselineHandleResponse(resp *http.Response) (DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse, error) { + result := DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult); err != nil { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentrulebaselines_client_example_test.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentrulebaselines_client_example_test.go new file mode 100644 index 000000000000..a3fa31c347b8 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentrulebaselines_client_example_test.go @@ -0,0 +1,186 @@ +//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_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/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineListByBaseline.json +func ExampleDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient_NewListByBaselinePager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient().NewListByBaselinePager("vulnerabilityaseessmenttest-4711", "vulnerabilityaseessmenttest-6411", "testdb", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult = armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult{ + // Value: []*armsql.DatabaseSQLVulnerabilityAssessmentRuleBaseline{ + // { + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/baselines"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/sqlVulnerabilityAssessments/default/baselines/default/rules/VA1001"), + // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties{ + // Results: [][]*string{ + // []*string{ + // to.Ptr("userA"), + // to.Ptr("SELECT")}, + // []*string{ + // to.Ptr("userB"), + // to.Ptr("SELECT")}, + // []*string{ + // to.Ptr("userC"), + // to.Ptr("SELECT")}}, + // }, + // }, + // { + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/baselines"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/sqlVulnerabilityAssessments/default/baselines/default/rules/VA1002"), + // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties{ + // Results: [][]*string{ + // []*string{ + // to.Ptr("userA"), + // to.Ptr("SELECT")}, + // []*string{ + // to.Ptr("userB"), + // to.Ptr("SELECT")}, + // []*string{ + // to.Ptr("userC"), + // to.Ptr("SELECT")}}, + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineGet.json +func ExampleDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient().Get(ctx, "vulnerabilityaseessmenttest-4711", "vulnerabilityaseessmenttest-6411", "testdb", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, "VA1001", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.DatabaseSQLVulnerabilityAssessmentRuleBaseline = armsql.DatabaseSQLVulnerabilityAssessmentRuleBaseline{ + // Name: to.Ptr("VA1001"), + // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/baselineRules"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/sqlVulnerabilityAssessments/default/baselines/default/rules/VA1001"), + // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties{ + // Results: [][]*string{ + // []*string{ + // to.Ptr("userA"), + // to.Ptr("SELECT")}, + // []*string{ + // to.Ptr("userB"), + // to.Ptr("SELECT")}, + // []*string{ + // to.Ptr("userC"), + // to.Ptr("SELECT")}}, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineCreate.json +func ExampleDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient_CreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, "VA1001", armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineInput{ + Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineInputProperties{ + LatestScan: to.Ptr(false), + Results: [][]*string{ + { + to.Ptr("userA"), + to.Ptr("SELECT")}, + { + to.Ptr("userB"), + to.Ptr("SELECT")}, + { + to.Ptr("userC"), + to.Ptr("SELECT")}}, + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.DatabaseSQLVulnerabilityAssessmentRuleBaseline = armsql.DatabaseSQLVulnerabilityAssessmentRuleBaseline{ + // Name: to.Ptr("Scan123"), + // Type: to.Ptr("Microsoft.Sql/servers/databases/vulnerabilityAssessments/rules/baselines"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/sqlVulnerabilityAssessments/default/baselines/default/rules/VA1001"), + // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties{ + // Results: [][]*string{ + // []*string{ + // to.Ptr("userA"), + // to.Ptr("SELECT")}, + // []*string{ + // to.Ptr("userB"), + // to.Ptr("SELECT")}, + // []*string{ + // to.Ptr("userC"), + // to.Ptr("SELECT")}}, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineDelete.json +func ExampleDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient().Delete(ctx, "vulnerabilityaseessmenttest-4711", "vulnerabilityaseessmenttest-6411", "testdb", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, "VA1001", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscanresult_client.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscanresult_client.go new file mode 100644 index 000000000000..3918cddf2389 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscanresult_client.go @@ -0,0 +1,212 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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" +) + +// DatabaseSQLVulnerabilityAssessmentScanResultClient contains the methods for the DatabaseSQLVulnerabilityAssessmentScanResult group. +// Don't use this type directly, use NewDatabaseSQLVulnerabilityAssessmentScanResultClient() instead. +type DatabaseSQLVulnerabilityAssessmentScanResultClient struct { + internal *arm.Client + subscriptionID string +} + +// NewDatabaseSQLVulnerabilityAssessmentScanResultClient creates a new instance of DatabaseSQLVulnerabilityAssessmentScanResultClient 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 NewDatabaseSQLVulnerabilityAssessmentScanResultClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseSQLVulnerabilityAssessmentScanResultClient, error) { + cl, err := arm.NewClient(moduleName+".DatabaseSQLVulnerabilityAssessmentScanResultClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DatabaseSQLVulnerabilityAssessmentScanResultClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Gets a vulnerability assessment scan record of a database. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the SQL Vulnerability Assessment. +// - scanID - The scan id of the SQL Vulnerability Assessment scan to retrieve result from. +// - scanResultID - The scan result id of the specific result to retrieve. +// - options - DatabaseSQLVulnerabilityAssessmentScanResultClientGetOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentScanResultClient.Get +// method. +func (client *DatabaseSQLVulnerabilityAssessmentScanResultClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName SQLVulnerabilityAssessmentName, scanID string, scanResultID string, options *DatabaseSQLVulnerabilityAssessmentScanResultClientGetOptions) (DatabaseSQLVulnerabilityAssessmentScanResultClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, scanID, scanResultID, options) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentScanResultClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentScanResultClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseSQLVulnerabilityAssessmentScanResultClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *DatabaseSQLVulnerabilityAssessmentScanResultClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName SQLVulnerabilityAssessmentName, scanID string, scanResultID string, options *DatabaseSQLVulnerabilityAssessmentScanResultClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults/{scanResultId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if scanID == "" { + return nil, errors.New("parameter scanID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scanId}", url.PathEscape(scanID)) + if scanResultID == "" { + return nil, errors.New("parameter scanResultID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scanResultId}", url.PathEscape(scanResultID)) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *DatabaseSQLVulnerabilityAssessmentScanResultClient) getHandleResponse(resp *http.Response) (DatabaseSQLVulnerabilityAssessmentScanResultClientGetResponse, error) { + result := DatabaseSQLVulnerabilityAssessmentScanResultClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessmentScanResults); err != nil { + return DatabaseSQLVulnerabilityAssessmentScanResultClientGetResponse{}, err + } + return result, nil +} + +// NewListByScanPager - Gets a vulnerability assessment scan record of a database. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the SQL Vulnerability Assessment. +// - scanID - The scan id of the SQL Vulnerability Assessment scan to retrieve result from. +// - options - DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanOptions contains the optional parameters for the +// DatabaseSQLVulnerabilityAssessmentScanResultClient.NewListByScanPager method. +func (client *DatabaseSQLVulnerabilityAssessmentScanResultClient) NewListByScanPager(resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName SQLVulnerabilityAssessmentName, scanID string, options *DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanOptions) *runtime.Pager[DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse] { + return runtime.NewPager(runtime.PagingHandler[DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse]{ + More: func(page DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse) (DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByScanCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, scanID, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse{}, runtime.NewResponseError(resp) + } + return client.listByScanHandleResponse(resp) + }, + }) +} + +// listByScanCreateRequest creates the ListByScan request. +func (client *DatabaseSQLVulnerabilityAssessmentScanResultClient) listByScanCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName SQLVulnerabilityAssessmentName, scanID string, options *DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if scanID == "" { + return nil, errors.New("parameter scanID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scanId}", url.PathEscape(scanID)) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByScanHandleResponse handles the ListByScan response. +func (client *DatabaseSQLVulnerabilityAssessmentScanResultClient) listByScanHandleResponse(resp *http.Response) (DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse, error) { + result := DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessmentScanListResult); err != nil { + return DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscanresult_client_example_test.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscanresult_client_example_test.go new file mode 100644 index 000000000000..8de664ab2680 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscanresult_client_example_test.go @@ -0,0 +1,213 @@ +//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_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentListScansResults.json +func ExampleDatabaseSQLVulnerabilityAssessmentScanResultClient_NewListByScanPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewDatabaseSQLVulnerabilityAssessmentScanResultClient().NewListByScanPager("vulnerabilityassessmenttest-4711", "testsvr", "master", armsql.SQLVulnerabilityAssessmentNameDefault, "scanId1", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.VulnerabilityAssessmentScanListResult = armsql.VulnerabilityAssessmentScanListResult{ + // Value: []*armsql.VulnerabilityAssessmentScanResults{ + // { + // Name: to.Ptr("VA1234"), + // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/scans/scanResults"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/testsvr/databases/master/sqlVulnerabilityAssessments/Default/scans/scanId1/scanResults/VA1234"), + // Properties: &armsql.VulnerabilityAssessmentScanResultProperties{ + // IsTrimmed: to.Ptr(false), + // QueryResults: [][]*string{ + // []*string{ + // to.Ptr("a1"), + // to.Ptr("a2"), + // to.Ptr("a3")}, + // []*string{ + // to.Ptr("b1"), + // to.Ptr("b2"), + // to.Ptr("b3")}}, + // Remediation: &armsql.Remediation{ + // Description: to.Ptr("Remove users"), + // Automated: to.Ptr(false), + // Scripts: []*string{ + // to.Ptr("drop user a"), + // to.Ptr("drop user b")}, + // }, + // RuleID: to.Ptr("VA1234"), + // RuleMetadata: &armsql.VaRule{ + // Description: to.Ptr("This is an example check"), + // BenchmarkReferences: []*armsql.BenchmarkReference{ + // { + // Benchmark: to.Ptr("fedramp"), + // Reference: to.Ptr("v1"), + // }}, + // Category: to.Ptr("information"), + // QueryCheck: &armsql.QueryCheck{ + // ColumnNames: []*string{ + // to.Ptr("col1"), + // to.Ptr("col2"), + // to.Ptr("col3")}, + // ExpectedResult: [][]*string{ + // }, + // Query: to.Ptr("Select a1,a2, a3"), + // }, + // Rationale: to.Ptr("This is important"), + // RuleID: to.Ptr("VA1234"), + // RuleType: to.Ptr(armsql.RuleTypeNegativeList), + // Severity: to.Ptr(armsql.RuleSeverityInformational), + // Title: to.Ptr("This is the title"), + // }, + // Status: to.Ptr(armsql.RuleStatusNonFinding), + // }, + // }, + // { + // Name: to.Ptr("VA2341"), + // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/scans/scanResults"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/testsvr/databases/master/sqlVulnerabilityAssessments/Default/scans/scanId1/scanResults/VA2341"), + // Properties: &armsql.VulnerabilityAssessmentScanResultProperties{ + // IsTrimmed: to.Ptr(false), + // QueryResults: [][]*string{ + // []*string{ + // to.Ptr("a1"), + // to.Ptr("a2"), + // to.Ptr("a3")}, + // []*string{ + // to.Ptr("b1"), + // to.Ptr("b2"), + // to.Ptr("b3")}}, + // Remediation: &armsql.Remediation{ + // Description: to.Ptr("Remove users"), + // Automated: to.Ptr(false), + // Scripts: []*string{ + // to.Ptr("drop user a"), + // to.Ptr("drop user b")}, + // }, + // RuleID: to.Ptr("VA2341"), + // RuleMetadata: &armsql.VaRule{ + // Description: to.Ptr("This is an example check"), + // BenchmarkReferences: []*armsql.BenchmarkReference{ + // { + // Benchmark: to.Ptr("fedramp"), + // Reference: to.Ptr("v1"), + // }}, + // Category: to.Ptr("information"), + // QueryCheck: &armsql.QueryCheck{ + // ColumnNames: []*string{ + // to.Ptr("col1"), + // to.Ptr("col2"), + // to.Ptr("col3")}, + // ExpectedResult: [][]*string{ + // }, + // Query: to.Ptr("Select a1,a2, a3"), + // }, + // Rationale: to.Ptr("This is important"), + // RuleID: to.Ptr("VA1234"), + // RuleType: to.Ptr(armsql.RuleTypeNegativeList), + // Severity: to.Ptr(armsql.RuleSeverityInformational), + // Title: to.Ptr("This is the title"), + // }, + // Status: to.Ptr(armsql.RuleStatusNonFinding), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentScansResults.json +func ExampleDatabaseSQLVulnerabilityAssessmentScanResultClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDatabaseSQLVulnerabilityAssessmentScanResultClient().Get(ctx, "vulnerabilityassessmenttest-4711", "vulnerabilityassessmenttest-6411", "master", armsql.SQLVulnerabilityAssessmentNameDefault, "scanId1", "VA1234", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.VulnerabilityAssessmentScanResults = armsql.VulnerabilityAssessmentScanResults{ + // Name: to.Ptr("VA1234"), + // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/scans/scanResults"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6411/sqlVulnerabilityAssessments/Default/scans/scanId1/scanResults/VA1234"), + // Properties: &armsql.VulnerabilityAssessmentScanResultProperties{ + // IsTrimmed: to.Ptr(false), + // QueryResults: [][]*string{ + // []*string{ + // to.Ptr("a1"), + // to.Ptr("a2"), + // to.Ptr("a3")}, + // []*string{ + // to.Ptr("b1"), + // to.Ptr("b2"), + // to.Ptr("b3")}}, + // Remediation: &armsql.Remediation{ + // Description: to.Ptr("Remove users"), + // Automated: to.Ptr(false), + // Scripts: []*string{ + // to.Ptr("drop user a"), + // to.Ptr("drop user b")}, + // }, + // RuleID: to.Ptr("VA1234"), + // RuleMetadata: &armsql.VaRule{ + // Description: to.Ptr("This is an example check"), + // BenchmarkReferences: []*armsql.BenchmarkReference{ + // { + // Benchmark: to.Ptr("fedramp"), + // Reference: to.Ptr("v1"), + // }}, + // Category: to.Ptr("information"), + // QueryCheck: &armsql.QueryCheck{ + // ColumnNames: []*string{ + // to.Ptr("col1"), + // to.Ptr("col2"), + // to.Ptr("col3")}, + // ExpectedResult: [][]*string{ + // }, + // Query: to.Ptr("Select a1,a2, a3"), + // }, + // Rationale: to.Ptr("This is important"), + // RuleID: to.Ptr("VA1234"), + // RuleType: to.Ptr(armsql.RuleTypeNegativeList), + // Severity: to.Ptr(armsql.RuleSeverityInformational), + // Title: to.Ptr("This is the title"), + // }, + // Status: to.Ptr(armsql.RuleStatusNonFinding), + // }, + // } +} diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscans_client.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscans_client.go new file mode 100644 index 000000000000..e2ba3f484684 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscans_client.go @@ -0,0 +1,202 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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" +) + +// DatabaseSQLVulnerabilityAssessmentScansClient contains the methods for the DatabaseSQLVulnerabilityAssessmentScans group. +// Don't use this type directly, use NewDatabaseSQLVulnerabilityAssessmentScansClient() instead. +type DatabaseSQLVulnerabilityAssessmentScansClient struct { + internal *arm.Client + subscriptionID string +} + +// NewDatabaseSQLVulnerabilityAssessmentScansClient creates a new instance of DatabaseSQLVulnerabilityAssessmentScansClient 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 NewDatabaseSQLVulnerabilityAssessmentScansClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseSQLVulnerabilityAssessmentScansClient, error) { + cl, err := arm.NewClient(moduleName+".DatabaseSQLVulnerabilityAssessmentScansClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DatabaseSQLVulnerabilityAssessmentScansClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Get a database vulnerability assessment scan result. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - scanID - The vulnerability assessment scan Id of the scan to retrieve. +// - options - DatabaseSQLVulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentScansClient.Get +// method. +func (client *DatabaseSQLVulnerabilityAssessmentScansClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, scanID string, options *DatabaseSQLVulnerabilityAssessmentScansClientGetOptions) (DatabaseSQLVulnerabilityAssessmentScansClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, scanID, options) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentScansClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentScansClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseSQLVulnerabilityAssessmentScansClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *DatabaseSQLVulnerabilityAssessmentScansClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, scanID string, options *DatabaseSQLVulnerabilityAssessmentScansClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if scanID == "" { + return nil, errors.New("parameter scanID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scanId}", url.PathEscape(scanID)) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *DatabaseSQLVulnerabilityAssessmentScansClient) getHandleResponse(resp *http.Response) (DatabaseSQLVulnerabilityAssessmentScansClientGetResponse, error) { + result := DatabaseSQLVulnerabilityAssessmentScansClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessmentScanRecordForSQL); err != nil { + return DatabaseSQLVulnerabilityAssessmentScansClientGetResponse{}, err + } + return result, nil +} + +// NewListBySQLVulnerabilityAssessmentsPager - Lists the vulnerability assessment scans of a database. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsOptions contains the optional parameters +// for the DatabaseSQLVulnerabilityAssessmentScansClient.NewListBySQLVulnerabilityAssessmentsPager method. +func (client *DatabaseSQLVulnerabilityAssessmentScansClient) NewListBySQLVulnerabilityAssessmentsPager(resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsOptions) *runtime.Pager[DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse] { + return runtime.NewPager(runtime.PagingHandler[DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse]{ + More: func(page DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse) (DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySQLVulnerabilityAssessmentsCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse{}, runtime.NewResponseError(resp) + } + return client.listBySQLVulnerabilityAssessmentsHandleResponse(resp) + }, + }) +} + +// listBySQLVulnerabilityAssessmentsCreateRequest creates the ListBySQLVulnerabilityAssessments request. +func (client *DatabaseSQLVulnerabilityAssessmentScansClient) listBySQLVulnerabilityAssessmentsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySQLVulnerabilityAssessmentsHandleResponse handles the ListBySQLVulnerabilityAssessments response. +func (client *DatabaseSQLVulnerabilityAssessmentScansClient) listBySQLVulnerabilityAssessmentsHandleResponse(resp *http.Response) (DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse, error) { + result := DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessmentScanRecordForSQLListResult); err != nil { + return DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscans_client_example_test.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscans_client_example_test.go new file mode 100644 index 000000000000..24480217a622 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscans_client_example_test.go @@ -0,0 +1,158 @@ +//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_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentScanRecordsListByDatabase.json +func ExampleDatabaseSQLVulnerabilityAssessmentScansClient_NewListBySQLVulnerabilityAssessmentsPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewDatabaseSQLVulnerabilityAssessmentScansClient().NewListBySQLVulnerabilityAssessmentsPager("vulnerabilityassessmenttest-4711", "vulnerabilityassessmenttest-6411", "testdb", armsql.VulnerabilityAssessmentNameDefault, nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.VulnerabilityAssessmentScanRecordForSQLListResult = armsql.VulnerabilityAssessmentScanRecordForSQLListResult{ + // Value: []*armsql.VulnerabilityAssessmentScanRecordForSQL{ + // { + // Name: to.Ptr("scan001"), + // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/scans"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6411/databases/testdb/sqlVulnerabilityAssessments/default/scans/scan001"), + // Properties: &armsql.VulnerabilityAssessmentScanRecordForSQLProperties{ + // Database: to.Ptr("testdb"), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.7236217Z"); return t}()), + // HighSeverityFailedRulesCount: to.Ptr[int32](3), + // IsBaselineApplied: to.Ptr(false), + // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), + // LowSeverityFailedRulesCount: to.Ptr[int32](1), + // MediumSeverityFailedRulesCount: to.Ptr[int32](2), + // ScanID: to.Ptr("scan001"), + // Server: to.Ptr("vulnerabilityassessmenttest-6411"), + // SQLVersion: to.Ptr("15.0.2000"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), + // State: to.Ptr(armsql.VulnerabilityAssessmentScanStateFailed), + // TotalFailedRulesCount: to.Ptr[int32](6), + // TotalPassedRulesCount: to.Ptr[int32](20), + // TotalRulesCount: to.Ptr[int32](26), + // TriggerType: to.Ptr(armsql.VulnerabilityAssessmentScanTriggerTypeRecurring), + // }, + // }, + // { + // Name: to.Ptr("scan001"), + // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/scans"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6411/databases/testdb/sqlVulnerabilityAssessments/default/scans/scan002"), + // Properties: &armsql.VulnerabilityAssessmentScanRecordForSQLProperties{ + // Database: to.Ptr("testdb"), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.7236217Z"); return t}()), + // HighSeverityFailedRulesCount: to.Ptr[int32](3), + // IsBaselineApplied: to.Ptr(false), + // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), + // LowSeverityFailedRulesCount: to.Ptr[int32](1), + // MediumSeverityFailedRulesCount: to.Ptr[int32](2), + // ScanID: to.Ptr("scan002"), + // Server: to.Ptr("vulnerabilityassessmenttest-6411"), + // SQLVersion: to.Ptr("15.0.2000"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), + // State: to.Ptr(armsql.VulnerabilityAssessmentScanStateFailed), + // TotalFailedRulesCount: to.Ptr[int32](6), + // TotalPassedRulesCount: to.Ptr[int32](20), + // TotalRulesCount: to.Ptr[int32](26), + // TriggerType: to.Ptr(armsql.VulnerabilityAssessmentScanTriggerTypeRecurring), + // }, + // }, + // { + // Name: to.Ptr("scan001"), + // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/scans"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6411/databases/testdb/sqlVulnerabilityAssessments/default/scans/scan003"), + // Properties: &armsql.VulnerabilityAssessmentScanRecordForSQLProperties{ + // Database: to.Ptr("testdb"), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.7236217Z"); return t}()), + // HighSeverityFailedRulesCount: to.Ptr[int32](3), + // IsBaselineApplied: to.Ptr(false), + // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), + // LowSeverityFailedRulesCount: to.Ptr[int32](1), + // MediumSeverityFailedRulesCount: to.Ptr[int32](2), + // ScanID: to.Ptr("scan003"), + // Server: to.Ptr("vulnerabilityassessmenttest-6411"), + // SQLVersion: to.Ptr("15.0.2000"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), + // State: to.Ptr(armsql.VulnerabilityAssessmentScanStateFailed), + // TotalFailedRulesCount: to.Ptr[int32](6), + // TotalPassedRulesCount: to.Ptr[int32](20), + // TotalRulesCount: to.Ptr[int32](26), + // TriggerType: to.Ptr(armsql.VulnerabilityAssessmentScanTriggerTypeRecurring), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentScan.json +func ExampleDatabaseSQLVulnerabilityAssessmentScansClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDatabaseSQLVulnerabilityAssessmentScansClient().Get(ctx, "vulnerabilityassessmenttest-4711", "vulnerabilityassessmenttest-6411", "testdb", armsql.VulnerabilityAssessmentNameDefault, "scan001", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.VulnerabilityAssessmentScanRecordForSQL = armsql.VulnerabilityAssessmentScanRecordForSQL{ + // Name: to.Ptr("scan001"), + // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/scans"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6411/databases/testdb/sqlVulnerabilityAssessments/default/scans/scan001"), + // Properties: &armsql.VulnerabilityAssessmentScanRecordForSQLProperties{ + // Database: to.Ptr("testdb"), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.7236217Z"); return t}()), + // HighSeverityFailedRulesCount: to.Ptr[int32](3), + // IsBaselineApplied: to.Ptr(false), + // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), + // LowSeverityFailedRulesCount: to.Ptr[int32](1), + // MediumSeverityFailedRulesCount: to.Ptr[int32](2), + // ScanID: to.Ptr("scan001"), + // Server: to.Ptr("vulnerabilityassessmenttest-6411"), + // SQLVersion: to.Ptr("15.0.2000"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), + // State: to.Ptr(armsql.VulnerabilityAssessmentScanStateFailed), + // TotalFailedRulesCount: to.Ptr[int32](6), + // TotalPassedRulesCount: to.Ptr[int32](20), + // TotalRulesCount: to.Ptr[int32](26), + // TriggerType: to.Ptr(armsql.VulnerabilityAssessmentScanTriggerTypeRecurring), + // }, + // } +} diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentssettings_client.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentssettings_client.go new file mode 100644 index 000000000000..437aa17d02dc --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentssettings_client.go @@ -0,0 +1,192 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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" +) + +// DatabaseSQLVulnerabilityAssessmentsSettingsClient contains the methods for the DatabaseSQLVulnerabilityAssessmentsSettings group. +// Don't use this type directly, use NewDatabaseSQLVulnerabilityAssessmentsSettingsClient() instead. +type DatabaseSQLVulnerabilityAssessmentsSettingsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewDatabaseSQLVulnerabilityAssessmentsSettingsClient creates a new instance of DatabaseSQLVulnerabilityAssessmentsSettingsClient 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 NewDatabaseSQLVulnerabilityAssessmentsSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseSQLVulnerabilityAssessmentsSettingsClient, error) { + cl, err := arm.NewClient(moduleName+".DatabaseSQLVulnerabilityAssessmentsSettingsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DatabaseSQLVulnerabilityAssessmentsSettingsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Gets SQL Vulnerability Assessment policy for database. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the SQL Vulnerability Assessment. +// - options - DatabaseSQLVulnerabilityAssessmentsSettingsClientGetOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentsSettingsClient.Get +// method. +func (client *DatabaseSQLVulnerabilityAssessmentsSettingsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName SQLVulnerabilityAssessmentName, options *DatabaseSQLVulnerabilityAssessmentsSettingsClientGetOptions) (DatabaseSQLVulnerabilityAssessmentsSettingsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, options) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentsSettingsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentsSettingsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseSQLVulnerabilityAssessmentsSettingsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *DatabaseSQLVulnerabilityAssessmentsSettingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName SQLVulnerabilityAssessmentName, options *DatabaseSQLVulnerabilityAssessmentsSettingsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *DatabaseSQLVulnerabilityAssessmentsSettingsClient) getHandleResponse(resp *http.Response) (DatabaseSQLVulnerabilityAssessmentsSettingsClientGetResponse, error) { + result := DatabaseSQLVulnerabilityAssessmentsSettingsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessment); err != nil { + return DatabaseSQLVulnerabilityAssessmentsSettingsClientGetResponse{}, err + } + return result, nil +} + +// NewListByDatabasePager - Lists SQL Vulnerability Assessment policies associated with a database. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseOptions contains the optional parameters for the +// DatabaseSQLVulnerabilityAssessmentsSettingsClient.NewListByDatabasePager method. +func (client *DatabaseSQLVulnerabilityAssessmentsSettingsClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseOptions) *runtime.Pager[DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse] { + return runtime.NewPager(runtime.PagingHandler[DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse]{ + More: func(page DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse) (DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByDatabaseCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse{}, runtime.NewResponseError(resp) + } + return client.listByDatabaseHandleResponse(resp) + }, + }) +} + +// listByDatabaseCreateRequest creates the ListByDatabase request. +func (client *DatabaseSQLVulnerabilityAssessmentsSettingsClient) listByDatabaseCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-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 *DatabaseSQLVulnerabilityAssessmentsSettingsClient) listByDatabaseHandleResponse(resp *http.Response) (DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse, error) { + result := DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessmentListResult); err != nil { + return DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentssettings_client_example_test.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentssettings_client_example_test.go new file mode 100644 index 000000000000..28afa967c8d8 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentssettings_client_example_test.go @@ -0,0 +1,82 @@ +//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_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentListByDatabase.json +func ExampleDatabaseSQLVulnerabilityAssessmentsSettingsClient_NewListByDatabasePager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewDatabaseSQLVulnerabilityAssessmentsSettingsClient().NewListByDatabasePager("vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.VulnerabilityAssessmentListResult = armsql.VulnerabilityAssessmentListResult{ + // Value: []*armsql.VulnerabilityAssessment{ + // { + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/sqlVulnerabilityAssessments/default"), + // Properties: &armsql.VulnerabilityAssessmentPolicyProperties{ + // State: to.Ptr(armsql.SQLVulnerabilityAssessmentStateEnabled), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentGet.json +func ExampleDatabaseSQLVulnerabilityAssessmentsSettingsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDatabaseSQLVulnerabilityAssessmentsSettingsClient().Get(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb", armsql.SQLVulnerabilityAssessmentNameDefault, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.VulnerabilityAssessment = armsql.VulnerabilityAssessment{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/sqlVulnerabilityAssessments/default"), + // Properties: &armsql.VulnerabilityAssessmentPolicyProperties{ + // State: to.Ptr(armsql.SQLVulnerabilityAssessmentStateEnabled), + // }, + // } +} diff --git a/sdk/resourcemanager/sql/armsql/databasetables_client.go b/sdk/resourcemanager/sql/armsql/databasetables_client.go index dd0b78b97ea6..dfb40fcc1c92 100644 --- a/sdk/resourcemanager/sql/armsql/databasetables_client.go +++ b/sdk/resourcemanager/sql/armsql/databasetables_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -56,18 +55,21 @@ func NewDatabaseTablesClient(subscriptionID string, credential azcore.TokenCrede // - tableName - The name of the table. // - options - DatabaseTablesClientGetOptions contains the optional parameters for the DatabaseTablesClient.Get method. func (client *DatabaseTablesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, options *DatabaseTablesClientGetOptions) (DatabaseTablesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, schemaName, tableName, options) if err != nil { return DatabaseTablesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseTablesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabaseTablesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseTablesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/databasetables_client_example_test.go b/sdk/resourcemanager/sql/armsql/databasetables_client_example_test.go index bfbba8449322..3c40e4dac248 100644 --- a/sdk/resourcemanager/sql/armsql/databasetables_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/databasetables_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseTableListBySchema.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -55,7 +55,7 @@ func ExampleDatabaseTablesClient_NewListBySchemaPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseTableGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/databaseusages_client.go b/sdk/resourcemanager/sql/armsql/databaseusages_client.go index 0d0b4090cdf0..2804f2441aa8 100644 --- a/sdk/resourcemanager/sql/armsql/databaseusages_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseusages_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // 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/databaseusages_client_example_test.go b/sdk/resourcemanager/sql/armsql/databaseusages_client_example_test.go index d7b42588deaa..173f2794e1eb 100644 --- a/sdk/resourcemanager/sql/armsql/databaseusages_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/databaseusages_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/GetDatabaseUsages.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentrulebaselines_client.go b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentrulebaselines_client.go index 2a907952975c..3746fd7c88d8 100644 --- a/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentrulebaselines_client.go +++ b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentrulebaselines_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -60,18 +59,21 @@ func NewDatabaseVulnerabilityAssessmentRuleBaselinesClient(subscriptionID string // - options - DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions contains the optional parameters for // the DatabaseVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate method. func (client *DatabaseVulnerabilityAssessmentRuleBaselinesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName, parameters DatabaseVulnerabilityAssessmentRuleBaseline, options *DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions) (DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, ruleID, baselineName, parameters, options) if err != nil { return DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -113,7 +115,10 @@ func (client *DatabaseVulnerabilityAssessmentRuleBaselinesClient) createOrUpdate reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -140,16 +145,18 @@ func (client *DatabaseVulnerabilityAssessmentRuleBaselinesClient) createOrUpdate // - options - DatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentRuleBaselinesClient.Delete // method. func (client *DatabaseVulnerabilityAssessmentRuleBaselinesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName, options *DatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions) (DatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, ruleID, baselineName, options) if err != nil { return DatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, err } return DatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, nil } @@ -210,18 +217,21 @@ func (client *DatabaseVulnerabilityAssessmentRuleBaselinesClient) deleteCreateRe // - options - DatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentRuleBaselinesClient.Get // method. func (client *DatabaseVulnerabilityAssessmentRuleBaselinesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName, options *DatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions) (DatabaseVulnerabilityAssessmentRuleBaselinesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, ruleID, baselineName, options) if err != nil { return DatabaseVulnerabilityAssessmentRuleBaselinesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseVulnerabilityAssessmentRuleBaselinesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabaseVulnerabilityAssessmentRuleBaselinesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseVulnerabilityAssessmentRuleBaselinesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentrulebaselines_client_example_test.go b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentrulebaselines_client_example_test.go index 7f5955bfefc8..9accc2ac5b41 100644 --- a/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentrulebaselines_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentrulebaselines_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentRuleBaselineGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -62,7 +62,7 @@ func ExampleDatabaseVulnerabilityAssessmentRuleBaselinesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentRuleBaselineCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -126,7 +126,7 @@ func ExampleDatabaseVulnerabilityAssessmentRuleBaselinesClient_CreateOrUpdate() // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentRuleBaselineDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessments_client.go b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessments_client.go index 226b78d50b8e..1a58243174d0 100644 --- a/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessments_client.go +++ b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessments_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -57,18 +56,21 @@ func NewDatabaseVulnerabilityAssessmentsClient(subscriptionID string, credential // - options - DatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.CreateOrUpdate // method. func (client *DatabaseVulnerabilityAssessmentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, parameters DatabaseVulnerabilityAssessment, options *DatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions) (DatabaseVulnerabilityAssessmentsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, parameters, options) if err != nil { return DatabaseVulnerabilityAssessmentsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseVulnerabilityAssessmentsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return DatabaseVulnerabilityAssessmentsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return DatabaseVulnerabilityAssessmentsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -102,7 +104,10 @@ func (client *DatabaseVulnerabilityAssessmentsClient) createOrUpdateCreateReques reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -126,16 +131,18 @@ func (client *DatabaseVulnerabilityAssessmentsClient) createOrUpdateHandleRespon // - options - DatabaseVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.Delete // method. func (client *DatabaseVulnerabilityAssessmentsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *DatabaseVulnerabilityAssessmentsClientDeleteOptions) (DatabaseVulnerabilityAssessmentsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, options) if err != nil { return DatabaseVulnerabilityAssessmentsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseVulnerabilityAssessmentsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabaseVulnerabilityAssessmentsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseVulnerabilityAssessmentsClientDeleteResponse{}, err } return DatabaseVulnerabilityAssessmentsClientDeleteResponse{}, nil } @@ -185,18 +192,21 @@ func (client *DatabaseVulnerabilityAssessmentsClient) deleteCreateRequest(ctx co // - options - DatabaseVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.Get // method. func (client *DatabaseVulnerabilityAssessmentsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *DatabaseVulnerabilityAssessmentsClientGetOptions) (DatabaseVulnerabilityAssessmentsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, options) if err != nil { return DatabaseVulnerabilityAssessmentsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseVulnerabilityAssessmentsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabaseVulnerabilityAssessmentsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseVulnerabilityAssessmentsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessments_client_example_test.go b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessments_client_example_test.go index 1dc8da8d1ad2..86bd7953f6db 100644 --- a/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessments_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessments_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -52,7 +52,7 @@ func ExampleDatabaseVulnerabilityAssessmentsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentCreateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentCreateMax.json func ExampleDatabaseVulnerabilityAssessmentsClient_CreateOrUpdate_createADatabasesVulnerabilityAssessmentWithAllParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -99,7 +99,7 @@ func ExampleDatabaseVulnerabilityAssessmentsClient_CreateOrUpdate_createADatabas // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentCreateStorageAccessKeyMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentCreateStorageAccessKeyMin.json func ExampleDatabaseVulnerabilityAssessmentsClient_CreateOrUpdate_createADatabasesVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAccessKeyIsSpecified() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -137,7 +137,7 @@ func ExampleDatabaseVulnerabilityAssessmentsClient_CreateOrUpdate_createADatabas // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentCreateContainerSasKeyMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentCreateContainerSasKeyMin.json func ExampleDatabaseVulnerabilityAssessmentsClient_CreateOrUpdate_createADatabasesVulnerabilityAssessmentWithMinimalParametersWhenStorageContainerSasKeyIsSpecified() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -175,7 +175,7 @@ func ExampleDatabaseVulnerabilityAssessmentsClient_CreateOrUpdate_createADatabas // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -192,7 +192,7 @@ func ExampleDatabaseVulnerabilityAssessmentsClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentListByDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentscans_client.go b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentscans_client.go index 79bd9727158e..3f6e910fc324 100644 --- a/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentscans_client.go +++ b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentscans_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -57,18 +56,21 @@ func NewDatabaseVulnerabilityAssessmentScansClient(subscriptionID string, creden // - options - DatabaseVulnerabilityAssessmentScansClientExportOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.Export // method. func (client *DatabaseVulnerabilityAssessmentScansClient) Export(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, scanID string, options *DatabaseVulnerabilityAssessmentScansClientExportOptions) (DatabaseVulnerabilityAssessmentScansClientExportResponse, error) { + var err error req, err := client.exportCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, scanID, options) if err != nil { return DatabaseVulnerabilityAssessmentScansClientExportResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseVulnerabilityAssessmentScansClientExportResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return DatabaseVulnerabilityAssessmentScansClientExportResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return DatabaseVulnerabilityAssessmentScansClientExportResponse{}, err } - return client.exportHandleResponse(resp) + resp, err := client.exportHandleResponse(httpResp) + return resp, err } // exportCreateRequest creates the Export request. @@ -131,18 +133,21 @@ func (client *DatabaseVulnerabilityAssessmentScansClient) exportHandleResponse(r // - options - DatabaseVulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.Get // method. func (client *DatabaseVulnerabilityAssessmentScansClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, scanID string, options *DatabaseVulnerabilityAssessmentScansClientGetOptions) (DatabaseVulnerabilityAssessmentScansClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, scanID, options) if err != nil { return DatabaseVulnerabilityAssessmentScansClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatabaseVulnerabilityAssessmentScansClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabaseVulnerabilityAssessmentScansClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatabaseVulnerabilityAssessmentScansClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -210,7 +215,8 @@ func (client *DatabaseVulnerabilityAssessmentScansClient) BeginInitiateScan(ctx if err != nil { return nil, err } - return runtime.NewPoller[DatabaseVulnerabilityAssessmentScansClientInitiateScanResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DatabaseVulnerabilityAssessmentScansClientInitiateScanResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DatabaseVulnerabilityAssessmentScansClientInitiateScanResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -221,18 +227,20 @@ func (client *DatabaseVulnerabilityAssessmentScansClient) BeginInitiateScan(ctx // // Generated from API version 2020-11-01-preview func (client *DatabaseVulnerabilityAssessmentScansClient) initiateScan(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, scanID string, options *DatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions) (*http.Response, error) { + var err error req, err := client.initiateScanCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, scanID, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // initiateScanCreateRequest creates the InitiateScan request. diff --git a/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentscans_client_example_test.go b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentscans_client_example_test.go index 82a1e6798863..537138bd5211 100644 --- a/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentscans_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentscans_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScansExecute.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -38,7 +38,7 @@ func ExampleDatabaseVulnerabilityAssessmentScansClient_BeginInitiateScan() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScanRecordsListByDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -117,7 +117,7 @@ func ExampleDatabaseVulnerabilityAssessmentScansClient_NewListByDatabasePager() } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScanRecordsGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -153,7 +153,7 @@ func ExampleDatabaseVulnerabilityAssessmentScansClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScanExport.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/datamaskingpolicies_client.go b/sdk/resourcemanager/sql/armsql/datamaskingpolicies_client.go index 8f4a5acbd7ce..5de5c533779c 100644 --- a/sdk/resourcemanager/sql/armsql/datamaskingpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/datamaskingpolicies_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -56,18 +55,21 @@ func NewDataMaskingPoliciesClient(subscriptionID string, credential azcore.Token // - options - DataMaskingPoliciesClientCreateOrUpdateOptions contains the optional parameters for the DataMaskingPoliciesClient.CreateOrUpdate // method. func (client *DataMaskingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DataMaskingPolicy, options *DataMaskingPoliciesClientCreateOrUpdateOptions) (DataMaskingPoliciesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { return DataMaskingPoliciesClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DataMaskingPoliciesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DataMaskingPoliciesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DataMaskingPoliciesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -98,7 +100,10 @@ func (client *DataMaskingPoliciesClient) createOrUpdateCreateRequest(ctx context reqQP.Set("api-version", "2014-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -120,18 +125,21 @@ func (client *DataMaskingPoliciesClient) createOrUpdateHandleResponse(resp *http // - databaseName - The name of the database. // - options - DataMaskingPoliciesClientGetOptions contains the optional parameters for the DataMaskingPoliciesClient.Get method. func (client *DataMaskingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DataMaskingPoliciesClientGetOptions) (DataMaskingPoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { return DataMaskingPoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DataMaskingPoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DataMaskingPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DataMaskingPoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/datamaskingpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/datamaskingpolicies_client_example_test.go index 155510f76192..6dd09499c510 100644 --- a/sdk/resourcemanager/sql/armsql/datamaskingpolicies_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/datamaskingpolicies_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyCreateOrUpdateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyCreateOrUpdateMax.json func ExampleDataMaskingPoliciesClient_CreateOrUpdate_createOrUpdateDataMaskingPolicyMax() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -55,7 +55,7 @@ func ExampleDataMaskingPoliciesClient_CreateOrUpdate_createOrUpdateDataMaskingPo // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyCreateOrUpdateMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyCreateOrUpdateMin.json func ExampleDataMaskingPoliciesClient_CreateOrUpdate_createOrUpdateDataMaskingPolicyMin() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -91,7 +91,7 @@ func ExampleDataMaskingPoliciesClient_CreateOrUpdate_createOrUpdateDataMaskingPo // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyGet.json func ExampleDataMaskingPoliciesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/sql/armsql/datamaskingrules_client.go b/sdk/resourcemanager/sql/armsql/datamaskingrules_client.go index 01e0c459ff41..619e7f8b59fb 100644 --- a/sdk/resourcemanager/sql/armsql/datamaskingrules_client.go +++ b/sdk/resourcemanager/sql/armsql/datamaskingrules_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -57,18 +56,21 @@ func NewDataMaskingRulesClient(subscriptionID string, credential azcore.TokenCre // - options - DataMaskingRulesClientCreateOrUpdateOptions contains the optional parameters for the DataMaskingRulesClient.CreateOrUpdate // method. func (client *DataMaskingRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingRuleName string, parameters DataMaskingRule, options *DataMaskingRulesClientCreateOrUpdateOptions) (DataMaskingRulesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, dataMaskingRuleName, parameters, options) if err != nil { return DataMaskingRulesClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DataMaskingRulesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return DataMaskingRulesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return DataMaskingRulesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -103,7 +105,10 @@ func (client *DataMaskingRulesClient) createOrUpdateCreateRequest(ctx context.Co reqQP.Set("api-version", "2014-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. diff --git a/sdk/resourcemanager/sql/armsql/datamaskingrules_client_example_test.go b/sdk/resourcemanager/sql/armsql/datamaskingrules_client_example_test.go index 00819454bfdf..cd0e4413d9c0 100644 --- a/sdk/resourcemanager/sql/armsql/datamaskingrules_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/datamaskingrules_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateDefaultMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateDefaultMax.json func ExampleDataMaskingRulesClient_CreateOrUpdate_createUpdateDataMaskingRuleForDefaultMax() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -61,7 +61,7 @@ func ExampleDataMaskingRulesClient_CreateOrUpdate_createUpdateDataMaskingRuleFor // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateDefaultMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateDefaultMin.json func ExampleDataMaskingRulesClient_CreateOrUpdate_createUpdateDataMaskingRuleForDefaultMin() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -101,7 +101,7 @@ func ExampleDataMaskingRulesClient_CreateOrUpdate_createUpdateDataMaskingRuleFor // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateNumber.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateNumber.json func ExampleDataMaskingRulesClient_CreateOrUpdate_createUpdateDataMaskingRuleForNumbers() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -145,7 +145,7 @@ func ExampleDataMaskingRulesClient_CreateOrUpdate_createUpdateDataMaskingRuleFor // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateText.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateText.json func ExampleDataMaskingRulesClient_CreateOrUpdate_createUpdateDataMaskingRuleForText() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -191,7 +191,7 @@ func ExampleDataMaskingRulesClient_CreateOrUpdate_createUpdateDataMaskingRuleFor // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleList.json func ExampleDataMaskingRulesClient_NewListByDatabasePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/sql/armsql/datawarehouseuseractivities_client.go b/sdk/resourcemanager/sql/armsql/datawarehouseuseractivities_client.go index 9024df39abe2..036c6cfaf055 100644 --- a/sdk/resourcemanager/sql/armsql/datawarehouseuseractivities_client.go +++ b/sdk/resourcemanager/sql/armsql/datawarehouseuseractivities_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -56,18 +55,21 @@ func NewDataWarehouseUserActivitiesClient(subscriptionID string, credential azco // - options - DataWarehouseUserActivitiesClientGetOptions contains the optional parameters for the DataWarehouseUserActivitiesClient.Get // method. func (client *DataWarehouseUserActivitiesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataWarehouseUserActivityName DataWarehouseUserActivityName, options *DataWarehouseUserActivitiesClientGetOptions) (DataWarehouseUserActivitiesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, dataWarehouseUserActivityName, options) if err != nil { return DataWarehouseUserActivitiesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DataWarehouseUserActivitiesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DataWarehouseUserActivitiesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DataWarehouseUserActivitiesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/datawarehouseuseractivities_client_example_test.go b/sdk/resourcemanager/sql/armsql/datawarehouseuseractivities_client_example_test.go index e319c70ea0fe..6cc0ebbbcf22 100644 --- a/sdk/resourcemanager/sql/armsql/datawarehouseuseractivities_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/datawarehouseuseractivities_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetDataWarehouseUserActivities.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -45,7 +45,7 @@ func ExampleDataWarehouseUserActivitiesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListDataWarehouseUserActivities.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/deletedservers_client.go b/sdk/resourcemanager/sql/armsql/deletedservers_client.go index 6d53d727f713..31247df5b587 100644 --- a/sdk/resourcemanager/sql/armsql/deletedservers_client.go +++ b/sdk/resourcemanager/sql/armsql/deletedservers_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -52,18 +51,21 @@ func NewDeletedServersClient(subscriptionID string, credential azcore.TokenCrede // - deletedServerName - The name of the deleted server. // - options - DeletedServersClientGetOptions contains the optional parameters for the DeletedServersClient.Get method. func (client *DeletedServersClient) Get(ctx context.Context, locationName string, deletedServerName string, options *DeletedServersClientGetOptions) (DeletedServersClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, locationName, deletedServerName, options) if err != nil { return DeletedServersClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DeletedServersClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DeletedServersClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DeletedServersClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -239,7 +241,8 @@ func (client *DeletedServersClient) BeginRecover(ctx context.Context, locationNa if err != nil { return nil, err } - return runtime.NewPoller[DeletedServersClientRecoverResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DeletedServersClientRecoverResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DeletedServersClientRecoverResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -250,18 +253,20 @@ func (client *DeletedServersClient) BeginRecover(ctx context.Context, locationNa // // Generated from API version 2020-11-01-preview func (client *DeletedServersClient) recoverOperation(ctx context.Context, locationName string, deletedServerName string, options *DeletedServersClientBeginRecoverOptions) (*http.Response, error) { + var err error req, err := client.recoverCreateRequest(ctx, locationName, deletedServerName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // recoverCreateRequest creates the Recover request. diff --git a/sdk/resourcemanager/sql/armsql/deletedservers_client_example_test.go b/sdk/resourcemanager/sql/armsql/deletedservers_client_example_test.go index 5b71839fc7c2..dbbfb2883f5f 100644 --- a/sdk/resourcemanager/sql/armsql/deletedservers_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/deletedservers_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -67,7 +67,7 @@ func ExampleDeletedServersClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -98,7 +98,7 @@ func ExampleDeletedServersClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -148,7 +148,7 @@ func ExampleDeletedServersClient_NewListByLocationPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerRecover.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/distributedavailabilitygroups_client.go b/sdk/resourcemanager/sql/armsql/distributedavailabilitygroups_client.go index 4f000d16e0f2..d0749baa4908 100644 --- a/sdk/resourcemanager/sql/armsql/distributedavailabilitygroups_client.go +++ b/sdk/resourcemanager/sql/armsql/distributedavailabilitygroups_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -61,7 +60,8 @@ func (client *DistributedAvailabilityGroupsClient) BeginCreateOrUpdate(ctx conte if err != nil { return nil, err } - return runtime.NewPoller[DistributedAvailabilityGroupsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DistributedAvailabilityGroupsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DistributedAvailabilityGroupsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *DistributedAvailabilityGroupsClient) BeginCreateOrUpdate(ctx conte // // Generated from API version 2021-11-01-preview func (client *DistributedAvailabilityGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroup, options *DistributedAvailabilityGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -113,7 +115,10 @@ func (client *DistributedAvailabilityGroupsClient) createOrUpdateCreateRequest(c 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) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Drops a distributed availability group between Sql On-Prem and Sql Managed Instance. @@ -132,7 +137,8 @@ func (client *DistributedAvailabilityGroupsClient) BeginDelete(ctx context.Conte if err != nil { return nil, err } - return runtime.NewPoller[DistributedAvailabilityGroupsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DistributedAvailabilityGroupsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DistributedAvailabilityGroupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -143,18 +149,20 @@ func (client *DistributedAvailabilityGroupsClient) BeginDelete(ctx context.Conte // // Generated from API version 2021-11-01-preview func (client *DistributedAvailabilityGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, options *DistributedAvailabilityGroupsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -197,18 +205,21 @@ func (client *DistributedAvailabilityGroupsClient) deleteCreateRequest(ctx conte // - options - DistributedAvailabilityGroupsClientGetOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.Get // method. func (client *DistributedAvailabilityGroupsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, options *DistributedAvailabilityGroupsClientGetOptions) (DistributedAvailabilityGroupsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, options) if err != nil { return DistributedAvailabilityGroupsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DistributedAvailabilityGroupsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DistributedAvailabilityGroupsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DistributedAvailabilityGroupsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -338,7 +349,8 @@ func (client *DistributedAvailabilityGroupsClient) BeginUpdate(ctx context.Conte if err != nil { return nil, err } - return runtime.NewPoller[DistributedAvailabilityGroupsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DistributedAvailabilityGroupsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DistributedAvailabilityGroupsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -349,18 +361,20 @@ func (client *DistributedAvailabilityGroupsClient) BeginUpdate(ctx context.Conte // // Generated from API version 2021-11-01-preview func (client *DistributedAvailabilityGroupsClient) update(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroup, options *DistributedAvailabilityGroupsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -390,5 +404,8 @@ func (client *DistributedAvailabilityGroupsClient) updateCreateRequest(ctx conte 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) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/distributedavailabilitygroups_client_example_test.go b/sdk/resourcemanager/sql/armsql/distributedavailabilitygroups_client_example_test.go index 122d32bdaa3d..a73b8f5c16fa 100644 --- a/sdk/resourcemanager/sql/armsql/distributedavailabilitygroups_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/distributedavailabilitygroups_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsListByInstance.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -76,7 +76,7 @@ func ExampleDistributedAvailabilityGroupsClient_NewListByInstancePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -111,7 +111,7 @@ func ExampleDistributedAvailabilityGroupsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -153,7 +153,7 @@ func ExampleDistributedAvailabilityGroupsClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -174,7 +174,7 @@ func ExampleDistributedAvailabilityGroupsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/elasticpoolactivities_client.go b/sdk/resourcemanager/sql/armsql/elasticpoolactivities_client.go index 8089bece09da..341e51f0a4ae 100644 --- a/sdk/resourcemanager/sql/armsql/elasticpoolactivities_client.go +++ b/sdk/resourcemanager/sql/armsql/elasticpoolactivities_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // 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/elasticpoolactivities_client_example_test.go b/sdk/resourcemanager/sql/armsql/elasticpoolactivities_client_example_test.go index f5520523a12f..ff335c00231f 100644 --- a/sdk/resourcemanager/sql/armsql/elasticpoolactivities_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/elasticpoolactivities_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ElasticPoolActivityList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/elasticpooldatabaseactivities_client.go b/sdk/resourcemanager/sql/armsql/elasticpooldatabaseactivities_client.go index 0d9dd3ba2ead..0f2be039b392 100644 --- a/sdk/resourcemanager/sql/armsql/elasticpooldatabaseactivities_client.go +++ b/sdk/resourcemanager/sql/armsql/elasticpooldatabaseactivities_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // 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/elasticpooldatabaseactivities_client_example_test.go b/sdk/resourcemanager/sql/armsql/elasticpooldatabaseactivities_client_example_test.go index 18c7fae9fdc4..b93f00d411c7 100644 --- a/sdk/resourcemanager/sql/armsql/elasticpooldatabaseactivities_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/elasticpooldatabaseactivities_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ElasticPoolDatabaseActivityList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/elasticpooloperations_client.go b/sdk/resourcemanager/sql/armsql/elasticpooloperations_client.go index b54ad0d09ea4..b442b231d6af 100644 --- a/sdk/resourcemanager/sql/armsql/elasticpooloperations_client.go +++ b/sdk/resourcemanager/sql/armsql/elasticpooloperations_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -55,16 +54,18 @@ func NewElasticPoolOperationsClient(subscriptionID string, credential azcore.Tok // - options - ElasticPoolOperationsClientCancelOptions contains the optional parameters for the ElasticPoolOperationsClient.Cancel // method. func (client *ElasticPoolOperationsClient) Cancel(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, operationID string, options *ElasticPoolOperationsClientCancelOptions) (ElasticPoolOperationsClientCancelResponse, error) { + var err error req, err := client.cancelCreateRequest(ctx, resourceGroupName, serverName, elasticPoolName, operationID, options) if err != nil { return ElasticPoolOperationsClientCancelResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ElasticPoolOperationsClientCancelResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ElasticPoolOperationsClientCancelResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ElasticPoolOperationsClientCancelResponse{}, err } return ElasticPoolOperationsClientCancelResponse{}, nil } diff --git a/sdk/resourcemanager/sql/armsql/elasticpooloperations_client_example_test.go b/sdk/resourcemanager/sql/armsql/elasticpooloperations_client_example_test.go index c9de302b8473..a6c0d1b01e4a 100644 --- a/sdk/resourcemanager/sql/armsql/elasticpooloperations_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/elasticpooloperations_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelElasticPoolOperation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -34,7 +34,7 @@ func ExampleElasticPoolOperationsClient_Cancel() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListElasticPoolOperations.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/elasticpools_client.go b/sdk/resourcemanager/sql/armsql/elasticpools_client.go index 498c050a70b5..8a4df3ccab7c 100644 --- a/sdk/resourcemanager/sql/armsql/elasticpools_client.go +++ b/sdk/resourcemanager/sql/armsql/elasticpools_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -48,7 +47,7 @@ func NewElasticPoolsClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Creates or updates an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01-preview +// Generated from API version 2022-08-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. @@ -62,7 +61,10 @@ func (client *ElasticPoolsClient) BeginCreateOrUpdate(ctx context.Context, resou if err != nil { return nil, err } - return runtime.NewPoller[ElasticPoolsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ElasticPoolsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ElasticPoolsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +73,22 @@ func (client *ElasticPoolsClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Creates or updates an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01-preview +// Generated from API version 2022-08-01-preview func (client *ElasticPoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, parameters ElasticPool, options *ElasticPoolsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, elasticPoolName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -111,16 +115,19 @@ func (client *ElasticPoolsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01-preview +// Generated from API version 2022-08-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. @@ -133,7 +140,10 @@ func (client *ElasticPoolsClient) BeginDelete(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller[ElasticPoolsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ElasticPoolsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ElasticPoolsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -142,20 +152,22 @@ func (client *ElasticPoolsClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Deletes an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01-preview +// Generated from API version 2022-08-01-preview func (client *ElasticPoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, elasticPoolName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -182,7 +194,7 @@ func (client *ElasticPoolsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -190,7 +202,7 @@ func (client *ElasticPoolsClient) deleteCreateRequest(ctx context.Context, resou // BeginFailover - Failovers an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01-preview +// Generated from API version 2022-08-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. @@ -203,7 +215,8 @@ func (client *ElasticPoolsClient) BeginFailover(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller[ElasticPoolsClientFailoverResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ElasticPoolsClientFailoverResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ElasticPoolsClientFailoverResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -212,20 +225,22 @@ func (client *ElasticPoolsClient) BeginFailover(ctx context.Context, resourceGro // Failover - Failovers an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01-preview +// Generated from API version 2022-08-01-preview func (client *ElasticPoolsClient) failover(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolsClientBeginFailoverOptions) (*http.Response, error) { + var err error req, err := client.failoverCreateRequest(ctx, resourceGroupName, serverName, elasticPoolName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // failoverCreateRequest creates the Failover request. @@ -252,7 +267,7 @@ func (client *ElasticPoolsClient) failoverCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -260,25 +275,28 @@ func (client *ElasticPoolsClient) failoverCreateRequest(ctx context.Context, res // Get - Gets an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01-preview +// Generated from API version 2022-08-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. // - elasticPoolName - The name of the elastic pool. // - options - ElasticPoolsClientGetOptions contains the optional parameters for the ElasticPoolsClient.Get method. func (client *ElasticPoolsClient) Get(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolsClientGetOptions) (ElasticPoolsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, elasticPoolName, options) if err != nil { return ElasticPoolsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ElasticPoolsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ElasticPoolsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ElasticPoolsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -305,7 +323,7 @@ func (client *ElasticPoolsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -322,7 +340,7 @@ func (client *ElasticPoolsClient) getHandleResponse(resp *http.Response) (Elasti // NewListByServerPager - Gets all elastic pools in a server. // -// Generated from API version 2021-08-01-preview +// Generated from API version 2022-08-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. @@ -379,7 +397,7 @@ func (client *ElasticPoolsClient) listByServerCreateRequest(ctx context.Context, if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(*options.Skip, 10)) } - reqQP.Set("api-version", "2021-08-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -539,7 +557,7 @@ func (client *ElasticPoolsClient) listMetricsHandleResponse(resp *http.Response) // BeginUpdate - Updates an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01-preview +// Generated from API version 2022-08-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. @@ -553,7 +571,10 @@ func (client *ElasticPoolsClient) BeginUpdate(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller[ElasticPoolsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ElasticPoolsClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ElasticPoolsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -562,20 +583,22 @@ func (client *ElasticPoolsClient) BeginUpdate(ctx context.Context, resourceGroup // Update - Updates an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01-preview +// Generated from API version 2022-08-01-preview func (client *ElasticPoolsClient) update(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, parameters ElasticPoolUpdate, options *ElasticPoolsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, elasticPoolName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -602,8 +625,11 @@ func (client *ElasticPoolsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/elasticpools_client_example_test.go b/sdk/resourcemanager/sql/armsql/elasticpools_client_example_test.go index 46fe70a62978..705eec2eb8eb 100644 --- a/sdk/resourcemanager/sql/armsql/elasticpools_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/elasticpools_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ElasticPoolMetricsListWithFilter.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ElasticPoolMetricsListWithFilter.json func ExampleElasticPoolsClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -81,7 +81,7 @@ func ExampleElasticPoolsClient_NewListMetricsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ElasticPoolMetricsDefinitionsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ElasticPoolMetricsDefinitionsList.json func ExampleElasticPoolsClient_NewListMetricDefinitionsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -479,7 +479,7 @@ func ExampleElasticPoolsClient_NewListMetricDefinitionsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolListByServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolListByServer.json func ExampleElasticPoolsClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -569,7 +569,7 @@ func ExampleElasticPoolsClient_NewListByServerPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/HyperscaleElasticPoolGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/HyperscaleElasticPoolGet.json func ExampleElasticPoolsClient_Get_getAHyperscaleElasticPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -615,7 +615,7 @@ func ExampleElasticPoolsClient_Get_getAHyperscaleElasticPool() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolGet.json func ExampleElasticPoolsClient_Get_getAnElasticPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -658,7 +658,157 @@ func ExampleElasticPoolsClient_Get_getAnElasticPool() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/HyperscaleElasticPoolCreateOrUpdateSetHighAvailabilityReplicaCount.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetElasticPoolWithAvailabilityZone.json +func ExampleElasticPoolsClient_Get_getAnElasticPoolWithAvailabilityZone() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewElasticPoolsClient().Get(ctx, "sqlcrudtest-2369", "sqlcrudtest-8069", "sqlcrudtest-8102", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ElasticPool = armsql.ElasticPool{ + // Name: to.Ptr("sqlcrudtest-8102"), + // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), + // Location: to.Ptr("Japan East"), + // Properties: &armsql.ElasticPoolProperties{ + // AvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-10T01:25:25.033Z"); return t}()), + // LicenseType: to.Ptr(armsql.ElasticPoolLicenseTypeLicenseIncluded), + // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_1"), + // MaxSizeBytes: to.Ptr[int64](5242880000), + // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ + // MaxCapacity: to.Ptr[float64](1), + // MinCapacity: to.Ptr[float64](0.25), + // }, + // State: to.Ptr(armsql.ElasticPoolStateReady), + // ZoneRedundant: to.Ptr(true), + // }, + // SKU: &armsql.SKU{ + // Name: to.Ptr("GP_Gen5_2"), + // Capacity: to.Ptr[int32](2), + // Tier: to.Ptr("GeneralPurpose"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolGetWithPreferredEnclaveType.json +func ExampleElasticPoolsClient_Get_getAnElasticPoolWithPreferredEnclaveTypeParameter() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewElasticPoolsClient().Get(ctx, "sqlcrudtest-2369", "sqlcrudtest-8069", "sqlcrudtest-8102", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ElasticPool = armsql.ElasticPool{ + // Name: to.Ptr("sqlcrudtest-8102"), + // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), + // Location: to.Ptr("Japan East"), + // Kind: to.Ptr("vcore,pool"), + // Properties: &armsql.ElasticPoolProperties{ + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-26T03:46:20.57Z"); return t}()), + // HighAvailabilityReplicaCount: to.Ptr[int32](2), + // LicenseType: to.Ptr(armsql.ElasticPoolLicenseTypeLicenseIncluded), + // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"), + // MaxSizeBytes: to.Ptr[int64](0), + // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ + // MaxCapacity: to.Ptr[float64](4), + // MinCapacity: to.Ptr[float64](0), + // }, + // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS), + // State: to.Ptr(armsql.ElasticPoolStateReady), + // ZoneRedundant: to.Ptr(false), + // }, + // SKU: &armsql.SKU{ + // Name: to.Ptr("GP_Gen5"), + // Capacity: to.Ptr[int32](4), + // Family: to.Ptr("Gen5"), + // Tier: to.Ptr("GeneralPurpose"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateElasticPoolWithAvailabilityZone.json +func ExampleElasticPoolsClient_BeginCreateOrUpdate_createOrUpdateAnElasticPoolWithAvailabilityZone() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewElasticPoolsClient().BeginCreateOrUpdate(ctx, "sqlcrudtest-2369", "sqlcrudtest-8069", "sqlcrudtest-8102", armsql.ElasticPool{ + Location: to.Ptr("Japan East"), + Properties: &armsql.ElasticPoolProperties{ + AvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne), + PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ + MaxCapacity: to.Ptr[float64](2), + MinCapacity: to.Ptr[float64](0.25), + }, + ZoneRedundant: to.Ptr(true), + }, + 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ElasticPool = armsql.ElasticPool{ + // Name: to.Ptr("sqlcrudtest-8102"), + // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), + // Location: to.Ptr("Japan East"), + // Properties: &armsql.ElasticPoolProperties{ + // AvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-10T01:25:25.033Z"); return t}()), + // MaxSizeBytes: to.Ptr[int64](102400), + // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ + // MaxCapacity: to.Ptr[float64](2), + // MinCapacity: to.Ptr[float64](0.25), + // }, + // State: to.Ptr(armsql.ElasticPoolStateReady), + // ZoneRedundant: to.Ptr(true), + // }, + // SKU: &armsql.SKU{ + // Name: to.Ptr("StandardPool"), + // Capacity: to.Ptr[int32](100), + // Tier: to.Ptr("Standard"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/HyperscaleElasticPoolCreateOrUpdateSetHighAvailabilityReplicaCount.json func ExampleElasticPoolsClient_BeginCreateOrUpdate_createOrUpdateHyperscaleElasticPoolWithHighAvailabilityReplicaCountParameter() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -716,7 +866,7 @@ func ExampleElasticPoolsClient_BeginCreateOrUpdate_createOrUpdateHyperscaleElast // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolCreateOrUpdateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolCreateOrUpdateMax.json func ExampleElasticPoolsClient_BeginCreateOrUpdate_createOrUpdateElasticPoolWithAllParameter() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -773,7 +923,7 @@ func ExampleElasticPoolsClient_BeginCreateOrUpdate_createOrUpdateElasticPoolWith // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolCreateOrUpdateSetMaintenanceConfiguration.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolCreateOrUpdateSetMaintenanceConfiguration.json func ExampleElasticPoolsClient_BeginCreateOrUpdate_createOrUpdateElasticPoolWithMaintenanceConfigurationParameter() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -823,7 +973,7 @@ func ExampleElasticPoolsClient_BeginCreateOrUpdate_createOrUpdateElasticPoolWith // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolCreateOrUpdateMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolCreateOrUpdateMin.json func ExampleElasticPoolsClient_BeginCreateOrUpdate_createOrUpdateElasticPoolWithMinimumParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -869,7 +1019,123 @@ func ExampleElasticPoolsClient_BeginCreateOrUpdate_createOrUpdateElasticPoolWith // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolCreateWithDefaultPreferredEnclaveType.json +func ExampleElasticPoolsClient_BeginCreateOrUpdate_createOrUpdateElasticPoolWithPreferredEnclaveTypeParameterAsDefault() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewElasticPoolsClient().BeginCreateOrUpdate(ctx, "sqlcrudtest-2369", "sqlcrudtest-8069", "sqlcrudtest-8102", armsql.ElasticPool{ + Location: to.Ptr("Japan East"), + Properties: &armsql.ElasticPoolProperties{ + PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault), + }, + SKU: &armsql.SKU{ + Name: to.Ptr("GP_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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ElasticPool = armsql.ElasticPool{ + // Name: to.Ptr("sqlcrudtest-8102"), + // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), + // Location: to.Ptr("Japan East"), + // Kind: to.Ptr("vcore,pool"), + // Properties: &armsql.ElasticPoolProperties{ + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-26T03:46:20.57Z"); return t}()), + // LicenseType: to.Ptr(armsql.ElasticPoolLicenseTypeLicenseIncluded), + // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"), + // MaxSizeBytes: to.Ptr[int64](0), + // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ + // MaxCapacity: to.Ptr[float64](4), + // MinCapacity: to.Ptr[float64](0), + // }, + // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault), + // State: to.Ptr(armsql.ElasticPoolStateReady), + // ZoneRedundant: to.Ptr(false), + // }, + // SKU: &armsql.SKU{ + // Name: to.Ptr("GP_Gen5"), + // Capacity: to.Ptr[int32](4), + // Family: to.Ptr("Gen5"), + // Tier: to.Ptr("GeneralPurpose"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolCreateWithVBSPreferredEnclaveType.json +func ExampleElasticPoolsClient_BeginCreateOrUpdate_createOrUpdateElasticPoolWithPreferredEnclaveTypeParameterAsVbs() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewElasticPoolsClient().BeginCreateOrUpdate(ctx, "sqlcrudtest-2369", "sqlcrudtest-8069", "sqlcrudtest-8102", armsql.ElasticPool{ + Location: to.Ptr("Japan East"), + Properties: &armsql.ElasticPoolProperties{ + PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS), + }, + SKU: &armsql.SKU{ + Name: to.Ptr("GP_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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ElasticPool = armsql.ElasticPool{ + // Name: to.Ptr("sqlcrudtest-8102"), + // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), + // Location: to.Ptr("Japan East"), + // Kind: to.Ptr("vcore,pool"), + // Properties: &armsql.ElasticPoolProperties{ + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-26T03:46:20.57Z"); return t}()), + // LicenseType: to.Ptr(armsql.ElasticPoolLicenseTypeLicenseIncluded), + // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"), + // MaxSizeBytes: to.Ptr[int64](0), + // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ + // MaxCapacity: to.Ptr[float64](4), + // MinCapacity: to.Ptr[float64](0), + // }, + // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS), + // State: to.Ptr(armsql.ElasticPoolStateReady), + // ZoneRedundant: to.Ptr(false), + // }, + // SKU: &armsql.SKU{ + // Name: to.Ptr("GP_Gen5"), + // Capacity: to.Ptr[int32](4), + // Family: to.Ptr("Gen5"), + // Tier: to.Ptr("GeneralPurpose"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolDelete.json func ExampleElasticPoolsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -890,7 +1156,7 @@ func ExampleElasticPoolsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolUpdateAssignMaintenanceConfiguration.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolUpdateAssignMaintenanceConfiguration.json func ExampleElasticPoolsClient_BeginUpdate_assignsMaintenanceConfigurationToAnElasticPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -939,7 +1205,121 @@ func ExampleElasticPoolsClient_BeginUpdate_assignsMaintenanceConfigurationToAnEl // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolUpdateResetMaintenanceConfiguration.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolUpdateWithDefaultPreferredEnclaveType.json +func ExampleElasticPoolsClient_BeginUpdate_createOrUpdateElasticPoolWithPreferredEnclaveTypeParameterAsDefault() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewElasticPoolsClient().BeginUpdate(ctx, "sqlcrudtest-2369", "sqlcrudtest-8069", "sqlcrudtest-8102", armsql.ElasticPoolUpdate{ + Properties: &armsql.ElasticPoolUpdateProperties{ + PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault), + }, + SKU: &armsql.SKU{ + Name: to.Ptr("GP_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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ElasticPool = armsql.ElasticPool{ + // Name: to.Ptr("sqlcrudtest-8102"), + // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), + // Location: to.Ptr("Japan East"), + // Kind: to.Ptr("vcore,pool"), + // Properties: &armsql.ElasticPoolProperties{ + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-26T03:46:20.57Z"); return t}()), + // LicenseType: to.Ptr(armsql.ElasticPoolLicenseTypeLicenseIncluded), + // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"), + // MaxSizeBytes: to.Ptr[int64](0), + // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ + // MaxCapacity: to.Ptr[float64](4), + // MinCapacity: to.Ptr[float64](0), + // }, + // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault), + // State: to.Ptr(armsql.ElasticPoolStateReady), + // ZoneRedundant: to.Ptr(false), + // }, + // SKU: &armsql.SKU{ + // Name: to.Ptr("GP_Gen5"), + // Capacity: to.Ptr[int32](4), + // Family: to.Ptr("Gen5"), + // Tier: to.Ptr("GeneralPurpose"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolUpdateWithVBSPreferredEnclaveType.json +func ExampleElasticPoolsClient_BeginUpdate_createOrUpdateElasticPoolWithPreferredEnclaveTypeParameterAsVbs() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewElasticPoolsClient().BeginUpdate(ctx, "sqlcrudtest-2369", "sqlcrudtest-8069", "sqlcrudtest-8102", armsql.ElasticPoolUpdate{ + Properties: &armsql.ElasticPoolUpdateProperties{ + PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS), + }, + SKU: &armsql.SKU{ + Name: to.Ptr("GP_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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ElasticPool = armsql.ElasticPool{ + // Name: to.Ptr("sqlcrudtest-8102"), + // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), + // Location: to.Ptr("Japan East"), + // Kind: to.Ptr("vcore,pool"), + // Properties: &armsql.ElasticPoolProperties{ + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-26T03:46:20.57Z"); return t}()), + // LicenseType: to.Ptr(armsql.ElasticPoolLicenseTypeLicenseIncluded), + // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"), + // MaxSizeBytes: to.Ptr[int64](0), + // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ + // MaxCapacity: to.Ptr[float64](4), + // MinCapacity: to.Ptr[float64](0), + // }, + // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS), + // State: to.Ptr(armsql.ElasticPoolStateReady), + // ZoneRedundant: to.Ptr(false), + // }, + // SKU: &armsql.SKU{ + // Name: to.Ptr("GP_Gen5"), + // Capacity: to.Ptr[int32](4), + // Family: to.Ptr("Gen5"), + // Tier: to.Ptr("GeneralPurpose"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolUpdateResetMaintenanceConfiguration.json func ExampleElasticPoolsClient_BeginUpdate_resetsMaintenanceConfigurationOfAnElasticPoolToDefault() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -987,7 +1367,7 @@ func ExampleElasticPoolsClient_BeginUpdate_resetsMaintenanceConfigurationOfAnEla // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolUpdateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolUpdateMax.json func ExampleElasticPoolsClient_BeginUpdate_updateAnElasticPoolWithAllParameter() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1047,7 +1427,7 @@ func ExampleElasticPoolsClient_BeginUpdate_updateAnElasticPoolWithAllParameter() // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolUpdateMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolUpdateMin.json func ExampleElasticPoolsClient_BeginUpdate_updateAnElasticPoolWithMinimumParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1091,7 +1471,7 @@ func ExampleElasticPoolsClient_BeginUpdate_updateAnElasticPoolWithMinimumParamet // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/HyperscaleElasticPoolUpdateSetHighAvailabilityReplicaCount.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/HyperscaleElasticPoolUpdateSetHighAvailabilityReplicaCount.json func ExampleElasticPoolsClient_BeginUpdate_updateHighAvailabilityReplicaCountOfAHyperscaleElasticPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1145,7 +1525,7 @@ func ExampleElasticPoolsClient_BeginUpdate_updateHighAvailabilityReplicaCountOfA // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/FailoverElasticPool.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/FailoverElasticPool.json func ExampleElasticPoolsClient_BeginFailover() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/sql/armsql/encryptionprotectors_client.go b/sdk/resourcemanager/sql/armsql/encryptionprotectors_client.go index 64f0600e1719..9927cf732e63 100644 --- a/sdk/resourcemanager/sql/armsql/encryptionprotectors_client.go +++ b/sdk/resourcemanager/sql/armsql/encryptionprotectors_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -61,7 +60,8 @@ func (client *EncryptionProtectorsClient) BeginCreateOrUpdate(ctx context.Contex if err != nil { return nil, err } - return runtime.NewPoller[EncryptionProtectorsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[EncryptionProtectorsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[EncryptionProtectorsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *EncryptionProtectorsClient) BeginCreateOrUpdate(ctx context.Contex // // Generated from API version 2020-11-01-preview func (client *EncryptionProtectorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, encryptionProtectorName EncryptionProtectorName, parameters EncryptionProtector, options *EncryptionProtectorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, encryptionProtectorName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -113,7 +115,10 @@ func (client *EncryptionProtectorsClient) createOrUpdateCreateRequest(ctx contex reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Get - Gets a server encryption protector. @@ -127,18 +132,21 @@ func (client *EncryptionProtectorsClient) createOrUpdateCreateRequest(ctx contex // - options - EncryptionProtectorsClientGetOptions contains the optional parameters for the EncryptionProtectorsClient.Get // method. func (client *EncryptionProtectorsClient) Get(ctx context.Context, resourceGroupName string, serverName string, encryptionProtectorName EncryptionProtectorName, options *EncryptionProtectorsClientGetOptions) (EncryptionProtectorsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, encryptionProtectorName, options) if err != nil { return EncryptionProtectorsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return EncryptionProtectorsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return EncryptionProtectorsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return EncryptionProtectorsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -267,7 +275,8 @@ func (client *EncryptionProtectorsClient) BeginRevalidate(ctx context.Context, r if err != nil { return nil, err } - return runtime.NewPoller[EncryptionProtectorsClientRevalidateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[EncryptionProtectorsClientRevalidateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[EncryptionProtectorsClientRevalidateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -278,18 +287,20 @@ func (client *EncryptionProtectorsClient) BeginRevalidate(ctx context.Context, r // // Generated from API version 2020-11-01-preview func (client *EncryptionProtectorsClient) revalidate(ctx context.Context, resourceGroupName string, serverName string, encryptionProtectorName EncryptionProtectorName, options *EncryptionProtectorsClientBeginRevalidateOptions) (*http.Response, error) { + var err error req, err := client.revalidateCreateRequest(ctx, resourceGroupName, serverName, encryptionProtectorName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // revalidateCreateRequest creates the Revalidate request. diff --git a/sdk/resourcemanager/sql/armsql/encryptionprotectors_client_example_test.go b/sdk/resourcemanager/sql/armsql/encryptionprotectors_client_example_test.go index 72598689f20f..41f7a13dbd9a 100644 --- a/sdk/resourcemanager/sql/armsql/encryptionprotectors_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/encryptionprotectors_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -58,7 +58,7 @@ func ExampleEncryptionProtectorsClient_NewListByServerPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -91,7 +91,7 @@ func ExampleEncryptionProtectorsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorCreateOrUpdateKeyVault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorCreateOrUpdateKeyVault.json func ExampleEncryptionProtectorsClient_BeginCreateOrUpdate_updateTheEncryptionProtectorToKeyVault() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -133,7 +133,7 @@ func ExampleEncryptionProtectorsClient_BeginCreateOrUpdate_updateTheEncryptionPr // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorCreateOrUpdateServiceManaged.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorCreateOrUpdateServiceManaged.json func ExampleEncryptionProtectorsClient_BeginCreateOrUpdate_updateTheEncryptionProtectorToServiceManaged() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -173,7 +173,7 @@ func ExampleEncryptionProtectorsClient_BeginCreateOrUpdate_updateTheEncryptionPr // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorRevalidate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/endpointcertificates_client.go b/sdk/resourcemanager/sql/armsql/endpointcertificates_client.go index f18074920e68..fc0008f7fcb7 100644 --- a/sdk/resourcemanager/sql/armsql/endpointcertificates_client.go +++ b/sdk/resourcemanager/sql/armsql/endpointcertificates_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -55,18 +54,21 @@ func NewEndpointCertificatesClient(subscriptionID string, credential azcore.Toke // - options - EndpointCertificatesClientGetOptions contains the optional parameters for the EndpointCertificatesClient.Get // method. func (client *EndpointCertificatesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, endpointType string, options *EndpointCertificatesClientGetOptions) (EndpointCertificatesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, endpointType, options) if err != nil { return EndpointCertificatesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return EndpointCertificatesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return EndpointCertificatesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return EndpointCertificatesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/endpointcertificates_client_example_test.go b/sdk/resourcemanager/sql/armsql/endpointcertificates_client_example_test.go index 7ec1e69149c4..31d43d5cb158 100644 --- a/sdk/resourcemanager/sql/armsql/endpointcertificates_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/endpointcertificates_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/EndpointCertificatesListByInstance.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -61,7 +61,7 @@ func ExampleEndpointCertificatesClient_NewListByInstancePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/EndpointCertificatesGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/extendeddatabaseblobauditingpolicies_client.go b/sdk/resourcemanager/sql/armsql/extendeddatabaseblobauditingpolicies_client.go index f00b2c1d242b..390e2d019084 100644 --- a/sdk/resourcemanager/sql/armsql/extendeddatabaseblobauditingpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/extendeddatabaseblobauditingpolicies_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -56,18 +55,21 @@ func NewExtendedDatabaseBlobAuditingPoliciesClient(subscriptionID string, creden // - options - ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ExtendedDatabaseBlobAuditingPoliciesClient.CreateOrUpdate // method. func (client *ExtendedDatabaseBlobAuditingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ExtendedDatabaseBlobAuditingPolicy, options *ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions) (ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { return ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -98,7 +100,10 @@ func (client *ExtendedDatabaseBlobAuditingPoliciesClient) createOrUpdateCreateRe 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) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -121,18 +126,21 @@ func (client *ExtendedDatabaseBlobAuditingPoliciesClient) createOrUpdateHandleRe // - options - ExtendedDatabaseBlobAuditingPoliciesClientGetOptions contains the optional parameters for the ExtendedDatabaseBlobAuditingPoliciesClient.Get // method. func (client *ExtendedDatabaseBlobAuditingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *ExtendedDatabaseBlobAuditingPoliciesClientGetOptions) (ExtendedDatabaseBlobAuditingPoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { return ExtendedDatabaseBlobAuditingPoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ExtendedDatabaseBlobAuditingPoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExtendedDatabaseBlobAuditingPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ExtendedDatabaseBlobAuditingPoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/extendeddatabaseblobauditingpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/extendeddatabaseblobauditingpolicies_client_example_test.go index 114845eb09b3..262856d7c91b 100644 --- a/sdk/resourcemanager/sql/armsql/extendeddatabaseblobauditingpolicies_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/extendeddatabaseblobauditingpolicies_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseExtendedAuditingSettingsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -63,7 +63,7 @@ func ExampleExtendedDatabaseBlobAuditingPoliciesClient_NewListByDatabasePager() } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseBlobAuditingGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -100,7 +100,7 @@ func ExampleExtendedDatabaseBlobAuditingPoliciesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseAzureMonitorAuditingCreateMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseAzureMonitorAuditingCreateMin.json func ExampleExtendedDatabaseBlobAuditingPoliciesClient_CreateOrUpdate_createOrUpdateAnExtendedDatabasesAzureMonitorAuditingPolicyWithMinimalParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -140,7 +140,7 @@ func ExampleExtendedDatabaseBlobAuditingPoliciesClient_CreateOrUpdate_createOrUp // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseBlobAuditingCreateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseBlobAuditingCreateMax.json func ExampleExtendedDatabaseBlobAuditingPoliciesClient_CreateOrUpdate_createOrUpdateAnExtendedDatabasesBlobAuditingPolicyWithAllParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -195,7 +195,7 @@ func ExampleExtendedDatabaseBlobAuditingPoliciesClient_CreateOrUpdate_createOrUp // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseBlobAuditingCreateMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseBlobAuditingCreateMin.json func ExampleExtendedDatabaseBlobAuditingPoliciesClient_CreateOrUpdate_createOrUpdateAnExtendedDatabasesBlobAuditingPolicyWithMinimalParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/sql/armsql/extendedserverblobauditingpolicies_client.go b/sdk/resourcemanager/sql/armsql/extendedserverblobauditingpolicies_client.go index 8239696c9444..f782367cafc0 100644 --- a/sdk/resourcemanager/sql/armsql/extendedserverblobauditingpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/extendedserverblobauditingpolicies_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -60,7 +59,8 @@ func (client *ExtendedServerBlobAuditingPoliciesClient) BeginCreateOrUpdate(ctx if err != nil { return nil, err } - return runtime.NewPoller[ExtendedServerBlobAuditingPoliciesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ExtendedServerBlobAuditingPoliciesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ExtendedServerBlobAuditingPoliciesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,18 +71,20 @@ func (client *ExtendedServerBlobAuditingPoliciesClient) BeginCreateOrUpdate(ctx // // Generated from API version 2021-11-01-preview func (client *ExtendedServerBlobAuditingPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ExtendedServerBlobAuditingPolicy, options *ExtendedServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -109,7 +111,10 @@ func (client *ExtendedServerBlobAuditingPoliciesClient) createOrUpdateCreateRequ 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) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Get - Gets an extended server's blob auditing policy. @@ -122,18 +127,21 @@ func (client *ExtendedServerBlobAuditingPoliciesClient) createOrUpdateCreateRequ // - options - ExtendedServerBlobAuditingPoliciesClientGetOptions contains the optional parameters for the ExtendedServerBlobAuditingPoliciesClient.Get // method. func (client *ExtendedServerBlobAuditingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, options *ExtendedServerBlobAuditingPoliciesClientGetOptions) (ExtendedServerBlobAuditingPoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, options) if err != nil { return ExtendedServerBlobAuditingPoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ExtendedServerBlobAuditingPoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExtendedServerBlobAuditingPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ExtendedServerBlobAuditingPoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/extendedserverblobauditingpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/extendedserverblobauditingpolicies_client_example_test.go index f2df79d848d2..668cff92e489 100644 --- a/sdk/resourcemanager/sql/armsql/extendedserverblobauditingpolicies_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/extendedserverblobauditingpolicies_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerExtendedAuditingSettingsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -63,7 +63,7 @@ func ExampleExtendedServerBlobAuditingPoliciesClient_NewListByServerPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedServerBlobAuditingGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -100,7 +100,7 @@ func ExampleExtendedServerBlobAuditingPoliciesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedServerBlobAuditingCreateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedServerBlobAuditingCreateMax.json func ExampleExtendedServerBlobAuditingPoliciesClient_BeginCreateOrUpdate_updateAServersExtendedBlobAuditingPolicyWithAllParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -159,7 +159,7 @@ func ExampleExtendedServerBlobAuditingPoliciesClient_BeginCreateOrUpdate_updateA // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedServerBlobAuditingCreateMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedServerBlobAuditingCreateMin.json func ExampleExtendedServerBlobAuditingPoliciesClient_BeginCreateOrUpdate_updateAServersExtendedBlobAuditingPolicyWithMinimalParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/sql/armsql/failovergroups_client.go b/sdk/resourcemanager/sql/armsql/failovergroups_client.go index d2c4960b17fb..849286db4558 100644 --- a/sdk/resourcemanager/sql/armsql/failovergroups_client.go +++ b/sdk/resourcemanager/sql/armsql/failovergroups_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -47,7 +46,7 @@ func NewFailoverGroupsClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateOrUpdate - Creates or updates a failover group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-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. // - serverName - The name of the server containing the failover group. @@ -61,7 +60,8 @@ func (client *FailoverGroupsClient) BeginCreateOrUpdate(ctx context.Context, res if err != nil { return nil, err } - return runtime.NewPoller[FailoverGroupsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[FailoverGroupsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[FailoverGroupsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,20 +70,22 @@ func (client *FailoverGroupsClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Creates or updates a failover group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-11-01-preview func (client *FailoverGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, parameters FailoverGroup, options *FailoverGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, failoverGroupName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -110,16 +112,19 @@ func (client *FailoverGroupsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a failover group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-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. // - serverName - The name of the server containing the failover group. @@ -132,7 +137,8 @@ func (client *FailoverGroupsClient) BeginDelete(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller[FailoverGroupsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[FailoverGroupsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[FailoverGroupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -141,20 +147,22 @@ func (client *FailoverGroupsClient) BeginDelete(ctx context.Context, resourceGro // Delete - Deletes a failover group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-11-01-preview func (client *FailoverGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, options *FailoverGroupsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, failoverGroupName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -181,7 +189,7 @@ func (client *FailoverGroupsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -189,7 +197,7 @@ func (client *FailoverGroupsClient) deleteCreateRequest(ctx context.Context, res // 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 2020-11-01-preview +// Generated from API version 2022-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. // - serverName - The name of the server containing the failover group. @@ -202,7 +210,8 @@ func (client *FailoverGroupsClient) BeginFailover(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller[FailoverGroupsClientFailoverResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[FailoverGroupsClientFailoverResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[FailoverGroupsClientFailoverResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -211,20 +220,22 @@ func (client *FailoverGroupsClient) BeginFailover(ctx context.Context, resourceG // 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 2020-11-01-preview +// Generated from API version 2022-11-01-preview func (client *FailoverGroupsClient) failover(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, options *FailoverGroupsClientBeginFailoverOptions) (*http.Response, error) { + var err error req, err := client.failoverCreateRequest(ctx, resourceGroupName, serverName, failoverGroupName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // failoverCreateRequest creates the Failover request. @@ -251,7 +262,7 @@ func (client *FailoverGroupsClient) failoverCreateRequest(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-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -261,7 +272,7 @@ func (client *FailoverGroupsClient) failoverCreateRequest(ctx context.Context, r // in data loss. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-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. // - serverName - The name of the server containing the failover group. @@ -274,7 +285,8 @@ func (client *FailoverGroupsClient) BeginForceFailoverAllowDataLoss(ctx context. if err != nil { return nil, err } - return runtime.NewPoller[FailoverGroupsClientForceFailoverAllowDataLossResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[FailoverGroupsClientForceFailoverAllowDataLossResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[FailoverGroupsClientForceFailoverAllowDataLossResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -284,20 +296,22 @@ func (client *FailoverGroupsClient) BeginForceFailoverAllowDataLoss(ctx context. // data loss. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-11-01-preview func (client *FailoverGroupsClient) forceFailoverAllowDataLoss(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, options *FailoverGroupsClientBeginForceFailoverAllowDataLossOptions) (*http.Response, error) { + var err error req, err := client.forceFailoverAllowDataLossCreateRequest(ctx, resourceGroupName, serverName, failoverGroupName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // forceFailoverAllowDataLossCreateRequest creates the ForceFailoverAllowDataLoss request. @@ -324,7 +338,7 @@ func (client *FailoverGroupsClient) forceFailoverAllowDataLossCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -333,25 +347,28 @@ func (client *FailoverGroupsClient) forceFailoverAllowDataLossCreateRequest(ctx // Get - Gets a failover group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-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. // - serverName - The name of the server containing the failover group. // - failoverGroupName - The name of the failover group. // - options - FailoverGroupsClientGetOptions contains the optional parameters for the FailoverGroupsClient.Get method. func (client *FailoverGroupsClient) Get(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, options *FailoverGroupsClientGetOptions) (FailoverGroupsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, failoverGroupName, options) if err != nil { return FailoverGroupsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return FailoverGroupsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FailoverGroupsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return FailoverGroupsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -378,7 +395,7 @@ func (client *FailoverGroupsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -395,7 +412,7 @@ func (client *FailoverGroupsClient) getHandleResponse(resp *http.Response) (Fail // NewListByServerPager - Lists the failover groups in a server. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-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. // - serverName - The name of the server containing the failover group. @@ -449,7 +466,7 @@ func (client *FailoverGroupsClient) listByServerCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -464,10 +481,88 @@ func (client *FailoverGroupsClient) listByServerHandleResponse(resp *http.Respon return result, nil } +// BeginTryPlannedBeforeForcedFailover - Fails over from the current primary server to this server. This operation tries planned +// before forced failover but might still result in data loss. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - failoverGroupName - The name of the failover group. +// - options - FailoverGroupsClientBeginTryPlannedBeforeForcedFailoverOptions contains the optional parameters for the FailoverGroupsClient.BeginTryPlannedBeforeForcedFailover +// method. +func (client *FailoverGroupsClient) BeginTryPlannedBeforeForcedFailover(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, options *FailoverGroupsClientBeginTryPlannedBeforeForcedFailoverOptions) (*runtime.Poller[FailoverGroupsClientTryPlannedBeforeForcedFailoverResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.tryPlannedBeforeForcedFailover(ctx, resourceGroupName, serverName, failoverGroupName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FailoverGroupsClientTryPlannedBeforeForcedFailoverResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[FailoverGroupsClientTryPlannedBeforeForcedFailoverResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// TryPlannedBeforeForcedFailover - Fails over from the current primary server to this server. This operation tries planned +// before forced failover but might still result in data loss. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *FailoverGroupsClient) tryPlannedBeforeForcedFailover(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, options *FailoverGroupsClientBeginTryPlannedBeforeForcedFailoverOptions) (*http.Response, error) { + var err error + req, err := client.tryPlannedBeforeForcedFailoverCreateRequest(ctx, resourceGroupName, serverName, failoverGroupName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// tryPlannedBeforeForcedFailoverCreateRequest creates the TryPlannedBeforeForcedFailover request. +func (client *FailoverGroupsClient) tryPlannedBeforeForcedFailoverCreateRequest(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, options *FailoverGroupsClientBeginTryPlannedBeforeForcedFailoverOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/tryPlannedBeforeForcedFailover" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if failoverGroupName == "" { + return nil, errors.New("parameter failoverGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{failoverGroupName}", url.PathEscape(failoverGroupName)) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // BeginUpdate - Updates a failover group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-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. // - serverName - The name of the server containing the failover group. @@ -481,7 +576,8 @@ func (client *FailoverGroupsClient) BeginUpdate(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller[FailoverGroupsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[FailoverGroupsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[FailoverGroupsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -490,20 +586,22 @@ func (client *FailoverGroupsClient) BeginUpdate(ctx context.Context, resourceGro // Update - Updates a failover group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-11-01-preview func (client *FailoverGroupsClient) update(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, parameters FailoverGroupUpdate, options *FailoverGroupsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, failoverGroupName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -530,8 +628,11 @@ func (client *FailoverGroupsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/failovergroups_client_example_test.go b/sdk/resourcemanager/sql/armsql/failovergroups_client_example_test.go index 9a9b93051ff6..65c0ba82e8a2 100644 --- a/sdk/resourcemanager/sql/armsql/failovergroups_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/failovergroups_client_example_test.go @@ -15,10 +15,88 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-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() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewFailoverGroupsClient().NewListByServerPager("Default", "failover-group-primary-server", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.FailoverGroupListResult = armsql.FailoverGroupListResult{ + // Value: []*armsql.FailoverGroup{ + // { + // Name: to.Ptr("failover-group-test"), + // Type: to.Ptr("Microsoft.Sql/servers/failoverGroups"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/failoverGroups/failover-group-test"), + // Location: to.Ptr("Japan East"), + // Properties: &armsql.FailoverGroupProperties{ + // Databases: []*string{ + // }, + // PartnerServers: []*armsql.PartnerInfo{ + // { + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server"), + // Location: to.Ptr("Japan West"), + // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRoleSecondary), + // }}, + // ReadOnlyEndpoint: &armsql.FailoverGroupReadOnlyEndpoint{ + // FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), + // }, + // ReadWriteEndpoint: &armsql.FailoverGroupReadWriteEndpoint{ + // FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), + // FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](480), + // }, + // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRolePrimary), + // ReplicationState: to.Ptr("CATCH_UP"), + // }, + // }, + // { + // Name: to.Ptr("failover-group-test-2"), + // Type: to.Ptr("Microsoft.Sql/servers/failoverGroups"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/failoverGroups/failover-group-test-2"), + // Location: to.Ptr("Japan East"), + // Properties: &armsql.FailoverGroupProperties{ + // Databases: []*string{ + // }, + // PartnerServers: []*armsql.PartnerInfo{ + // { + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server"), + // Location: to.Ptr("Japan West"), + // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRoleSecondary), + // }}, + // ReadOnlyEndpoint: &armsql.FailoverGroupReadOnlyEndpoint{ + // FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), + // }, + // ReadWriteEndpoint: &armsql.FailoverGroupReadWriteEndpoint{ + // FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), + // FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](480), + // }, + // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRolePrimary), + // ReplicationState: to.Ptr("CATCH_UP"), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/FailoverGroupGet.json func ExampleFailoverGroupsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -63,7 +141,7 @@ func ExampleFailoverGroupsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupCreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/FailoverGroupCreateOrUpdate.json func ExampleFailoverGroupsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -130,7 +208,7 @@ func ExampleFailoverGroupsClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/FailoverGroupDelete.json func ExampleFailoverGroupsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -151,7 +229,7 @@ func ExampleFailoverGroupsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/FailoverGroupUpdate.json func ExampleFailoverGroupsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -209,8 +287,8 @@ func ExampleFailoverGroupsClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupList.json -func ExampleFailoverGroupsClient_NewListByServerPager() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-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) @@ -220,75 +298,47 @@ func ExampleFailoverGroupsClient_NewListByServerPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewFailoverGroupsClient().NewListByServerPager("Default", "failover-group-primary-server", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FailoverGroupListResult = armsql.FailoverGroupListResult{ - // Value: []*armsql.FailoverGroup{ - // { - // Name: to.Ptr("failover-group-test"), - // Type: to.Ptr("Microsoft.Sql/servers/failoverGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/failoverGroups/failover-group-test"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.FailoverGroupProperties{ - // Databases: []*string{ - // }, - // PartnerServers: []*armsql.PartnerInfo{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server"), - // Location: to.Ptr("Japan West"), - // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRoleSecondary), - // }}, - // ReadOnlyEndpoint: &armsql.FailoverGroupReadOnlyEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), - // }, - // ReadWriteEndpoint: &armsql.FailoverGroupReadWriteEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - // FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](480), - // }, - // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRolePrimary), - // ReplicationState: to.Ptr("CATCH_UP"), - // }, - // }, - // { - // Name: to.Ptr("failover-group-test-2"), - // Type: to.Ptr("Microsoft.Sql/servers/failoverGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/failoverGroups/failover-group-test-2"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.FailoverGroupProperties{ - // Databases: []*string{ - // }, - // PartnerServers: []*armsql.PartnerInfo{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server"), - // Location: to.Ptr("Japan West"), - // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRoleSecondary), - // }}, - // ReadOnlyEndpoint: &armsql.FailoverGroupReadOnlyEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), - // }, - // ReadWriteEndpoint: &armsql.FailoverGroupReadWriteEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - // FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](480), - // }, - // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRolePrimary), - // ReplicationState: to.Ptr("CATCH_UP"), - // }, - // }}, - // } + poller, err := clientFactory.NewFailoverGroupsClient().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) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.FailoverGroup = armsql.FailoverGroup{ + // Name: to.Ptr("failover-group-test-3"), + // Type: to.Ptr("Microsoft.Sql/servers/failoverGroups"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server/failoverGroups/failover-group-test-3"), + // Location: to.Ptr("Japan West"), + // Properties: &armsql.FailoverGroupProperties{ + // Databases: []*string{ + // to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server/databases/testdb-1"), + // to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server/databases/testdb-2")}, + // PartnerServers: []*armsql.PartnerInfo{ + // { + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server"), + // Location: to.Ptr("Japan East"), + // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRoleSecondary), + // }}, + // ReadOnlyEndpoint: &armsql.FailoverGroupReadOnlyEndpoint{ + // FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), + // }, + // ReadWriteEndpoint: &armsql.FailoverGroupReadWriteEndpoint{ + // FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), + // FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](120), + // }, + // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRolePrimary), + // ReplicationState: to.Ptr("CATCH_UP"), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupFailover.json -func ExampleFailoverGroupsClient_BeginFailover() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-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) @@ -298,7 +348,7 @@ func ExampleFailoverGroupsClient_BeginFailover() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewFailoverGroupsClient().BeginFailover(ctx, "Default", "failover-group-secondary-server", "failover-group-test-3", nil) + poller, err := clientFactory.NewFailoverGroupsClient().BeginForceFailoverAllowDataLoss(ctx, "Default", "failover-group-secondary-server", "failover-group-test-3", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -337,8 +387,8 @@ func ExampleFailoverGroupsClient_BeginFailover() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupForceFailoverAllowDataLoss.json -func ExampleFailoverGroupsClient_BeginForceFailoverAllowDataLoss() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/FailoverGroupTryPlannedBeforeForcedFailover.json +func ExampleFailoverGroupsClient_BeginTryPlannedBeforeForcedFailover() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -348,7 +398,7 @@ func ExampleFailoverGroupsClient_BeginForceFailoverAllowDataLoss() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewFailoverGroupsClient().BeginForceFailoverAllowDataLoss(ctx, "Default", "failover-group-secondary-server", "failover-group-test-3", nil) + poller, err := clientFactory.NewFailoverGroupsClient().BeginTryPlannedBeforeForcedFailover(ctx, "Default", "failovergroupsecondaryserver", "failovergrouptest3", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -360,17 +410,17 @@ func ExampleFailoverGroupsClient_BeginForceFailoverAllowDataLoss() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.FailoverGroup = armsql.FailoverGroup{ - // Name: to.Ptr("failover-group-test-3"), + // Name: to.Ptr("failovergrouptest3"), // Type: to.Ptr("Microsoft.Sql/servers/failoverGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server/failoverGroups/failover-group-test-3"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failovergroupsecondaryserver/failoverGroups/failovergrouptest3"), // Location: to.Ptr("Japan West"), // Properties: &armsql.FailoverGroupProperties{ // Databases: []*string{ - // to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server/databases/testdb-1"), - // to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server/databases/testdb-2")}, + // to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failovergroupsecondaryserver/databases/testdb1"), + // to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failovergroupsecondaryserver/databases/testdb2")}, // PartnerServers: []*armsql.PartnerInfo{ // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failovergroupprimaryserver"), // Location: to.Ptr("Japan East"), // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRoleSecondary), // }}, diff --git a/sdk/resourcemanager/sql/armsql/firewallrules_client.go b/sdk/resourcemanager/sql/armsql/firewallrules_client.go index 884cbf8bebd5..5bf47a1a4a3b 100644 --- a/sdk/resourcemanager/sql/armsql/firewallrules_client.go +++ b/sdk/resourcemanager/sql/armsql/firewallrules_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -56,18 +55,21 @@ func NewFirewallRulesClient(subscriptionID string, credential azcore.TokenCreden // - options - FirewallRulesClientCreateOrUpdateOptions contains the optional parameters for the FirewallRulesClient.CreateOrUpdate // method. func (client *FirewallRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters FirewallRule, options *FirewallRulesClientCreateOrUpdateOptions) (FirewallRulesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, firewallRuleName, parameters, options) if err != nil { return FirewallRulesClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return FirewallRulesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return FirewallRulesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return FirewallRulesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -97,7 +99,10 @@ func (client *FirewallRulesClient) createOrUpdateCreateRequest(ctx context.Conte reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -119,16 +124,18 @@ func (client *FirewallRulesClient) createOrUpdateHandleResponse(resp *http.Respo // - firewallRuleName - The name of the firewall rule. // - options - FirewallRulesClientDeleteOptions contains the optional parameters for the FirewallRulesClient.Delete method. func (client *FirewallRulesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *FirewallRulesClientDeleteOptions) (FirewallRulesClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, firewallRuleName, options) if err != nil { return FirewallRulesClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return FirewallRulesClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return FirewallRulesClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return FirewallRulesClientDeleteResponse{}, err } return FirewallRulesClientDeleteResponse{}, nil } @@ -172,18 +179,21 @@ func (client *FirewallRulesClient) deleteCreateRequest(ctx context.Context, reso // - firewallRuleName - The name of the firewall rule. // - options - FirewallRulesClientGetOptions contains the optional parameters for the FirewallRulesClient.Get method. func (client *FirewallRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *FirewallRulesClientGetOptions) (FirewallRulesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, firewallRuleName, options) if err != nil { return FirewallRulesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return FirewallRulesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FirewallRulesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return FirewallRulesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -305,18 +315,21 @@ func (client *FirewallRulesClient) listByServerHandleResponse(resp *http.Respons // - serverName - The name of the server. // - options - FirewallRulesClientReplaceOptions contains the optional parameters for the FirewallRulesClient.Replace method. func (client *FirewallRulesClient) Replace(ctx context.Context, resourceGroupName string, serverName string, parameters FirewallRuleList, options *FirewallRulesClientReplaceOptions) (FirewallRulesClientReplaceResponse, error) { + var err error req, err := client.replaceCreateRequest(ctx, resourceGroupName, serverName, parameters, options) if err != nil { return FirewallRulesClientReplaceResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return FirewallRulesClientReplaceResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return FirewallRulesClientReplaceResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return FirewallRulesClientReplaceResponse{}, err } - return client.replaceHandleResponse(resp) + resp, err := client.replaceHandleResponse(httpResp) + return resp, err } // replaceCreateRequest creates the Replace request. @@ -342,7 +355,10 @@ func (client *FirewallRulesClient) replaceCreateRequest(ctx context.Context, res reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // replaceHandleResponse handles the Replace response. diff --git a/sdk/resourcemanager/sql/armsql/firewallrules_client_example_test.go b/sdk/resourcemanager/sql/armsql/firewallrules_client_example_test.go index 7902fc43b158..24e73f6cde2a 100644 --- a/sdk/resourcemanager/sql/armsql/firewallrules_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/firewallrules_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -47,7 +47,7 @@ func ExampleFirewallRulesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleCreate.json func ExampleFirewallRulesClient_CreateOrUpdate_createAFirewallRuleMaxMin() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -81,7 +81,7 @@ func ExampleFirewallRulesClient_CreateOrUpdate_createAFirewallRuleMaxMin() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleUpdate.json func ExampleFirewallRulesClient_CreateOrUpdate_updateAFirewallRuleMaxMin() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -115,7 +115,7 @@ func ExampleFirewallRulesClient_CreateOrUpdate_updateAFirewallRuleMaxMin() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -132,7 +132,7 @@ func ExampleFirewallRulesClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -196,7 +196,7 @@ func ExampleFirewallRulesClient_NewListByServerPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleReplace.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/geobackuppolicies_client.go b/sdk/resourcemanager/sql/armsql/geobackuppolicies_client.go index c27402527be0..92ca7a599530 100644 --- a/sdk/resourcemanager/sql/armsql/geobackuppolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/geobackuppolicies_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -57,18 +56,21 @@ func NewGeoBackupPoliciesClient(subscriptionID string, credential azcore.TokenCr // - options - GeoBackupPoliciesClientCreateOrUpdateOptions contains the optional parameters for the GeoBackupPoliciesClient.CreateOrUpdate // method. func (client *GeoBackupPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, geoBackupPolicyName GeoBackupPolicyName, parameters GeoBackupPolicy, options *GeoBackupPoliciesClientCreateOrUpdateOptions) (GeoBackupPoliciesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, geoBackupPolicyName, parameters, options) if err != nil { return GeoBackupPoliciesClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GeoBackupPoliciesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return GeoBackupPoliciesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return GeoBackupPoliciesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -102,7 +104,10 @@ func (client *GeoBackupPoliciesClient) createOrUpdateCreateRequest(ctx context.C reqQP.Set("api-version", "2014-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -125,18 +130,21 @@ func (client *GeoBackupPoliciesClient) createOrUpdateHandleResponse(resp *http.R // - geoBackupPolicyName - The name of the geo backup policy. // - options - GeoBackupPoliciesClientGetOptions contains the optional parameters for the GeoBackupPoliciesClient.Get method. func (client *GeoBackupPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, geoBackupPolicyName GeoBackupPolicyName, options *GeoBackupPoliciesClientGetOptions) (GeoBackupPoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, geoBackupPolicyName, options) if err != nil { return GeoBackupPoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GeoBackupPoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GeoBackupPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GeoBackupPoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/geobackuppolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/geobackuppolicies_client_example_test.go index bbdf3cfcadee..fcbb7f3a20fd 100644 --- a/sdk/resourcemanager/sql/armsql/geobackuppolicies_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/geobackuppolicies_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesCreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesCreateOrUpdate.json func ExampleGeoBackupPoliciesClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -50,7 +50,7 @@ func ExampleGeoBackupPoliciesClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesGet.json func ExampleGeoBackupPoliciesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -80,7 +80,7 @@ func ExampleGeoBackupPoliciesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesList.json func ExampleGeoBackupPoliciesClient_NewListByDatabasePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/sql/armsql/go.mod b/sdk/resourcemanager/sql/armsql/go.mod index a7fe91f9b406..1476e76053c9 100644 --- a/sdk/resourcemanager/sql/armsql/go.mod +++ b/sdk/resourcemanager/sql/armsql/go.mod @@ -1,23 +1,21 @@ -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.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 ) require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 // indirect github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/google/uuid v1.3.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + golang.org/x/crypto v0.7.0 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/sys v0.6.0 // indirect + golang.org/x/text v0.8.0 // indirect ) - -retract v0.6.0 diff --git a/sdk/resourcemanager/sql/armsql/go.sum b/sdk/resourcemanager/sql/armsql/go.sum index 8ba445a8c4da..ee2bc4389c66 100644 --- a/sdk/resourcemanager/sql/armsql/go.sum +++ b/sdk/resourcemanager/sql/armsql/go.sum @@ -1,13 +1,13 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 h1:vcYCAze6p19qBW7MhZybIsqD8sMV8js0NyQM8JDnVtg= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0/go.mod h1:OQeznEEkTZ9OrhHJoDD8ZDq51FHgXjqtP9z6bEwBq9U= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= +github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 h1:OBhqkivkhkMqLPymWEppkm7vgPQY2XsHoEkaMQ0AdZY= +github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= 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/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= @@ -18,14 +18,14 @@ github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9 github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= 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.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/sql/armsql/instancefailovergroups_client.go b/sdk/resourcemanager/sql/armsql/instancefailovergroups_client.go index 4807de1a9144..716ed367bead 100644 --- a/sdk/resourcemanager/sql/armsql/instancefailovergroups_client.go +++ b/sdk/resourcemanager/sql/armsql/instancefailovergroups_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -47,7 +46,7 @@ func NewInstanceFailoverGroupsClient(subscriptionID string, credential azcore.To // BeginCreateOrUpdate - Creates or updates a failover group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-05-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. // - locationName - The name of the region where the resource is located. @@ -61,7 +60,8 @@ func (client *InstanceFailoverGroupsClient) BeginCreateOrUpdate(ctx context.Cont if err != nil { return nil, err } - return runtime.NewPoller[InstanceFailoverGroupsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[InstanceFailoverGroupsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[InstanceFailoverGroupsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,20 +70,22 @@ func (client *InstanceFailoverGroupsClient) BeginCreateOrUpdate(ctx context.Cont // CreateOrUpdate - Creates or updates a failover group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-05-01-preview func (client *InstanceFailoverGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string, parameters InstanceFailoverGroup, options *InstanceFailoverGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, locationName, failoverGroupName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -110,16 +112,19 @@ func (client *InstanceFailoverGroupsClient) createOrUpdateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a failover group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-05-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. // - locationName - The name of the region where the resource is located. @@ -132,7 +137,8 @@ func (client *InstanceFailoverGroupsClient) BeginDelete(ctx context.Context, res if err != nil { return nil, err } - return runtime.NewPoller[InstanceFailoverGroupsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[InstanceFailoverGroupsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[InstanceFailoverGroupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -141,20 +147,22 @@ func (client *InstanceFailoverGroupsClient) BeginDelete(ctx context.Context, res // Delete - Deletes a failover group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-05-01-preview func (client *InstanceFailoverGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string, options *InstanceFailoverGroupsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, locationName, failoverGroupName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -181,7 +189,7 @@ func (client *InstanceFailoverGroupsClient) deleteCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -189,7 +197,7 @@ func (client *InstanceFailoverGroupsClient) deleteCreateRequest(ctx context.Cont // BeginFailover - Fails over from the current primary managed instance to this 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-05-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. // - locationName - The name of the region where the resource is located. @@ -202,7 +210,8 @@ func (client *InstanceFailoverGroupsClient) BeginFailover(ctx context.Context, r if err != nil { return nil, err } - return runtime.NewPoller[InstanceFailoverGroupsClientFailoverResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[InstanceFailoverGroupsClientFailoverResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[InstanceFailoverGroupsClientFailoverResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -211,20 +220,22 @@ func (client *InstanceFailoverGroupsClient) BeginFailover(ctx context.Context, r // Failover - Fails over from the current primary managed instance to this 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-05-01-preview func (client *InstanceFailoverGroupsClient) failover(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string, options *InstanceFailoverGroupsClientBeginFailoverOptions) (*http.Response, error) { + var err error req, err := client.failoverCreateRequest(ctx, resourceGroupName, locationName, failoverGroupName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // failoverCreateRequest creates the Failover request. @@ -251,7 +262,7 @@ func (client *InstanceFailoverGroupsClient) failoverCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -261,7 +272,7 @@ func (client *InstanceFailoverGroupsClient) failoverCreateRequest(ctx context.Co // might result in data loss. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-05-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. // - locationName - The name of the region where the resource is located. @@ -274,7 +285,8 @@ func (client *InstanceFailoverGroupsClient) BeginForceFailoverAllowDataLoss(ctx if err != nil { return nil, err } - return runtime.NewPoller[InstanceFailoverGroupsClientForceFailoverAllowDataLossResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[InstanceFailoverGroupsClientForceFailoverAllowDataLossResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[InstanceFailoverGroupsClientForceFailoverAllowDataLossResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -284,20 +296,22 @@ func (client *InstanceFailoverGroupsClient) BeginForceFailoverAllowDataLoss(ctx // might result in data loss. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-05-01-preview func (client *InstanceFailoverGroupsClient) forceFailoverAllowDataLoss(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string, options *InstanceFailoverGroupsClientBeginForceFailoverAllowDataLossOptions) (*http.Response, error) { + var err error req, err := client.forceFailoverAllowDataLossCreateRequest(ctx, resourceGroupName, locationName, failoverGroupName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // forceFailoverAllowDataLossCreateRequest creates the ForceFailoverAllowDataLoss request. @@ -324,7 +338,7 @@ func (client *InstanceFailoverGroupsClient) forceFailoverAllowDataLossCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -333,7 +347,7 @@ func (client *InstanceFailoverGroupsClient) forceFailoverAllowDataLossCreateRequ // Get - Gets a failover group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-05-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. // - locationName - The name of the region where the resource is located. @@ -341,18 +355,21 @@ func (client *InstanceFailoverGroupsClient) forceFailoverAllowDataLossCreateRequ // - options - InstanceFailoverGroupsClientGetOptions contains the optional parameters for the InstanceFailoverGroupsClient.Get // method. func (client *InstanceFailoverGroupsClient) Get(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string, options *InstanceFailoverGroupsClientGetOptions) (InstanceFailoverGroupsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, locationName, failoverGroupName, options) if err != nil { return InstanceFailoverGroupsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return InstanceFailoverGroupsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return InstanceFailoverGroupsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return InstanceFailoverGroupsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -379,7 +396,7 @@ func (client *InstanceFailoverGroupsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -396,7 +413,7 @@ func (client *InstanceFailoverGroupsClient) getHandleResponse(resp *http.Respons // NewListByLocationPager - Lists the failover groups in a location. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-05-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. // - locationName - The name of the region where the resource is located. @@ -450,7 +467,7 @@ func (client *InstanceFailoverGroupsClient) listByLocationCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-05-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/instancefailovergroups_client_example_test.go b/sdk/resourcemanager/sql/armsql/instancefailovergroups_client_example_test.go index 8a04c7255df9..6f296ed0e04d 100644 --- a/sdk/resourcemanager/sql/armsql/instancefailovergroups_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/instancefailovergroups_client_example_test.go @@ -15,10 +15,92 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-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() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewInstanceFailoverGroupsClient().NewListByLocationPager("Default", "Japan East", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.InstanceFailoverGroupListResult = armsql.InstanceFailoverGroupListResult{ + // Value: []*armsql.InstanceFailoverGroup{ + // { + // Name: to.Ptr("failover-group-test"), + // Type: to.Ptr("Microsoft.Sql/locations/instanceFailoverGroups"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/locations/JapanEast/instanceFailoverGroups/failover-group-test"), + // 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"), + // ReplicationRole: to.Ptr(armsql.InstanceFailoverGroupReplicationRoleSecondary), + // }}, + // ReadOnlyEndpoint: &armsql.InstanceFailoverGroupReadOnlyEndpoint{ + // FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), + // }, + // ReadWriteEndpoint: &armsql.InstanceFailoverGroupReadWriteEndpoint{ + // FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), + // FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](480), + // }, + // ReplicationRole: to.Ptr(armsql.InstanceFailoverGroupReplicationRolePrimary), + // ReplicationState: to.Ptr("CATCH_UP"), + // SecondaryType: to.Ptr(armsql.SecondaryInstanceTypeGeo), + // }, + // }, + // { + // Name: to.Ptr("failover-group-test-1"), + // Type: to.Ptr("Microsoft.Sql/locations/instanceFailoverGroups"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/locations/JapanEast/instanceFailoverGroups/failover-group-test-1"), + // 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-1"), + // PrimaryManagedInstanceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-primary-mngdInstance-1"), + // }}, + // PartnerRegions: []*armsql.PartnerRegionInfo{ + // { + // Location: to.Ptr("Japan West"), + // ReplicationRole: to.Ptr(armsql.InstanceFailoverGroupReplicationRoleSecondary), + // }}, + // ReadOnlyEndpoint: &armsql.InstanceFailoverGroupReadOnlyEndpoint{ + // FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), + // }, + // ReadWriteEndpoint: &armsql.InstanceFailoverGroupReadWriteEndpoint{ + // FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), + // FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](480), + // }, + // ReplicationRole: to.Ptr(armsql.InstanceFailoverGroupReplicationRolePrimary), + // ReplicationState: to.Ptr("CATCH_UP"), + // SecondaryType: to.Ptr(armsql.SecondaryInstanceTypeGeo), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/InstanceFailoverGroupGet.json func ExampleInstanceFailoverGroupsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -38,7 +120,7 @@ func ExampleInstanceFailoverGroupsClient_Get() { // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.InstanceFailoverGroup = armsql.InstanceFailoverGroup{ // Name: to.Ptr("failover-group-test-3"), - // Type: to.Ptr("Microsoft.Sql/locations/failoverGroups"), + // Type: to.Ptr("Microsoft.Sql/locations/instanceFailoverGroups"), // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/locations/JapanEast/instanceFailoverGroups/failover-group-test-3"), // Properties: &armsql.InstanceFailoverGroupProperties{ // ManagedInstancePairs: []*armsql.ManagedInstancePairInfo{ @@ -60,11 +142,12 @@ func ExampleInstanceFailoverGroupsClient_Get() { // }, // ReplicationRole: to.Ptr(armsql.InstanceFailoverGroupReplicationRolePrimary), // ReplicationState: to.Ptr("CATCH_UP"), + // SecondaryType: to.Ptr(armsql.SecondaryInstanceTypeGeo), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupCreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/InstanceFailoverGroupCreateOrUpdate.json func ExampleInstanceFailoverGroupsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -93,6 +176,7 @@ func ExampleInstanceFailoverGroupsClient_BeginCreateOrUpdate() { FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](480), }, + SecondaryType: to.Ptr(armsql.SecondaryInstanceTypeGeo), }, }, nil) if err != nil { @@ -107,7 +191,7 @@ func ExampleInstanceFailoverGroupsClient_BeginCreateOrUpdate() { // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.InstanceFailoverGroup = armsql.InstanceFailoverGroup{ // Name: to.Ptr("failover-group-test-3"), - // Type: to.Ptr("Microsoft.Sql/locations/failoverGroups"), + // Type: to.Ptr("Microsoft.Sql/locations/instanceFailoverGroups"), // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/locations/JapanEast/instanceFailoverGroups/failover-group-test-3"), // Properties: &armsql.InstanceFailoverGroupProperties{ // ManagedInstancePairs: []*armsql.ManagedInstancePairInfo{ @@ -129,11 +213,12 @@ func ExampleInstanceFailoverGroupsClient_BeginCreateOrUpdate() { // }, // ReplicationRole: to.Ptr(armsql.InstanceFailoverGroupReplicationRolePrimary), // ReplicationState: to.Ptr("CATCH_UP"), + // SecondaryType: to.Ptr(armsql.SecondaryInstanceTypeGeo), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/InstanceFailoverGroupDelete.json func ExampleInstanceFailoverGroupsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -154,87 +239,7 @@ func ExampleInstanceFailoverGroupsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/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() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInstanceFailoverGroupsClient().NewListByLocationPager("Default", "Japan East", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.InstanceFailoverGroupListResult = armsql.InstanceFailoverGroupListResult{ - // Value: []*armsql.InstanceFailoverGroup{ - // { - // Name: to.Ptr("failover-group-test"), - // Type: to.Ptr("Microsoft.Sql/locations/failoverGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/locations/JapanEast/instanceFailoverGroups/failover-group-test"), - // 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"), - // ReplicationRole: to.Ptr(armsql.InstanceFailoverGroupReplicationRoleSecondary), - // }}, - // ReadOnlyEndpoint: &armsql.InstanceFailoverGroupReadOnlyEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), - // }, - // ReadWriteEndpoint: &armsql.InstanceFailoverGroupReadWriteEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - // FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](480), - // }, - // ReplicationRole: to.Ptr(armsql.InstanceFailoverGroupReplicationRolePrimary), - // ReplicationState: to.Ptr("CATCH_UP"), - // }, - // }, - // { - // Name: to.Ptr("failover-group-test-1"), - // Type: to.Ptr("Microsoft.Sql/locations/failoverGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/locations/JapanEast/instanceFailoverGroups/failover-group-test-1"), - // 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-1"), - // PrimaryManagedInstanceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-primary-mngdInstance-1"), - // }}, - // PartnerRegions: []*armsql.PartnerRegionInfo{ - // { - // Location: to.Ptr("Japan West"), - // ReplicationRole: to.Ptr(armsql.InstanceFailoverGroupReplicationRoleSecondary), - // }}, - // ReadOnlyEndpoint: &armsql.InstanceFailoverGroupReadOnlyEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), - // }, - // ReadWriteEndpoint: &armsql.InstanceFailoverGroupReadWriteEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - // FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](480), - // }, - // ReplicationRole: to.Ptr(armsql.InstanceFailoverGroupReplicationRolePrimary), - // ReplicationState: to.Ptr("CATCH_UP"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupFailover.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/InstanceFailoverGroupFailover.json func ExampleInstanceFailoverGroupsClient_BeginFailover() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -258,7 +263,7 @@ func ExampleInstanceFailoverGroupsClient_BeginFailover() { // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.InstanceFailoverGroup = armsql.InstanceFailoverGroup{ // Name: to.Ptr("failover-group-test-3"), - // Type: to.Ptr("Microsoft.Sql/locations/failoverGroups"), + // Type: to.Ptr("Microsoft.Sql/locations/instanceFailoverGroups"), // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/locations/JapanWest/instanceFailoverGroups/failover-group-test-3"), // Properties: &armsql.InstanceFailoverGroupProperties{ // ManagedInstancePairs: []*armsql.ManagedInstancePairInfo{ @@ -280,11 +285,12 @@ func ExampleInstanceFailoverGroupsClient_BeginFailover() { // }, // ReplicationRole: to.Ptr(armsql.InstanceFailoverGroupReplicationRolePrimary), // ReplicationState: to.Ptr("CATCH_UP"), + // SecondaryType: to.Ptr(armsql.SecondaryInstanceTypeGeo), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupForceFailoverAllowDataLoss.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/InstanceFailoverGroupForceFailoverAllowDataLoss.json func ExampleInstanceFailoverGroupsClient_BeginForceFailoverAllowDataLoss() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -308,7 +314,7 @@ func ExampleInstanceFailoverGroupsClient_BeginForceFailoverAllowDataLoss() { // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.InstanceFailoverGroup = armsql.InstanceFailoverGroup{ // Name: to.Ptr("failover-group-test-3"), - // Type: to.Ptr("Microsoft.Sql/locations/failoverGroups"), + // Type: to.Ptr("Microsoft.Sql/locations/instanceFailoverGroups"), // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/locations/JapanWest/instanceFailoverGroups/failover-group-test-3"), // Properties: &armsql.InstanceFailoverGroupProperties{ // ManagedInstancePairs: []*armsql.ManagedInstancePairInfo{ @@ -330,6 +336,7 @@ func ExampleInstanceFailoverGroupsClient_BeginForceFailoverAllowDataLoss() { // }, // ReplicationRole: to.Ptr(armsql.InstanceFailoverGroupReplicationRolePrimary), // ReplicationState: to.Ptr("CATCH_UP"), + // SecondaryType: to.Ptr(armsql.SecondaryInstanceTypeGeo), // }, // } } diff --git a/sdk/resourcemanager/sql/armsql/instancepools_client.go b/sdk/resourcemanager/sql/armsql/instancepools_client.go index e768af7bff7b..e5499b46152e 100644 --- a/sdk/resourcemanager/sql/armsql/instancepools_client.go +++ b/sdk/resourcemanager/sql/armsql/instancepools_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -60,7 +59,8 @@ func (client *InstancePoolsClient) BeginCreateOrUpdate(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller[InstancePoolsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[InstancePoolsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[InstancePoolsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,18 +71,20 @@ func (client *InstancePoolsClient) BeginCreateOrUpdate(ctx context.Context, reso // // Generated from API version 2020-11-01-preview func (client *InstancePoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, instancePoolName string, parameters InstancePool, options *InstancePoolsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, instancePoolName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -108,7 +110,10 @@ func (client *InstancePoolsClient) createOrUpdateCreateRequest(ctx context.Conte reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes an instance pool @@ -126,7 +131,8 @@ func (client *InstancePoolsClient) BeginDelete(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller[InstancePoolsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[InstancePoolsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[InstancePoolsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -137,18 +143,20 @@ func (client *InstancePoolsClient) BeginDelete(ctx context.Context, resourceGrou // // Generated from API version 2020-11-01-preview func (client *InstancePoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, instancePoolName string, options *InstancePoolsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, instancePoolName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -185,18 +193,21 @@ func (client *InstancePoolsClient) deleteCreateRequest(ctx context.Context, reso // - instancePoolName - The name of the instance pool to be retrieved. // - options - InstancePoolsClientGetOptions contains the optional parameters for the InstancePoolsClient.Get method. func (client *InstancePoolsClient) Get(ctx context.Context, resourceGroupName string, instancePoolName string, options *InstancePoolsClientGetOptions) (InstancePoolsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, instancePoolName, options) if err != nil { return InstancePoolsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return InstancePoolsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return InstancePoolsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return InstancePoolsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -375,7 +386,8 @@ func (client *InstancePoolsClient) BeginUpdate(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller[InstancePoolsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[InstancePoolsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[InstancePoolsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -386,18 +398,20 @@ func (client *InstancePoolsClient) BeginUpdate(ctx context.Context, resourceGrou // // Generated from API version 2020-11-01-preview func (client *InstancePoolsClient) update(ctx context.Context, resourceGroupName string, instancePoolName string, parameters InstancePoolUpdate, options *InstancePoolsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, instancePoolName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -423,5 +437,8 @@ func (client *InstancePoolsClient) updateCreateRequest(ctx context.Context, reso reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/instancepools_client_example_test.go b/sdk/resourcemanager/sql/armsql/instancepools_client_example_test.go index 8a368f98ac19..2b1351b292ae 100644 --- a/sdk/resourcemanager/sql/armsql/instancepools_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/instancepools_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetInstancePool.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -57,7 +57,7 @@ func ExampleInstancePoolsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateInstancePoolMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateInstancePoolMax.json func ExampleInstancePoolsClient_BeginCreateOrUpdate_createAnInstancePoolWithAllProperties() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -115,7 +115,7 @@ func ExampleInstancePoolsClient_BeginCreateOrUpdate_createAnInstancePoolWithAllP // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateInstancePoolMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateInstancePoolMin.json func ExampleInstancePoolsClient_BeginCreateOrUpdate_createAnInstancePoolWithMinProperties() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -169,7 +169,7 @@ func ExampleInstancePoolsClient_BeginCreateOrUpdate_createAnInstancePoolWithMinP // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteInstancePool.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -190,7 +190,7 @@ func ExampleInstancePoolsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PatchInstancePool.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -237,7 +237,7 @@ func ExampleInstancePoolsClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListInstancePoolsByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -303,7 +303,7 @@ func ExampleInstancePoolsClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListInstancePoolsBySubscriptionId.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/ipv6firewallrules_client.go b/sdk/resourcemanager/sql/armsql/ipv6firewallrules_client.go index aaf4351c99d1..c0d474157f8f 100644 --- a/sdk/resourcemanager/sql/armsql/ipv6firewallrules_client.go +++ b/sdk/resourcemanager/sql/armsql/ipv6firewallrules_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -47,7 +46,7 @@ func NewIPv6FirewallRulesClient(subscriptionID string, credential azcore.TokenCr // CreateOrUpdate - Creates or updates an IPv6 firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-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. // - serverName - The name of the server. @@ -56,18 +55,21 @@ func NewIPv6FirewallRulesClient(subscriptionID string, credential azcore.TokenCr // - options - IPv6FirewallRulesClientCreateOrUpdateOptions contains the optional parameters for the IPv6FirewallRulesClient.CreateOrUpdate // method. func (client *IPv6FirewallRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters IPv6FirewallRule, options *IPv6FirewallRulesClientCreateOrUpdateOptions) (IPv6FirewallRulesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, firewallRuleName, parameters, options) if err != nil { return IPv6FirewallRulesClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return IPv6FirewallRulesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return IPv6FirewallRulesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return IPv6FirewallRulesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -94,10 +96,13 @@ func (client *IPv6FirewallRulesClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -112,7 +117,7 @@ func (client *IPv6FirewallRulesClient) createOrUpdateHandleResponse(resp *http.R // Delete - Deletes an IPv6 firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-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. // - serverName - The name of the server. @@ -120,16 +125,18 @@ func (client *IPv6FirewallRulesClient) createOrUpdateHandleResponse(resp *http.R // - options - IPv6FirewallRulesClientDeleteOptions contains the optional parameters for the IPv6FirewallRulesClient.Delete // method. func (client *IPv6FirewallRulesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *IPv6FirewallRulesClientDeleteOptions) (IPv6FirewallRulesClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, firewallRuleName, options) if err != nil { return IPv6FirewallRulesClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return IPv6FirewallRulesClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return IPv6FirewallRulesClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return IPv6FirewallRulesClientDeleteResponse{}, err } return IPv6FirewallRulesClientDeleteResponse{}, nil } @@ -158,7 +165,7 @@ func (client *IPv6FirewallRulesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -166,25 +173,28 @@ func (client *IPv6FirewallRulesClient) deleteCreateRequest(ctx context.Context, // Get - Gets an IPv6 firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-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. // - serverName - The name of the server. // - firewallRuleName - The name of the firewall rule. // - options - IPv6FirewallRulesClientGetOptions contains the optional parameters for the IPv6FirewallRulesClient.Get method. func (client *IPv6FirewallRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *IPv6FirewallRulesClientGetOptions) (IPv6FirewallRulesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, firewallRuleName, options) if err != nil { return IPv6FirewallRulesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return IPv6FirewallRulesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IPv6FirewallRulesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return IPv6FirewallRulesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -211,7 +221,7 @@ func (client *IPv6FirewallRulesClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -228,7 +238,7 @@ func (client *IPv6FirewallRulesClient) getHandleResponse(resp *http.Response) (I // NewListByServerPager - Gets a list of IPv6 firewall rules. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-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. // - serverName - The name of the server. @@ -282,7 +292,7 @@ func (client *IPv6FirewallRulesClient) listByServerCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-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/ipv6firewallrules_client_example_test.go b/sdk/resourcemanager/sql/armsql/ipv6firewallrules_client_example_test.go index 2ee5f20d7828..1513f07f4f36 100644 --- a/sdk/resourcemanager/sql/armsql/ipv6firewallrules_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/ipv6firewallrules_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/IPv6FirewallRuleList.json func ExampleIPv6FirewallRulesClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -82,7 +82,7 @@ func ExampleIPv6FirewallRulesClient_NewListByServerPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/IPv6FirewallRuleGet.json func ExampleIPv6FirewallRulesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -111,7 +111,7 @@ func ExampleIPv6FirewallRulesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/IPv6FirewallRuleCreate.json func ExampleIPv6FirewallRulesClient_CreateOrUpdate_createAnIPv6FirewallRuleMaxMin() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -145,7 +145,7 @@ func ExampleIPv6FirewallRulesClient_CreateOrUpdate_createAnIPv6FirewallRuleMaxMi // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/IPv6FirewallRuleUpdate.json func ExampleIPv6FirewallRulesClient_CreateOrUpdate_updateAnIPv6FirewallRuleMaxMin() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -179,7 +179,7 @@ func ExampleIPv6FirewallRulesClient_CreateOrUpdate_updateAnIPv6FirewallRuleMaxMi // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/IPv6FirewallRuleDelete.json func ExampleIPv6FirewallRulesClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/sql/armsql/jobagents_client.go b/sdk/resourcemanager/sql/armsql/jobagents_client.go index d14d6a9419d8..bdc2c7d69e91 100644 --- a/sdk/resourcemanager/sql/armsql/jobagents_client.go +++ b/sdk/resourcemanager/sql/armsql/jobagents_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -61,7 +60,8 @@ func (client *JobAgentsClient) BeginCreateOrUpdate(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller[JobAgentsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[JobAgentsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[JobAgentsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *JobAgentsClient) BeginCreateOrUpdate(ctx context.Context, resource // // Generated from API version 2020-11-01-preview func (client *JobAgentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, parameters JobAgent, options *JobAgentsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -113,7 +115,10 @@ func (client *JobAgentsClient) createOrUpdateCreateRequest(ctx context.Context, reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a job agent. @@ -131,7 +136,8 @@ func (client *JobAgentsClient) BeginDelete(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - return runtime.NewPoller[JobAgentsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[JobAgentsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[JobAgentsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -142,18 +148,20 @@ func (client *JobAgentsClient) BeginDelete(ctx context.Context, resourceGroupNam // // Generated from API version 2020-11-01-preview func (client *JobAgentsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, options *JobAgentsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -195,18 +203,21 @@ func (client *JobAgentsClient) deleteCreateRequest(ctx context.Context, resource // - jobAgentName - The name of the job agent to be retrieved. // - options - JobAgentsClientGetOptions contains the optional parameters for the JobAgentsClient.Get method. func (client *JobAgentsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, options *JobAgentsClientGetOptions) (JobAgentsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, options) if err != nil { return JobAgentsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobAgentsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return JobAgentsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return JobAgentsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -335,7 +346,8 @@ func (client *JobAgentsClient) BeginUpdate(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - return runtime.NewPoller[JobAgentsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[JobAgentsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[JobAgentsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -346,18 +358,20 @@ func (client *JobAgentsClient) BeginUpdate(ctx context.Context, resourceGroupNam // // Generated from API version 2020-11-01-preview func (client *JobAgentsClient) update(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, parameters JobAgentUpdate, options *JobAgentsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -387,5 +401,8 @@ func (client *JobAgentsClient) updateCreateRequest(ctx context.Context, resource reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/jobagents_client_example_test.go b/sdk/resourcemanager/sql/armsql/jobagents_client_example_test.go index e25362cb7d50..da1c84247fdb 100644 --- a/sdk/resourcemanager/sql/armsql/jobagents_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/jobagents_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobAgentsByServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -72,7 +72,7 @@ func ExampleJobAgentsClient_NewListByServerPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobAgent.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -105,7 +105,7 @@ func ExampleJobAgentsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobAgent.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -147,7 +147,7 @@ func ExampleJobAgentsClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobAgent.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -168,7 +168,7 @@ func ExampleJobAgentsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateJobAgent.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/jobcredentials_client.go b/sdk/resourcemanager/sql/armsql/jobcredentials_client.go index 66c87de4e6f2..0a28e5fdc6e1 100644 --- a/sdk/resourcemanager/sql/armsql/jobcredentials_client.go +++ b/sdk/resourcemanager/sql/armsql/jobcredentials_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -57,18 +56,21 @@ func NewJobCredentialsClient(subscriptionID string, credential azcore.TokenCrede // - options - JobCredentialsClientCreateOrUpdateOptions contains the optional parameters for the JobCredentialsClient.CreateOrUpdate // method. func (client *JobCredentialsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, credentialName string, parameters JobCredential, options *JobCredentialsClientCreateOrUpdateOptions) (JobCredentialsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, credentialName, parameters, options) if err != nil { return JobCredentialsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobCredentialsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return JobCredentialsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return JobCredentialsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -102,7 +104,10 @@ func (client *JobCredentialsClient) createOrUpdateCreateRequest(ctx context.Cont reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -125,16 +130,18 @@ func (client *JobCredentialsClient) createOrUpdateHandleResponse(resp *http.Resp // - credentialName - The name of the credential. // - options - JobCredentialsClientDeleteOptions contains the optional parameters for the JobCredentialsClient.Delete method. func (client *JobCredentialsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, credentialName string, options *JobCredentialsClientDeleteOptions) (JobCredentialsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, credentialName, options) if err != nil { return JobCredentialsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobCredentialsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return JobCredentialsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return JobCredentialsClientDeleteResponse{}, err } return JobCredentialsClientDeleteResponse{}, nil } @@ -183,18 +190,21 @@ func (client *JobCredentialsClient) deleteCreateRequest(ctx context.Context, res // - credentialName - The name of the credential. // - options - JobCredentialsClientGetOptions contains the optional parameters for the JobCredentialsClient.Get method. func (client *JobCredentialsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, credentialName string, options *JobCredentialsClientGetOptions) (JobCredentialsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, credentialName, options) if err != nil { return JobCredentialsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobCredentialsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return JobCredentialsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return JobCredentialsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/jobcredentials_client_example_test.go b/sdk/resourcemanager/sql/armsql/jobcredentials_client_example_test.go index 02000671a4d9..307ceb3e9d1e 100644 --- a/sdk/resourcemanager/sql/armsql/jobcredentials_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/jobcredentials_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobCredentialsByAgent.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -62,7 +62,7 @@ func ExampleJobCredentialsClient_NewListByAgentPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobCredential.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -90,7 +90,7 @@ func ExampleJobCredentialsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobCredential.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -123,7 +123,7 @@ func ExampleJobCredentialsClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobCredential.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/jobexecutions_client.go b/sdk/resourcemanager/sql/armsql/jobexecutions_client.go index 14ad840770c1..62948e222358 100644 --- a/sdk/resourcemanager/sql/armsql/jobexecutions_client.go +++ b/sdk/resourcemanager/sql/armsql/jobexecutions_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -58,16 +57,18 @@ func NewJobExecutionsClient(subscriptionID string, credential azcore.TokenCreden // - jobExecutionID - The id of the job execution to cancel. // - options - JobExecutionsClientCancelOptions contains the optional parameters for the JobExecutionsClient.Cancel method. func (client *JobExecutionsClient) Cancel(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID string, options *JobExecutionsClientCancelOptions) (JobExecutionsClientCancelResponse, error) { + var err error req, err := client.cancelCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobExecutionID, options) if err != nil { return JobExecutionsClientCancelResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobExecutionsClientCancelResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return JobExecutionsClientCancelResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return JobExecutionsClientCancelResponse{}, err } return JobExecutionsClientCancelResponse{}, nil } @@ -123,7 +124,8 @@ func (client *JobExecutionsClient) BeginCreate(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller[JobExecutionsClientCreateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[JobExecutionsClientCreateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[JobExecutionsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -134,18 +136,20 @@ func (client *JobExecutionsClient) BeginCreate(ctx context.Context, resourceGrou // // Generated from API version 2020-11-01-preview func (client *JobExecutionsClient) create(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, options *JobExecutionsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -200,7 +204,8 @@ func (client *JobExecutionsClient) BeginCreateOrUpdate(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller[JobExecutionsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[JobExecutionsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[JobExecutionsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -211,18 +216,20 @@ func (client *JobExecutionsClient) BeginCreateOrUpdate(ctx context.Context, reso // // Generated from API version 2020-11-01-preview func (client *JobExecutionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID string, options *JobExecutionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobExecutionID, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -272,18 +279,21 @@ func (client *JobExecutionsClient) createOrUpdateCreateRequest(ctx context.Conte // - jobExecutionID - The id of the job execution // - options - JobExecutionsClientGetOptions contains the optional parameters for the JobExecutionsClient.Get method. func (client *JobExecutionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID string, options *JobExecutionsClientGetOptions) (JobExecutionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobExecutionID, options) if err != nil { return JobExecutionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobExecutionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return JobExecutionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return JobExecutionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/jobexecutions_client_example_test.go b/sdk/resourcemanager/sql/armsql/jobexecutions_client_example_test.go index afeba61a9a9a..6d31943946fb 100644 --- a/sdk/resourcemanager/sql/armsql/jobexecutions_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/jobexecutions_client_example_test.go @@ -17,10 +17,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionsByAgentWithFilter.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionsByAgentWithFilter.json func ExampleJobExecutionsClient_NewListByAgentPager_listAllJobExecutionsInAJobAgentWithFiltering() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -88,7 +88,7 @@ func ExampleJobExecutionsClient_NewListByAgentPager_listAllJobExecutionsInAJobAg } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionsByAgent.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionsByAgent.json func ExampleJobExecutionsClient_NewListByAgentPager_listAllJobExecutionsInAJobAgent() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -156,7 +156,7 @@ func ExampleJobExecutionsClient_NewListByAgentPager_listAllJobExecutionsInAJobAg } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelJobExecution.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -173,7 +173,7 @@ func ExampleJobExecutionsClient_Cancel() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateJobExecution.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -211,7 +211,7 @@ func ExampleJobExecutionsClient_BeginCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionsByJob.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -279,7 +279,7 @@ func ExampleJobExecutionsClient_NewListByJobPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobExecution.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -316,7 +316,7 @@ func ExampleJobExecutionsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobExecution.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/jobs_client.go b/sdk/resourcemanager/sql/armsql/jobs_client.go index 2043d5c52aa7..bc176d3bd02e 100644 --- a/sdk/resourcemanager/sql/armsql/jobs_client.go +++ b/sdk/resourcemanager/sql/armsql/jobs_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -56,18 +55,21 @@ func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, opt // - parameters - The requested job state. // - options - JobsClientCreateOrUpdateOptions contains the optional parameters for the JobsClient.CreateOrUpdate method. func (client *JobsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, parameters Job, options *JobsClientCreateOrUpdateOptions) (JobsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, parameters, options) if err != nil { return JobsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return JobsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return JobsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -101,7 +103,10 @@ func (client *JobsClient) createOrUpdateCreateRequest(ctx context.Context, resou reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -124,16 +129,18 @@ func (client *JobsClient) createOrUpdateHandleResponse(resp *http.Response) (Job // - jobName - The name of the job to delete. // - options - JobsClientDeleteOptions contains the optional parameters for the JobsClient.Delete method. func (client *JobsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, options *JobsClientDeleteOptions) (JobsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, options) if err != nil { return JobsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return JobsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return JobsClientDeleteResponse{}, err } return JobsClientDeleteResponse{}, nil } @@ -182,18 +189,21 @@ func (client *JobsClient) deleteCreateRequest(ctx context.Context, resourceGroup // - jobName - The name of the job to get. // - options - JobsClientGetOptions contains the optional parameters for the JobsClient.Get method. func (client *JobsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, options *JobsClientGetOptions) (JobsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, options) if err != nil { return JobsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return JobsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return JobsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/jobs_client_example_test.go b/sdk/resourcemanager/sql/armsql/jobs_client_example_test.go index 1b41ff5284e2..e72e95f77d58 100644 --- a/sdk/resourcemanager/sql/armsql/jobs_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/jobs_client_example_test.go @@ -17,10 +17,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobsByAgent.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -94,7 +94,7 @@ func ExampleJobsClient_NewListByAgentPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJob.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -129,7 +129,7 @@ func ExampleJobsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobMax.json func ExampleJobsClient_CreateOrUpdate_createAJobWithAllPropertiesSpecified() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -176,7 +176,7 @@ func ExampleJobsClient_CreateOrUpdate_createAJobWithAllPropertiesSpecified() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobMin.json func ExampleJobsClient_CreateOrUpdate_createAJobWithDefaultProperties() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -211,7 +211,7 @@ func ExampleJobsClient_CreateOrUpdate_createAJobWithDefaultProperties() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJob.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/jobstepexecutions_client.go b/sdk/resourcemanager/sql/armsql/jobstepexecutions_client.go index 2276c0b56ce5..0dfd3cba0f6d 100644 --- a/sdk/resourcemanager/sql/armsql/jobstepexecutions_client.go +++ b/sdk/resourcemanager/sql/armsql/jobstepexecutions_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -59,18 +58,21 @@ func NewJobStepExecutionsClient(subscriptionID string, credential azcore.TokenCr // - stepName - The name of the step. // - options - JobStepExecutionsClientGetOptions contains the optional parameters for the JobStepExecutionsClient.Get method. func (client *JobStepExecutionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID string, stepName string, options *JobStepExecutionsClientGetOptions) (JobStepExecutionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobExecutionID, stepName, options) if err != nil { return JobStepExecutionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobStepExecutionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return JobStepExecutionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return JobStepExecutionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/jobstepexecutions_client_example_test.go b/sdk/resourcemanager/sql/armsql/jobstepexecutions_client_example_test.go index 79d82521c605..082805b798b6 100644 --- a/sdk/resourcemanager/sql/armsql/jobstepexecutions_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/jobstepexecutions_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionSteps.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -71,7 +71,7 @@ func ExampleJobStepExecutionsClient_NewListByJobExecutionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobExecutionStep.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/jobsteps_client.go b/sdk/resourcemanager/sql/armsql/jobsteps_client.go index 224ea9f9cfa2..545a40f700b5 100644 --- a/sdk/resourcemanager/sql/armsql/jobsteps_client.go +++ b/sdk/resourcemanager/sql/armsql/jobsteps_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -58,18 +57,21 @@ func NewJobStepsClient(subscriptionID string, credential azcore.TokenCredential, // - parameters - The requested state of the job step. // - options - JobStepsClientCreateOrUpdateOptions contains the optional parameters for the JobStepsClient.CreateOrUpdate method. func (client *JobStepsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, stepName string, parameters JobStep, options *JobStepsClientCreateOrUpdateOptions) (JobStepsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, stepName, parameters, options) if err != nil { return JobStepsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobStepsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return JobStepsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return JobStepsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -107,7 +109,10 @@ func (client *JobStepsClient) createOrUpdateCreateRequest(ctx context.Context, r reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -131,16 +136,18 @@ func (client *JobStepsClient) createOrUpdateHandleResponse(resp *http.Response) // - stepName - The name of the job step to delete. // - options - JobStepsClientDeleteOptions contains the optional parameters for the JobStepsClient.Delete method. func (client *JobStepsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, stepName string, options *JobStepsClientDeleteOptions) (JobStepsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, stepName, options) if err != nil { return JobStepsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobStepsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return JobStepsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return JobStepsClientDeleteResponse{}, err } return JobStepsClientDeleteResponse{}, nil } @@ -194,18 +201,21 @@ func (client *JobStepsClient) deleteCreateRequest(ctx context.Context, resourceG // - stepName - The name of the job step. // - options - JobStepsClientGetOptions contains the optional parameters for the JobStepsClient.Get method. func (client *JobStepsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, stepName string, options *JobStepsClientGetOptions) (JobStepsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, stepName, options) if err != nil { return JobStepsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobStepsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return JobStepsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return JobStepsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -268,18 +278,21 @@ func (client *JobStepsClient) getHandleResponse(resp *http.Response) (JobStepsCl // - stepName - The name of the job step. // - options - JobStepsClientGetByVersionOptions contains the optional parameters for the JobStepsClient.GetByVersion method. func (client *JobStepsClient) GetByVersion(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobVersion int32, stepName string, options *JobStepsClientGetByVersionOptions) (JobStepsClientGetByVersionResponse, error) { + var err error req, err := client.getByVersionCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobVersion, stepName, options) if err != nil { return JobStepsClientGetByVersionResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobStepsClientGetByVersionResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return JobStepsClientGetByVersionResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return JobStepsClientGetByVersionResponse{}, err } - return client.getByVersionHandleResponse(resp) + resp, err := client.getByVersionHandleResponse(httpResp) + return resp, err } // getByVersionCreateRequest creates the GetByVersion request. diff --git a/sdk/resourcemanager/sql/armsql/jobsteps_client_example_test.go b/sdk/resourcemanager/sql/armsql/jobsteps_client_example_test.go index f7702126f9a4..50ad77561f77 100644 --- a/sdk/resourcemanager/sql/armsql/jobsteps_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/jobsteps_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobStepsByVersion.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -110,7 +110,7 @@ func ExampleJobStepsClient_NewListByVersionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobStepByVersion.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -162,7 +162,7 @@ func ExampleJobStepsClient_GetByVersion() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobStepsByJob.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -254,7 +254,7 @@ func ExampleJobStepsClient_NewListByJobPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobStepByJob.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -306,7 +306,7 @@ func ExampleJobStepsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobStepMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobStepMax.json func ExampleJobStepsClient_CreateOrUpdate_createOrUpdateAJobStepWithAllPropertiesSpecified() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -386,7 +386,7 @@ func ExampleJobStepsClient_CreateOrUpdate_createOrUpdateAJobStepWithAllPropertie // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobStepMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobStepMin.json func ExampleJobStepsClient_CreateOrUpdate_createOrUpdateAJobStepWithMinimalPropertiesSpecified() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -436,7 +436,7 @@ func ExampleJobStepsClient_CreateOrUpdate_createOrUpdateAJobStepWithMinimalPrope // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobStep.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/jobtargetexecutions_client.go b/sdk/resourcemanager/sql/armsql/jobtargetexecutions_client.go index ec7cf6e8b8c7..f146b1eb8fcf 100644 --- a/sdk/resourcemanager/sql/armsql/jobtargetexecutions_client.go +++ b/sdk/resourcemanager/sql/armsql/jobtargetexecutions_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -60,18 +59,21 @@ func NewJobTargetExecutionsClient(subscriptionID string, credential azcore.Token // - targetID - The target id. // - options - JobTargetExecutionsClientGetOptions contains the optional parameters for the JobTargetExecutionsClient.Get method. func (client *JobTargetExecutionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID string, stepName string, targetID string, options *JobTargetExecutionsClientGetOptions) (JobTargetExecutionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobExecutionID, stepName, targetID, options) if err != nil { return JobTargetExecutionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobTargetExecutionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return JobTargetExecutionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return JobTargetExecutionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/jobtargetexecutions_client_example_test.go b/sdk/resourcemanager/sql/armsql/jobtargetexecutions_client_example_test.go index 9cc24129bbb8..2bb130d2295f 100644 --- a/sdk/resourcemanager/sql/armsql/jobtargetexecutions_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/jobtargetexecutions_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionTargetsByExecution.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -76,7 +76,7 @@ func ExampleJobTargetExecutionsClient_NewListByJobExecutionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionTargetsByStep.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -135,7 +135,7 @@ func ExampleJobTargetExecutionsClient_NewListByStepPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobExecutionTarget.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/jobtargetgroups_client.go b/sdk/resourcemanager/sql/armsql/jobtargetgroups_client.go index 40c84f719cb9..e878d5b086ea 100644 --- a/sdk/resourcemanager/sql/armsql/jobtargetgroups_client.go +++ b/sdk/resourcemanager/sql/armsql/jobtargetgroups_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -57,18 +56,21 @@ func NewJobTargetGroupsClient(subscriptionID string, credential azcore.TokenCred // - options - JobTargetGroupsClientCreateOrUpdateOptions contains the optional parameters for the JobTargetGroupsClient.CreateOrUpdate // method. func (client *JobTargetGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, targetGroupName string, parameters JobTargetGroup, options *JobTargetGroupsClientCreateOrUpdateOptions) (JobTargetGroupsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, targetGroupName, parameters, options) if err != nil { return JobTargetGroupsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobTargetGroupsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return JobTargetGroupsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return JobTargetGroupsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -102,7 +104,10 @@ func (client *JobTargetGroupsClient) createOrUpdateCreateRequest(ctx context.Con reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -125,16 +130,18 @@ func (client *JobTargetGroupsClient) createOrUpdateHandleResponse(resp *http.Res // - targetGroupName - The name of the target group. // - options - JobTargetGroupsClientDeleteOptions contains the optional parameters for the JobTargetGroupsClient.Delete method. func (client *JobTargetGroupsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, targetGroupName string, options *JobTargetGroupsClientDeleteOptions) (JobTargetGroupsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, targetGroupName, options) if err != nil { return JobTargetGroupsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobTargetGroupsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return JobTargetGroupsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return JobTargetGroupsClientDeleteResponse{}, err } return JobTargetGroupsClientDeleteResponse{}, nil } @@ -183,18 +190,21 @@ func (client *JobTargetGroupsClient) deleteCreateRequest(ctx context.Context, re // - targetGroupName - The name of the target group. // - options - JobTargetGroupsClientGetOptions contains the optional parameters for the JobTargetGroupsClient.Get method. func (client *JobTargetGroupsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, targetGroupName string, options *JobTargetGroupsClientGetOptions) (JobTargetGroupsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, targetGroupName, options) if err != nil { return JobTargetGroupsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobTargetGroupsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return JobTargetGroupsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return JobTargetGroupsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/jobtargetgroups_client_example_test.go b/sdk/resourcemanager/sql/armsql/jobtargetgroups_client_example_test.go index 2adc3e856259..6d912b44d861 100644 --- a/sdk/resourcemanager/sql/armsql/jobtargetgroups_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/jobtargetgroups_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobTargetGroups.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -80,7 +80,7 @@ func ExampleJobTargetGroupsClient_NewListByAgentPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobTargetGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -134,7 +134,7 @@ func ExampleJobTargetGroupsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobTargetGroupMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobTargetGroupMax.json func ExampleJobTargetGroupsClient_CreateOrUpdate_createOrUpdateATargetGroupWithAllProperties() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -218,7 +218,7 @@ func ExampleJobTargetGroupsClient_CreateOrUpdate_createOrUpdateATargetGroupWithA // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobTargetGroupMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobTargetGroupMin.json func ExampleJobTargetGroupsClient_CreateOrUpdate_createOrUpdateATargetGroupWithMinimalProperties() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -251,7 +251,7 @@ func ExampleJobTargetGroupsClient_CreateOrUpdate_createOrUpdateATargetGroupWithM // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobTargetGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/jobversions_client.go b/sdk/resourcemanager/sql/armsql/jobversions_client.go index 11aad5ec0799..a6117ffa1bb9 100644 --- a/sdk/resourcemanager/sql/armsql/jobversions_client.go +++ b/sdk/resourcemanager/sql/armsql/jobversions_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -57,18 +56,21 @@ func NewJobVersionsClient(subscriptionID string, credential azcore.TokenCredenti // - jobVersion - The version of the job to get. // - options - JobVersionsClientGetOptions contains the optional parameters for the JobVersionsClient.Get method. func (client *JobVersionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobVersion int32, options *JobVersionsClientGetOptions) (JobVersionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobVersion, options) if err != nil { return JobVersionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobVersionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return JobVersionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return JobVersionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/jobversions_client_example_test.go b/sdk/resourcemanager/sql/armsql/jobversions_client_example_test.go index 1a0d4e7e8e7f..e9a1901ba77b 100644 --- a/sdk/resourcemanager/sql/armsql/jobversions_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/jobversions_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobVersions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -55,7 +55,7 @@ func ExampleJobVersionsClient_NewListByJobPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobVersion.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/ledgerdigestuploads_client.go b/sdk/resourcemanager/sql/armsql/ledgerdigestuploads_client.go index 7d0712bae366..94ff8a243f87 100644 --- a/sdk/resourcemanager/sql/armsql/ledgerdigestuploads_client.go +++ b/sdk/resourcemanager/sql/armsql/ledgerdigestuploads_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -60,7 +59,8 @@ func (client *LedgerDigestUploadsClient) BeginCreateOrUpdate(ctx context.Context if err != nil { return nil, err } - return runtime.NewPoller[LedgerDigestUploadsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[LedgerDigestUploadsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[LedgerDigestUploadsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,18 +71,20 @@ func (client *LedgerDigestUploadsClient) BeginCreateOrUpdate(ctx context.Context // // Generated from API version 2021-02-01-preview func (client *LedgerDigestUploadsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, ledgerDigestUploads LedgerDigestUploadsName, parameters LedgerDigestUploads, options *LedgerDigestUploadsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, ledgerDigestUploads, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -116,7 +118,10 @@ func (client *LedgerDigestUploadsClient) createOrUpdateCreateRequest(ctx context reqQP.Set("api-version", "2021-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDisable - Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger instance. @@ -135,7 +140,8 @@ func (client *LedgerDigestUploadsClient) BeginDisable(ctx context.Context, resou if err != nil { return nil, err } - return runtime.NewPoller[LedgerDigestUploadsClientDisableResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[LedgerDigestUploadsClientDisableResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[LedgerDigestUploadsClientDisableResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -146,18 +152,20 @@ func (client *LedgerDigestUploadsClient) BeginDisable(ctx context.Context, resou // // Generated from API version 2021-02-01-preview func (client *LedgerDigestUploadsClient) disable(ctx context.Context, resourceGroupName string, serverName string, databaseName string, ledgerDigestUploads LedgerDigestUploadsName, options *LedgerDigestUploadsClientBeginDisableOptions) (*http.Response, error) { + var err error req, err := client.disableCreateRequest(ctx, resourceGroupName, serverName, databaseName, ledgerDigestUploads, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // disableCreateRequest creates the Disable request. @@ -204,18 +212,21 @@ func (client *LedgerDigestUploadsClient) disableCreateRequest(ctx context.Contex // - databaseName - The name of the database. // - options - LedgerDigestUploadsClientGetOptions contains the optional parameters for the LedgerDigestUploadsClient.Get method. func (client *LedgerDigestUploadsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, ledgerDigestUploads LedgerDigestUploadsName, options *LedgerDigestUploadsClientGetOptions) (LedgerDigestUploadsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, ledgerDigestUploads, options) if err != nil { return LedgerDigestUploadsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LedgerDigestUploadsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LedgerDigestUploadsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LedgerDigestUploadsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/ledgerdigestuploads_client_example_test.go b/sdk/resourcemanager/sql/armsql/ledgerdigestuploads_client_example_test.go index 49e4efcc7dcb..a39f6c3869eb 100644 --- a/sdk/resourcemanager/sql/armsql/ledgerdigestuploads_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/ledgerdigestuploads_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -47,7 +47,7 @@ func ExampleLedgerDigestUploadsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsEnable.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -84,7 +84,7 @@ func ExampleLedgerDigestUploadsClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -121,7 +121,7 @@ func ExampleLedgerDigestUploadsClient_NewListByDatabasePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsDisable.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/longtermretentionbackups_client.go b/sdk/resourcemanager/sql/armsql/longtermretentionbackups_client.go index aca8458c57e8..8fe73b745cbc 100644 --- a/sdk/resourcemanager/sql/armsql/longtermretentionbackups_client.go +++ b/sdk/resourcemanager/sql/armsql/longtermretentionbackups_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -62,7 +61,8 @@ func (client *LongTermRetentionBackupsClient) BeginCopy(ctx context.Context, loc if err != nil { return nil, err } - return runtime.NewPoller[LongTermRetentionBackupsClientCopyResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[LongTermRetentionBackupsClientCopyResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[LongTermRetentionBackupsClientCopyResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -73,18 +73,20 @@ func (client *LongTermRetentionBackupsClient) BeginCopy(ctx context.Context, loc // // Generated from API version 2021-05-01-preview func (client *LongTermRetentionBackupsClient) copyOperation(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters CopyLongTermRetentionBackupParameters, options *LongTermRetentionBackupsClientBeginCopyOptions) (*http.Response, error) { + var err error req, err := client.copyCreateRequest(ctx, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // copyCreateRequest creates the Copy request. @@ -118,7 +120,10 @@ func (client *LongTermRetentionBackupsClient) copyCreateRequest(ctx context.Cont reqQP.Set("api-version", "2021-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginCopyByResourceGroup - Copy an existing long term retention backup to a different server. @@ -140,7 +145,8 @@ func (client *LongTermRetentionBackupsClient) BeginCopyByResourceGroup(ctx conte if err != nil { return nil, err } - return runtime.NewPoller[LongTermRetentionBackupsClientCopyByResourceGroupResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[LongTermRetentionBackupsClientCopyByResourceGroupResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[LongTermRetentionBackupsClientCopyByResourceGroupResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -151,18 +157,20 @@ func (client *LongTermRetentionBackupsClient) BeginCopyByResourceGroup(ctx conte // // Generated from API version 2021-05-01-preview func (client *LongTermRetentionBackupsClient) copyByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters CopyLongTermRetentionBackupParameters, options *LongTermRetentionBackupsClientBeginCopyByResourceGroupOptions) (*http.Response, error) { + var err error req, err := client.copyByResourceGroupCreateRequest(ctx, resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // copyByResourceGroupCreateRequest creates the CopyByResourceGroup request. @@ -200,7 +208,10 @@ func (client *LongTermRetentionBackupsClient) copyByResourceGroupCreateRequest(c reqQP.Set("api-version", "2021-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a long term retention backup. @@ -219,7 +230,8 @@ func (client *LongTermRetentionBackupsClient) BeginDelete(ctx context.Context, l if err != nil { return nil, err } - return runtime.NewPoller[LongTermRetentionBackupsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[LongTermRetentionBackupsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[LongTermRetentionBackupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -230,18 +242,20 @@ func (client *LongTermRetentionBackupsClient) BeginDelete(ctx context.Context, l // // Generated from API version 2021-05-01-preview func (client *LongTermRetentionBackupsClient) deleteOperation(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, options *LongTermRetentionBackupsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -295,7 +309,8 @@ func (client *LongTermRetentionBackupsClient) BeginDeleteByResourceGroup(ctx con if err != nil { return nil, err } - return runtime.NewPoller[LongTermRetentionBackupsClientDeleteByResourceGroupResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[LongTermRetentionBackupsClientDeleteByResourceGroupResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[LongTermRetentionBackupsClientDeleteByResourceGroupResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -306,18 +321,20 @@ func (client *LongTermRetentionBackupsClient) BeginDeleteByResourceGroup(ctx con // // Generated from API version 2021-05-01-preview func (client *LongTermRetentionBackupsClient) deleteByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, options *LongTermRetentionBackupsClientBeginDeleteByResourceGroupOptions) (*http.Response, error) { + var err error req, err := client.deleteByResourceGroupCreateRequest(ctx, resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteByResourceGroupCreateRequest creates the DeleteByResourceGroup request. @@ -368,18 +385,21 @@ func (client *LongTermRetentionBackupsClient) deleteByResourceGroupCreateRequest // - options - LongTermRetentionBackupsClientGetOptions contains the optional parameters for the LongTermRetentionBackupsClient.Get // method. func (client *LongTermRetentionBackupsClient) Get(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, options *LongTermRetentionBackupsClientGetOptions) (LongTermRetentionBackupsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options) if err != nil { return LongTermRetentionBackupsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LongTermRetentionBackupsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LongTermRetentionBackupsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LongTermRetentionBackupsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -438,18 +458,21 @@ func (client *LongTermRetentionBackupsClient) getHandleResponse(resp *http.Respo // - options - LongTermRetentionBackupsClientGetByResourceGroupOptions contains the optional parameters for the LongTermRetentionBackupsClient.GetByResourceGroup // method. func (client *LongTermRetentionBackupsClient) GetByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, options *LongTermRetentionBackupsClientGetByResourceGroupOptions) (LongTermRetentionBackupsClientGetByResourceGroupResponse, error) { + var err error req, err := client.getByResourceGroupCreateRequest(ctx, resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options) if err != nil { return LongTermRetentionBackupsClientGetByResourceGroupResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LongTermRetentionBackupsClientGetByResourceGroupResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LongTermRetentionBackupsClientGetByResourceGroupResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LongTermRetentionBackupsClientGetByResourceGroupResponse{}, err } - return client.getByResourceGroupHandleResponse(resp) + resp, err := client.getByResourceGroupHandleResponse(httpResp) + return resp, err } // getByResourceGroupCreateRequest creates the GetByResourceGroup request. @@ -990,7 +1013,8 @@ func (client *LongTermRetentionBackupsClient) BeginUpdate(ctx context.Context, l if err != nil { return nil, err } - return runtime.NewPoller[LongTermRetentionBackupsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[LongTermRetentionBackupsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[LongTermRetentionBackupsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -1001,18 +1025,20 @@ func (client *LongTermRetentionBackupsClient) BeginUpdate(ctx context.Context, l // // Generated from API version 2021-05-01-preview func (client *LongTermRetentionBackupsClient) update(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters UpdateLongTermRetentionBackupParameters, options *LongTermRetentionBackupsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -1046,7 +1072,10 @@ func (client *LongTermRetentionBackupsClient) updateCreateRequest(ctx context.Co reqQP.Set("api-version", "2021-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginUpdateByResourceGroup - Updates an existing long term retention backup. @@ -1068,7 +1097,8 @@ func (client *LongTermRetentionBackupsClient) BeginUpdateByResourceGroup(ctx con if err != nil { return nil, err } - return runtime.NewPoller[LongTermRetentionBackupsClientUpdateByResourceGroupResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[LongTermRetentionBackupsClientUpdateByResourceGroupResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[LongTermRetentionBackupsClientUpdateByResourceGroupResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -1079,18 +1109,20 @@ func (client *LongTermRetentionBackupsClient) BeginUpdateByResourceGroup(ctx con // // Generated from API version 2021-05-01-preview func (client *LongTermRetentionBackupsClient) updateByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters UpdateLongTermRetentionBackupParameters, options *LongTermRetentionBackupsClientBeginUpdateByResourceGroupOptions) (*http.Response, error) { + var err error req, err := client.updateByResourceGroupCreateRequest(ctx, resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateByResourceGroupCreateRequest creates the UpdateByResourceGroup request. @@ -1128,5 +1160,8 @@ func (client *LongTermRetentionBackupsClient) updateByResourceGroupCreateRequest reqQP.Set("api-version", "2021-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/longtermretentionbackups_client_example_test.go b/sdk/resourcemanager/sql/armsql/longtermretentionbackups_client_example_test.go index 67843ead9281..27698ac056c2 100644 --- a/sdk/resourcemanager/sql/armsql/longtermretentionbackups_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/longtermretentionbackups_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupCopy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -61,7 +61,7 @@ func ExampleLongTermRetentionBackupsClient_BeginCopy() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -101,7 +101,7 @@ func ExampleLongTermRetentionBackupsClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -133,7 +133,7 @@ func ExampleLongTermRetentionBackupsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -154,7 +154,7 @@ func ExampleLongTermRetentionBackupsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupListByDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -221,7 +221,7 @@ func ExampleLongTermRetentionBackupsClient_NewListByDatabasePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupListByLocation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -287,7 +287,7 @@ func ExampleLongTermRetentionBackupsClient_NewListByLocationPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupListByServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -353,7 +353,7 @@ func ExampleLongTermRetentionBackupsClient_NewListByServerPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupCopy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -396,7 +396,7 @@ func ExampleLongTermRetentionBackupsClient_BeginCopyByResourceGroup() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -436,7 +436,7 @@ func ExampleLongTermRetentionBackupsClient_BeginUpdateByResourceGroup() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -468,7 +468,7 @@ func ExampleLongTermRetentionBackupsClient_GetByResourceGroup() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -489,7 +489,7 @@ func ExampleLongTermRetentionBackupsClient_BeginDeleteByResourceGroup() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupListByDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -556,7 +556,7 @@ func ExampleLongTermRetentionBackupsClient_NewListByResourceGroupDatabasePager() } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupListByLocation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -622,7 +622,7 @@ func ExampleLongTermRetentionBackupsClient_NewListByResourceGroupLocationPager() } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupListByServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/longtermretentionmanagedinstancebackups_client.go b/sdk/resourcemanager/sql/armsql/longtermretentionmanagedinstancebackups_client.go index bc2257544cd6..aa29dcdf051f 100644 --- a/sdk/resourcemanager/sql/armsql/longtermretentionmanagedinstancebackups_client.go +++ b/sdk/resourcemanager/sql/armsql/longtermretentionmanagedinstancebackups_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -61,7 +60,8 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) BeginDelete(ctx con if err != nil { return nil, err } - return runtime.NewPoller[LongTermRetentionManagedInstanceBackupsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[LongTermRetentionManagedInstanceBackupsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[LongTermRetentionManagedInstanceBackupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) BeginDelete(ctx con // // Generated from API version 2021-05-01-preview func (client *LongTermRetentionManagedInstanceBackupsClient) deleteOperation(ctx context.Context, locationName string, managedInstanceName string, databaseName string, backupName string, options *LongTermRetentionManagedInstanceBackupsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, locationName, managedInstanceName, databaseName, backupName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -137,7 +139,8 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) BeginDeleteByResour if err != nil { return nil, err } - return runtime.NewPoller[LongTermRetentionManagedInstanceBackupsClientDeleteByResourceGroupResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[LongTermRetentionManagedInstanceBackupsClientDeleteByResourceGroupResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[LongTermRetentionManagedInstanceBackupsClientDeleteByResourceGroupResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -148,18 +151,20 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) BeginDeleteByResour // // Generated from API version 2021-05-01-preview func (client *LongTermRetentionManagedInstanceBackupsClient) deleteByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, databaseName string, backupName string, options *LongTermRetentionManagedInstanceBackupsClientBeginDeleteByResourceGroupOptions) (*http.Response, error) { + var err error req, err := client.deleteByResourceGroupCreateRequest(ctx, resourceGroupName, locationName, managedInstanceName, databaseName, backupName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteByResourceGroupCreateRequest creates the DeleteByResourceGroup request. @@ -210,18 +215,21 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) deleteByResourceGro // - options - LongTermRetentionManagedInstanceBackupsClientGetOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.Get // method. func (client *LongTermRetentionManagedInstanceBackupsClient) Get(ctx context.Context, locationName string, managedInstanceName string, databaseName string, backupName string, options *LongTermRetentionManagedInstanceBackupsClientGetOptions) (LongTermRetentionManagedInstanceBackupsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, locationName, managedInstanceName, databaseName, backupName, options) if err != nil { return LongTermRetentionManagedInstanceBackupsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LongTermRetentionManagedInstanceBackupsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LongTermRetentionManagedInstanceBackupsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LongTermRetentionManagedInstanceBackupsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -280,18 +288,21 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) getHandleResponse(r // - options - LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupOptions contains the optional parameters for the // LongTermRetentionManagedInstanceBackupsClient.GetByResourceGroup method. func (client *LongTermRetentionManagedInstanceBackupsClient) GetByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, databaseName string, backupName string, options *LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupOptions) (LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupResponse, error) { + var err error req, err := client.getByResourceGroupCreateRequest(ctx, resourceGroupName, locationName, managedInstanceName, databaseName, backupName, options) if err != nil { return LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupResponse{}, err } - return client.getByResourceGroupHandleResponse(resp) + resp, err := client.getByResourceGroupHandleResponse(httpResp) + return resp, err } // getByResourceGroupCreateRequest creates the GetByResourceGroup request. diff --git a/sdk/resourcemanager/sql/armsql/longtermretentionmanagedinstancebackups_client_example_test.go b/sdk/resourcemanager/sql/armsql/longtermretentionmanagedinstancebackups_client_example_test.go index e79d22b8ca5d..86e7f2d5149b 100644 --- a/sdk/resourcemanager/sql/armsql/longtermretentionmanagedinstancebackups_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/longtermretentionmanagedinstancebackups_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -49,7 +49,7 @@ func ExampleLongTermRetentionManagedInstanceBackupsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -70,7 +70,7 @@ func ExampleLongTermRetentionManagedInstanceBackupsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupListByDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -137,7 +137,7 @@ func ExampleLongTermRetentionManagedInstanceBackupsClient_NewListByDatabasePager } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupListByInstance.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -203,7 +203,7 @@ func ExampleLongTermRetentionManagedInstanceBackupsClient_NewListByInstancePager } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupListByLocation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -269,7 +269,7 @@ func ExampleLongTermRetentionManagedInstanceBackupsClient_NewListByLocationPager } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -301,7 +301,7 @@ func ExampleLongTermRetentionManagedInstanceBackupsClient_GetByResourceGroup() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -322,7 +322,7 @@ func ExampleLongTermRetentionManagedInstanceBackupsClient_BeginDeleteByResourceG } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -389,7 +389,7 @@ func ExampleLongTermRetentionManagedInstanceBackupsClient_NewListByResourceGroup } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByInstance.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -455,7 +455,7 @@ func ExampleLongTermRetentionManagedInstanceBackupsClient_NewListByResourceGroup } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByLocation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/longtermretentionpolicies_client.go b/sdk/resourcemanager/sql/armsql/longtermretentionpolicies_client.go index 7ab6e88d6b9a..a3a7bc2f7345 100644 --- a/sdk/resourcemanager/sql/armsql/longtermretentionpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/longtermretentionpolicies_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -62,7 +61,8 @@ func (client *LongTermRetentionPoliciesClient) BeginCreateOrUpdate(ctx context.C if err != nil { return nil, err } - return runtime.NewPoller[LongTermRetentionPoliciesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[LongTermRetentionPoliciesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[LongTermRetentionPoliciesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -73,18 +73,20 @@ func (client *LongTermRetentionPoliciesClient) BeginCreateOrUpdate(ctx context.C // // Generated from API version 2020-11-01-preview func (client *LongTermRetentionPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, policyName LongTermRetentionPolicyName, parameters LongTermRetentionPolicy, options *LongTermRetentionPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, policyName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -118,7 +120,10 @@ func (client *LongTermRetentionPoliciesClient) createOrUpdateCreateRequest(ctx c reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Get - Gets a database's long term retention policy. @@ -133,18 +138,21 @@ func (client *LongTermRetentionPoliciesClient) createOrUpdateCreateRequest(ctx c // - options - LongTermRetentionPoliciesClientGetOptions contains the optional parameters for the LongTermRetentionPoliciesClient.Get // method. func (client *LongTermRetentionPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, policyName LongTermRetentionPolicyName, options *LongTermRetentionPoliciesClientGetOptions) (LongTermRetentionPoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, policyName, options) if err != nil { return LongTermRetentionPoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LongTermRetentionPoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LongTermRetentionPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LongTermRetentionPoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/longtermretentionpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/longtermretentionpolicies_client_example_test.go index a9ae686cd0cb..38d3b97ce858 100644 --- a/sdk/resourcemanager/sql/armsql/longtermretentionpolicies_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/longtermretentionpolicies_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LongTermRetentionPolicyGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -49,7 +49,7 @@ func ExampleLongTermRetentionPoliciesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -91,7 +91,7 @@ func ExampleLongTermRetentionPoliciesClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LongTermRetentionPolicyListByDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/maintenancewindowoptions_client.go b/sdk/resourcemanager/sql/armsql/maintenancewindowoptions_client.go index 2984cf31b923..44c1f7ca5889 100644 --- a/sdk/resourcemanager/sql/armsql/maintenancewindowoptions_client.go +++ b/sdk/resourcemanager/sql/armsql/maintenancewindowoptions_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -56,18 +55,21 @@ func NewMaintenanceWindowOptionsClient(subscriptionID string, credential azcore. // - options - MaintenanceWindowOptionsClientGetOptions contains the optional parameters for the MaintenanceWindowOptionsClient.Get // method. func (client *MaintenanceWindowOptionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, maintenanceWindowOptionsName string, options *MaintenanceWindowOptionsClientGetOptions) (MaintenanceWindowOptionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, maintenanceWindowOptionsName, options) if err != nil { return MaintenanceWindowOptionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MaintenanceWindowOptionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MaintenanceWindowOptionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MaintenanceWindowOptionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/maintenancewindowoptions_client_example_test.go b/sdk/resourcemanager/sql/armsql/maintenancewindowoptions_client_example_test.go index 3eb3511fd8e3..becb4c097c08 100644 --- a/sdk/resourcemanager/sql/armsql/maintenancewindowoptions_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/maintenancewindowoptions_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetMaintenanceWindowOptions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/maintenancewindows_client.go b/sdk/resourcemanager/sql/armsql/maintenancewindows_client.go index fe9533355f3d..6fb19f5c593b 100644 --- a/sdk/resourcemanager/sql/armsql/maintenancewindows_client.go +++ b/sdk/resourcemanager/sql/armsql/maintenancewindows_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -56,16 +55,18 @@ func NewMaintenanceWindowsClient(subscriptionID string, credential azcore.TokenC // - options - MaintenanceWindowsClientCreateOrUpdateOptions contains the optional parameters for the MaintenanceWindowsClient.CreateOrUpdate // method. func (client *MaintenanceWindowsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, maintenanceWindowName string, parameters MaintenanceWindows, options *MaintenanceWindowsClientCreateOrUpdateOptions) (MaintenanceWindowsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, maintenanceWindowName, parameters, options) if err != nil { return MaintenanceWindowsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MaintenanceWindowsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MaintenanceWindowsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MaintenanceWindowsClientCreateOrUpdateResponse{}, err } return MaintenanceWindowsClientCreateOrUpdateResponse{}, nil } @@ -97,7 +98,10 @@ func (client *MaintenanceWindowsClient) createOrUpdateCreateRequest(ctx context. reqQP.Set("maintenanceWindowName", maintenanceWindowName) reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Get - Gets maintenance windows settings for a database. @@ -111,18 +115,21 @@ func (client *MaintenanceWindowsClient) createOrUpdateCreateRequest(ctx context. // - maintenanceWindowName - Maintenance window name. // - options - MaintenanceWindowsClientGetOptions contains the optional parameters for the MaintenanceWindowsClient.Get method. func (client *MaintenanceWindowsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, maintenanceWindowName string, options *MaintenanceWindowsClientGetOptions) (MaintenanceWindowsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, maintenanceWindowName, options) if err != nil { return MaintenanceWindowsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MaintenanceWindowsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MaintenanceWindowsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MaintenanceWindowsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/maintenancewindows_client_example_test.go b/sdk/resourcemanager/sql/armsql/maintenancewindows_client_example_test.go index 01b2cac90d26..4f3f4500e788 100644 --- a/sdk/resourcemanager/sql/armsql/maintenancewindows_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/maintenancewindows_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetMaintenanceWindows.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -51,7 +51,7 @@ func ExampleMaintenanceWindowsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateMaintenanceWindows.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/managedbackupshorttermretentionpolicies_client.go b/sdk/resourcemanager/sql/armsql/managedbackupshorttermretentionpolicies_client.go index 6b2c5d25771b..dbf138d7996b 100644 --- a/sdk/resourcemanager/sql/armsql/managedbackupshorttermretentionpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/managedbackupshorttermretentionpolicies_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -62,7 +61,8 @@ func (client *ManagedBackupShortTermRetentionPoliciesClient) BeginCreateOrUpdate if err != nil { return nil, err } - return runtime.NewPoller[ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -73,18 +73,20 @@ func (client *ManagedBackupShortTermRetentionPoliciesClient) BeginCreateOrUpdate // // Generated from API version 2020-11-01-preview func (client *ManagedBackupShortTermRetentionPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, policyName ManagedShortTermRetentionPolicyName, parameters ManagedBackupShortTermRetentionPolicy, options *ManagedBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, policyName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -118,7 +120,10 @@ func (client *ManagedBackupShortTermRetentionPoliciesClient) createOrUpdateCreat reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Get - Gets a managed database's short term retention policy. @@ -133,18 +138,21 @@ func (client *ManagedBackupShortTermRetentionPoliciesClient) createOrUpdateCreat // - options - ManagedBackupShortTermRetentionPoliciesClientGetOptions contains the optional parameters for the ManagedBackupShortTermRetentionPoliciesClient.Get // method. func (client *ManagedBackupShortTermRetentionPoliciesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, policyName ManagedShortTermRetentionPolicyName, options *ManagedBackupShortTermRetentionPoliciesClientGetOptions) (ManagedBackupShortTermRetentionPoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, policyName, options) if err != nil { return ManagedBackupShortTermRetentionPoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedBackupShortTermRetentionPoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedBackupShortTermRetentionPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedBackupShortTermRetentionPoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -284,7 +292,8 @@ func (client *ManagedBackupShortTermRetentionPoliciesClient) BeginUpdate(ctx con if err != nil { return nil, err } - return runtime.NewPoller[ManagedBackupShortTermRetentionPoliciesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedBackupShortTermRetentionPoliciesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedBackupShortTermRetentionPoliciesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -295,18 +304,20 @@ func (client *ManagedBackupShortTermRetentionPoliciesClient) BeginUpdate(ctx con // // Generated from API version 2020-11-01-preview func (client *ManagedBackupShortTermRetentionPoliciesClient) update(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, policyName ManagedShortTermRetentionPolicyName, parameters ManagedBackupShortTermRetentionPolicy, options *ManagedBackupShortTermRetentionPoliciesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, policyName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -340,5 +351,8 @@ func (client *ManagedBackupShortTermRetentionPoliciesClient) updateCreateRequest reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/managedbackupshorttermretentionpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedbackupshorttermretentionpolicies_client_example_test.go index c937f4835ce3..e1aa4f4a6a73 100644 --- a/sdk/resourcemanager/sql/armsql/managedbackupshorttermretentionpolicies_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/managedbackupshorttermretentionpolicies_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetManagedShortTermRetentionPolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -46,7 +46,7 @@ func ExampleManagedBackupShortTermRetentionPoliciesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateManagedShortTermRetentionPolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -82,7 +82,7 @@ func ExampleManagedBackupShortTermRetentionPoliciesClient_BeginCreateOrUpdate() // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetListManagedShortTermRetentionPolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/manageddatabaseadvancedthreatprotectionsettings_client.go b/sdk/resourcemanager/sql/armsql/manageddatabaseadvancedthreatprotectionsettings_client.go new file mode 100644 index 000000000000..4e9995f3ef01 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/manageddatabaseadvancedthreatprotectionsettings_client.go @@ -0,0 +1,268 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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 { + internal *arm.Client + subscriptionID string +} + +// 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) { + cl, err := arm.NewClient(moduleName+".ManagedDatabaseAdvancedThreatProtectionSettingsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ManagedDatabaseAdvancedThreatProtectionSettingsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + 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) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, advancedThreatProtectionName, parameters, options) + if err != nil { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// 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.internal.Endpoint(), 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"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// 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) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, advancedThreatProtectionName, options) + if err != nil { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// 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.internal.Endpoint(), 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. +// +// 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.NewListByDatabasePager 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.internal.Pipeline().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.internal.Endpoint(), 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/manageddatabaseadvancedthreatprotectionsettings_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabaseadvancedthreatprotectionsettings_client_example_test.go new file mode 100644 index 000000000000..c3273d9bf5b6 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/manageddatabaseadvancedthreatprotectionsettings_client_example_test.go @@ -0,0 +1,183 @@ +//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_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/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseAdvancedThreatProtectionSettingsListByDatabase.json +func ExampleManagedDatabaseAdvancedThreatProtectionSettingsClient_NewListByDatabasePager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewManagedDatabaseAdvancedThreatProtectionSettingsClient().NewListByDatabasePager("threatprotection-6852", "threatprotection-2080", "testdb", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ManagedDatabaseAdvancedThreatProtectionListResult = armsql.ManagedDatabaseAdvancedThreatProtectionListResult{ + // Value: []*armsql.ManagedDatabaseAdvancedThreatProtection{ + // { + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/advancedThreatProtectionSettings"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-6852/providers/Microsoft.Sql/managedInstances/threatprotection-2080/databases/testdb/advancedThreatProtectionSettings"), + // Properties: &armsql.AdvancedThreatProtectionProperties{ + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // State: to.Ptr(armsql.AdvancedThreatProtectionStateEnabled), + // }, + // SystemData: &armsql.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseAdvancedThreatProtectionSettingsGet.json +func ExampleManagedDatabaseAdvancedThreatProtectionSettingsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewManagedDatabaseAdvancedThreatProtectionSettingsClient().Get(ctx, "threatprotection-6852", "threatprotection-2080", "testdb", armsql.AdvancedThreatProtectionNameDefault, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedDatabaseAdvancedThreatProtection = armsql.ManagedDatabaseAdvancedThreatProtection{ + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/advancedThreatProtectionSettings"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/managedInstances/threatprotection-6440/advancedThreatProtectionSettings/Default"), + // Properties: &armsql.AdvancedThreatProtectionProperties{ + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // State: to.Ptr(armsql.AdvancedThreatProtectionStateEnabled), + // }, + // SystemData: &armsql.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseAdvancedThreatProtectionSettingsCreateMax.json +func ExampleManagedDatabaseAdvancedThreatProtectionSettingsClient_CreateOrUpdate_updateAManagedDatabasesAdvancedThreatProtectionSettingsWithAllParameters() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewManagedDatabaseAdvancedThreatProtectionSettingsClient().CreateOrUpdate(ctx, "threatprotection-4799", "threatprotection-6440", "testdb", armsql.AdvancedThreatProtectionNameDefault, armsql.ManagedDatabaseAdvancedThreatProtection{ + Properties: &armsql.AdvancedThreatProtectionProperties{ + State: to.Ptr(armsql.AdvancedThreatProtectionStateEnabled), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedDatabaseAdvancedThreatProtection = armsql.ManagedDatabaseAdvancedThreatProtection{ + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/advancedThreatProtectionSettings"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/managedInstances/threatprotection-6440/advancedThreatProtectionSettings/Default"), + // Properties: &armsql.AdvancedThreatProtectionProperties{ + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // State: to.Ptr(armsql.AdvancedThreatProtectionStateEnabled), + // }, + // SystemData: &armsql.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseAdvancedThreatProtectionSettingsCreateMin.json +func ExampleManagedDatabaseAdvancedThreatProtectionSettingsClient_CreateOrUpdate_updateAManagedDatabasesAdvancedThreatProtectionSettingsWithMinimalParameters() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewManagedDatabaseAdvancedThreatProtectionSettingsClient().CreateOrUpdate(ctx, "threatprotection-4799", "threatprotection-6440", "testdb", armsql.AdvancedThreatProtectionNameDefault, armsql.ManagedDatabaseAdvancedThreatProtection{ + Properties: &armsql.AdvancedThreatProtectionProperties{ + State: to.Ptr(armsql.AdvancedThreatProtectionStateDisabled), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedDatabaseAdvancedThreatProtection = armsql.ManagedDatabaseAdvancedThreatProtection{ + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/advancedThreatProtectionSettings"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/managedInstances/threatprotection-6440/advancedThreatProtectionSettings/Default"), + // Properties: &armsql.AdvancedThreatProtectionProperties{ + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // State: to.Ptr(armsql.AdvancedThreatProtectionStateDisabled), + // }, + // SystemData: &armsql.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), + // }, + // } +} diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasecolumns_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasecolumns_client.go index b1631433c6db..6c452cf89b9a 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasecolumns_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasecolumns_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -58,18 +57,21 @@ func NewManagedDatabaseColumnsClient(subscriptionID string, credential azcore.To // - options - ManagedDatabaseColumnsClientGetOptions contains the optional parameters for the ManagedDatabaseColumnsClient.Get // method. func (client *ManagedDatabaseColumnsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, options *ManagedDatabaseColumnsClientGetOptions) (ManagedDatabaseColumnsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, options) if err != nil { return ManagedDatabaseColumnsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedDatabaseColumnsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedDatabaseColumnsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseColumnsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasecolumns_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasecolumns_client_example_test.go index af025305ef34..896204d34cf0 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasecolumns_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasecolumns_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedColumnsListByDatabaseMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedColumnsListByDatabaseMax.json func ExampleManagedDatabaseColumnsClient_NewListByDatabasePager_filterManagedDatabaseColumns() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -68,7 +68,7 @@ func ExampleManagedDatabaseColumnsClient_NewListByDatabasePager_filterManagedDat } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedColumnsListByDatabaseMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedColumnsListByDatabaseMin.json func ExampleManagedDatabaseColumnsClient_NewListByDatabasePager_listManagedDatabaseColumns() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -123,7 +123,7 @@ func ExampleManagedDatabaseColumnsClient_NewListByDatabasePager_listManagedDatab } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnListByTable.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -167,7 +167,7 @@ func ExampleManagedDatabaseColumnsClient_NewListByTablePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasemoveoperations_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasemoveoperations_client.go new file mode 100644 index 000000000000..542931136cbb --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/manageddatabasemoveoperations_client.go @@ -0,0 +1,183 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// ManagedDatabaseMoveOperationsClient contains the methods for the ManagedDatabaseMoveOperations group. +// Don't use this type directly, use NewManagedDatabaseMoveOperationsClient() instead. +type ManagedDatabaseMoveOperationsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewManagedDatabaseMoveOperationsClient creates a new instance of ManagedDatabaseMoveOperationsClient 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 NewManagedDatabaseMoveOperationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedDatabaseMoveOperationsClient, error) { + cl, err := arm.NewClient(moduleName+".ManagedDatabaseMoveOperationsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ManagedDatabaseMoveOperationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Gets a managed database move operation. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-05-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. +// - options - ManagedDatabaseMoveOperationsClientGetOptions contains the optional parameters for the ManagedDatabaseMoveOperationsClient.Get +// method. +func (client *ManagedDatabaseMoveOperationsClient) Get(ctx context.Context, resourceGroupName string, locationName string, operationID string, options *ManagedDatabaseMoveOperationsClientGetOptions) (ManagedDatabaseMoveOperationsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, locationName, operationID, options) + if err != nil { + return ManagedDatabaseMoveOperationsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagedDatabaseMoveOperationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseMoveOperationsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ManagedDatabaseMoveOperationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, locationName string, operationID string, options *ManagedDatabaseMoveOperationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseMoveOperationResults/{operationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if locationName == "" { + return nil, errors.New("parameter locationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{locationName}", url.PathEscape(locationName)) + urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-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 *ManagedDatabaseMoveOperationsClient) getHandleResponse(resp *http.Response) (ManagedDatabaseMoveOperationsClientGetResponse, error) { + result := ManagedDatabaseMoveOperationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedDatabaseMoveOperationResult); err != nil { + return ManagedDatabaseMoveOperationsClientGetResponse{}, err + } + return result, nil +} + +// NewListByLocationPager - Lists managed database move operations. +// +// Generated from API version 2022-05-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. +// - options - ManagedDatabaseMoveOperationsClientListByLocationOptions contains the optional parameters for the ManagedDatabaseMoveOperationsClient.NewListByLocationPager +// method. +func (client *ManagedDatabaseMoveOperationsClient) NewListByLocationPager(resourceGroupName string, locationName string, options *ManagedDatabaseMoveOperationsClientListByLocationOptions) *runtime.Pager[ManagedDatabaseMoveOperationsClientListByLocationResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedDatabaseMoveOperationsClientListByLocationResponse]{ + More: func(page ManagedDatabaseMoveOperationsClientListByLocationResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedDatabaseMoveOperationsClientListByLocationResponse) (ManagedDatabaseMoveOperationsClientListByLocationResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByLocationCreateRequest(ctx, resourceGroupName, locationName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagedDatabaseMoveOperationsClientListByLocationResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagedDatabaseMoveOperationsClientListByLocationResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedDatabaseMoveOperationsClientListByLocationResponse{}, runtime.NewResponseError(resp) + } + return client.listByLocationHandleResponse(resp) + }, + }) +} + +// listByLocationCreateRequest creates the ListByLocation request. +func (client *ManagedDatabaseMoveOperationsClient) listByLocationCreateRequest(ctx context.Context, resourceGroupName string, locationName string, options *ManagedDatabaseMoveOperationsClientListByLocationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseMoveOperationResults" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if locationName == "" { + return nil, errors.New("parameter locationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{locationName}", url.PathEscape(locationName)) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.OnlyLatestPerDatabase != nil { + reqQP.Set("onlyLatestPerDatabase", strconv.FormatBool(*options.OnlyLatestPerDatabase)) + } + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByLocationHandleResponse handles the ListByLocation response. +func (client *ManagedDatabaseMoveOperationsClient) listByLocationHandleResponse(resp *http.Response) (ManagedDatabaseMoveOperationsClientListByLocationResponse, error) { + result := ManagedDatabaseMoveOperationsClientListByLocationResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedDatabaseMoveOperationListResult); err != nil { + return ManagedDatabaseMoveOperationsClientListByLocationResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasemoveoperations_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasemoveoperations_client_example_test.go new file mode 100644 index 000000000000..afb75f3da536 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/manageddatabasemoveoperations_client_example_test.go @@ -0,0 +1,262 @@ +//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_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/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedDatabaseMoveOperationResultList.json +func ExampleManagedDatabaseMoveOperationsClient_NewListByLocationPager_getsAllManagedDatabaseMoveOperationsForSpecifiedSubscriptionResourceGroupAndLocation() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewManagedDatabaseMoveOperationsClient().NewListByLocationPager("rg1", "westeurope", &armsql.ManagedDatabaseMoveOperationsClientListByLocationOptions{OnlyLatestPerDatabase: nil, + Filter: nil, + }) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ManagedDatabaseMoveOperationListResult = armsql.ManagedDatabaseMoveOperationListResult{ + // Value: []*armsql.ManagedDatabaseMoveOperationResult{ + // { + // Name: to.Ptr("15961324-d809-46ed-86b9-d786953140e2"), + // Type: to.Ptr("Microsoft.Sql/locations/managedDatabaseMoveOperationResults"), + // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/locations/westeurope/managedDatabaseMoveOperationResults/15961324-d809-46ed-86b9-d786953140e2"), + // Properties: &armsql.ManagedDatabaseMoveOperationResultProperties{ + // IsCancellable: to.Ptr(false), + // Operation: to.Ptr("startManagedInstanceDatabaseMove"), + // OperationFriendlyName: to.Ptr("Start Azure SQL Managed Instance database move"), + // OperationMode: to.Ptr(armsql.MoveOperationModeMove), + // SourceDatabaseName: to.Ptr("db1"), + // SourceManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/managedInstances/mi1"), + // SourceManagedInstanceName: to.Ptr("mi1"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-24T12:54:29.72Z"); return t}()), + // State: to.Ptr(armsql.ManagementOperationStateSucceeded), + // TargetDatabaseName: to.Ptr("db1"), + // TargetManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg2/providers/Microsoft.Sql/managedInstances/mi2"), + // TargetManagedInstanceName: to.Ptr("mi2"), + // }, + // }, + // { + // Name: to.Ptr("12341324-e123-45cd-86b9-d786953131a5"), + // Type: to.Ptr("Microsoft.Sql/locations/managedDatabaseMoveOperationResults"), + // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/locations/westeurope/managedDatabaseMoveOperationResults/12341324-e123-45cd-86b9-d786953131a5"), + // Properties: &armsql.ManagedDatabaseMoveOperationResultProperties{ + // IsCancellable: to.Ptr(true), + // Operation: to.Ptr("ContinueManagedInstanceDatabaseMove"), + // OperationFriendlyName: to.Ptr("Complete Azure SQL Managed Instance database move"), + // OperationMode: to.Ptr(armsql.MoveOperationModeMove), + // SourceDatabaseName: to.Ptr("db1"), + // SourceManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/managedInstances/mi1"), + // SourceManagedInstanceName: to.Ptr("mi1"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-24T12:54:29.72Z"); return t}()), + // State: to.Ptr(armsql.ManagementOperationStateInProgress), + // TargetDatabaseName: to.Ptr("db1"), + // TargetManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg2/providers/Microsoft.Sql/managedInstances/mi2"), + // TargetManagedInstanceName: to.Ptr("mi2"), + // }, + // }, + // { + // Name: to.Ptr("87654321-30a2-f39a-z171-b78695fg32a8"), + // Type: to.Ptr("Microsoft.Sql/locations/managedDatabaseMoveOperationResults"), + // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/locations/westeurope/managedDatabaseMoveOperationResults/87654321-30a2-f39a-z171-b78695fg32a8"), + // Properties: &armsql.ManagedDatabaseMoveOperationResultProperties{ + // IsCancellable: to.Ptr(true), + // Operation: to.Ptr("StartManagedInstanceDatabaseMove"), + // OperationFriendlyName: to.Ptr("Start Azure SQL Managed Instance database move"), + // OperationMode: to.Ptr(armsql.MoveOperationModeCopy), + // SourceDatabaseName: to.Ptr("db2"), + // SourceManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/managedInstances/mi1"), + // SourceManagedInstanceName: to.Ptr("mi1"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-24T13:37:19.71Z"); return t}()), + // State: to.Ptr(armsql.ManagementOperationStateInProgress), + // TargetDatabaseName: to.Ptr("db2"), + // TargetManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg2/providers/Microsoft.Sql/managedInstances/mi2"), + // TargetManagedInstanceName: to.Ptr("mi2"), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedDatabaseMoveOperationResultListMax.json +func ExampleManagedDatabaseMoveOperationsClient_NewListByLocationPager_getsTheLatestManagedDatabaseMoveOperationsForEachDatabaseUnderSpecifiedSubscriptionResourceGroupAndLocationFilteredByOperationType() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewManagedDatabaseMoveOperationsClient().NewListByLocationPager("rg1", "westeurope", &armsql.ManagedDatabaseMoveOperationsClientListByLocationOptions{OnlyLatestPerDatabase: nil, + Filter: to.Ptr("Properties/Operation eq 'StartManagedInstanceDatabaseMove'"), + }) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ManagedDatabaseMoveOperationListResult = armsql.ManagedDatabaseMoveOperationListResult{ + // Value: []*armsql.ManagedDatabaseMoveOperationResult{ + // { + // Name: to.Ptr("87654321-30a2-f39a-z171-b78695fg32a8"), + // Type: to.Ptr("Microsoft.Sql/locations/managedDatabaseMoveOperationResults"), + // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/locations/westeurope/managedDatabaseMoveOperationResults/87654321-30a2-f39a-z171-b78695fg32a8"), + // Properties: &armsql.ManagedDatabaseMoveOperationResultProperties{ + // IsCancellable: to.Ptr(true), + // Operation: to.Ptr("StartManagedInstanceDatabaseMove"), + // OperationFriendlyName: to.Ptr("Start Azure SQL Managed Instance database move"), + // OperationMode: to.Ptr(armsql.MoveOperationModeCopy), + // SourceDatabaseName: to.Ptr("db1"), + // SourceManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/managedInstances/mi1"), + // SourceManagedInstanceName: to.Ptr("mi1"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-24T12:54:29.72Z"); return t}()), + // State: to.Ptr(armsql.ManagementOperationStateInProgress), + // TargetDatabaseName: to.Ptr("db1"), + // TargetManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg2/providers/Microsoft.Sql/managedInstances/mi2"), + // TargetManagedInstanceName: to.Ptr("mi2"), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedDatabaseMoveOperationResultListLastOperations.json +func ExampleManagedDatabaseMoveOperationsClient_NewListByLocationPager_getsTheLatestManagedDatabaseMoveOperationsForEachDatabaseUnderSpecifiedSubscriptionResourceGroupAndLocation() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewManagedDatabaseMoveOperationsClient().NewListByLocationPager("rg1", "westeurope", &armsql.ManagedDatabaseMoveOperationsClientListByLocationOptions{OnlyLatestPerDatabase: nil, + Filter: nil, + }) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ManagedDatabaseMoveOperationListResult = armsql.ManagedDatabaseMoveOperationListResult{ + // Value: []*armsql.ManagedDatabaseMoveOperationResult{ + // { + // Name: to.Ptr("12341324-e123-45cd-86b9-d786953131a5"), + // Type: to.Ptr("Microsoft.Sql/locations/managedDatabaseMoveOperationResults"), + // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/locations/westeurope/managedDatabaseMoveOperationResults/12341324-e123-45cd-86b9-d786953131a5"), + // Properties: &armsql.ManagedDatabaseMoveOperationResultProperties{ + // IsCancellable: to.Ptr(true), + // Operation: to.Ptr("ContinueManagedInstanceDatabaseMove"), + // OperationFriendlyName: to.Ptr("Complete Azure SQL Managed Instance database move"), + // OperationMode: to.Ptr(armsql.MoveOperationModeMove), + // SourceDatabaseName: to.Ptr("db1"), + // SourceManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/managedInstances/mi1"), + // SourceManagedInstanceName: to.Ptr("mi1"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-24T12:54:29.72Z"); return t}()), + // State: to.Ptr(armsql.ManagementOperationStateInProgress), + // TargetDatabaseName: to.Ptr("db1"), + // TargetManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg2/providers/Microsoft.Sql/managedInstances/mi2"), + // TargetManagedInstanceName: to.Ptr("mi2"), + // }, + // }, + // { + // Name: to.Ptr("87654321-30a2-f39a-z171-b78695fg32a8"), + // Type: to.Ptr("Microsoft.Sql/locations/managedDatabaseMoveOperationResults"), + // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/locations/westeurope/managedDatabaseMoveOperationResults/87654321-30a2-f39a-z171-b78695fg32a8"), + // Properties: &armsql.ManagedDatabaseMoveOperationResultProperties{ + // IsCancellable: to.Ptr(true), + // Operation: to.Ptr("StartManagedInstanceDatabaseMove"), + // OperationFriendlyName: to.Ptr("Start Azure SQL Managed Instance database move"), + // OperationMode: to.Ptr(armsql.MoveOperationModeCopy), + // SourceDatabaseName: to.Ptr("db2"), + // SourceManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/managedInstances/mi1"), + // SourceManagedInstanceName: to.Ptr("mi1"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-24T13:37:19.71Z"); return t}()), + // State: to.Ptr(armsql.ManagementOperationStateInProgress), + // TargetDatabaseName: to.Ptr("db2"), + // TargetManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg2/providers/Microsoft.Sql/managedInstances/mi2"), + // TargetManagedInstanceName: to.Ptr("mi2"), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedDatabaseMoveOperationResultGet.json +func ExampleManagedDatabaseMoveOperationsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewManagedDatabaseMoveOperationsClient().Get(ctx, "rg1", "westeurope", "15961324-d809-46ed-86b9-d786953140e2", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedDatabaseMoveOperationResult = armsql.ManagedDatabaseMoveOperationResult{ + // Name: to.Ptr("15961324-d809-46ed-86b9-d786953140e2"), + // Type: to.Ptr("Microsoft.Sql/locations/managedDatabaseMoveOperationResults"), + // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/locations/westeurope/managedDatabaseMoveOperationResults/15961324-d809-46ed-86b9-d786953140e2"), + // Properties: &armsql.ManagedDatabaseMoveOperationResultProperties{ + // IsCancellable: to.Ptr(true), + // Operation: to.Ptr("StartManagedInstanceDatabaseMove"), + // OperationFriendlyName: to.Ptr("Start Azure SQL Managed Instance database move"), + // OperationMode: to.Ptr(armsql.MoveOperationModeMove), + // SourceDatabaseName: to.Ptr("db1"), + // SourceManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/managedInstances/mi1"), + // SourceManagedInstanceName: to.Ptr("mi1"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-24T12:54:29.72Z"); return t}()), + // State: to.Ptr(armsql.ManagementOperationStateInProgress), + // TargetDatabaseName: to.Ptr("db1"), + // TargetManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg2/providers/Microsoft.Sql/managedInstances/mi2"), + // TargetManagedInstanceName: to.Ptr("mi2"), + // }, + // } +} diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasequeries_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasequeries_client.go index 8a941e3b9ce1..c3e649d30907 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasequeries_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasequeries_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -55,18 +54,21 @@ func NewManagedDatabaseQueriesClient(subscriptionID string, credential azcore.To // - options - ManagedDatabaseQueriesClientGetOptions contains the optional parameters for the ManagedDatabaseQueriesClient.Get // method. func (client *ManagedDatabaseQueriesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, queryID string, options *ManagedDatabaseQueriesClientGetOptions) (ManagedDatabaseQueriesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, queryID, options) if err != nil { return ManagedDatabaseQueriesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedDatabaseQueriesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedDatabaseQueriesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseQueriesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasequeries_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasequeries_client_example_test.go index fc54c805fab9..9494aa603e68 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasequeries_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasequeries_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -45,7 +45,7 @@ func ExampleManagedDatabaseQueriesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryStatisticsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryStatisticsList.json func ExampleManagedDatabaseQueriesClient_NewListByQueryPager_obtainQueryExecutionStatistics() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -331,7 +331,7 @@ func ExampleManagedDatabaseQueriesClient_NewListByQueryPager_obtainQueryExecutio } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryStatisticsListMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryStatisticsListMax.json func ExampleManagedDatabaseQueriesClient_NewListByQueryPager_obtainQueryExecutionStatisticsExampleWithAllRequestParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -434,7 +434,7 @@ func ExampleManagedDatabaseQueriesClient_NewListByQueryPager_obtainQueryExecutio } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryStatisticsListMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryStatisticsListMin.json func ExampleManagedDatabaseQueriesClient_NewListByQueryPager_obtainQueryExecutionStatisticsMinimalExampleWithOnlyMandatoryRequestParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/sql/armsql/manageddatabaserecommendedsensitivitylabels_client.go b/sdk/resourcemanager/sql/armsql/manageddatabaserecommendedsensitivitylabels_client.go index 0f05c3a08734..9768556b637f 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabaserecommendedsensitivitylabels_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabaserecommendedsensitivitylabels_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -55,16 +54,18 @@ func NewManagedDatabaseRecommendedSensitivityLabelsClient(subscriptionID string, // - options - ManagedDatabaseRecommendedSensitivityLabelsClientUpdateOptions contains the optional parameters for the ManagedDatabaseRecommendedSensitivityLabelsClient.Update // method. func (client *ManagedDatabaseRecommendedSensitivityLabelsClient) Update(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters RecommendedSensitivityLabelUpdateList, options *ManagedDatabaseRecommendedSensitivityLabelsClientUpdateOptions) (ManagedDatabaseRecommendedSensitivityLabelsClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) if err != nil { return ManagedDatabaseRecommendedSensitivityLabelsClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedDatabaseRecommendedSensitivityLabelsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedDatabaseRecommendedSensitivityLabelsClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseRecommendedSensitivityLabelsClientUpdateResponse{}, err } return ManagedDatabaseRecommendedSensitivityLabelsClientUpdateResponse{}, nil } @@ -95,5 +96,8 @@ func (client *ManagedDatabaseRecommendedSensitivityLabelsClient) updateCreateReq reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/manageddatabaserecommendedsensitivitylabels_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabaserecommendedsensitivitylabels_client_example_test.go index 621114c30e71..44d2662bdea3 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabaserecommendedsensitivitylabels_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabaserecommendedsensitivitylabels_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsRecommendedUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/manageddatabaserestoredetails_client.go b/sdk/resourcemanager/sql/armsql/manageddatabaserestoredetails_client.go index 620dcdfbd1f4..7ff474aa6c62 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabaserestoredetails_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabaserestoredetails_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -47,7 +46,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-05-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. @@ -56,18 +55,21 @@ func NewManagedDatabaseRestoreDetailsClient(subscriptionID string, credential az // - options - ManagedDatabaseRestoreDetailsClientGetOptions contains the optional parameters for the ManagedDatabaseRestoreDetailsClient.Get // method. func (client *ManagedDatabaseRestoreDetailsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, restoreDetailsName RestoreDetailsName, options *ManagedDatabaseRestoreDetailsClientGetOptions) (ManagedDatabaseRestoreDetailsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, restoreDetailsName, options) if err != nil { return ManagedDatabaseRestoreDetailsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedDatabaseRestoreDetailsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedDatabaseRestoreDetailsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseRestoreDetailsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -98,7 +100,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-05-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/manageddatabaserestoredetails_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabaserestoredetails_client_example_test.go index a56c25cc5ba1..3f2f2bc9120a 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabaserestoredetails_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabaserestoredetails_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseRestoreDetails.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedDatabaseRestoreDetails.json func ExampleManagedDatabaseRestoreDetailsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -40,14 +40,129 @@ func ExampleManagedDatabaseRestoreDetailsClient_Get() { // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/restoreDetails"), // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/databases/testdb/restoreDetails/current"), // Properties: &armsql.ManagedDatabaseRestoreDetailsProperties{ - // CurrentRestoringFileName: to.Ptr("full_0"), - // LastUploadedFileName: to.Ptr("log2_3"), - // LastUploadedFileTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-15T11:38:33Z"); return t}()), - // NumberOfFilesDetected: to.Ptr[int64](26), - // PercentCompleted: to.Ptr[float64](0), + // Type: to.Ptr("LRSRestore"), + // CurrentBackupType: to.Ptr("Log"), + // CurrentRestorePlanSizeMB: to.Ptr[int32](47), + // CurrentRestoredSizeMB: to.Ptr[int32](25), + // CurrentRestoringFileName: to.Ptr("RestoreDetailsFullBlownExampleLog10.bak"), + // DiffBackupSets: []*armsql.ManagedDatabaseRestoreDetailsBackupSetProperties{ + // { + // BackupSizeMB: to.Ptr[int32](0), + // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleDiff2.bak"), + // NumberOfStripes: to.Ptr[int32](1), + // Status: to.Ptr("Skipped"), + // }, + // { + // BackupSizeMB: to.Ptr[int32](1), + // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleDiff3_1.bak"), + // NumberOfStripes: to.Ptr[int32](3), + // RestoreFinishedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:20:21.3667454Z"); return t}()), + // RestoreStartedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:19:40.5455092Z"); return t}()), + // Status: to.Ptr("Restored"), + // }}, + // FullBackupSets: []*armsql.ManagedDatabaseRestoreDetailsBackupSetProperties{ + // { + // BackupSizeMB: to.Ptr[int32](2), + // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleFull2.bak"), + // NumberOfStripes: to.Ptr[int32](1), + // Status: to.Ptr("Skipped"), + // }, + // { + // BackupSizeMB: to.Ptr[int32](3), + // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleFull3_1.bak"), + // NumberOfStripes: to.Ptr[int32](3), + // RestoreFinishedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:18:41.3785089Z"); return t}()), + // RestoreStartedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:15:40.3143263Z"); return t}()), + // Status: to.Ptr("Restored"), + // }}, + // LastRestoredFileName: to.Ptr("RestoreDetailsFullBlownExampleLog9_1.bak"), + // LastRestoredFileTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:27:20.4936305Z"); return t}()), + // LastUploadedFileName: to.Ptr("RestoreDetailsFullBlownExampleLog11.bak"), + // LastUploadedFileTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-01T07:54:21Z"); return t}()), + // LogBackupSets: []*armsql.ManagedDatabaseRestoreDetailsBackupSetProperties{ + // { + // BackupSizeMB: to.Ptr[int32](0), + // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleLog2.bak"), + // NumberOfStripes: to.Ptr[int32](1), + // Status: to.Ptr("Skipped"), + // }, + // { + // BackupSizeMB: to.Ptr[int32](8), + // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleLog3.bak"), + // NumberOfStripes: to.Ptr[int32](1), + // Status: to.Ptr("Skipped"), + // }, + // { + // BackupSizeMB: to.Ptr[int32](11), + // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleLog4.bak"), + // NumberOfStripes: to.Ptr[int32](1), + // Status: to.Ptr("Skipped"), + // }, + // { + // BackupSizeMB: to.Ptr[int32](7), + // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleLog5.bak"), + // NumberOfStripes: to.Ptr[int32](1), + // RestoreFinishedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:21:54.7557851Z"); return t}()), + // RestoreStartedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:21:01.7717453Z"); return t}()), + // Status: to.Ptr("Restored"), + // }, + // { + // BackupSizeMB: to.Ptr[int32](3), + // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleLog6.bak"), + // NumberOfStripes: to.Ptr[int32](1), + // RestoreFinishedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:23:03.709407Z"); return t}()), + // RestoreStartedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:22:41.8784062Z"); return t}()), + // Status: to.Ptr("Restored"), + // }, + // { + // BackupSizeMB: to.Ptr[int32](4), + // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleLog7.bak"), + // NumberOfStripes: to.Ptr[int32](1), + // RestoreFinishedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:23:52.9274047Z"); return t}()), + // RestoreStartedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:23:36.6264066Z"); return t}()), + // Status: to.Ptr("Restored"), + // }, + // { + // BackupSizeMB: to.Ptr[int32](3), + // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleLog8.bak"), + // NumberOfStripes: to.Ptr[int32](1), + // RestoreFinishedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:24:37.9954063Z"); return t}()), + // RestoreStartedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:24:25.899407Z"); return t}()), + // Status: to.Ptr("Restored"), + // }, + // { + // BackupSizeMB: to.Ptr[int32](4), + // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleLog9_1.bak"), + // NumberOfStripes: to.Ptr[int32](4), + // RestoreFinishedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:25:27.808409Z"); return t}()), + // RestoreStartedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:25:10.8804065Z"); return t}()), + // Status: to.Ptr("Restored"), + // }, + // { + // BackupSizeMB: to.Ptr[int32](15), + // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleLog10.bak"), + // NumberOfStripes: to.Ptr[int32](1), + // RestoreStartedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:26:00.7813103Z"); return t}()), + // Status: to.Ptr("Restoring"), + // }, + // { + // BackupSizeMB: to.Ptr[int32](7), + // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleLog11.bak"), + // NumberOfStripes: to.Ptr[int32](1), + // Status: to.Ptr("Queued"), + // }}, + // NumberOfFilesDetected: to.Ptr[int32](25), + // NumberOfFilesQueued: to.Ptr[int32](1), + // NumberOfFilesRestored: to.Ptr[int32](14), + // NumberOfFilesRestoring: to.Ptr[int32](1), + // NumberOfFilesSkipped: to.Ptr[int32](8), + // NumberOfFilesUnrestorable: to.Ptr[int32](1), + // PercentCompleted: to.Ptr[int32](53), // Status: to.Ptr("Restoring"), - // UnrestorableFiles: []*string{ - // }, + // UnrestorableFiles: []*armsql.ManagedDatabaseRestoreDetailsUnrestorableFileProperties{ + // { + // Name: to.Ptr("ImageFile.JPG"), + // }}, // }, // } } diff --git a/sdk/resourcemanager/sql/armsql/manageddatabases_client.go b/sdk/resourcemanager/sql/armsql/manageddatabases_client.go index 7fa650a7f66d..124639567594 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabases_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabases_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -44,10 +43,164 @@ 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-08-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 + } + poller, err := runtime.NewPoller[ManagedDatabasesClientCancelMoveResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ManagedDatabasesClientCancelMoveResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CancelMove - Cancels a managed database move operation. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01-preview +func (client *ManagedDatabasesClient) cancelMove(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseMoveDefinition, options *ManagedDatabasesClientBeginCancelMoveOptions) (*http.Response, error) { + var err error + req, err := client.cancelMoveCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginCompleteMove - Completes a managed database move operation. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-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 + } + poller, err := runtime.NewPoller[ManagedDatabasesClientCompleteMoveResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ManagedDatabasesClientCompleteMoveResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CompleteMove - Completes a managed database move operation. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01-preview +func (client *ManagedDatabasesClient) completeMove(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseMoveDefinition, options *ManagedDatabasesClientBeginCompleteMoveOptions) (*http.Response, error) { + var err error + req, err := client.completeMoveCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + // 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-08-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. @@ -61,7 +214,8 @@ func (client *ManagedDatabasesClient) BeginCompleteRestore(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[ManagedDatabasesClientCompleteRestoreResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedDatabasesClientCompleteRestoreResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedDatabasesClientCompleteRestoreResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,20 +224,22 @@ 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-08-01-preview func (client *ManagedDatabasesClient) completeRestore(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters CompleteDatabaseRestoreDefinition, options *ManagedDatabasesClientBeginCompleteRestoreOptions) (*http.Response, error) { + var err error req, err := client.completeRestoreCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // completeRestoreCreateRequest creates the CompleteRestore request. @@ -110,15 +266,18 @@ 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-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // 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-08-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. @@ -132,7 +291,8 @@ func (client *ManagedDatabasesClient) BeginCreateOrUpdate(ctx context.Context, r if err != nil { return nil, err } - return runtime.NewPoller[ManagedDatabasesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedDatabasesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedDatabasesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -141,20 +301,22 @@ 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-08-01-preview func (client *ManagedDatabasesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabase, options *ManagedDatabasesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -181,16 +343,19 @@ 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-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // 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-08-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. @@ -203,7 +368,8 @@ func (client *ManagedDatabasesClient) BeginDelete(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller[ManagedDatabasesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedDatabasesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedDatabasesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -212,20 +378,22 @@ 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-08-01-preview func (client *ManagedDatabasesClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabasesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -252,7 +420,7 @@ 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-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -260,25 +428,28 @@ func (client *ManagedDatabasesClient) deleteCreateRequest(ctx context.Context, r // 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-08-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 - ManagedDatabasesClientGetOptions contains the optional parameters for the ManagedDatabasesClient.Get method. func (client *ManagedDatabasesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabasesClientGetOptions) (ManagedDatabasesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, options) if err != nil { return ManagedDatabasesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedDatabasesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedDatabasesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabasesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -305,7 +476,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-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -322,7 +493,7 @@ func (client *ManagedDatabasesClient) getHandleResponse(resp *http.Response) (Ma // NewListByInstancePager - Gets a list of managed databases. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-08-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. @@ -376,7 +547,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-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -393,7 +564,7 @@ func (client *ManagedDatabasesClient) listByInstanceHandleResponse(resp *http.Re // NewListInaccessibleByInstancePager - Gets a list of inaccessible managed databases in a managed instance // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-08-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. @@ -447,7 +618,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-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -462,10 +633,87 @@ 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-08-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 + } + poller, err := runtime.NewPoller[ManagedDatabasesClientStartMoveResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ManagedDatabasesClientStartMoveResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// StartMove - Starts a managed database move operation. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01-preview +func (client *ManagedDatabasesClient) startMove(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseStartMoveDefinition, options *ManagedDatabasesClientBeginStartMoveOptions) (*http.Response, error) { + var err error + req, err := client.startMoveCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + // 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-08-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. @@ -479,7 +727,8 @@ func (client *ManagedDatabasesClient) BeginUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller[ManagedDatabasesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedDatabasesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedDatabasesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -488,20 +737,22 @@ 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-08-01-preview func (client *ManagedDatabasesClient) update(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseUpdate, options *ManagedDatabasesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -528,8 +779,11 @@ 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-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/manageddatabases_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabases_client_example_test.go index 35efc3e3ebb5..f4fc8cd7262d 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabases_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabases_client_example_test.go @@ -17,10 +17,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseListByManagedInstance.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseListByManagedInstance.json func ExampleManagedDatabasesClient_NewListByInstancePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -53,6 +53,7 @@ func ExampleManagedDatabasesClient_NewListByInstancePager() { // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-04T15:00:17.73Z"); return t}()), // DefaultSecondaryLocation: to.Ptr("North Europe"), + // IsLedgerOn: to.Ptr(false), // Status: to.Ptr(armsql.ManagedDatabaseStatusOnline), // }, // }, @@ -65,6 +66,7 @@ func ExampleManagedDatabasesClient_NewListByInstancePager() { // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-04T15:00:17.73Z"); return t}()), // DefaultSecondaryLocation: to.Ptr("North Europe"), + // IsLedgerOn: to.Ptr(false), // Status: to.Ptr(armsql.ManagedDatabaseStatusOnline), // }, // }}, @@ -72,7 +74,7 @@ func ExampleManagedDatabasesClient_NewListByInstancePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseGet.json func ExampleManagedDatabasesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -99,12 +101,13 @@ func ExampleManagedDatabasesClient_Get() { // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-04T15:00:17.73Z"); return t}()), // DefaultSecondaryLocation: to.Ptr("North Europe"), + // IsLedgerOn: to.Ptr(false), // Status: to.Ptr(armsql.ManagedDatabaseStatusOnline), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseCreateRestoreExternalBackup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCreateRestoreExternalBackup.json func ExampleManagedDatabasesClient_BeginCreateOrUpdate_createsANewManagedDatabaseByRestoringFromAnExternalBackup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -148,12 +151,63 @@ func ExampleManagedDatabasesClient_BeginCreateOrUpdate_createsANewManagedDatabas // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), // DefaultSecondaryLocation: to.Ptr("North Europe"), + // IsLedgerOn: to.Ptr(false), // Status: to.Ptr(armsql.ManagedDatabaseStatusOnline), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseCreateRecovery.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCreateRestoreExternalBackupManagedIdentity.json +func ExampleManagedDatabasesClient_BeginCreateOrUpdate_createsANewManagedDatabaseByRestoringFromAnExternalBackupUsingManagedIdentity() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedDatabasesClient().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"), + StorageContainerIdentity: to.Ptr("ManagedIdentity"), + 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedDatabase = armsql.ManagedDatabase{ + // Name: to.Ptr("testdb1"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/databases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb1"), + // Location: to.Ptr("southeastasia"), + // Tags: map[string]*string{ + // "tagKey1": to.Ptr("TagValue1"), + // }, + // Properties: &armsql.ManagedDatabaseProperties{ + // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), + // DefaultSecondaryLocation: to.Ptr("North Europe"), + // IsLedgerOn: to.Ptr(false), + // Status: to.Ptr(armsql.ManagedDatabaseStatusOnline), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCreateRecovery.json func ExampleManagedDatabasesClient_BeginCreateOrUpdate_createsANewManagedDatabaseFromRestoringAGeoReplicatedBackup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -192,12 +246,13 @@ func ExampleManagedDatabasesClient_BeginCreateOrUpdate_createsANewManagedDatabas // Properties: &armsql.ManagedDatabaseProperties{ // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-07T04:41:33.937Z"); return t}()), + // IsLedgerOn: to.Ptr(false), // Status: to.Ptr(armsql.ManagedDatabaseStatusOnline), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseCreateRestoreLtrBackup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCreateRestoreLtrBackup.json func ExampleManagedDatabasesClient_BeginCreateOrUpdate_createsANewManagedDatabaseFromRestoringALongTermRetentionBackup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -239,12 +294,61 @@ func ExampleManagedDatabasesClient_BeginCreateOrUpdate_createsANewManagedDatabas // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), // DefaultSecondaryLocation: to.Ptr("North Europe"), + // IsLedgerOn: to.Ptr(false), + // Status: to.Ptr(armsql.ManagedDatabaseStatusOnline), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCreateCrossSubscriptionPointInTimeRestore.json +func ExampleManagedDatabasesClient_BeginCreateOrUpdate_createsANewManagedDatabaseUsingCrossSubscriptionPointInTimeRestore() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "managedInstance", "managedDatabase", armsql.ManagedDatabase{ + Location: to.Ptr("southeastasia"), + Properties: &armsql.ManagedDatabaseProperties{ + CreateMode: to.Ptr(armsql.ManagedDatabaseCreateModePointInTimeRestore), + CrossSubscriptionSourceDatabaseID: to.Ptr("/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr2/databases/testdb"), + CrossSubscriptionTargetManagedInstanceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr"), + RestorePointInTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-14T05:35:31.503Z"); return t }()), + }, + }, 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedDatabase = armsql.ManagedDatabase{ + // Name: to.Ptr("testdb1"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/databases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb1"), + // Location: to.Ptr("southeastasia"), + // Tags: map[string]*string{ + // "tagKey1": to.Ptr("TagValue1"), + // }, + // Properties: &armsql.ManagedDatabaseProperties{ + // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), + // DefaultSecondaryLocation: to.Ptr("North Europe"), + // IsLedgerOn: to.Ptr(false), // Status: to.Ptr(armsql.ManagedDatabaseStatusOnline), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseCreatePointInTimeRestore.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCreatePointInTimeRestore.json func ExampleManagedDatabasesClient_BeginCreateOrUpdate_createsANewManagedDatabaseUsingPointInTimeRestore() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -285,12 +389,58 @@ func ExampleManagedDatabasesClient_BeginCreateOrUpdate_createsANewManagedDatabas // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), // DefaultSecondaryLocation: to.Ptr("North Europe"), + // IsLedgerOn: to.Ptr(false), // Status: to.Ptr(armsql.ManagedDatabaseStatusOnline), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseCreateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateManagedDatabaseLedger.json +func ExampleManagedDatabasesClient_BeginCreateOrUpdate_createsANewManagedDatabaseWithLedgerOn() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "managedInstance", "managedDatabase", armsql.ManagedDatabase{ + Location: to.Ptr("southeastasia"), + Properties: &armsql.ManagedDatabaseProperties{ + IsLedgerOn: 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedDatabase = armsql.ManagedDatabase{ + // Name: to.Ptr("testdb1"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/databases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testcl/databases/testdb1"), + // Location: to.Ptr("southeastasia"), + // Tags: map[string]*string{ + // "tagKey1": to.Ptr("TagValue1"), + // }, + // Properties: &armsql.ManagedDatabaseProperties{ + // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), + // DefaultSecondaryLocation: to.Ptr("North Europe"), + // IsLedgerOn: to.Ptr(true), + // Status: to.Ptr(armsql.ManagedDatabaseStatusOnline), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCreateMax.json func ExampleManagedDatabasesClient_BeginCreateOrUpdate_createsANewManagedDatabaseWithMaximalProperties() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -329,12 +479,13 @@ func ExampleManagedDatabasesClient_BeginCreateOrUpdate_createsANewManagedDatabas // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), // DefaultSecondaryLocation: to.Ptr("North Europe"), + // IsLedgerOn: to.Ptr(false), // Status: to.Ptr(armsql.ManagedDatabaseStatusOnline), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseCreateMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCreateMin.json func ExampleManagedDatabasesClient_BeginCreateOrUpdate_createsANewManagedDatabaseWithMinimalProperties() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -367,12 +518,13 @@ func ExampleManagedDatabasesClient_BeginCreateOrUpdate_createsANewManagedDatabas // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), // DefaultSecondaryLocation: to.Ptr("North Europe"), + // IsLedgerOn: to.Ptr(false), // Status: to.Ptr(armsql.ManagedDatabaseStatusOnline), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseDelete.json func ExampleManagedDatabasesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -393,7 +545,7 @@ func ExampleManagedDatabasesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseUpdateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseUpdateMax.json func ExampleManagedDatabasesClient_BeginUpdate_updatesAManagedDatabaseWithMaximalProperties() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -429,7 +581,7 @@ func ExampleManagedDatabasesClient_BeginUpdate_updatesAManagedDatabaseWithMaxima // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseUpdateMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseUpdateMin.json func ExampleManagedDatabasesClient_BeginUpdate_updatesAManagedDatabaseWithMinimalProperties() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -465,7 +617,53 @@ func ExampleManagedDatabasesClient_BeginUpdate_updatesAManagedDatabaseWithMinima // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseCompleteExternalRestore.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCancelMove.json +func ExampleManagedDatabasesClient_BeginCancelMove() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedDatabasesClient().BeginCancelMove(ctx, "group1", "testInstanceSrc", "testDatabase", armsql.ManagedDatabaseMoveDefinition{ + DestinationManagedDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/managedInstances/testInstanceTgt/databases/testDatabase"), + }, 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/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCompleteMove.json +func ExampleManagedDatabasesClient_BeginCompleteMove() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedDatabasesClient().BeginCompleteMove(ctx, "group1", "testInstanceSrc", "testDatabase", armsql.ManagedDatabaseMoveDefinition{ + DestinationManagedDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/managedInstances/testInstanceTgt/databases/testDatabase"), + }, 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/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCompleteExternalRestore.json func ExampleManagedDatabasesClient_BeginCompleteRestore() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -488,7 +686,54 @@ func ExampleManagedDatabasesClient_BeginCompleteRestore() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InaccessibleManagedDatabaseListByManagedInstance.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseStartMoveMax.json +func ExampleManagedDatabasesClient_BeginStartMove_startsAManagedDatabaseMoveWithAllOptionalParametersSpecified() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedDatabasesClient().BeginStartMove(ctx, "group1", "testInstanceSrc", "testDatabase", armsql.ManagedDatabaseStartMoveDefinition{ + DestinationManagedDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/managedInstances/testInstanceTgt/databases/testDatabase"), + OperationMode: to.Ptr(armsql.MoveOperationModeCopy), + }, 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/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseStartMoveMin.json +func ExampleManagedDatabasesClient_BeginStartMove_startsAManagedDatabaseMoveWithNoOptionalParametersSpecified() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedDatabasesClient().BeginStartMove(ctx, "group1", "testInstanceSrc", "testDatabase", armsql.ManagedDatabaseStartMoveDefinition{ + DestinationManagedDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/managedInstances/testInstanceTgt/databases/testDatabase"), + }, 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/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/InaccessibleManagedDatabaseListByManagedInstance.json func ExampleManagedDatabasesClient_NewListInaccessibleByInstancePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/sql/armsql/manageddatabaseschemas_client.go b/sdk/resourcemanager/sql/armsql/manageddatabaseschemas_client.go index 9975878005c9..07b67e6cbf28 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabaseschemas_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabaseschemas_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -56,18 +55,21 @@ func NewManagedDatabaseSchemasClient(subscriptionID string, credential azcore.To // - options - ManagedDatabaseSchemasClientGetOptions contains the optional parameters for the ManagedDatabaseSchemasClient.Get // method. func (client *ManagedDatabaseSchemasClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, options *ManagedDatabaseSchemasClientGetOptions) (ManagedDatabaseSchemasClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, schemaName, options) if err != nil { return ManagedDatabaseSchemasClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedDatabaseSchemasClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedDatabaseSchemasClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseSchemasClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/manageddatabaseschemas_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabaseschemas_client_example_test.go index 7f24e40d31dd..4946238a6927 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabaseschemas_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabaseschemas_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSchemaListByDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -55,7 +55,7 @@ func ExampleManagedDatabaseSchemasClient_NewListByDatabasePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSchemaGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasesecurityalertpolicies_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasesecurityalertpolicies_client.go index 7cc57c67c154..795159864b67 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasesecurityalertpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasesecurityalertpolicies_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -57,18 +56,21 @@ func NewManagedDatabaseSecurityAlertPoliciesClient(subscriptionID string, creden // - options - ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseSecurityAlertPoliciesClient.CreateOrUpdate // method. func (client *ManagedDatabaseSecurityAlertPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, securityAlertPolicyName SecurityAlertPolicyName, parameters ManagedDatabaseSecurityAlertPolicy, options *ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions) (ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, securityAlertPolicyName, parameters, options) if err != nil { return ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -102,7 +104,10 @@ func (client *ManagedDatabaseSecurityAlertPoliciesClient) createOrUpdateCreateRe reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -126,18 +131,21 @@ func (client *ManagedDatabaseSecurityAlertPoliciesClient) createOrUpdateHandleRe // - options - ManagedDatabaseSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ManagedDatabaseSecurityAlertPoliciesClient.Get // method. func (client *ManagedDatabaseSecurityAlertPoliciesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, securityAlertPolicyName SecurityAlertPolicyName, options *ManagedDatabaseSecurityAlertPoliciesClientGetOptions) (ManagedDatabaseSecurityAlertPoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, securityAlertPolicyName, options) if err != nil { return ManagedDatabaseSecurityAlertPoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedDatabaseSecurityAlertPoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedDatabaseSecurityAlertPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseSecurityAlertPoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasesecurityalertpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasesecurityalertpolicies_client_example_test.go index 4a77109b6be1..312bfef493b4 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasesecurityalertpolicies_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasesecurityalertpolicies_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -55,7 +55,7 @@ func ExampleManagedDatabaseSecurityAlertPoliciesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertCreateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertCreateMax.json func ExampleManagedDatabaseSecurityAlertPoliciesClient_CreateOrUpdate_updateADatabasesThreatDetectionPolicyWithAllParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -107,7 +107,7 @@ func ExampleManagedDatabaseSecurityAlertPoliciesClient_CreateOrUpdate_updateADat // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertCreateMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertCreateMin.json func ExampleManagedDatabaseSecurityAlertPoliciesClient_CreateOrUpdate_updateADatabasesThreatDetectionPolicyWithMinimalParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -147,7 +147,7 @@ func ExampleManagedDatabaseSecurityAlertPoliciesClient_CreateOrUpdate_updateADat // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertListByDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasesecurityevents_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasesecurityevents_client.go index 6b21e834b3ca..c6cddedbd549 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasesecurityevents_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasesecurityevents_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // 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/manageddatabasesecurityevents_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasesecurityevents_client_example_test.go index da43d3085b50..4102dfba3458 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasesecurityevents_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasesecurityevents_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityEventsGetMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityEventsGetMax.json func ExampleManagedDatabaseSecurityEventsClient_NewListByDatabasePager_getTheManagedDatabasesSecurityEventsWithMaximalParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -74,7 +74,7 @@ func ExampleManagedDatabaseSecurityEventsClient_NewListByDatabasePager_getTheMan } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityEventsGetMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityEventsGetMin.json func ExampleManagedDatabaseSecurityEventsClient_NewListByDatabasePager_getTheManagedDatabasesSecurityEventsWithMinimalParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasesensitivitylabels_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasesensitivitylabels_client.go index 418909bac90b..7f26defe09f3 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasesensitivitylabels_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasesensitivitylabels_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -60,18 +59,21 @@ func NewManagedDatabaseSensitivityLabelsClient(subscriptionID string, credential // - options - ManagedDatabaseSensitivityLabelsClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.CreateOrUpdate // method. func (client *ManagedDatabaseSensitivityLabelsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, parameters SensitivityLabel, options *ManagedDatabaseSensitivityLabelsClientCreateOrUpdateOptions) (ManagedDatabaseSensitivityLabelsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, parameters, options) if err != nil { return ManagedDatabaseSensitivityLabelsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedDatabaseSensitivityLabelsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ManagedDatabaseSensitivityLabelsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseSensitivityLabelsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -114,7 +116,10 @@ func (client *ManagedDatabaseSensitivityLabelsClient) createOrUpdateCreateReques reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -140,16 +145,18 @@ func (client *ManagedDatabaseSensitivityLabelsClient) createOrUpdateHandleRespon // - options - ManagedDatabaseSensitivityLabelsClientDeleteOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.Delete // method. func (client *ManagedDatabaseSensitivityLabelsClient) Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, options *ManagedDatabaseSensitivityLabelsClientDeleteOptions) (ManagedDatabaseSensitivityLabelsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, options) if err != nil { return ManagedDatabaseSensitivityLabelsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedDatabaseSensitivityLabelsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedDatabaseSensitivityLabelsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseSensitivityLabelsClientDeleteResponse{}, err } return ManagedDatabaseSensitivityLabelsClientDeleteResponse{}, nil } @@ -210,16 +217,18 @@ func (client *ManagedDatabaseSensitivityLabelsClient) deleteCreateRequest(ctx co // - options - ManagedDatabaseSensitivityLabelsClientDisableRecommendationOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.DisableRecommendation // method. func (client *ManagedDatabaseSensitivityLabelsClient) DisableRecommendation(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, options *ManagedDatabaseSensitivityLabelsClientDisableRecommendationOptions) (ManagedDatabaseSensitivityLabelsClientDisableRecommendationResponse, error) { + var err error req, err := client.disableRecommendationCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, options) if err != nil { return ManagedDatabaseSensitivityLabelsClientDisableRecommendationResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedDatabaseSensitivityLabelsClientDisableRecommendationResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedDatabaseSensitivityLabelsClientDisableRecommendationResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseSensitivityLabelsClientDisableRecommendationResponse{}, err } return ManagedDatabaseSensitivityLabelsClientDisableRecommendationResponse{}, nil } @@ -281,16 +290,18 @@ func (client *ManagedDatabaseSensitivityLabelsClient) disableRecommendationCreat // - options - ManagedDatabaseSensitivityLabelsClientEnableRecommendationOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.EnableRecommendation // method. func (client *ManagedDatabaseSensitivityLabelsClient) EnableRecommendation(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, options *ManagedDatabaseSensitivityLabelsClientEnableRecommendationOptions) (ManagedDatabaseSensitivityLabelsClientEnableRecommendationResponse, error) { + var err error req, err := client.enableRecommendationCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, options) if err != nil { return ManagedDatabaseSensitivityLabelsClientEnableRecommendationResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedDatabaseSensitivityLabelsClientEnableRecommendationResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedDatabaseSensitivityLabelsClientEnableRecommendationResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseSensitivityLabelsClientEnableRecommendationResponse{}, err } return ManagedDatabaseSensitivityLabelsClientEnableRecommendationResponse{}, nil } @@ -352,18 +363,21 @@ func (client *ManagedDatabaseSensitivityLabelsClient) enableRecommendationCreate // - options - ManagedDatabaseSensitivityLabelsClientGetOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.Get // method. func (client *ManagedDatabaseSensitivityLabelsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, sensitivityLabelSource SensitivityLabelSource, options *ManagedDatabaseSensitivityLabelsClientGetOptions) (ManagedDatabaseSensitivityLabelsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, options) if err != nil { return ManagedDatabaseSensitivityLabelsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedDatabaseSensitivityLabelsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedDatabaseSensitivityLabelsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseSensitivityLabelsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -602,16 +616,18 @@ func (client *ManagedDatabaseSensitivityLabelsClient) listRecommendedByDatabaseH // - options - ManagedDatabaseSensitivityLabelsClientUpdateOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.Update // method. func (client *ManagedDatabaseSensitivityLabelsClient) Update(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters SensitivityLabelUpdateList, options *ManagedDatabaseSensitivityLabelsClientUpdateOptions) (ManagedDatabaseSensitivityLabelsClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) if err != nil { return ManagedDatabaseSensitivityLabelsClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedDatabaseSensitivityLabelsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedDatabaseSensitivityLabelsClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseSensitivityLabelsClientUpdateResponse{}, err } return ManagedDatabaseSensitivityLabelsClientUpdateResponse{}, nil } @@ -642,5 +658,8 @@ func (client *ManagedDatabaseSensitivityLabelsClient) updateCreateRequest(ctx co reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasesensitivitylabels_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasesensitivitylabels_client_example_test.go index 9ae2352f44de..d2ba32ad13a0 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasesensitivitylabels_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasesensitivitylabels_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnSensitivityLabelGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -53,7 +53,7 @@ func ExampleManagedDatabaseSensitivityLabelsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnSensitivityLabelCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -96,7 +96,7 @@ func ExampleManagedDatabaseSensitivityLabelsClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnSensitivityLabelDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -113,7 +113,7 @@ func ExampleManagedDatabaseSensitivityLabelsClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseRecommendedColumnSensitivityLabelDisable.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -130,7 +130,7 @@ func ExampleManagedDatabaseSensitivityLabelsClient_DisableRecommendation() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseRecommendedColumnSensitivityLabelEnable.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -147,7 +147,7 @@ func ExampleManagedDatabaseSensitivityLabelsClient_EnableRecommendation() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsListByDatabaseCurrent.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -208,7 +208,7 @@ func ExampleManagedDatabaseSensitivityLabelsClient_NewListCurrentByDatabasePager } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsCurrentUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -267,7 +267,7 @@ func ExampleManagedDatabaseSensitivityLabelsClient_Update() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsListByDatabaseRecommended.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasetables_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasetables_client.go index a6780b6e5841..0e9407b1929d 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasetables_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasetables_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -57,18 +56,21 @@ func NewManagedDatabaseTablesClient(subscriptionID string, credential azcore.Tok // - options - ManagedDatabaseTablesClientGetOptions contains the optional parameters for the ManagedDatabaseTablesClient.Get // method. func (client *ManagedDatabaseTablesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, options *ManagedDatabaseTablesClientGetOptions) (ManagedDatabaseTablesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, options) if err != nil { return ManagedDatabaseTablesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedDatabaseTablesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedDatabaseTablesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseTablesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasetables_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasetables_client_example_test.go index 94375b40692f..988ea9ee5487 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasetables_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasetables_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseTableListBySchema.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -55,7 +55,7 @@ func ExampleManagedDatabaseTablesClient_NewListBySchemaPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseTableGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasetransparentdataencryption_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasetransparentdataencryption_client.go index 80b5bb439945..678075b260ed 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasetransparentdataencryption_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasetransparentdataencryption_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -57,18 +56,21 @@ func NewManagedDatabaseTransparentDataEncryptionClient(subscriptionID string, cr // - options - ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateOptions contains the optional parameters for the // ManagedDatabaseTransparentDataEncryptionClient.CreateOrUpdate method. func (client *ManagedDatabaseTransparentDataEncryptionClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, tdeName TransparentDataEncryptionName, parameters ManagedTransparentDataEncryption, options *ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateOptions) (ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, tdeName, parameters, options) if err != nil { return ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -102,7 +104,10 @@ func (client *ManagedDatabaseTransparentDataEncryptionClient) createOrUpdateCrea reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -126,18 +131,21 @@ func (client *ManagedDatabaseTransparentDataEncryptionClient) createOrUpdateHand // - options - ManagedDatabaseTransparentDataEncryptionClientGetOptions contains the optional parameters for the ManagedDatabaseTransparentDataEncryptionClient.Get // method. func (client *ManagedDatabaseTransparentDataEncryptionClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, tdeName TransparentDataEncryptionName, options *ManagedDatabaseTransparentDataEncryptionClientGetOptions) (ManagedDatabaseTransparentDataEncryptionClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, tdeName, options) if err != nil { return ManagedDatabaseTransparentDataEncryptionClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedDatabaseTransparentDataEncryptionClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedDatabaseTransparentDataEncryptionClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseTransparentDataEncryptionClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasetransparentdataencryption_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasetransparentdataencryption_client_example_test.go index a82561ab8542..80b280df8f33 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasetransparentdataencryption_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasetransparentdataencryption_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedTransparentDataEncryptionGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -46,7 +46,7 @@ func ExampleManagedDatabaseTransparentDataEncryptionClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedTransparentDataEncryptionUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -78,7 +78,7 @@ func ExampleManagedDatabaseTransparentDataEncryptionClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedTransparentDataEncryptionList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentrulebaselines_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentrulebaselines_client.go index 4a8271581f57..6e2e727a2318 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentrulebaselines_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentrulebaselines_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -60,18 +59,21 @@ func NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient(subscriptionID // - options - ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions contains the optional parameters // for the ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate method. func (client *ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName, parameters DatabaseVulnerabilityAssessmentRuleBaseline, options *ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions) (ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, vulnerabilityAssessmentName, ruleID, baselineName, parameters, options) if err != nil { return ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -113,7 +115,10 @@ func (client *ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) createO reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -140,16 +145,18 @@ func (client *ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) createO // - options - ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions contains the optional parameters for the // ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.Delete method. func (client *ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName, options *ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions) (ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, vulnerabilityAssessmentName, ruleID, baselineName, options) if err != nil { return ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, err } return ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, nil } @@ -210,18 +217,21 @@ func (client *ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) deleteC // - options - ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions contains the optional parameters for the // ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.Get method. func (client *ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName, options *ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions) (ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, vulnerabilityAssessmentName, ruleID, baselineName, options) if err != nil { return ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentrulebaselines_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentrulebaselines_client_example_test.go index 9b6acce7327e..dd2bb6ee4dc6 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentrulebaselines_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentrulebaselines_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -62,7 +62,7 @@ func ExampleManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -126,7 +126,7 @@ func ExampleManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient_CreateOrUp // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessments_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessments_client.go index 87aa472e0352..66a14c6272d1 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessments_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessments_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -57,18 +56,21 @@ func NewManagedDatabaseVulnerabilityAssessmentsClient(subscriptionID string, cre // - options - ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.CreateOrUpdate // method. func (client *ManagedDatabaseVulnerabilityAssessmentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, parameters DatabaseVulnerabilityAssessment, options *ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions) (ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, vulnerabilityAssessmentName, parameters, options) if err != nil { return ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -102,7 +104,10 @@ func (client *ManagedDatabaseVulnerabilityAssessmentsClient) createOrUpdateCreat reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -126,16 +131,18 @@ func (client *ManagedDatabaseVulnerabilityAssessmentsClient) createOrUpdateHandl // - options - ManagedDatabaseVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.Delete // method. func (client *ManagedDatabaseVulnerabilityAssessmentsClient) Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *ManagedDatabaseVulnerabilityAssessmentsClientDeleteOptions) (ManagedDatabaseVulnerabilityAssessmentsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, vulnerabilityAssessmentName, options) if err != nil { return ManagedDatabaseVulnerabilityAssessmentsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedDatabaseVulnerabilityAssessmentsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedDatabaseVulnerabilityAssessmentsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseVulnerabilityAssessmentsClientDeleteResponse{}, err } return ManagedDatabaseVulnerabilityAssessmentsClientDeleteResponse{}, nil } @@ -185,18 +192,21 @@ func (client *ManagedDatabaseVulnerabilityAssessmentsClient) deleteCreateRequest // - options - ManagedDatabaseVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.Get // method. func (client *ManagedDatabaseVulnerabilityAssessmentsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *ManagedDatabaseVulnerabilityAssessmentsClientGetOptions) (ManagedDatabaseVulnerabilityAssessmentsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, vulnerabilityAssessmentName, options) if err != nil { return ManagedDatabaseVulnerabilityAssessmentsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedDatabaseVulnerabilityAssessmentsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedDatabaseVulnerabilityAssessmentsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseVulnerabilityAssessmentsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessments_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessments_client_example_test.go index 058763b00d1d..38cd23de2e43 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessments_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessments_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -52,7 +52,7 @@ func ExampleManagedDatabaseVulnerabilityAssessmentsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentCreateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentCreateMax.json func ExampleManagedDatabaseVulnerabilityAssessmentsClient_CreateOrUpdate_createADatabasesVulnerabilityAssessmentWithAllParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -98,7 +98,7 @@ func ExampleManagedDatabaseVulnerabilityAssessmentsClient_CreateOrUpdate_createA // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentCreateMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentCreateMin.json func ExampleManagedDatabaseVulnerabilityAssessmentsClient_CreateOrUpdate_createADatabasesVulnerabilityAssessmentWithMinimalParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -136,7 +136,7 @@ func ExampleManagedDatabaseVulnerabilityAssessmentsClient_CreateOrUpdate_createA // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -153,7 +153,7 @@ func ExampleManagedDatabaseVulnerabilityAssessmentsClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentListByDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentscans_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentscans_client.go index 951004943992..766e2e4704c9 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentscans_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentscans_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -57,18 +56,21 @@ func NewManagedDatabaseVulnerabilityAssessmentScansClient(subscriptionID string, // - options - ManagedDatabaseVulnerabilityAssessmentScansClientExportOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentScansClient.Export // method. func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) Export(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, scanID string, options *ManagedDatabaseVulnerabilityAssessmentScansClientExportOptions) (ManagedDatabaseVulnerabilityAssessmentScansClientExportResponse, error) { + var err error req, err := client.exportCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, vulnerabilityAssessmentName, scanID, options) if err != nil { return ManagedDatabaseVulnerabilityAssessmentScansClientExportResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedDatabaseVulnerabilityAssessmentScansClientExportResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ManagedDatabaseVulnerabilityAssessmentScansClientExportResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseVulnerabilityAssessmentScansClientExportResponse{}, err } - return client.exportHandleResponse(resp) + resp, err := client.exportHandleResponse(httpResp) + return resp, err } // exportCreateRequest creates the Export request. @@ -131,18 +133,21 @@ func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) exportHandleRes // - options - ManagedDatabaseVulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentScansClient.Get // method. func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, scanID string, options *ManagedDatabaseVulnerabilityAssessmentScansClientGetOptions) (ManagedDatabaseVulnerabilityAssessmentScansClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, vulnerabilityAssessmentName, scanID, options) if err != nil { return ManagedDatabaseVulnerabilityAssessmentScansClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedDatabaseVulnerabilityAssessmentScansClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedDatabaseVulnerabilityAssessmentScansClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedDatabaseVulnerabilityAssessmentScansClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -210,7 +215,8 @@ func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) BeginInitiateSc if err != nil { return nil, err } - return runtime.NewPoller[ManagedDatabaseVulnerabilityAssessmentScansClientInitiateScanResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedDatabaseVulnerabilityAssessmentScansClientInitiateScanResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedDatabaseVulnerabilityAssessmentScansClientInitiateScanResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -221,18 +227,20 @@ func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) BeginInitiateSc // // Generated from API version 2020-11-01-preview func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) initiateScan(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, scanID string, options *ManagedDatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions) (*http.Response, error) { + var err error req, err := client.initiateScanCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, vulnerabilityAssessmentName, scanID, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // initiateScanCreateRequest creates the InitiateScan request. diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentscans_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentscans_client_example_test.go index ea484ceea087..37dceba13694 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentscans_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentscans_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScansExecute.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -38,7 +38,7 @@ func ExampleManagedDatabaseVulnerabilityAssessmentScansClient_BeginInitiateScan( } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScanExport.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -66,7 +66,7 @@ func ExampleManagedDatabaseVulnerabilityAssessmentScansClient_Export() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScanRecordsListByDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -145,7 +145,7 @@ func ExampleManagedDatabaseVulnerabilityAssessmentScansClient_NewListByDatabaseP } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScanRecordsGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceadministrators_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceadministrators_client.go index 895166c02162..3568ef0145a0 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstanceadministrators_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceadministrators_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -60,7 +59,8 @@ func (client *ManagedInstanceAdministratorsClient) BeginCreateOrUpdate(ctx conte if err != nil { return nil, err } - return runtime.NewPoller[ManagedInstanceAdministratorsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedInstanceAdministratorsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedInstanceAdministratorsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,18 +71,20 @@ func (client *ManagedInstanceAdministratorsClient) BeginCreateOrUpdate(ctx conte // // Generated from API version 2020-11-01-preview func (client *ManagedInstanceAdministratorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, administratorName AdministratorName, parameters ManagedInstanceAdministrator, options *ManagedInstanceAdministratorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, administratorName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -112,7 +114,10 @@ func (client *ManagedInstanceAdministratorsClient) createOrUpdateCreateRequest(c reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a managed instance administrator. @@ -130,7 +135,8 @@ func (client *ManagedInstanceAdministratorsClient) BeginDelete(ctx context.Conte if err != nil { return nil, err } - return runtime.NewPoller[ManagedInstanceAdministratorsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedInstanceAdministratorsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedInstanceAdministratorsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -141,18 +147,20 @@ func (client *ManagedInstanceAdministratorsClient) BeginDelete(ctx context.Conte // // Generated from API version 2020-11-01-preview func (client *ManagedInstanceAdministratorsClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, administratorName AdministratorName, options *ManagedInstanceAdministratorsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, administratorName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -194,18 +202,21 @@ func (client *ManagedInstanceAdministratorsClient) deleteCreateRequest(ctx conte // - options - ManagedInstanceAdministratorsClientGetOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.Get // method. func (client *ManagedInstanceAdministratorsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, administratorName AdministratorName, options *ManagedInstanceAdministratorsClientGetOptions) (ManagedInstanceAdministratorsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, administratorName, options) if err != nil { return ManagedInstanceAdministratorsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedInstanceAdministratorsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedInstanceAdministratorsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedInstanceAdministratorsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceadministrators_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstanceadministrators_client_example_test.go index ecf9e8983879..74ebabd36b1c 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstanceadministrators_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceadministrators_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorListByInstance.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -57,7 +57,7 @@ func ExampleManagedInstanceAdministratorsClient_NewListByInstancePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -88,7 +88,7 @@ func ExampleManagedInstanceAdministratorsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorCreate.json func ExampleManagedInstanceAdministratorsClient_BeginCreateOrUpdate_createAdministratorOfManagedInstance() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -130,7 +130,7 @@ func ExampleManagedInstanceAdministratorsClient_BeginCreateOrUpdate_createAdmini // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorUpdate.json func ExampleManagedInstanceAdministratorsClient_BeginCreateOrUpdate_updateAdministratorOfManagedInstance() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -172,7 +172,7 @@ func ExampleManagedInstanceAdministratorsClient_BeginCreateOrUpdate_updateAdmini // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceadvancedthreatprotectionsettings_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceadvancedthreatprotectionsettings_client.go new file mode 100644 index 000000000000..c7193be14fe4 --- /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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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 { + internal *arm.Client + subscriptionID string +} + +// 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) { + cl, err := arm.NewClient(moduleName+".ManagedInstanceAdvancedThreatProtectionSettingsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ManagedInstanceAdvancedThreatProtectionSettingsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + 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 + } + poller, err := runtime.NewPoller[ManagedInstanceAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ManagedInstanceAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), 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) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, advancedThreatProtectionName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, 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.internal.Endpoint(), 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"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// 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) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, advancedThreatProtectionName, options) + if err != nil { + return ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// 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.internal.Endpoint(), 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. +// +// 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.NewListByInstancePager 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.internal.Pipeline().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.internal.Endpoint(), 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/managedinstanceadvancedthreatprotectionsettings_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstanceadvancedthreatprotectionsettings_client_example_test.go new file mode 100644 index 000000000000..bd010d6f5042 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/managedinstanceadvancedthreatprotectionsettings_client_example_test.go @@ -0,0 +1,191 @@ +//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_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/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedInstanceAdvancedThreatProtectionSettingsListByInstance.json +func ExampleManagedInstanceAdvancedThreatProtectionSettingsClient_NewListByInstancePager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewManagedInstanceAdvancedThreatProtectionSettingsClient().NewListByInstancePager("threatprotection-4799", "threatprotection-6440", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ManagedInstanceAdvancedThreatProtectionListResult = armsql.ManagedInstanceAdvancedThreatProtectionListResult{ + // Value: []*armsql.ManagedInstanceAdvancedThreatProtection{ + // { + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/advancedThreatProtectionSettings"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/managedInstances/threatprotection-6440/advancedThreatProtectionSettings"), + // Properties: &armsql.AdvancedThreatProtectionProperties{ + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // State: to.Ptr(armsql.AdvancedThreatProtectionStateDisabled), + // }, + // SystemData: &armsql.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedInstanceAdvancedThreatProtectionSettingsGet.json +func ExampleManagedInstanceAdvancedThreatProtectionSettingsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewManagedInstanceAdvancedThreatProtectionSettingsClient().Get(ctx, "threatprotection-4799", "threatprotection-6440", armsql.AdvancedThreatProtectionNameDefault, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedInstanceAdvancedThreatProtection = armsql.ManagedInstanceAdvancedThreatProtection{ + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/advancedThreatProtectionSettings"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/managedInstances/threatprotection-6440/advancedThreatProtectionSettings/Default"), + // Properties: &armsql.AdvancedThreatProtectionProperties{ + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // State: to.Ptr(armsql.AdvancedThreatProtectionStateDisabled), + // }, + // SystemData: &armsql.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedInstanceAdvancedThreatProtectionSettingsCreateMax.json +func ExampleManagedInstanceAdvancedThreatProtectionSettingsClient_BeginCreateOrUpdate_updateAManagedInstancesAdvancedThreatProtectionSettingsWithAllParameters() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedInstanceAdvancedThreatProtectionSettingsClient().BeginCreateOrUpdate(ctx, "threatprotection-4799", "threatprotection-6440", armsql.AdvancedThreatProtectionNameDefault, armsql.ManagedInstanceAdvancedThreatProtection{ + 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedInstanceAdvancedThreatProtection = armsql.ManagedInstanceAdvancedThreatProtection{ + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/advancedThreatProtectionSettings"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/managedInstances/threatprotection-6440/advancedThreatProtectionSettings/Default"), + // Properties: &armsql.AdvancedThreatProtectionProperties{ + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // State: to.Ptr(armsql.AdvancedThreatProtectionStateEnabled), + // }, + // SystemData: &armsql.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedInstanceAdvancedThreatProtectionSettingsCreateMin.json +func ExampleManagedInstanceAdvancedThreatProtectionSettingsClient_BeginCreateOrUpdate_updateAManagedInstancesAdvancedThreatProtectionSettingsWithMinimalParameters() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedInstanceAdvancedThreatProtectionSettingsClient().BeginCreateOrUpdate(ctx, "threatprotection-4799", "threatprotection-6440", armsql.AdvancedThreatProtectionNameDefault, armsql.ManagedInstanceAdvancedThreatProtection{ + Properties: &armsql.AdvancedThreatProtectionProperties{ + State: to.Ptr(armsql.AdvancedThreatProtectionStateDisabled), + }, + }, 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedInstanceAdvancedThreatProtection = armsql.ManagedInstanceAdvancedThreatProtection{ + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/advancedThreatProtectionSettings"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/managedInstances/threatprotection-6440/advancedThreatProtectionSettings/Default"), + // Properties: &armsql.AdvancedThreatProtectionProperties{ + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // State: to.Ptr(armsql.AdvancedThreatProtectionStateDisabled), + // }, + // SystemData: &armsql.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), + // }, + // } +} diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceazureadonlyauthentications_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceazureadonlyauthentications_client.go index 53649df07c2d..ff0ed12d115d 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstanceazureadonlyauthentications_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceazureadonlyauthentications_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -62,7 +61,8 @@ func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) BeginCreateOrUpda if err != nil { return nil, err } - return runtime.NewPoller[ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -74,18 +74,20 @@ func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) BeginCreateOrUpda // // Generated from API version 2020-11-01-preview func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, authenticationName AuthenticationName, parameters ManagedInstanceAzureADOnlyAuthentication, options *ManagedInstanceAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, authenticationName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -115,7 +117,10 @@ func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) createOrUpdateCre reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes an existing server Active Directory only authentication property. @@ -134,7 +139,8 @@ func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) BeginDelete(ctx c if err != nil { return nil, err } - return runtime.NewPoller[ManagedInstanceAzureADOnlyAuthenticationsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedInstanceAzureADOnlyAuthenticationsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedInstanceAzureADOnlyAuthenticationsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -145,18 +151,20 @@ func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) BeginDelete(ctx c // // Generated from API version 2020-11-01-preview func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, authenticationName AuthenticationName, options *ManagedInstanceAzureADOnlyAuthenticationsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, authenticationName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -199,18 +207,21 @@ func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) deleteCreateReque // - options - ManagedInstanceAzureADOnlyAuthenticationsClientGetOptions contains the optional parameters for the ManagedInstanceAzureADOnlyAuthenticationsClient.Get // method. func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, authenticationName AuthenticationName, options *ManagedInstanceAzureADOnlyAuthenticationsClientGetOptions) (ManagedInstanceAzureADOnlyAuthenticationsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, authenticationName, options) if err != nil { return ManagedInstanceAzureADOnlyAuthenticationsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedInstanceAzureADOnlyAuthenticationsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedInstanceAzureADOnlyAuthenticationsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedInstanceAzureADOnlyAuthenticationsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceazureadonlyauthentications_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstanceazureadonlyauthentications_client_example_test.go index f3c1eb7c2e6d..1f1de3551805 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstanceazureadonlyauthentications_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceazureadonlyauthentications_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -46,7 +46,7 @@ func ExampleManagedInstanceAzureADOnlyAuthenticationsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthCreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -82,7 +82,7 @@ func ExampleManagedInstanceAzureADOnlyAuthenticationsClient_BeginCreateOrUpdate( // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -103,7 +103,7 @@ func ExampleManagedInstanceAzureADOnlyAuthenticationsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthListByInstance.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/managedinstancedtcs_client.go b/sdk/resourcemanager/sql/armsql/managedinstancedtcs_client.go new file mode 100644 index 000000000000..56dc25718b24 --- /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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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 { + internal *arm.Client + subscriptionID string +} + +// 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) { + cl, err := arm.NewClient(moduleName+".ManagedInstanceDtcsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ManagedInstanceDtcsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Updates managed instance DTC settings. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-05-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 + } + poller, err := runtime.NewPoller[ManagedInstanceDtcsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ManagedInstanceDtcsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Updates managed instance DTC settings. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-05-01-preview +func (client *ManagedInstanceDtcsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, dtcName DtcName, parameters ManagedInstanceDtc, options *ManagedInstanceDtcsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, dtcName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// Get - Gets managed instance DTC settings. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-05-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) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, dtcName, options) + if err != nil { + return ManagedInstanceDtcsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagedInstanceDtcsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedInstanceDtcsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-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. +// +// Generated from API version 2022-05-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.NewListByManagedInstancePager +// 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.internal.Pipeline().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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-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/managedinstancedtcs_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstancedtcs_client_example_test.go new file mode 100644 index 000000000000..abd24cb9971b --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/managedinstancedtcs_client_example_test.go @@ -0,0 +1,233 @@ +//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_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/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedInstanceDtcList.json +func ExampleManagedInstanceDtcsClient_NewListByManagedInstancePager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewManagedInstanceDtcsClient().NewListByManagedInstancePager("testrg", "testinstance", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ManagedInstanceDtcListResult = armsql.ManagedInstanceDtcListResult{ + // Value: []*armsql.ManagedInstanceDtc{ + // { + // Name: to.Ptr("current"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/dtc"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance/dtc/current"), + // Properties: &armsql.ManagedInstanceDtcProperties{ + // DtcEnabled: to.Ptr(true), + // DtcHostNameDNSSuffix: to.Ptr("dtcHostNameSuffixExample.com"), + // ExternalDNSSuffixSearchList: []*string{ + // to.Ptr("dns.example1.com"), + // to.Ptr("dns.example2.com")}, + // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), + // SecuritySettings: &armsql.ManagedInstanceDtcSecuritySettings{ + // SnaLu6Point2TransactionsEnabled: to.Ptr(false), + // TransactionManagerCommunicationSettings: &armsql.ManagedInstanceDtcTransactionManagerCommunicationSettings{ + // AllowInboundEnabled: to.Ptr(false), + // AllowOutboundEnabled: to.Ptr(true), + // Authentication: to.Ptr("NoAuth"), + // }, + // XaTransactionsDefaultTimeout: to.Ptr[int32](1000), + // XaTransactionsEnabled: to.Ptr(false), + // XaTransactionsMaximumTimeout: to.Ptr[int32](3000), + // }, + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedInstanceDtcGet.json +func ExampleManagedInstanceDtcsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewManagedInstanceDtcsClient().Get(ctx, "testrg", "testinstance", armsql.DtcNameCurrent, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedInstanceDtc = armsql.ManagedInstanceDtc{ + // Name: to.Ptr("current"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/dtc"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance/dtc/current"), + // Properties: &armsql.ManagedInstanceDtcProperties{ + // DtcEnabled: to.Ptr(true), + // DtcHostNameDNSSuffix: to.Ptr("dtcHostNameSuffixExample.com"), + // ExternalDNSSuffixSearchList: []*string{ + // to.Ptr("dns.example1.com"), + // to.Ptr("dns.example2.com")}, + // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), + // SecuritySettings: &armsql.ManagedInstanceDtcSecuritySettings{ + // SnaLu6Point2TransactionsEnabled: to.Ptr(false), + // TransactionManagerCommunicationSettings: &armsql.ManagedInstanceDtcTransactionManagerCommunicationSettings{ + // AllowInboundEnabled: to.Ptr(false), + // AllowOutboundEnabled: to.Ptr(true), + // Authentication: to.Ptr("NoAuth"), + // }, + // XaTransactionsDefaultTimeout: to.Ptr[int32](1000), + // XaTransactionsEnabled: to.Ptr(false), + // XaTransactionsMaximumTimeout: to.Ptr[int32](3000), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedInstanceDtcUpdateEnableDtc.json +func ExampleManagedInstanceDtcsClient_BeginCreateOrUpdate_updatesManagedInstanceDtcSettingsByEnablingDtc() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedInstanceDtcsClient().BeginCreateOrUpdate(ctx, "testrg", "testinstance", armsql.DtcNameCurrent, armsql.ManagedInstanceDtc{ + Properties: &armsql.ManagedInstanceDtcProperties{ + DtcEnabled: 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedInstanceDtc = armsql.ManagedInstanceDtc{ + // Name: to.Ptr("current"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/dtc"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance/dtc/current"), + // Properties: &armsql.ManagedInstanceDtcProperties{ + // DtcEnabled: to.Ptr(true), + // DtcHostNameDNSSuffix: to.Ptr("dtcHostNameSuffixExample.com"), + // ExternalDNSSuffixSearchList: []*string{ + // to.Ptr("dns.example1.com"), + // to.Ptr("dns.example2.com")}, + // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), + // SecuritySettings: &armsql.ManagedInstanceDtcSecuritySettings{ + // SnaLu6Point2TransactionsEnabled: to.Ptr(false), + // TransactionManagerCommunicationSettings: &armsql.ManagedInstanceDtcTransactionManagerCommunicationSettings{ + // AllowInboundEnabled: to.Ptr(false), + // AllowOutboundEnabled: to.Ptr(true), + // Authentication: to.Ptr("NoAuth"), + // }, + // XaTransactionsDefaultTimeout: to.Ptr[int32](1000), + // XaTransactionsEnabled: to.Ptr(false), + // XaTransactionsMaximumTimeout: to.Ptr[int32](3000), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedInstanceDtcUpdateMax.json +func ExampleManagedInstanceDtcsClient_BeginCreateOrUpdate_updatesManagedInstanceDtcSettingsWithAllOptionalParametersSpecified() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedInstanceDtcsClient().BeginCreateOrUpdate(ctx, "testrg", "testinstance", armsql.DtcNameCurrent, armsql.ManagedInstanceDtc{ + Properties: &armsql.ManagedInstanceDtcProperties{ + DtcEnabled: to.Ptr(true), + ExternalDNSSuffixSearchList: []*string{ + to.Ptr("dns.example1.com"), + to.Ptr("dns.example2.com")}, + SecuritySettings: &armsql.ManagedInstanceDtcSecuritySettings{ + SnaLu6Point2TransactionsEnabled: to.Ptr(false), + TransactionManagerCommunicationSettings: &armsql.ManagedInstanceDtcTransactionManagerCommunicationSettings{ + AllowInboundEnabled: to.Ptr(false), + AllowOutboundEnabled: to.Ptr(true), + Authentication: to.Ptr("NoAuth"), + }, + XaTransactionsDefaultTimeout: to.Ptr[int32](1000), + XaTransactionsEnabled: to.Ptr(false), + XaTransactionsMaximumTimeout: to.Ptr[int32](3000), + }, + }, + }, 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedInstanceDtc = armsql.ManagedInstanceDtc{ + // Name: to.Ptr("current"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/dtc"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance/dtc/current"), + // Properties: &armsql.ManagedInstanceDtcProperties{ + // DtcEnabled: to.Ptr(true), + // DtcHostNameDNSSuffix: to.Ptr("dtcHostNameSuffixExample.com"), + // ExternalDNSSuffixSearchList: []*string{ + // to.Ptr("dns.example1.com"), + // to.Ptr("dns.example2.com")}, + // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), + // SecuritySettings: &armsql.ManagedInstanceDtcSecuritySettings{ + // SnaLu6Point2TransactionsEnabled: to.Ptr(false), + // TransactionManagerCommunicationSettings: &armsql.ManagedInstanceDtcTransactionManagerCommunicationSettings{ + // AllowInboundEnabled: to.Ptr(false), + // AllowOutboundEnabled: to.Ptr(true), + // Authentication: to.Ptr("NoAuth"), + // }, + // XaTransactionsDefaultTimeout: to.Ptr[int32](1000), + // XaTransactionsEnabled: to.Ptr(false), + // XaTransactionsMaximumTimeout: to.Ptr[int32](3000), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceencryptionprotectors_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceencryptionprotectors_client.go index 3443d556c4e7..ee97041a5cb9 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstanceencryptionprotectors_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceencryptionprotectors_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -61,7 +60,8 @@ func (client *ManagedInstanceEncryptionProtectorsClient) BeginCreateOrUpdate(ctx if err != nil { return nil, err } - return runtime.NewPoller[ManagedInstanceEncryptionProtectorsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedInstanceEncryptionProtectorsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedInstanceEncryptionProtectorsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *ManagedInstanceEncryptionProtectorsClient) BeginCreateOrUpdate(ctx // // Generated from API version 2020-11-01-preview func (client *ManagedInstanceEncryptionProtectorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, encryptionProtectorName EncryptionProtectorName, parameters ManagedInstanceEncryptionProtector, options *ManagedInstanceEncryptionProtectorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, encryptionProtectorName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -113,7 +115,10 @@ func (client *ManagedInstanceEncryptionProtectorsClient) createOrUpdateCreateReq reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Get - Gets a managed instance encryption protector. @@ -127,18 +132,21 @@ func (client *ManagedInstanceEncryptionProtectorsClient) createOrUpdateCreateReq // - options - ManagedInstanceEncryptionProtectorsClientGetOptions contains the optional parameters for the ManagedInstanceEncryptionProtectorsClient.Get // method. func (client *ManagedInstanceEncryptionProtectorsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, encryptionProtectorName EncryptionProtectorName, options *ManagedInstanceEncryptionProtectorsClientGetOptions) (ManagedInstanceEncryptionProtectorsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, encryptionProtectorName, options) if err != nil { return ManagedInstanceEncryptionProtectorsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedInstanceEncryptionProtectorsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedInstanceEncryptionProtectorsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedInstanceEncryptionProtectorsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -267,7 +275,8 @@ func (client *ManagedInstanceEncryptionProtectorsClient) BeginRevalidate(ctx con if err != nil { return nil, err } - return runtime.NewPoller[ManagedInstanceEncryptionProtectorsClientRevalidateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedInstanceEncryptionProtectorsClientRevalidateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedInstanceEncryptionProtectorsClientRevalidateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -278,18 +287,20 @@ func (client *ManagedInstanceEncryptionProtectorsClient) BeginRevalidate(ctx con // // Generated from API version 2020-11-01-preview func (client *ManagedInstanceEncryptionProtectorsClient) revalidate(ctx context.Context, resourceGroupName string, managedInstanceName string, encryptionProtectorName EncryptionProtectorName, options *ManagedInstanceEncryptionProtectorsClientBeginRevalidateOptions) (*http.Response, error) { + var err error req, err := client.revalidateCreateRequest(ctx, resourceGroupName, managedInstanceName, encryptionProtectorName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // revalidateCreateRequest creates the Revalidate request. diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceencryptionprotectors_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstanceencryptionprotectors_client_example_test.go index 0d3e72db8627..44af8003211c 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstanceencryptionprotectors_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceencryptionprotectors_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorRevalidate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -39,7 +39,7 @@ func ExampleManagedInstanceEncryptionProtectorsClient_BeginRevalidate() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -78,7 +78,7 @@ func ExampleManagedInstanceEncryptionProtectorsClient_NewListByInstancePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -109,7 +109,7 @@ func ExampleManagedInstanceEncryptionProtectorsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorCreateOrUpdateKeyVault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorCreateOrUpdateKeyVault.json func ExampleManagedInstanceEncryptionProtectorsClient_BeginCreateOrUpdate_updateTheEncryptionProtectorToKeyVault() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -150,7 +150,7 @@ func ExampleManagedInstanceEncryptionProtectorsClient_BeginCreateOrUpdate_update // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorCreateOrUpdateServiceManaged.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorCreateOrUpdateServiceManaged.json func ExampleManagedInstanceEncryptionProtectorsClient_BeginCreateOrUpdate_updateTheEncryptionProtectorToServiceManaged() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/sql/armsql/managedinstancekeys_client.go b/sdk/resourcemanager/sql/armsql/managedinstancekeys_client.go index 0e8200e122af..ebf05f865907 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstancekeys_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstancekeys_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -61,7 +60,8 @@ func (client *ManagedInstanceKeysClient) BeginCreateOrUpdate(ctx context.Context if err != nil { return nil, err } - return runtime.NewPoller[ManagedInstanceKeysClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedInstanceKeysClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedInstanceKeysClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *ManagedInstanceKeysClient) BeginCreateOrUpdate(ctx context.Context // // Generated from API version 2020-11-01-preview func (client *ManagedInstanceKeysClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string, parameters ManagedInstanceKey, options *ManagedInstanceKeysClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, keyName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -113,7 +115,10 @@ func (client *ManagedInstanceKeysClient) createOrUpdateCreateRequest(ctx context reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes the managed instance key with the given name. @@ -132,7 +137,8 @@ func (client *ManagedInstanceKeysClient) BeginDelete(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller[ManagedInstanceKeysClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedInstanceKeysClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedInstanceKeysClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -143,18 +149,20 @@ func (client *ManagedInstanceKeysClient) BeginDelete(ctx context.Context, resour // // Generated from API version 2020-11-01-preview func (client *ManagedInstanceKeysClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string, options *ManagedInstanceKeysClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, keyName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -196,18 +204,21 @@ func (client *ManagedInstanceKeysClient) deleteCreateRequest(ctx context.Context // - keyName - The name of the managed instance key to be retrieved. // - options - ManagedInstanceKeysClientGetOptions contains the optional parameters for the ManagedInstanceKeysClient.Get method. func (client *ManagedInstanceKeysClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string, options *ManagedInstanceKeysClientGetOptions) (ManagedInstanceKeysClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, keyName, options) if err != nil { return ManagedInstanceKeysClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedInstanceKeysClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedInstanceKeysClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedInstanceKeysClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/managedinstancekeys_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstancekeys_client_example_test.go index ecb628d09628..cacf5e1f8e9d 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstancekeys_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/managedinstancekeys_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -76,7 +76,7 @@ func ExampleManagedInstanceKeysClient_NewListByInstancePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -107,7 +107,7 @@ func ExampleManagedInstanceKeysClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyCreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -147,7 +147,7 @@ func ExampleManagedInstanceKeysClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/managedinstancelongtermretentionpolicies_client.go b/sdk/resourcemanager/sql/armsql/managedinstancelongtermretentionpolicies_client.go index 3755f2aeb408..f926030af96e 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstancelongtermretentionpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstancelongtermretentionpolicies_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -62,7 +61,8 @@ func (client *ManagedInstanceLongTermRetentionPoliciesClient) BeginCreateOrUpdat if err != nil { return nil, err } - return runtime.NewPoller[ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -73,18 +73,20 @@ func (client *ManagedInstanceLongTermRetentionPoliciesClient) BeginCreateOrUpdat // // Generated from API version 2020-11-01-preview func (client *ManagedInstanceLongTermRetentionPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, policyName ManagedInstanceLongTermRetentionPolicyName, parameters ManagedInstanceLongTermRetentionPolicy, options *ManagedInstanceLongTermRetentionPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, policyName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -118,7 +120,10 @@ func (client *ManagedInstanceLongTermRetentionPoliciesClient) createOrUpdateCrea reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Get - Gets a managed database's long term retention policy. @@ -133,18 +138,21 @@ func (client *ManagedInstanceLongTermRetentionPoliciesClient) createOrUpdateCrea // - options - ManagedInstanceLongTermRetentionPoliciesClientGetOptions contains the optional parameters for the ManagedInstanceLongTermRetentionPoliciesClient.Get // method. func (client *ManagedInstanceLongTermRetentionPoliciesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, policyName ManagedInstanceLongTermRetentionPolicyName, options *ManagedInstanceLongTermRetentionPoliciesClientGetOptions) (ManagedInstanceLongTermRetentionPoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, policyName, options) if err != nil { return ManagedInstanceLongTermRetentionPoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedInstanceLongTermRetentionPoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedInstanceLongTermRetentionPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedInstanceLongTermRetentionPoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/managedinstancelongtermretentionpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstancelongtermretentionpolicies_client_example_test.go index 40fea7558d51..7b778c4f5cd0 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstancelongtermretentionpolicies_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/managedinstancelongtermretentionpolicies_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceLongTermRetentionPolicyGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -49,7 +49,7 @@ func ExampleManagedInstanceLongTermRetentionPoliciesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceLongTermRetentionPolicyCreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -91,7 +91,7 @@ func ExampleManagedInstanceLongTermRetentionPoliciesClient_BeginCreateOrUpdate() // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceLongTermRetentionPolicyListByDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceoperations_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceoperations_client.go index 2d1188dbe842..011de2a5d24d 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstanceoperations_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceoperations_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -54,16 +53,18 @@ func NewManagedInstanceOperationsClient(subscriptionID string, credential azcore // - options - ManagedInstanceOperationsClientCancelOptions contains the optional parameters for the ManagedInstanceOperationsClient.Cancel // method. func (client *ManagedInstanceOperationsClient) Cancel(ctx context.Context, resourceGroupName string, managedInstanceName string, operationID string, options *ManagedInstanceOperationsClientCancelOptions) (ManagedInstanceOperationsClientCancelResponse, error) { + var err error req, err := client.cancelCreateRequest(ctx, resourceGroupName, managedInstanceName, operationID, options) if err != nil { return ManagedInstanceOperationsClientCancelResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedInstanceOperationsClientCancelResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedInstanceOperationsClientCancelResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedInstanceOperationsClientCancelResponse{}, err } return ManagedInstanceOperationsClientCancelResponse{}, nil } @@ -104,18 +105,21 @@ func (client *ManagedInstanceOperationsClient) cancelCreateRequest(ctx context.C // - options - ManagedInstanceOperationsClientGetOptions contains the optional parameters for the ManagedInstanceOperationsClient.Get // method. func (client *ManagedInstanceOperationsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, operationID string, options *ManagedInstanceOperationsClientGetOptions) (ManagedInstanceOperationsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, operationID, options) if err != nil { return ManagedInstanceOperationsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedInstanceOperationsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedInstanceOperationsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedInstanceOperationsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceoperations_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstanceoperations_client_example_test.go index 6633fd0a560e..76a06e7101ca 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstanceoperations_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceoperations_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListManagedInstanceOperations.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -148,7 +148,7 @@ func ExampleManagedInstanceOperationsClient_NewListByManagedInstancePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetManagedInstanceOperation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -212,7 +212,7 @@ func ExampleManagedInstanceOperationsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelManagedInstanceOperation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceprivateendpointconnections_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceprivateendpointconnections_client.go index 92a95afa08f1..fe986848d5c4 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstanceprivateendpointconnections_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceprivateendpointconnections_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -59,7 +58,8 @@ func (client *ManagedInstancePrivateEndpointConnectionsClient) BeginCreateOrUpda if err != nil { return nil, err } - return runtime.NewPoller[ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,18 +70,20 @@ func (client *ManagedInstancePrivateEndpointConnectionsClient) BeginCreateOrUpda // // Generated from API version 2020-11-01-preview func (client *ManagedInstancePrivateEndpointConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, privateEndpointConnectionName string, parameters ManagedInstancePrivateEndpointConnection, options *ManagedInstancePrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, privateEndpointConnectionName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -111,7 +113,10 @@ func (client *ManagedInstancePrivateEndpointConnectionsClient) createOrUpdateCre reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a private endpoint connection with a given name. @@ -129,7 +134,8 @@ func (client *ManagedInstancePrivateEndpointConnectionsClient) BeginDelete(ctx c if err != nil { return nil, err } - return runtime.NewPoller[ManagedInstancePrivateEndpointConnectionsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedInstancePrivateEndpointConnectionsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedInstancePrivateEndpointConnectionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -140,18 +146,20 @@ func (client *ManagedInstancePrivateEndpointConnectionsClient) BeginDelete(ctx c // // Generated from API version 2020-11-01-preview func (client *ManagedInstancePrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, privateEndpointConnectionName string, options *ManagedInstancePrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, privateEndpointConnectionName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -194,18 +202,21 @@ func (client *ManagedInstancePrivateEndpointConnectionsClient) deleteCreateReque // - options - ManagedInstancePrivateEndpointConnectionsClientGetOptions contains the optional parameters for the ManagedInstancePrivateEndpointConnectionsClient.Get // method. func (client *ManagedInstancePrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, privateEndpointConnectionName string, options *ManagedInstancePrivateEndpointConnectionsClientGetOptions) (ManagedInstancePrivateEndpointConnectionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, privateEndpointConnectionName, options) if err != nil { return ManagedInstancePrivateEndpointConnectionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedInstancePrivateEndpointConnectionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedInstancePrivateEndpointConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedInstancePrivateEndpointConnectionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceprivateendpointconnections_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstanceprivateendpointconnections_client_example_test.go index 4932128800e5..a1794f4e2812 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstanceprivateendpointconnections_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceprivateendpointconnections_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -54,7 +54,7 @@ func ExampleManagedInstancePrivateEndpointConnectionsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -101,7 +101,7 @@ func ExampleManagedInstancePrivateEndpointConnectionsClient_BeginCreateOrUpdate( // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -122,7 +122,7 @@ func ExampleManagedInstancePrivateEndpointConnectionsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceprivatelinkresources_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceprivatelinkresources_client.go index 8c14343abe70..7ee57e15ccae 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstanceprivatelinkresources_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceprivatelinkresources_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -55,18 +54,21 @@ func NewManagedInstancePrivateLinkResourcesClient(subscriptionID string, credent // - options - ManagedInstancePrivateLinkResourcesClientGetOptions contains the optional parameters for the ManagedInstancePrivateLinkResourcesClient.Get // method. func (client *ManagedInstancePrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, groupName string, options *ManagedInstancePrivateLinkResourcesClientGetOptions) (ManagedInstancePrivateLinkResourcesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, groupName, options) if err != nil { return ManagedInstancePrivateLinkResourcesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedInstancePrivateLinkResourcesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedInstancePrivateLinkResourcesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedInstancePrivateLinkResourcesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceprivatelinkresources_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstanceprivatelinkresources_client_example_test.go index 67da4da6df93..a596c3c80b3a 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstanceprivatelinkresources_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceprivatelinkresources_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateLinkResourcesList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -55,7 +55,7 @@ func ExampleManagedInstancePrivateLinkResourcesClient_NewListByManagedInstancePa } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateLinkResourcesGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/managedinstances_client.go b/sdk/resourcemanager/sql/armsql/managedinstances_client.go index eb9f11d23a65..f63e7d750a74 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstances_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstances_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -48,7 +47,7 @@ func NewManagedInstancesClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Creates or updates a managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-08-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. @@ -61,7 +60,8 @@ func (client *ManagedInstancesClient) BeginCreateOrUpdate(ctx context.Context, r if err != nil { return nil, err } - return runtime.NewPoller[ManagedInstancesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedInstancesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedInstancesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,20 +70,22 @@ func (client *ManagedInstancesClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Creates or updates a managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-08-01-preview func (client *ManagedInstancesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters ManagedInstance, options *ManagedInstancesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -106,16 +108,19 @@ func (client *ManagedInstancesClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-08-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. @@ -127,7 +132,8 @@ func (client *ManagedInstancesClient) BeginDelete(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller[ManagedInstancesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedInstancesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedInstancesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -136,20 +142,22 @@ func (client *ManagedInstancesClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes a managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-08-01-preview func (client *ManagedInstancesClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -172,7 +180,7 @@ func (client *ManagedInstancesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -180,7 +188,7 @@ func (client *ManagedInstancesClient) deleteCreateRequest(ctx context.Context, r // BeginFailover - Failovers a managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-08-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 to failover. @@ -192,7 +200,8 @@ func (client *ManagedInstancesClient) BeginFailover(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller[ManagedInstancesClientFailoverResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedInstancesClientFailoverResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedInstancesClientFailoverResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -201,20 +210,22 @@ func (client *ManagedInstancesClient) BeginFailover(ctx context.Context, resourc // Failover - Failovers a managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-08-01-preview func (client *ManagedInstancesClient) failover(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginFailoverOptions) (*http.Response, error) { + var err error req, err := client.failoverCreateRequest(ctx, resourceGroupName, managedInstanceName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // failoverCreateRequest creates the Failover request. @@ -240,7 +251,7 @@ func (client *ManagedInstancesClient) failoverCreateRequest(ctx context.Context, 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-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -248,24 +259,27 @@ func (client *ManagedInstancesClient) failoverCreateRequest(ctx context.Context, // Get - Gets a managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-08-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 - ManagedInstancesClientGetOptions contains the optional parameters for the ManagedInstancesClient.Get method. func (client *ManagedInstancesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientGetOptions) (ManagedInstancesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, options) if err != nil { return ManagedInstancesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedInstancesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedInstancesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedInstancesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -291,7 +305,7 @@ func (client *ManagedInstancesClient) getCreateRequest(ctx context.Context, reso if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -308,7 +322,7 @@ func (client *ManagedInstancesClient) getHandleResponse(resp *http.Response) (Ma // NewListPager - Gets a list of all managed instances in the subscription. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-08-01-preview // - options - ManagedInstancesClientListOptions contains the optional parameters for the ManagedInstancesClient.NewListPager // method. func (client *ManagedInstancesClient) NewListPager(options *ManagedInstancesClientListOptions) *runtime.Pager[ManagedInstancesClientListResponse] { @@ -354,7 +368,7 @@ func (client *ManagedInstancesClient) listCreateRequest(ctx context.Context, opt if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -371,7 +385,7 @@ func (client *ManagedInstancesClient) listHandleResponse(resp *http.Response) (M // NewListByInstancePoolPager - Gets a list of all managed instances in an instance pool. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-08-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. // - instancePoolName - The instance pool name. @@ -428,7 +442,7 @@ func (client *ManagedInstancesClient) listByInstancePoolCreateRequest(ctx contex if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -445,7 +459,7 @@ func (client *ManagedInstancesClient) listByInstancePoolHandleResponse(resp *htt // NewListByManagedInstancePager - Get top resource consuming queries of a managed instance. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-08-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. @@ -520,7 +534,7 @@ func (client *ManagedInstancesClient) listByManagedInstanceCreateRequest(ctx con if options != nil && options.ObservationMetric != nil { reqQP.Set("observationMetric", string(*options.ObservationMetric)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -537,7 +551,7 @@ func (client *ManagedInstancesClient) listByManagedInstanceHandleResponse(resp * // NewListByResourceGroupPager - Gets a list of managed instances in a resource group. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-08-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. // - options - ManagedInstancesClientListByResourceGroupOptions contains the optional parameters for the ManagedInstancesClient.NewListByResourceGroupPager @@ -589,7 +603,7 @@ func (client *ManagedInstancesClient) listByResourceGroupCreateRequest(ctx conte if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -604,10 +618,222 @@ func (client *ManagedInstancesClient) listByResourceGroupHandleResponse(resp *ht return result, nil } +// NewListOutboundNetworkDependenciesByManagedInstancePager - Gets the collection of outbound network dependencies for the +// given managed instance. +// +// Generated from API version 2022-08-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 - ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceOptions contains the optional parameters +// for the ManagedInstancesClient.NewListOutboundNetworkDependenciesByManagedInstancePager method. +func (client *ManagedInstancesClient) NewListOutboundNetworkDependenciesByManagedInstancePager(resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceOptions) *runtime.Pager[ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse]{ + More: func(page ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse) (ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listOutboundNetworkDependenciesByManagedInstanceCreateRequest(ctx, resourceGroupName, managedInstanceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse{}, runtime.NewResponseError(resp) + } + return client.listOutboundNetworkDependenciesByManagedInstanceHandleResponse(resp) + }, + }) +} + +// listOutboundNetworkDependenciesByManagedInstanceCreateRequest creates the ListOutboundNetworkDependenciesByManagedInstance request. +func (client *ManagedInstancesClient) listOutboundNetworkDependenciesByManagedInstanceCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/outboundNetworkDependenciesEndpoints" + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listOutboundNetworkDependenciesByManagedInstanceHandleResponse handles the ListOutboundNetworkDependenciesByManagedInstance response. +func (client *ManagedInstancesClient) listOutboundNetworkDependenciesByManagedInstanceHandleResponse(resp *http.Response) (ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse, error) { + result := ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OutboundEnvironmentEndpointCollection); err != nil { + return ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse{}, err + } + return result, nil +} + +// BeginStart - Starts the managed instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-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 - ManagedInstancesClientBeginStartOptions contains the optional parameters for the ManagedInstancesClient.BeginStart +// method. +func (client *ManagedInstancesClient) BeginStart(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginStartOptions) (*runtime.Poller[ManagedInstancesClientStartResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.start(ctx, resourceGroupName, managedInstanceName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagedInstancesClientStartResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ManagedInstancesClientStartResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Start - Starts the managed instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01-preview +func (client *ManagedInstancesClient) start(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginStartOptions) (*http.Response, error) { + var err error + req, err := client.startCreateRequest(ctx, resourceGroupName, managedInstanceName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// startCreateRequest creates the Start request. +func (client *ManagedInstancesClient) startCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginStartOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/start" + 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.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// BeginStop - Stops the managed instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-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 - ManagedInstancesClientBeginStopOptions contains the optional parameters for the ManagedInstancesClient.BeginStop +// method. +func (client *ManagedInstancesClient) BeginStop(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginStopOptions) (*runtime.Poller[ManagedInstancesClientStopResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.stop(ctx, resourceGroupName, managedInstanceName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagedInstancesClientStopResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ManagedInstancesClientStopResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Stop - Stops the managed instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01-preview +func (client *ManagedInstancesClient) stop(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginStopOptions) (*http.Response, error) { + var err error + req, err := client.stopCreateRequest(ctx, resourceGroupName, managedInstanceName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// stopCreateRequest creates the Stop request. +func (client *ManagedInstancesClient) stopCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginStopOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/stop" + 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.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + // BeginUpdate - Updates a managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-08-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. @@ -620,7 +846,8 @@ func (client *ManagedInstancesClient) BeginUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller[ManagedInstancesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedInstancesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedInstancesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -629,20 +856,22 @@ func (client *ManagedInstancesClient) BeginUpdate(ctx context.Context, resourceG // Update - Updates a managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-08-01-preview func (client *ManagedInstancesClient) update(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters ManagedInstanceUpdate, options *ManagedInstancesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, managedInstanceName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -665,8 +894,11 @@ func (client *ManagedInstancesClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/managedinstances_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstances_client_example_test.go index 332efa5b7435..f7a8b8ca2d02 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstances_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/managedinstances_client_example_test.go @@ -15,11 +15,11 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceListByInstancePool.json -func ExampleManagedInstancesClient_NewListByInstancePoolPager_listManagedInstancesByInstancePool() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceList.json +func ExampleManagedInstancesClient_NewListPager_listManagedInstances() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -29,7 +29,7 @@ func ExampleManagedInstancesClient_NewListByInstancePoolPager_listManagedInstanc if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewManagedInstancesClient().NewListByInstancePoolPager("Test1", "pool1", &armsql.ManagedInstancesClientListByInstancePoolOptions{Expand: nil}) + pager := clientFactory.NewManagedInstancesClient().NewListPager(&armsql.ManagedInstancesClientListOptions{Expand: nil}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -45,71 +45,69 @@ func ExampleManagedInstancesClient_NewListByInstancePoolPager_listManagedInstanc // { // Name: to.Ptr("testinstance1"), // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance1"), - // Location: to.Ptr("canadacentral"), + // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance1"), + // Location: to.Ptr("japaneast"), // Properties: &armsql.ManagedInstanceProperties{ // AdministratorLogin: to.Ptr("dummylogin"), // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), // DNSZone: to.Ptr("1b4e2caff2530"), // FullyQualifiedDomainName: to.Ptr("testinstance1.1b4e2caff2530.database.windows.net"), - // InstancePoolID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Sql/instancePools/pool1"), // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_CanadaCentral_MI_1"), + // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), // MinimalTLSVersion: to.Ptr("1.2"), // ProvisioningState: to.Ptr(armsql.ManagedInstancePropertiesProvisioningStateSucceeded), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect), + // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault), // PublicDataEndpointEnabled: to.Ptr(false), // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), // State: to.Ptr("Ready"), // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), // VCores: to.Ptr[int32](8), // }, // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), + // Name: to.Ptr("GP_Gen4"), // Capacity: to.Ptr[int32](8), - // Family: to.Ptr("Gen5"), + // Family: to.Ptr("Gen4"), // Tier: to.Ptr("GeneralPurpose"), // }, // }, // { // Name: to.Ptr("testinstance2"), // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance2"), - // Location: to.Ptr("canadacentral"), + // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance2"), + // Location: to.Ptr("japaneast"), // Properties: &armsql.ManagedInstanceProperties{ // AdministratorLogin: to.Ptr("dummylogin"), // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), // DNSZone: to.Ptr("2c3d1bdae3412"), // FullyQualifiedDomainName: to.Ptr("testinstance2.2c3d1bdae3412.database.windows.net"), - // InstancePoolID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Sql/instancePools/pool1"), // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseType("Full")), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_CanadaCentral_MI_1"), + // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), // MinimalTLSVersion: to.Ptr("1.2"), // ProvisioningState: to.Ptr(armsql.ManagedInstancePropertiesProvisioningStateSucceeded), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect), + // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault), // PublicDataEndpointEnabled: to.Ptr(false), // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), // State: to.Ptr("Ready"), // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/subnet2"), // VCores: to.Ptr[int32](16), // }, // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), + // Name: to.Ptr("BC_Gen5"), // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("GeneralPurpose"), + // Family: to.Ptr("Gen4"), + // Tier: to.Ptr("BusinessCritical"), // }, // }}, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceListByInstancePoolWithExpandEqualsAdministrators.json -func ExampleManagedInstancesClient_NewListByInstancePoolPager_listManagedInstancesByInstancePoolWithExpandAdministratorsActivedirectory() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceListWithExpandEqualsAdministrators.json +func ExampleManagedInstancesClient_NewListPager_listManagedInstancesWithExpandAdministratorsActivedirectory() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -119,7 +117,7 @@ func ExampleManagedInstancesClient_NewListByInstancePoolPager_listManagedInstanc if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewManagedInstancesClient().NewListByInstancePoolPager("Test1", "pool1", &armsql.ManagedInstancesClientListByInstancePoolOptions{Expand: nil}) + pager := clientFactory.NewManagedInstancesClient().NewListPager(&armsql.ManagedInstancesClientListOptions{Expand: nil}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -135,8 +133,8 @@ func ExampleManagedInstancesClient_NewListByInstancePoolPager_listManagedInstanc // { // Name: to.Ptr("testinstance1"), // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance1"), - // Location: to.Ptr("canadacentral"), + // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance1"), + // Location: to.Ptr("japaneast"), // Properties: &armsql.ManagedInstanceProperties{ // AdministratorLogin: to.Ptr("dummylogin"), // Administrators: &armsql.ManagedInstanceExternalAdministrator{ @@ -150,31 +148,30 @@ func ExampleManagedInstancesClient_NewListByInstancePoolPager_listManagedInstanc // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), // DNSZone: to.Ptr("1b4e2caff2530"), // FullyQualifiedDomainName: to.Ptr("testinstance1.1b4e2caff2530.database.windows.net"), - // InstancePoolID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Sql/instancePools/pool1"), // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_CanadaCentral_MI_1"), + // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), // MinimalTLSVersion: to.Ptr("1.2"), // ProvisioningState: to.Ptr(armsql.ManagedInstancePropertiesProvisioningStateSucceeded), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect), + // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault), // PublicDataEndpointEnabled: to.Ptr(false), // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), // State: to.Ptr("Ready"), // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), // VCores: to.Ptr[int32](8), // }, // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), + // Name: to.Ptr("GP_Gen4"), // Capacity: to.Ptr[int32](8), - // Family: to.Ptr("Gen5"), + // Family: to.Ptr("Gen4"), // Tier: to.Ptr("GeneralPurpose"), // }, // }, // { // Name: to.Ptr("testinstance2"), // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance2"), - // Location: to.Ptr("canadacentral"), + // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance2"), + // Location: to.Ptr("japaneast"), // Properties: &armsql.ManagedInstanceProperties{ // AdministratorLogin: to.Ptr("dummylogin"), // Administrators: &armsql.ManagedInstanceExternalAdministrator{ @@ -188,32 +185,31 @@ func ExampleManagedInstancesClient_NewListByInstancePoolPager_listManagedInstanc // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), // DNSZone: to.Ptr("2c3d1bdae3412"), // FullyQualifiedDomainName: to.Ptr("testinstance2.2c3d1bdae3412.database.windows.net"), - // InstancePoolID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Sql/instancePools/pool1"), // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseType("Full")), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_CanadaCentral_MI_2"), + // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_2"), // MinimalTLSVersion: to.Ptr("1.2"), // ProvisioningState: to.Ptr(armsql.ManagedInstancePropertiesProvisioningStateSucceeded), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect), + // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault), // PublicDataEndpointEnabled: to.Ptr(false), // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), // State: to.Ptr("Ready"), // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/subnet2"), // VCores: to.Ptr[int32](16), // }, // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), + // Name: to.Ptr("BC_Gen5"), // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("GeneralPurpose"), + // Family: to.Ptr("Gen4"), + // Tier: to.Ptr("BusinessCritical"), // }, // }}, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceList.json -func ExampleManagedInstancesClient_NewListPager_listManagedInstances() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceListByInstancePool.json +func ExampleManagedInstancesClient_NewListByInstancePoolPager_listManagedInstancesByInstancePool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -223,7 +219,7 @@ func ExampleManagedInstancesClient_NewListPager_listManagedInstances() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewManagedInstancesClient().NewListPager(&armsql.ManagedInstancesClientListOptions{Expand: nil}) + pager := clientFactory.NewManagedInstancesClient().NewListByInstancePoolPager("Test1", "pool1", &armsql.ManagedInstancesClientListByInstancePoolOptions{Expand: nil}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -239,69 +235,71 @@ func ExampleManagedInstancesClient_NewListPager_listManagedInstances() { // { // Name: to.Ptr("testinstance1"), // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance1"), - // Location: to.Ptr("japaneast"), + // ID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance1"), + // Location: to.Ptr("canadacentral"), // Properties: &armsql.ManagedInstanceProperties{ // AdministratorLogin: to.Ptr("dummylogin"), // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), // DNSZone: to.Ptr("1b4e2caff2530"), // FullyQualifiedDomainName: to.Ptr("testinstance1.1b4e2caff2530.database.windows.net"), + // InstancePoolID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/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"), + // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_CanadaCentral_MI_1"), // MinimalTLSVersion: to.Ptr("1.2"), // ProvisioningState: to.Ptr(armsql.ManagedInstancePropertiesProvisioningStateSucceeded), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault), + // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect), // PublicDataEndpointEnabled: to.Ptr(false), // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), // State: to.Ptr("Ready"), // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), // VCores: to.Ptr[int32](8), // }, // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen4"), + // Name: to.Ptr("GP_Gen5"), // Capacity: to.Ptr[int32](8), - // Family: to.Ptr("Gen4"), + // Family: to.Ptr("Gen5"), // Tier: to.Ptr("GeneralPurpose"), // }, // }, // { // Name: to.Ptr("testinstance2"), // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance2"), - // Location: to.Ptr("japaneast"), + // ID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance2"), + // Location: to.Ptr("canadacentral"), // Properties: &armsql.ManagedInstanceProperties{ // AdministratorLogin: to.Ptr("dummylogin"), // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), // DNSZone: to.Ptr("2c3d1bdae3412"), // FullyQualifiedDomainName: to.Ptr("testinstance2.2c3d1bdae3412.database.windows.net"), + // InstancePoolID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Sql/instancePools/pool1"), // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseType("Full")), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), + // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_CanadaCentral_MI_1"), // MinimalTLSVersion: to.Ptr("1.2"), // ProvisioningState: to.Ptr(armsql.ManagedInstancePropertiesProvisioningStateSucceeded), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault), + // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect), // PublicDataEndpointEnabled: to.Ptr(false), // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), // State: to.Ptr("Ready"), // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/subnet2"), + // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), // VCores: to.Ptr[int32](16), // }, // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen5"), + // Name: to.Ptr("GP_Gen5"), // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("BusinessCritical"), + // Family: to.Ptr("Gen5"), + // Tier: to.Ptr("GeneralPurpose"), // }, // }}, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceListWithExpandEqualsAdministrators.json -func ExampleManagedInstancesClient_NewListPager_listManagedInstancesWithExpandAdministratorsActivedirectory() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceListByInstancePoolWithExpandEqualsAdministrators.json +func ExampleManagedInstancesClient_NewListByInstancePoolPager_listManagedInstancesByInstancePoolWithExpandAdministratorsActivedirectory() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -311,7 +309,7 @@ func ExampleManagedInstancesClient_NewListPager_listManagedInstancesWithExpandAd if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewManagedInstancesClient().NewListPager(&armsql.ManagedInstancesClientListOptions{Expand: nil}) + pager := clientFactory.NewManagedInstancesClient().NewListByInstancePoolPager("Test1", "pool1", &armsql.ManagedInstancesClientListByInstancePoolOptions{Expand: nil}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -327,8 +325,8 @@ func ExampleManagedInstancesClient_NewListPager_listManagedInstancesWithExpandAd // { // Name: to.Ptr("testinstance1"), // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance1"), - // Location: to.Ptr("japaneast"), + // ID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance1"), + // Location: to.Ptr("canadacentral"), // Properties: &armsql.ManagedInstanceProperties{ // AdministratorLogin: to.Ptr("dummylogin"), // Administrators: &armsql.ManagedInstanceExternalAdministrator{ @@ -342,30 +340,31 @@ func ExampleManagedInstancesClient_NewListPager_listManagedInstancesWithExpandAd // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), // DNSZone: to.Ptr("1b4e2caff2530"), // FullyQualifiedDomainName: to.Ptr("testinstance1.1b4e2caff2530.database.windows.net"), + // InstancePoolID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/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"), + // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_CanadaCentral_MI_1"), // MinimalTLSVersion: to.Ptr("1.2"), // ProvisioningState: to.Ptr(armsql.ManagedInstancePropertiesProvisioningStateSucceeded), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault), + // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect), // PublicDataEndpointEnabled: to.Ptr(false), // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), // State: to.Ptr("Ready"), // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), // VCores: to.Ptr[int32](8), // }, // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen4"), + // Name: to.Ptr("GP_Gen5"), // Capacity: to.Ptr[int32](8), - // Family: to.Ptr("Gen4"), + // Family: to.Ptr("Gen5"), // Tier: to.Ptr("GeneralPurpose"), // }, // }, // { // Name: to.Ptr("testinstance2"), // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance2"), - // Location: to.Ptr("japaneast"), + // ID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance2"), + // Location: to.Ptr("canadacentral"), // Properties: &armsql.ManagedInstanceProperties{ // AdministratorLogin: to.Ptr("dummylogin"), // Administrators: &armsql.ManagedInstanceExternalAdministrator{ @@ -379,30 +378,31 @@ func ExampleManagedInstancesClient_NewListPager_listManagedInstancesWithExpandAd // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), // DNSZone: to.Ptr("2c3d1bdae3412"), // FullyQualifiedDomainName: to.Ptr("testinstance2.2c3d1bdae3412.database.windows.net"), + // InstancePoolID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Sql/instancePools/pool1"), // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseType("Full")), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_2"), + // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_CanadaCentral_MI_2"), // MinimalTLSVersion: to.Ptr("1.2"), // ProvisioningState: to.Ptr(armsql.ManagedInstancePropertiesProvisioningStateSucceeded), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault), + // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect), // PublicDataEndpointEnabled: to.Ptr(false), // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), // State: to.Ptr("Ready"), // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/subnet2"), + // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), // VCores: to.Ptr[int32](16), // }, // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen5"), + // Name: to.Ptr("GP_Gen5"), // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("BusinessCritical"), + // Family: to.Ptr("Gen5"), + // Tier: to.Ptr("GeneralPurpose"), // }, // }}, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceListByResourceGroup.json func ExampleManagedInstancesClient_NewListByResourceGroupPager_listManagedInstancesByResourceGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -490,7 +490,7 @@ func ExampleManagedInstancesClient_NewListByResourceGroupPager_listManagedInstan } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceListByResourceGroupWithExpandEqualsAdministrators.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceListByResourceGroupWithExpandEqualsAdministrators.json func ExampleManagedInstancesClient_NewListByResourceGroupPager_listManagedInstancesByResourceGroupWithExpandAdministratorsActivedirectory() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -592,7 +592,7 @@ func ExampleManagedInstancesClient_NewListByResourceGroupPager_listManagedInstan } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceGet.json func ExampleManagedInstancesClient_Get_getManagedInstance() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -652,7 +652,7 @@ func ExampleManagedInstancesClient_Get_getManagedInstance() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceGetWithExpandEqualsAdministrators.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceGetWithExpandEqualsAdministrators.json func ExampleManagedInstancesClient_Get_getManagedInstanceWithExpandAdministratorsActivedirectory() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -713,7 +713,7 @@ func ExampleManagedInstancesClient_Get_getManagedInstanceWithExpandAdministrator // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceCreateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceCreateMax.json func ExampleManagedInstancesClient_BeginCreateOrUpdate_createManagedInstanceWithAllProperties() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -821,7 +821,7 @@ func ExampleManagedInstancesClient_BeginCreateOrUpdate_createManagedInstanceWith // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceCreateMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceCreateMin.json func ExampleManagedInstancesClient_BeginCreateOrUpdate_createManagedInstanceWithMinimalProperties() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -889,7 +889,7 @@ func ExampleManagedInstancesClient_BeginCreateOrUpdate_createManagedInstanceWith // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceDelete.json func ExampleManagedInstancesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -910,7 +910,7 @@ func ExampleManagedInstancesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceRemoveMaintenanceConfiguration.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceRemoveMaintenanceConfiguration.json func ExampleManagedInstancesClient_BeginUpdate_removeMaintenancePolicyFromManagedInstanceSelectDefaultMaintenancePolicy() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -965,7 +965,7 @@ func ExampleManagedInstancesClient_BeginUpdate_removeMaintenancePolicyFromManage // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceUpdateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceUpdateMax.json func ExampleManagedInstancesClient_BeginUpdate_updateManagedInstanceWithAllProperties() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1044,7 +1044,7 @@ func ExampleManagedInstancesClient_BeginUpdate_updateManagedInstanceWithAllPrope // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceUpdateMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceUpdateMin.json func ExampleManagedInstancesClient_BeginUpdate_updateManagedInstanceWithMinimalProperties() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1104,7 +1104,195 @@ func ExampleManagedInstancesClient_BeginUpdate_updateManagedInstanceWithMinimalP // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceTopQueriesList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-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() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedInstancesClient().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) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ListOutboundNetworkDependenciesByManagedInstance.json +func ExampleManagedInstancesClient_NewListOutboundNetworkDependenciesByManagedInstancePager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewManagedInstancesClient().NewListOutboundNetworkDependenciesByManagedInstancePager("sqlcrudtest-7398", "testinstance", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.OutboundEnvironmentEndpointCollection = armsql.OutboundEnvironmentEndpointCollection{ + // Value: []*armsql.OutboundEnvironmentEndpoint{ + // { + // Category: to.Ptr("Azure SQL Database"), + // Endpoints: []*armsql.EndpointDependency{ + // { + // DomainName: to.Ptr("control.database.windows.net"), + // EndpointDetails: []*armsql.EndpointDetail{ + // { + // Port: to.Ptr[int32](443), + // }}, + // }, + // { + // DomainName: to.Ptr("worker.database.windows.net"), + // EndpointDetails: []*armsql.EndpointDetail{ + // { + // Port: to.Ptr[int32](443), + // }}, + // }}, + // }, + // { + // Category: to.Ptr("Azure Storage"), + // Endpoints: []*armsql.EndpointDependency{ + // { + // DomainName: to.Ptr("blob.core.windows.net"), + // EndpointDetails: []*armsql.EndpointDetail{ + // { + // Port: to.Ptr[int32](443), + // }}, + // }, + // { + // DomainName: to.Ptr("table.core.windows.net"), + // EndpointDetails: []*armsql.EndpointDetail{ + // { + // Port: to.Ptr[int32](443), + // }}, + // }}, + // }, + // { + // Category: to.Ptr("Service Bus"), + // Endpoints: []*armsql.EndpointDependency{ + // { + // DomainName: to.Ptr("servicebus.windows.net"), + // EndpointDetails: []*armsql.EndpointDetail{ + // { + // Port: to.Ptr[int32](443), + // }}, + // }}, + // }, + // { + // Category: to.Ptr("Certificate Verification"), + // Endpoints: []*armsql.EndpointDependency{ + // { + // DomainName: to.Ptr("dsms.core.windows.net"), + // EndpointDetails: []*armsql.EndpointDetail{ + // { + // Port: to.Ptr[int32](443), + // }}, + // }, + // { + // DomainName: to.Ptr("dsts.core.windows.net"), + // EndpointDetails: []*armsql.EndpointDetail{ + // { + // Port: to.Ptr[int32](443), + // }}, + // }, + // { + // DomainName: to.Ptr("login.windows.net"), + // EndpointDetails: []*armsql.EndpointDetail{ + // { + // Port: to.Ptr[int32](443), + // }}, + // }}, + // }, + // { + // Category: to.Ptr("Telemetry"), + // Endpoints: []*armsql.EndpointDependency{ + // { + // DomainName: to.Ptr("azurewatsonanalysis-prod.core.windows.net"), + // EndpointDetails: []*armsql.EndpointDetail{ + // { + // Port: to.Ptr[int32](443), + // }}, + // }, + // { + // DomainName: to.Ptr("global.metrics.nsatc.net"), + // EndpointDetails: []*armsql.EndpointDetail{ + // { + // Port: to.Ptr[int32](443), + // }}, + // }, + // { + // DomainName: to.Ptr("production.diagnostics.monitoring.core.windows.net"), + // EndpointDetails: []*armsql.EndpointDetail{ + // { + // Port: to.Ptr[int32](443), + // }}, + // }}, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StartManagedInstance.json +func ExampleManagedInstancesClient_BeginStart() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedInstancesClient().BeginStart(ctx, "startrg", "mitostart", 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/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StopManagedInstance.json +func ExampleManagedInstancesClient_BeginStop() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedInstancesClient().BeginStop(ctx, "stoprg", "mitostop", 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/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceTopQueriesList.json func ExampleManagedInstancesClient_NewListByManagedInstancePager_obtainListOfInstancesTopResourceConsumingQueries() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1348,7 +1536,7 @@ func ExampleManagedInstancesClient_NewListByManagedInstancePager_obtainListOfIns } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceTopQueriesListMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceTopQueriesListMax.json func ExampleManagedInstancesClient_NewListByManagedInstancePager_obtainListOfInstancesTopResourceConsumingQueriesFullBlownRequestAndResponse() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1592,7 +1780,7 @@ func ExampleManagedInstancesClient_NewListByManagedInstancePager_obtainListOfIns } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceTopQueriesListMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceTopQueriesListMin.json func ExampleManagedInstancesClient_NewListByManagedInstancePager_obtainListOfInstancesTopResourceConsumingQueriesMinimalRequestAndResponse() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1636,24 +1824,3 @@ func ExampleManagedInstancesClient_NewListByManagedInstancePager_obtainListOfIns // } } } - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/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() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstancesClient().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/managedinstancetdecertificates_client.go b/sdk/resourcemanager/sql/armsql/managedinstancetdecertificates_client.go index 5762f99c66da..2c532c17fda5 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstancetdecertificates_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstancetdecertificates_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -60,7 +59,8 @@ func (client *ManagedInstanceTdeCertificatesClient) BeginCreate(ctx context.Cont if err != nil { return nil, err } - return runtime.NewPoller[ManagedInstanceTdeCertificatesClientCreateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedInstanceTdeCertificatesClientCreateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedInstanceTdeCertificatesClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,18 +71,20 @@ func (client *ManagedInstanceTdeCertificatesClient) BeginCreate(ctx context.Cont // // Generated from API version 2020-11-01-preview func (client *ManagedInstanceTdeCertificatesClient) create(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters TdeCertificate, options *ManagedInstanceTdeCertificatesClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, managedInstanceName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -107,5 +109,8 @@ func (client *ManagedInstanceTdeCertificatesClient) createCreateRequest(ctx cont reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/managedinstancetdecertificates_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstancetdecertificates_client_example_test.go index bfc5a0d835dc..0046337acc72 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstancetdecertificates_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/managedinstancetdecertificates_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceTdeCertificate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/managedinstancevulnerabilityassessments_client.go b/sdk/resourcemanager/sql/armsql/managedinstancevulnerabilityassessments_client.go index 843f90e33420..779b973ab7fa 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstancevulnerabilityassessments_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstancevulnerabilityassessments_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -58,18 +57,21 @@ func NewManagedInstanceVulnerabilityAssessmentsClient(subscriptionID string, cre // - options - ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.CreateOrUpdate // method. func (client *ManagedInstanceVulnerabilityAssessmentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, parameters ManagedInstanceVulnerabilityAssessment, options *ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateOptions) (ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, vulnerabilityAssessmentName, parameters, options) if err != nil { return ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -99,7 +101,10 @@ func (client *ManagedInstanceVulnerabilityAssessmentsClient) createOrUpdateCreat reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -122,16 +127,18 @@ func (client *ManagedInstanceVulnerabilityAssessmentsClient) createOrUpdateHandl // - options - ManagedInstanceVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.Delete // method. func (client *ManagedInstanceVulnerabilityAssessmentsClient) Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *ManagedInstanceVulnerabilityAssessmentsClientDeleteOptions) (ManagedInstanceVulnerabilityAssessmentsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, vulnerabilityAssessmentName, options) if err != nil { return ManagedInstanceVulnerabilityAssessmentsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedInstanceVulnerabilityAssessmentsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedInstanceVulnerabilityAssessmentsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedInstanceVulnerabilityAssessmentsClientDeleteResponse{}, err } return ManagedInstanceVulnerabilityAssessmentsClientDeleteResponse{}, nil } @@ -176,18 +183,21 @@ func (client *ManagedInstanceVulnerabilityAssessmentsClient) deleteCreateRequest // - options - ManagedInstanceVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.Get // method. func (client *ManagedInstanceVulnerabilityAssessmentsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *ManagedInstanceVulnerabilityAssessmentsClientGetOptions) (ManagedInstanceVulnerabilityAssessmentsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, vulnerabilityAssessmentName, options) if err != nil { return ManagedInstanceVulnerabilityAssessmentsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedInstanceVulnerabilityAssessmentsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedInstanceVulnerabilityAssessmentsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedInstanceVulnerabilityAssessmentsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/managedinstancevulnerabilityassessments_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstancevulnerabilityassessments_client_example_test.go index 2cfc746101ed..297f80bf44fd 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstancevulnerabilityassessments_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/managedinstancevulnerabilityassessments_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -52,7 +52,7 @@ func ExampleManagedInstanceVulnerabilityAssessmentsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentCreateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentCreateMax.json func ExampleManagedInstanceVulnerabilityAssessmentsClient_CreateOrUpdate_createAManagedInstancesVulnerabilityAssessmentWithAllParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -99,7 +99,7 @@ func ExampleManagedInstanceVulnerabilityAssessmentsClient_CreateOrUpdate_createA // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentCreateStorageAccessKeyMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentCreateStorageAccessKeyMin.json func ExampleManagedInstanceVulnerabilityAssessmentsClient_CreateOrUpdate_createAManagedInstancesVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAccessKeyIsSpecified() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -137,7 +137,7 @@ func ExampleManagedInstanceVulnerabilityAssessmentsClient_CreateOrUpdate_createA // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentCreateContainerSasKeyMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentCreateContainerSasKeyMin.json func ExampleManagedInstanceVulnerabilityAssessmentsClient_CreateOrUpdate_createAManagedInstancesVulnerabilityAssessmentWithMinimalParametersWhenStorageContainerSasKeyIsSpecified() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -175,7 +175,7 @@ func ExampleManagedInstanceVulnerabilityAssessmentsClient_CreateOrUpdate_createA // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -192,7 +192,7 @@ func ExampleManagedInstanceVulnerabilityAssessmentsClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentListByInstance.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/managedledgerdigestuploads_client.go b/sdk/resourcemanager/sql/armsql/managedledgerdigestuploads_client.go new file mode 100644 index 000000000000..2cdd28889db8 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/managedledgerdigestuploads_client.go @@ -0,0 +1,352 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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" +) + +// ManagedLedgerDigestUploadsClient contains the methods for the ManagedLedgerDigestUploads group. +// Don't use this type directly, use NewManagedLedgerDigestUploadsClient() instead. +type ManagedLedgerDigestUploadsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewManagedLedgerDigestUploadsClient creates a new instance of ManagedLedgerDigestUploadsClient 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 NewManagedLedgerDigestUploadsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedLedgerDigestUploadsClient, error) { + cl, err := arm.NewClient(moduleName+".ManagedLedgerDigestUploadsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ManagedLedgerDigestUploadsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-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. +// - ledgerDigestUploads - The name of the Ledger Digest Upload Configurations. +// - parameters - The Ledger Digest Storage Endpoint. +// - options - ManagedLedgerDigestUploadsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedLedgerDigestUploadsClient.BeginCreateOrUpdate +// method. +func (client *ManagedLedgerDigestUploadsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ledgerDigestUploads ManagedLedgerDigestUploadsName, parameters ManagedLedgerDigestUploads, options *ManagedLedgerDigestUploadsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedLedgerDigestUploadsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, databaseName, ledgerDigestUploads, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller[ManagedLedgerDigestUploadsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ManagedLedgerDigestUploadsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01-preview +func (client *ManagedLedgerDigestUploadsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ledgerDigestUploads ManagedLedgerDigestUploadsName, parameters ManagedLedgerDigestUploads, options *ManagedLedgerDigestUploadsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, ledgerDigestUploads, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ManagedLedgerDigestUploadsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ledgerDigestUploads ManagedLedgerDigestUploadsName, parameters ManagedLedgerDigestUploads, options *ManagedLedgerDigestUploadsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}" + 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 ledgerDigestUploads == "" { + return nil, errors.New("parameter ledgerDigestUploads cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ledgerDigestUploads}", url.PathEscape(string(ledgerDigestUploads))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDisable - Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-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 - ManagedLedgerDigestUploadsClientBeginDisableOptions contains the optional parameters for the ManagedLedgerDigestUploadsClient.BeginDisable +// method. +func (client *ManagedLedgerDigestUploadsClient) BeginDisable(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ledgerDigestUploads ManagedLedgerDigestUploadsName, options *ManagedLedgerDigestUploadsClientBeginDisableOptions) (*runtime.Poller[ManagedLedgerDigestUploadsClientDisableResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.disable(ctx, resourceGroupName, managedInstanceName, databaseName, ledgerDigestUploads, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller[ManagedLedgerDigestUploadsClientDisableResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ManagedLedgerDigestUploadsClientDisableResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Disable - Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01-preview +func (client *ManagedLedgerDigestUploadsClient) disable(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ledgerDigestUploads ManagedLedgerDigestUploadsName, options *ManagedLedgerDigestUploadsClientBeginDisableOptions) (*http.Response, error) { + var err error + req, err := client.disableCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, ledgerDigestUploads, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// disableCreateRequest creates the Disable request. +func (client *ManagedLedgerDigestUploadsClient) disableCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ledgerDigestUploads ManagedLedgerDigestUploadsName, options *ManagedLedgerDigestUploadsClientBeginDisableOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable" + 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 ledgerDigestUploads == "" { + return nil, errors.New("parameter ledgerDigestUploads cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ledgerDigestUploads}", url.PathEscape(string(ledgerDigestUploads))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the current ledger digest upload configuration for a database. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-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 - ManagedLedgerDigestUploadsClientGetOptions contains the optional parameters for the ManagedLedgerDigestUploadsClient.Get +// method. +func (client *ManagedLedgerDigestUploadsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ledgerDigestUploads ManagedLedgerDigestUploadsName, options *ManagedLedgerDigestUploadsClientGetOptions) (ManagedLedgerDigestUploadsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, ledgerDigestUploads, options) + if err != nil { + return ManagedLedgerDigestUploadsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagedLedgerDigestUploadsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedLedgerDigestUploadsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ManagedLedgerDigestUploadsClient) getCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ledgerDigestUploads ManagedLedgerDigestUploadsName, options *ManagedLedgerDigestUploadsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}" + 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 ledgerDigestUploads == "" { + return nil, errors.New("parameter ledgerDigestUploads cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ledgerDigestUploads}", url.PathEscape(string(ledgerDigestUploads))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-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 *ManagedLedgerDigestUploadsClient) getHandleResponse(resp *http.Response) (ManagedLedgerDigestUploadsClientGetResponse, error) { + result := ManagedLedgerDigestUploadsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedLedgerDigestUploads); err != nil { + return ManagedLedgerDigestUploadsClientGetResponse{}, err + } + return result, nil +} + +// NewListByDatabasePager - Gets all ledger digest upload settings on a database. +// +// Generated from API version 2022-08-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 - ManagedLedgerDigestUploadsClientListByDatabaseOptions contains the optional parameters for the ManagedLedgerDigestUploadsClient.NewListByDatabasePager +// method. +func (client *ManagedLedgerDigestUploadsClient) NewListByDatabasePager(resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedLedgerDigestUploadsClientListByDatabaseOptions) *runtime.Pager[ManagedLedgerDigestUploadsClientListByDatabaseResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedLedgerDigestUploadsClientListByDatabaseResponse]{ + More: func(page ManagedLedgerDigestUploadsClientListByDatabaseResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedLedgerDigestUploadsClientListByDatabaseResponse) (ManagedLedgerDigestUploadsClientListByDatabaseResponse, 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 ManagedLedgerDigestUploadsClientListByDatabaseResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagedLedgerDigestUploadsClientListByDatabaseResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedLedgerDigestUploadsClientListByDatabaseResponse{}, runtime.NewResponseError(resp) + } + return client.listByDatabaseHandleResponse(resp) + }, + }) +} + +// listByDatabaseCreateRequest creates the ListByDatabase request. +func (client *ManagedLedgerDigestUploadsClient) listByDatabaseCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedLedgerDigestUploadsClientListByDatabaseOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/ledgerDigestUploads" + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-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 *ManagedLedgerDigestUploadsClient) listByDatabaseHandleResponse(resp *http.Response) (ManagedLedgerDigestUploadsClientListByDatabaseResponse, error) { + result := ManagedLedgerDigestUploadsClientListByDatabaseResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedLedgerDigestUploadsListResult); err != nil { + return ManagedLedgerDigestUploadsClientListByDatabaseResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/managedledgerdigestuploads_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedledgerdigestuploads_client_example_test.go new file mode 100644 index 000000000000..feefa95e1bf3 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/managedledgerdigestuploads_client_example_test.go @@ -0,0 +1,154 @@ +//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_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/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedLedgerDigestUploadsList.json +func ExampleManagedLedgerDigestUploadsClient_NewListByDatabasePager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewManagedLedgerDigestUploadsClient().NewListByDatabasePager("ledgertestrg", "ledgertestserver", "testdb", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ManagedLedgerDigestUploadsListResult = armsql.ManagedLedgerDigestUploadsListResult{ + // Value: []*armsql.ManagedLedgerDigestUploads{ + // { + // Name: to.Ptr("current"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/ledgerDigestUploads"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/ledgertestrg/providers/Microsoft.Sql/managedInstances/ledgertestserver/databases/testdb/current"), + // Properties: &armsql.ManagedLedgerDigestUploadsProperties{ + // DigestStorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), + // State: to.Ptr(armsql.ManagedLedgerDigestUploadsStateEnabled), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedLedgerDigestUploadsGet.json +func ExampleManagedLedgerDigestUploadsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewManagedLedgerDigestUploadsClient().Get(ctx, "ledgertestrg", "ledgertestserver", "testdb", armsql.ManagedLedgerDigestUploadsNameCurrent, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedLedgerDigestUploads = armsql.ManagedLedgerDigestUploads{ + // Name: to.Ptr("current"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/ledgerDigestUploads"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/ledgertestrg/providers/Microsoft.Sql/managedInstances/ledgertestserver/databases/testdb/current"), + // Properties: &armsql.ManagedLedgerDigestUploadsProperties{ + // DigestStorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), + // State: to.Ptr(armsql.ManagedLedgerDigestUploadsStateEnabled), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedLedgerDigestUploadsEnable.json +func ExampleManagedLedgerDigestUploadsClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedLedgerDigestUploadsClient().BeginCreateOrUpdate(ctx, "ledgertestrg", "ledgertestserver", "testdb", armsql.ManagedLedgerDigestUploadsNameCurrent, armsql.ManagedLedgerDigestUploads{ + Properties: &armsql.ManagedLedgerDigestUploadsProperties{ + 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedLedgerDigestUploads = armsql.ManagedLedgerDigestUploads{ + // Name: to.Ptr("current"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/ledgerDigestUploads"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/ledgertestrg/providers/Microsoft.Sql/managedInstances/ledgertestserver/databases/testdb/ledgerDigestUploads/current"), + // Properties: &armsql.ManagedLedgerDigestUploadsProperties{ + // DigestStorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), + // State: to.Ptr(armsql.ManagedLedgerDigestUploadsStateEnabled), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedLedgerDigestUploadsDisable.json +func ExampleManagedLedgerDigestUploadsClient_BeginDisable() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedLedgerDigestUploadsClient().BeginDisable(ctx, "ledgertestrg", "ledgertestserver", "testdb", armsql.ManagedLedgerDigestUploadsNameCurrent, 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedLedgerDigestUploads = armsql.ManagedLedgerDigestUploads{ + // Name: to.Ptr("current"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/ledgerDigestUploads"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/ledgertestrg/providers/Microsoft.Sql/managedInstances/ledgertestserver/databases/testdb/ledgerDigestUploads/current/disable"), + // Properties: &armsql.ManagedLedgerDigestUploadsProperties{ + // State: to.Ptr(armsql.ManagedLedgerDigestUploadsStateDisabled), + // }, + // } +} diff --git a/sdk/resourcemanager/sql/armsql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client.go b/sdk/resourcemanager/sql/armsql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client.go index bc44b2cc56c8..dc60b2586294 100644 --- a/sdk/resourcemanager/sql/armsql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -62,7 +61,8 @@ func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCl if err != nil { return nil, err } - return runtime.NewPoller[ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -73,18 +73,20 @@ func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCl // // Generated from API version 2020-11-01-preview func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string, policyName ManagedShortTermRetentionPolicyName, parameters ManagedBackupShortTermRetentionPolicy, options *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, restorableDroppedDatabaseID, policyName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -118,7 +120,10 @@ func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCl reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Get - Gets a dropped database's short term retention policy. @@ -132,18 +137,21 @@ func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCl // - options - ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetOptions contains the optional parameters // for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.Get method. func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string, policyName ManagedShortTermRetentionPolicyName, options *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetOptions) (ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, restorableDroppedDatabaseID, policyName, options) if err != nil { return ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -282,7 +290,8 @@ func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCl if err != nil { return nil, err } - return runtime.NewPoller[ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -293,18 +302,20 @@ func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCl // // Generated from API version 2020-11-01-preview func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) update(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string, policyName ManagedShortTermRetentionPolicyName, parameters ManagedBackupShortTermRetentionPolicy, options *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, managedInstanceName, restorableDroppedDatabaseID, policyName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -338,5 +349,8 @@ func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCl reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client_example_test.go index 2b13e8a8ea3a..da6733439262 100644 --- a/sdk/resourcemanager/sql/armsql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetManagedShortTermRetentionPolicyRestorableDropped.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -46,7 +46,7 @@ func ExampleManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClie // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateManagedShortTermRetentionPolicyRestorableDropped.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -82,7 +82,7 @@ func ExampleManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClie // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetListManagedShortTermRetentionPolicyRestorableDropped.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/managedserverdnsaliases_client.go b/sdk/resourcemanager/sql/armsql/managedserverdnsaliases_client.go new file mode 100644 index 000000000000..43ee1b32ce83 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/managedserverdnsaliases_client.go @@ -0,0 +1,405 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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 { + internal *arm.Client + subscriptionID string +} + +// 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) { + cl, err := arm.NewClient(moduleName+".ManagedServerDNSAliasesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ManagedServerDNSAliasesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + 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 + } + poller, err := runtime.NewPoller[ManagedServerDNSAliasesClientAcquireResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ManagedServerDNSAliasesClientAcquireResponse](options.ResumeToken, client.internal.Pipeline(), 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) { + var err error + req, err := client.acquireCreateRequest(ctx, resourceGroupName, managedInstanceName, dnsAliasName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, 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.internal.Endpoint(), 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"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// 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 + } + poller, err := runtime.NewPoller[ManagedServerDNSAliasesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ManagedServerDNSAliasesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), 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) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, dnsAliasName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, 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.internal.Endpoint(), 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"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// 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 + } + poller, err := runtime.NewPoller[ManagedServerDNSAliasesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ManagedServerDNSAliasesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), 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) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, dnsAliasName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, 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.internal.Endpoint(), 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) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, dnsAliasName, options) + if err != nil { + return ManagedServerDNSAliasesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagedServerDNSAliasesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedServerDNSAliasesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// 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.internal.Endpoint(), 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. +// +// 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.NewListByManagedInstancePager +// 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.internal.Pipeline().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.internal.Endpoint(), 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/managedserverdnsaliases_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedserverdnsaliases_client_example_test.go new file mode 100644 index 000000000000..cb76a76fa36c --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/managedserverdnsaliases_client_example_test.go @@ -0,0 +1,181 @@ +//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_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/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ManagedServerDnsAliasList.json +func ExampleManagedServerDNSAliasesClient_NewListByManagedInstancePager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewManagedServerDNSAliasesClient().NewListByManagedInstancePager("Default", "dns-mi", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ManagedServerDNSAliasListResult = armsql.ManagedServerDNSAliasListResult{ + // Value: []*armsql.ManagedServerDNSAlias{ + // { + // Name: to.Ptr("dns-alias-mi"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/dnsAliases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/dns-mi/dnsAliases/dns-alias-mi"), + // Properties: &armsql.ManagedServerDNSAliasProperties{ + // AzureDNSRecord: to.Ptr("dns-alias-mi.abcd1234.database.windows.net"), + // PublicAzureDNSRecord: to.Ptr("dns-alias-mi.public.abcd1234.database.windows.net"), + // }, + // }, + // { + // Name: to.Ptr("dns-alias-mi-2"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/dnsAliases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/dns-mi/dnsAliases/dns-alias-mi-2"), + // Properties: &armsql.ManagedServerDNSAliasProperties{ + // AzureDNSRecord: to.Ptr("dns-alias-mi-2.abcd1234.database.windows.net"), + // PublicAzureDNSRecord: to.Ptr("dns-alias-mi-2.public.abcd1234.database.windows.net"), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ManagedServerDnsAliasGet.json +func ExampleManagedServerDNSAliasesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewManagedServerDNSAliasesClient().Get(ctx, "Default", "dns-mi", "dns-alias-mi", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedServerDNSAlias = armsql.ManagedServerDNSAlias{ + // Name: to.Ptr("dns-alias-mi"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/dnsAliases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/dns-mi/dnsAliases/dns-alias-mi"), + // Properties: &armsql.ManagedServerDNSAliasProperties{ + // AzureDNSRecord: to.Ptr("dns-alias-mi.abcd1234.database.windows.net"), + // PublicAzureDNSRecord: to.Ptr("dns-alias-mi.public.abcd1234.database.windows.net"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ManagedServerDnsAliasCreateOrUpdate.json +func ExampleManagedServerDNSAliasesClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedServerDNSAliasesClient().BeginCreateOrUpdate(ctx, "Default", "dns-mi", "dns-alias-mi", armsql.ManagedServerDNSAliasCreation{}, 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedServerDNSAlias = armsql.ManagedServerDNSAlias{ + // Name: to.Ptr("dns-alias-mi"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/dnsAliases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/dns-mi/dnsAliases/dns-alias-mi"), + // Properties: &armsql.ManagedServerDNSAliasProperties{ + // AzureDNSRecord: to.Ptr("dns-alias-mi.abcd1234.database.windows.net"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ManagedServerDnsAliasDelete.json +func ExampleManagedServerDNSAliasesClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedServerDNSAliasesClient().BeginDelete(ctx, "Default", "dns-mi", "dns-alias-mi", 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/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ManagedServerDnsAliasAcquire.json +func ExampleManagedServerDNSAliasesClient_BeginAcquire() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedServerDNSAliasesClient().BeginAcquire(ctx, "Default", "new-mi", "dns-alias-mi", armsql.ManagedServerDNSAliasAcquisition{ + OldManagedServerDNSAliasResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/old-mi/dnsAliases/alias1"), + }, 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedServerDNSAlias = armsql.ManagedServerDNSAlias{ + // Name: to.Ptr("alias1"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/dnsAliases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/new-mi/dnsAliases/alias1"), + // Properties: &armsql.ManagedServerDNSAliasProperties{ + // AzureDNSRecord: to.Ptr("alias1.abcd1234.database.windows.net"), + // }, + // } +} diff --git a/sdk/resourcemanager/sql/armsql/managedserversecurityalertpolicies_client.go b/sdk/resourcemanager/sql/armsql/managedserversecurityalertpolicies_client.go index c987cf04638a..b3cc8f504848 100644 --- a/sdk/resourcemanager/sql/armsql/managedserversecurityalertpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/managedserversecurityalertpolicies_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -61,7 +60,8 @@ func (client *ManagedServerSecurityAlertPoliciesClient) BeginCreateOrUpdate(ctx if err != nil { return nil, err } - return runtime.NewPoller[ManagedServerSecurityAlertPoliciesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagedServerSecurityAlertPoliciesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagedServerSecurityAlertPoliciesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *ManagedServerSecurityAlertPoliciesClient) BeginCreateOrUpdate(ctx // // Generated from API version 2020-11-01-preview func (client *ManagedServerSecurityAlertPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, securityAlertPolicyName SecurityAlertPolicyName, parameters ManagedServerSecurityAlertPolicy, options *ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, securityAlertPolicyName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -113,7 +115,10 @@ func (client *ManagedServerSecurityAlertPoliciesClient) createOrUpdateCreateRequ reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Get - Get a managed server's threat detection policy. @@ -127,18 +132,21 @@ func (client *ManagedServerSecurityAlertPoliciesClient) createOrUpdateCreateRequ // - options - ManagedServerSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ManagedServerSecurityAlertPoliciesClient.Get // method. func (client *ManagedServerSecurityAlertPoliciesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, securityAlertPolicyName SecurityAlertPolicyName, options *ManagedServerSecurityAlertPoliciesClientGetOptions) (ManagedServerSecurityAlertPoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, securityAlertPolicyName, options) if err != nil { return ManagedServerSecurityAlertPoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagedServerSecurityAlertPoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedServerSecurityAlertPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedServerSecurityAlertPoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/managedserversecurityalertpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedserversecurityalertpolicies_client_example_test.go index b1cbc12a9553..3bb44791842c 100644 --- a/sdk/resourcemanager/sql/armsql/managedserversecurityalertpolicies_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/managedserversecurityalertpolicies_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -63,7 +63,7 @@ func ExampleManagedServerSecurityAlertPoliciesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertCreateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertCreateMax.json func ExampleManagedServerSecurityAlertPoliciesClient_BeginCreateOrUpdate_updateAManagedServersThreatDetectionPolicyWithAllParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -125,7 +125,7 @@ func ExampleManagedServerSecurityAlertPoliciesClient_BeginCreateOrUpdate_updateA // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertCreateMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertCreateMin.json func ExampleManagedServerSecurityAlertPoliciesClient_BeginCreateOrUpdate_updateAManagedServersThreatDetectionPolicyWithMinimalParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -177,7 +177,7 @@ func ExampleManagedServerSecurityAlertPoliciesClient_BeginCreateOrUpdate_updateA // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertListByInstance.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/models.go b/sdk/resourcemanager/sql/armsql/models.go index 0cea9bf0525f..e099d3db4604 100644 --- a/sdk/resourcemanager/sql/armsql/models.go +++ b/sdk/resourcemanager/sql/armsql/models.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -14,534 +13,484 @@ import "time" // AdministratorListResult - A list of active directory administrators. type AdministratorListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ServerAzureADAdministrator `json:"value,omitempty" azure:"ro"` + Value []*ServerAzureADAdministrator } // AdministratorProperties - Properties of a active directory administrator. type AdministratorProperties struct { // REQUIRED; Type of the sever administrator. - AdministratorType *AdministratorType `json:"administratorType,omitempty"` + AdministratorType *AdministratorType // REQUIRED; Login name of the server administrator. - Login *string `json:"login,omitempty"` + Login *string // REQUIRED; SID (object ID) of the server administrator. - Sid *string `json:"sid,omitempty"` + Sid *string // Tenant ID of the administrator. - TenantID *string `json:"tenantId,omitempty"` + TenantID *string // READ-ONLY; Azure Active Directory only Authentication enabled. - AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty" azure:"ro"` + AzureADOnlyAuthentication *bool } // AdvancedThreatProtectionProperties - Properties of an Advanced Threat Protection state. type AdvancedThreatProtectionProperties struct { // REQUIRED; Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled or a state has not been // applied yet on the specific database or server. - State *AdvancedThreatProtectionState `json:"state,omitempty"` + State *AdvancedThreatProtectionState // READ-ONLY; Specifies the UTC creation time of the policy. - CreationTime *time.Time `json:"creationTime,omitempty" azure:"ro"` + CreationTime *time.Time } // Advisor - Database, Server or Elastic Pool Advisor. type Advisor struct { // Resource properties. - Properties *AdvisorProperties `json:"properties,omitempty"` + Properties *AdvisorProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource kind. - Kind *string `json:"kind,omitempty" azure:"ro"` + Kind *string // READ-ONLY; Resource location. - Location *string `json:"location,omitempty" azure:"ro"` + Location *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // AdvisorProperties - Properties for a Database, Server or Elastic Pool Advisor. type AdvisorProperties struct { // REQUIRED; Gets the auto-execute status (whether to let the system execute the recommendations) of this advisor. Possible // values are 'Enabled' and 'Disabled' - AutoExecuteStatus *AutoExecuteStatus `json:"autoExecuteStatus,omitempty"` + AutoExecuteStatus *AutoExecuteStatus // READ-ONLY; Gets the status of availability of this advisor to customers. Possible values are 'GA', 'PublicPreview', 'LimitedPublicPreview' // and 'PrivatePreview'. - AdvisorStatus *AdvisorStatus `json:"advisorStatus,omitempty" azure:"ro"` + AdvisorStatus *AdvisorStatus // READ-ONLY; Gets the resource from which current value of auto-execute status is inherited. Auto-execute status can be set // on (and inherited from) different levels in the resource hierarchy. Possible values are // 'Subscription', 'Server', 'ElasticPool', 'Database' and 'Default' (when status is not explicitly set on any level). - AutoExecuteStatusInheritedFrom *AutoExecuteStatusInheritedFrom `json:"autoExecuteStatusInheritedFrom,omitempty" azure:"ro"` + AutoExecuteStatusInheritedFrom *AutoExecuteStatusInheritedFrom // READ-ONLY; Gets the time when the current resource was analyzed for recommendations by this advisor. - LastChecked *time.Time `json:"lastChecked,omitempty" azure:"ro"` + LastChecked *time.Time // READ-ONLY; Gets that status of recommendations for this advisor and reason for not having any recommendations. Possible // values include, but are not limited to, 'Ok' (Recommendations available),LowActivity (not // enough workload to analyze), 'DbSeemsTuned' (Database is doing well), etc. - RecommendationsStatus *string `json:"recommendationsStatus,omitempty" azure:"ro"` + RecommendationsStatus *string // READ-ONLY; Gets the recommended actions for this advisor. - RecommendedActions []*RecommendedAction `json:"recommendedActions,omitempty" azure:"ro"` -} - -// AgentClientCreateOrUpdateOptions contains the optional parameters for the AgentClient.CreateOrUpdate method. -type AgentClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// AgentClientGetOptions contains the optional parameters for the AgentClient.Get method. -type AgentClientGetOptions struct { - // placeholder for future optional parameters + RecommendedActions []*RecommendedAction } // AgentConfiguration - A recoverable managed database resource. type AgentConfiguration struct { // Resource properties. - Properties *AgentConfigurationProperties `json:"properties,omitempty"` + Properties *AgentConfigurationProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // AgentConfigurationProperties - Sql agent configuration properties. type AgentConfigurationProperties struct { // The state of Sql Agent. - State *SQLAgentConfigurationPropertiesState `json:"state,omitempty"` + State *SQLAgentConfigurationPropertiesState } // AutoPauseDelayTimeRange - Supported auto pause delay time range type AutoPauseDelayTimeRange struct { // READ-ONLY; Default value is no value is provided - Default *int32 `json:"default,omitempty" azure:"ro"` + Default *int32 // READ-ONLY; Value that is used to not pause (infinite delay before pause) - DoNotPauseValue *int32 `json:"doNotPauseValue,omitempty" azure:"ro"` + DoNotPauseValue *int32 // READ-ONLY; Maximum value - MaxValue *int32 `json:"maxValue,omitempty" azure:"ro"` + MaxValue *int32 // READ-ONLY; Minimum value - MinValue *int32 `json:"minValue,omitempty" azure:"ro"` + MinValue *int32 // READ-ONLY; Step value for discrete values between the minimum value and the maximum value. - StepSize *int32 `json:"stepSize,omitempty" azure:"ro"` + StepSize *int32 // READ-ONLY; Unit of time that delay is expressed in - Unit *PauseDelayTimeUnit `json:"unit,omitempty" azure:"ro"` + Unit *PauseDelayTimeUnit } // AutomaticTuningOptions - Automatic tuning properties for individual advisors. type AutomaticTuningOptions struct { // Automatic tuning option desired state. - DesiredState *AutomaticTuningOptionModeDesired `json:"desiredState,omitempty"` + DesiredState *AutomaticTuningOptionModeDesired // READ-ONLY; Automatic tuning option actual state. - ActualState *AutomaticTuningOptionModeActual `json:"actualState,omitempty" azure:"ro"` + ActualState *AutomaticTuningOptionModeActual // READ-ONLY; Reason code if desired and actual state are different. - ReasonCode *int32 `json:"reasonCode,omitempty" azure:"ro"` + ReasonCode *int32 // READ-ONLY; Reason description if desired and actual state are different. - ReasonDesc *AutomaticTuningDisabledReason `json:"reasonDesc,omitempty" azure:"ro"` + ReasonDesc *AutomaticTuningDisabledReason } // AutomaticTuningServerOptions - Automatic tuning properties for individual advisors. type AutomaticTuningServerOptions struct { // Automatic tuning option desired state. - DesiredState *AutomaticTuningOptionModeDesired `json:"desiredState,omitempty"` + DesiredState *AutomaticTuningOptionModeDesired // READ-ONLY; Automatic tuning option actual state. - ActualState *AutomaticTuningOptionModeActual `json:"actualState,omitempty" azure:"ro"` + ActualState *AutomaticTuningOptionModeActual // READ-ONLY; Reason code if desired and actual state are different. - ReasonCode *int32 `json:"reasonCode,omitempty" azure:"ro"` + ReasonCode *int32 // READ-ONLY; Reason description if desired and actual state are different. - ReasonDesc *AutomaticTuningServerReason `json:"reasonDesc,omitempty" azure:"ro"` + ReasonDesc *AutomaticTuningServerReason } // AutomaticTuningServerProperties - Server-level Automatic Tuning properties. type AutomaticTuningServerProperties struct { // Automatic tuning desired state. - DesiredState *AutomaticTuningServerMode `json:"desiredState,omitempty"` + DesiredState *AutomaticTuningServerMode // Automatic tuning options definition. - Options map[string]*AutomaticTuningServerOptions `json:"options,omitempty"` + Options map[string]*AutomaticTuningServerOptions // READ-ONLY; Automatic tuning actual state. - ActualState *AutomaticTuningServerMode `json:"actualState,omitempty" azure:"ro"` + ActualState *AutomaticTuningServerMode } // AzureADOnlyAuthListResult - A list of active directory only authentications. type AzureADOnlyAuthListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ServerAzureADOnlyAuthentication `json:"value,omitempty" azure:"ro"` + Value []*ServerAzureADOnlyAuthentication } // AzureADOnlyAuthProperties - Properties of a active directory only authentication. type AzureADOnlyAuthProperties struct { // REQUIRED; Azure Active Directory only Authentication enabled. - AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty"` -} - -// BackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate -// method. -type BackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BackupShortTermRetentionPoliciesClientBeginUpdateOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.BeginUpdate -// method. -type BackupShortTermRetentionPoliciesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BackupShortTermRetentionPoliciesClientGetOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.Get -// method. -type BackupShortTermRetentionPoliciesClientGetOptions struct { - // placeholder for future optional parameters -} - -// BackupShortTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.NewListByDatabasePager -// method. -type BackupShortTermRetentionPoliciesClientListByDatabaseOptions struct { - // placeholder for future optional parameters + AzureADOnlyAuthentication *bool } // BackupShortTermRetentionPolicy - A short term retention policy. type BackupShortTermRetentionPolicy struct { // Resource properties. - Properties *BackupShortTermRetentionPolicyProperties `json:"properties,omitempty"` + Properties *BackupShortTermRetentionPolicyProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // BackupShortTermRetentionPolicyListResult - A list of short term retention policies. type BackupShortTermRetentionPolicyListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*BackupShortTermRetentionPolicy `json:"value,omitempty" azure:"ro"` + Value []*BackupShortTermRetentionPolicy } // BackupShortTermRetentionPolicyProperties - Properties of a short term retention policy type BackupShortTermRetentionPolicyProperties struct { // The differential backup interval in hours. This is how many interval hours between each differential backup will be supported. // This is only applicable to live databases but not dropped databases. - DiffBackupIntervalInHours *DiffBackupIntervalInHours `json:"diffBackupIntervalInHours,omitempty"` + DiffBackupIntervalInHours *DiffBackupIntervalInHours // The backup retention period in days. This is how many days Point-in-Time Restore will be supported. - RetentionDays *int32 `json:"retentionDays,omitempty"` + RetentionDays *int32 } // BaseLongTermRetentionPolicyProperties - Properties of a long term retention policy type BaseLongTermRetentionPolicyProperties struct { // The monthly retention policy for an LTR backup in an ISO 8601 format. - MonthlyRetention *string `json:"monthlyRetention,omitempty"` + MonthlyRetention *string // The week of year to take the yearly backup in an ISO 8601 format. - WeekOfYear *int32 `json:"weekOfYear,omitempty"` + WeekOfYear *int32 // The weekly retention policy for an LTR backup in an ISO 8601 format. - WeeklyRetention *string `json:"weeklyRetention,omitempty"` + WeeklyRetention *string // The yearly retention policy for an LTR backup in an ISO 8601 format. - YearlyRetention *string `json:"yearlyRetention,omitempty"` + YearlyRetention *string +} + +// Baseline - SQL Vulnerability Assessment baseline Details +type Baseline struct { + // READ-ONLY; SQL Vulnerability Assessment baseline expected results + ExpectedResults [][]*string + + // READ-ONLY; SQL Vulnerability Assessment baseline update time (UTC) + UpdatedTime *time.Time +} + +// BaselineAdjustedResult - SQL Vulnerability Assessment baseline adjusted results +type BaselineAdjustedResult struct { + // READ-ONLY; SQL Vulnerability Assessment baseline details + Baseline *Baseline + + // READ-ONLY; SQL Vulnerability Assessment results that are not in baseline + ResultsNotInBaseline [][]*string + + // READ-ONLY; SQL Vulnerability Assessment results that are in baseline. + ResultsOnlyInBaseline [][]*string + + // READ-ONLY; SQL Vulnerability Assessment baseline status + Status *RuleStatus } -// CapabilitiesClientListByLocationOptions contains the optional parameters for the CapabilitiesClient.ListByLocation method. -type CapabilitiesClientListByLocationOptions struct { - // If specified, restricts the response to only include the selected item. - Include *CapabilityGroup +// BenchmarkReference - SQL Vulnerability Assessment benchmark reference +type BenchmarkReference struct { + // READ-ONLY; SQL Vulnerability Assessment benchmark name + Benchmark *string + + // READ-ONLY; SQL Vulnerability Assessment benchmark reference. + Reference *string } // CheckNameAvailabilityRequest - A request to check whether the specified name for a resource is available. type CheckNameAvailabilityRequest struct { // REQUIRED - Name *string `json:"name,omitempty"` + Name *string // CONSTANT; Field has constant value "Microsoft.Sql/servers", any specified value is ignored. - Type *string `json:"type,omitempty"` + Type *string } // CheckNameAvailabilityResponse - The result of a name availability check. type CheckNameAvailabilityResponse struct { // READ-ONLY; True if the name is available, otherwise false. - Available *bool `json:"available,omitempty" azure:"ro"` + Available *bool // READ-ONLY; A message explaining why the name is unavailable. Will be undefined if the name is available. - Message *string `json:"message,omitempty" azure:"ro"` + Message *string // READ-ONLY; The name whose availability was checked. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The reason code explaining why the name is unavailable. Will be undefined if the name is available. - Reason *CheckNameAvailabilityReason `json:"reason,omitempty" azure:"ro"` + Reason *CheckNameAvailabilityReason } // CompleteDatabaseRestoreDefinition - Contains the information necessary to perform a complete database restore operation. type CompleteDatabaseRestoreDefinition struct { // REQUIRED; The last backup name to apply - LastBackupName *string `json:"lastBackupName,omitempty"` + LastBackupName *string } // CopyLongTermRetentionBackupParameters - Contains the information necessary to perform long term retention backup copy operation. type CopyLongTermRetentionBackupParameters struct { // Resource properties. - Properties *CopyLongTermRetentionBackupParametersProperties `json:"properties,omitempty"` + Properties *CopyLongTermRetentionBackupParametersProperties } // CopyLongTermRetentionBackupParametersProperties - Contains the properties to perform long term retention backup copy operation. type CopyLongTermRetentionBackupParametersProperties struct { // The storage redundancy type of the copied backup - TargetBackupStorageRedundancy *BackupStorageRedundancy `json:"targetBackupStorageRedundancy,omitempty"` + TargetBackupStorageRedundancy *BackupStorageRedundancy // The name of the database owns the copied backup. - TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetDatabaseName *string // The resource group that owns the target server - TargetResourceGroup *string `json:"targetResourceGroup,omitempty"` + TargetResourceGroup *string // The fully qualified domain name of the target server - TargetServerFullyQualifiedDomainName *string `json:"targetServerFullyQualifiedDomainName,omitempty"` + TargetServerFullyQualifiedDomainName *string // The resource Id of the target server that owns the database - TargetServerResourceID *string `json:"targetServerResourceId,omitempty"` + TargetServerResourceID *string // The subscription that owns the target server - TargetSubscriptionID *string `json:"targetSubscriptionId,omitempty"` + TargetSubscriptionID *string } // CreateDatabaseRestorePointDefinition - Contains the information necessary to perform a create database restore point operation. type CreateDatabaseRestorePointDefinition struct { // REQUIRED; The restore point label to apply - RestorePointLabel *string `json:"restorePointLabel,omitempty"` -} - -// DNSRefreshConfigurationProperties - DNS refresh configuration properties. -type DNSRefreshConfigurationProperties struct { - // READ-ONLY; The status of the DNS refresh operation. - Status *DNSRefreshConfigurationPropertiesStatus `json:"status,omitempty" azure:"ro"` -} - -// DataMaskingPoliciesClientCreateOrUpdateOptions contains the optional parameters for the DataMaskingPoliciesClient.CreateOrUpdate -// method. -type DataMaskingPoliciesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// DataMaskingPoliciesClientGetOptions contains the optional parameters for the DataMaskingPoliciesClient.Get method. -type DataMaskingPoliciesClientGetOptions struct { - // placeholder for future optional parameters + RestorePointLabel *string } // DataMaskingPolicy - Represents a database data masking policy. type DataMaskingPolicy struct { // The properties of the data masking policy. - Properties *DataMaskingPolicyProperties `json:"properties,omitempty"` + Properties *DataMaskingPolicyProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The kind of data masking policy. Metadata, used for Azure portal. - Kind *string `json:"kind,omitempty" azure:"ro"` + Kind *string // READ-ONLY; The location of the data masking policy. - Location *string `json:"location,omitempty" azure:"ro"` + Location *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // DataMaskingPolicyProperties - The properties of a database data masking policy. type DataMaskingPolicyProperties struct { // REQUIRED; The state of the data masking policy. - DataMaskingState *DataMaskingState `json:"dataMaskingState,omitempty"` + DataMaskingState *DataMaskingState // The list of the exempt principals. Specifies the semicolon-separated list of database users for which the data masking // policy does not apply. The specified users receive data results without masking // for all of the database queries. - ExemptPrincipals *string `json:"exemptPrincipals,omitempty"` + ExemptPrincipals *string // READ-ONLY; The list of the application principals. This is a legacy parameter and is no longer used. - ApplicationPrincipals *string `json:"applicationPrincipals,omitempty" azure:"ro"` + ApplicationPrincipals *string // READ-ONLY; The masking level. This is a legacy parameter and is no longer used. - MaskingLevel *string `json:"maskingLevel,omitempty" azure:"ro"` + MaskingLevel *string } // DataMaskingRule - Represents a database data masking rule. type DataMaskingRule struct { // The properties of the resource. - Properties *DataMaskingRuleProperties `json:"properties,omitempty"` + Properties *DataMaskingRuleProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The kind of Data Masking Rule. Metadata, used for Azure portal. - Kind *string `json:"kind,omitempty" azure:"ro"` + Kind *string // READ-ONLY; The location of the data masking rule. - Location *string `json:"location,omitempty" azure:"ro"` + Location *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // DataMaskingRuleListResult - The response to a list data masking rules request. type DataMaskingRuleListResult struct { // The list of database data masking rules. - Value []*DataMaskingRule `json:"value,omitempty"` + Value []*DataMaskingRule } // DataMaskingRuleProperties - The properties of a database data masking rule. type DataMaskingRuleProperties struct { // REQUIRED; The column name on which the data masking rule is applied. - ColumnName *string `json:"columnName,omitempty"` + ColumnName *string // REQUIRED; The masking function that is used for the data masking rule. - MaskingFunction *DataMaskingFunction `json:"maskingFunction,omitempty"` + MaskingFunction *DataMaskingFunction // REQUIRED; The schema name on which the data masking rule is applied. - SchemaName *string `json:"schemaName,omitempty"` + SchemaName *string // REQUIRED; The table name on which the data masking rule is applied. - TableName *string `json:"tableName,omitempty"` + TableName *string // The alias name. This is a legacy parameter and is no longer used. - AliasName *string `json:"aliasName,omitempty"` + AliasName *string // The numberFrom property of the masking rule. Required if maskingFunction is set to Number, otherwise this parameter will // be ignored. - NumberFrom *string `json:"numberFrom,omitempty"` + NumberFrom *string // The numberTo property of the data masking rule. Required if maskingFunction is set to Number, otherwise this parameter // will be ignored. - NumberTo *string `json:"numberTo,omitempty"` + NumberTo *string // If maskingFunction is set to Text, the number of characters to show unmasked in the beginning of the string. Otherwise, // this parameter will be ignored. - PrefixSize *string `json:"prefixSize,omitempty"` + PrefixSize *string // If maskingFunction is set to Text, the character to use for masking the unexposed part of the string. Otherwise, this parameter // will be ignored. - ReplacementString *string `json:"replacementString,omitempty"` + ReplacementString *string // The rule state. Used to delete a rule. To delete an existing rule, specify the schemaName, tableName, columnName, maskingFunction, // and specify ruleState as disabled. However, if the rule doesn't // already exist, the rule will be created with ruleState set to enabled, regardless of the provided value of ruleState. - RuleState *DataMaskingRuleState `json:"ruleState,omitempty"` + RuleState *DataMaskingRuleState // If maskingFunction is set to Text, the number of characters to show unmasked at the end of the string. Otherwise, this // parameter will be ignored. - SuffixSize *string `json:"suffixSize,omitempty"` + SuffixSize *string // READ-ONLY; The rule Id. - ID *string `json:"id,omitempty" azure:"ro"` -} - -// DataMaskingRulesClientCreateOrUpdateOptions contains the optional parameters for the DataMaskingRulesClient.CreateOrUpdate -// method. -type DataMaskingRulesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// DataMaskingRulesClientListByDatabaseOptions contains the optional parameters for the DataMaskingRulesClient.NewListByDatabasePager -// method. -type DataMaskingRulesClientListByDatabaseOptions struct { - // placeholder for future optional parameters + ID *string } // DataWarehouseUserActivities - User activities of a data warehouse type DataWarehouseUserActivities struct { // Resource properties. - Properties *DataWarehouseUserActivitiesProperties `json:"properties,omitempty"` + Properties *DataWarehouseUserActivitiesProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// DataWarehouseUserActivitiesClientGetOptions contains the optional parameters for the DataWarehouseUserActivitiesClient.Get -// method. -type DataWarehouseUserActivitiesClientGetOptions struct { - // placeholder for future optional parameters -} - -// DataWarehouseUserActivitiesClientListByDatabaseOptions contains the optional parameters for the DataWarehouseUserActivitiesClient.NewListByDatabasePager -// method. -type DataWarehouseUserActivitiesClientListByDatabaseOptions struct { - // placeholder for future optional parameters + Type *string } // DataWarehouseUserActivitiesListResult - User activities of a data warehouse type DataWarehouseUserActivitiesListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*DataWarehouseUserActivities `json:"value,omitempty" azure:"ro"` + Value []*DataWarehouseUserActivities } // DataWarehouseUserActivitiesProperties - User activities of a data warehouse. This currently includes the count of running // or suspended queries. For more information, please view the sys.dmpdwexec_requests dynamic management view (DMV). type DataWarehouseUserActivitiesProperties struct { // READ-ONLY; Count of running and suspended queries. - ActiveQueriesCount *int32 `json:"activeQueriesCount,omitempty" azure:"ro"` + ActiveQueriesCount *int32 } // Database - A database resource. type Database struct { // REQUIRED; Resource location. - Location *string `json:"location,omitempty"` + Location *string // The Azure Active Directory identity of the database. - Identity *DatabaseIdentity `json:"identity,omitempty"` + Identity *DatabaseIdentity // Resource properties. - Properties *DatabaseProperties `json:"properties,omitempty"` + Properties *DatabaseProperties // The database SKU. // The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, @@ -551,176 +500,112 @@ type Database struct { // ` // Get-AzSqlServerServiceObjective -Location // ` - SKU *SKU `json:"sku,omitempty"` + SKU *SKU // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Kind of database. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty" azure:"ro"` + Kind *string // READ-ONLY; Resource that manages the database. - ManagedBy *string `json:"managedBy,omitempty" azure:"ro"` + ManagedBy *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // DatabaseAdvancedThreatProtection - A database Advanced Threat Protection. type DatabaseAdvancedThreatProtection struct { // Resource properties. - Properties *AdvancedThreatProtectionProperties `json:"properties,omitempty"` + Properties *AdvancedThreatProtectionProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; SystemData of AdvancedThreatProtectionResource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // DatabaseAdvancedThreatProtectionListResult - A list of the database's Advanced Threat Protection configurations. type DatabaseAdvancedThreatProtectionListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*DatabaseAdvancedThreatProtection `json:"value,omitempty" azure:"ro"` -} - -// DatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateOptions contains the optional parameters for the DatabaseAdvancedThreatProtectionSettingsClient.CreateOrUpdate -// method. -type DatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// DatabaseAdvancedThreatProtectionSettingsClientGetOptions contains the optional parameters for the DatabaseAdvancedThreatProtectionSettingsClient.Get -// method. -type DatabaseAdvancedThreatProtectionSettingsClientGetOptions struct { - // placeholder for future optional parameters -} - -// DatabaseAdvancedThreatProtectionSettingsClientListByDatabaseOptions contains the optional parameters for the DatabaseAdvancedThreatProtectionSettingsClient.NewListByDatabasePager -// method. -type DatabaseAdvancedThreatProtectionSettingsClientListByDatabaseOptions struct { - // placeholder for future optional parameters -} - -// DatabaseAdvisorsClientGetOptions contains the optional parameters for the DatabaseAdvisorsClient.Get method. -type DatabaseAdvisorsClientGetOptions struct { - // placeholder for future optional parameters -} - -// DatabaseAdvisorsClientListByDatabaseOptions contains the optional parameters for the DatabaseAdvisorsClient.ListByDatabase -// method. -type DatabaseAdvisorsClientListByDatabaseOptions struct { - // The child resources to include in the response. - Expand *string -} - -// DatabaseAdvisorsClientUpdateOptions contains the optional parameters for the DatabaseAdvisorsClient.Update method. -type DatabaseAdvisorsClientUpdateOptions struct { - // placeholder for future optional parameters + Value []*DatabaseAdvancedThreatProtection } // DatabaseAutomaticTuning - Database-level Automatic Tuning. type DatabaseAutomaticTuning struct { // Resource properties. - Properties *DatabaseAutomaticTuningProperties `json:"properties,omitempty"` + Properties *DatabaseAutomaticTuningProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// DatabaseAutomaticTuningClientGetOptions contains the optional parameters for the DatabaseAutomaticTuningClient.Get method. -type DatabaseAutomaticTuningClientGetOptions struct { - // placeholder for future optional parameters -} - -// DatabaseAutomaticTuningClientUpdateOptions contains the optional parameters for the DatabaseAutomaticTuningClient.Update -// method. -type DatabaseAutomaticTuningClientUpdateOptions struct { - // placeholder for future optional parameters + Type *string } // DatabaseAutomaticTuningProperties - Database-level Automatic Tuning properties. type DatabaseAutomaticTuningProperties struct { // Automatic tuning desired state. - DesiredState *AutomaticTuningMode `json:"desiredState,omitempty"` + DesiredState *AutomaticTuningMode // Automatic tuning options definition. - Options map[string]*AutomaticTuningOptions `json:"options,omitempty"` + Options map[string]*AutomaticTuningOptions // READ-ONLY; Automatic tuning actual state. - ActualState *AutomaticTuningMode `json:"actualState,omitempty" azure:"ro"` -} - -// DatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions contains the optional parameters for the DatabaseBlobAuditingPoliciesClient.CreateOrUpdate -// method. -type DatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// DatabaseBlobAuditingPoliciesClientGetOptions contains the optional parameters for the DatabaseBlobAuditingPoliciesClient.Get -// method. -type DatabaseBlobAuditingPoliciesClientGetOptions struct { - // placeholder for future optional parameters -} - -// DatabaseBlobAuditingPoliciesClientListByDatabaseOptions contains the optional parameters for the DatabaseBlobAuditingPoliciesClient.NewListByDatabasePager -// method. -type DatabaseBlobAuditingPoliciesClientListByDatabaseOptions struct { - // placeholder for future optional parameters + ActualState *AutomaticTuningMode } // DatabaseBlobAuditingPolicy - A database blob auditing policy. type DatabaseBlobAuditingPolicy struct { // Resource properties. - Properties *DatabaseBlobAuditingPolicyProperties `json:"properties,omitempty"` + Properties *DatabaseBlobAuditingPolicyProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource kind. - Kind *string `json:"kind,omitempty" azure:"ro"` + Kind *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // DatabaseBlobAuditingPolicyListResult - A list of database auditing settings. type DatabaseBlobAuditingPolicyListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*DatabaseBlobAuditingPolicy `json:"value,omitempty" azure:"ro"` + Value []*DatabaseBlobAuditingPolicy } // DatabaseBlobAuditingPolicyProperties - Properties of a database blob auditing policy. type DatabaseBlobAuditingPolicyProperties struct { // REQUIRED; Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. - State *BlobAuditingPolicyState `json:"state,omitempty"` + State *BlobAuditingPolicyState // Specifies the Actions-Groups and Actions to audit. // The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures @@ -750,7 +635,7 @@ type DatabaseBlobAuditingPolicyProperties struct { // For example: SELECT on dbo.myTable by public SELECT on DATABASE::myDatabase by public SELECT on SCHEMA::mySchema by public // For more information, see Database-Level Audit Actions // [https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions] - AuditActionsAndGroups []*string `json:"auditActionsAndGroups,omitempty"` + AuditActionsAndGroups []*string // Specifies whether audit events are sent to Azure Monitor. In order to send the events to Azure Monitor, specify 'State' // as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true. @@ -761,20 +646,20 @@ type DatabaseBlobAuditingPolicyProperties struct { // https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview // For more information, see Diagnostic Settings REST API [https://go.microsoft.com/fwlink/?linkid=2033207]or Diagnostic Settings // PowerShell [https://go.microsoft.com/fwlink/?linkid=2033043] - IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"` + IsAzureMonitorTargetEnabled *bool // Specifies whether Managed Identity is used to access blob storage - IsManagedIdentityInUse *bool `json:"isManagedIdentityInUse,omitempty"` + IsManagedIdentityInUse *bool // Specifies whether storageAccountAccessKey value is the storage's secondary key. - IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"` + IsStorageSecondaryKeyInUse *bool // Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed. The default // minimum value is 1000 (1 second). The maximum is 2,147,483,647. - QueueDelayMs *int32 `json:"queueDelayMs,omitempty"` + QueueDelayMs *int32 // Specifies the number of days to keep in the audit logs in the storage account. - RetentionDays *int32 `json:"retentionDays,omitempty"` + RetentionDays *int32 // Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, not // specifying the storageAccountAccessKey will use SQL server system-assigned @@ -783,237 +668,203 @@ type DatabaseBlobAuditingPolicyProperties struct { // 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server // identity. For more information, see Auditing to storage using Managed // Identity authentication [https://go.microsoft.com/fwlink/?linkid=2114355] - StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` + StorageAccountAccessKey *string // Specifies the blob storage subscription Id. - StorageAccountSubscriptionID *string `json:"storageAccountSubscriptionId,omitempty"` + StorageAccountSubscriptionID *string // Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint // or isAzureMonitorTargetEnabled is required. - StorageEndpoint *string `json:"storageEndpoint,omitempty"` + StorageEndpoint *string } // DatabaseColumn - A database column resource. type DatabaseColumn struct { // Resource properties. - Properties *DatabaseColumnProperties `json:"properties,omitempty"` + Properties *DatabaseColumnProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // DatabaseColumnListResult - A list of database columns. type DatabaseColumnListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*DatabaseColumn `json:"value,omitempty" azure:"ro"` + Value []*DatabaseColumn } // DatabaseColumnProperties - Database column properties. type DatabaseColumnProperties struct { // The column data type. - ColumnType *ColumnDataType `json:"columnType,omitempty"` + ColumnType *ColumnDataType // Whether or not the column is computed. - IsComputed *bool `json:"isComputed,omitempty"` + IsComputed *bool // Whether or not the column belongs to a memory optimized table. - MemoryOptimized *bool `json:"memoryOptimized,omitempty"` + MemoryOptimized *bool // The table temporal type. - TemporalType *TableTemporalType `json:"temporalType,omitempty"` -} - -// DatabaseColumnsClientGetOptions contains the optional parameters for the DatabaseColumnsClient.Get method. -type DatabaseColumnsClientGetOptions struct { - // placeholder for future optional parameters -} - -// DatabaseColumnsClientListByDatabaseOptions contains the optional parameters for the DatabaseColumnsClient.NewListByDatabasePager -// method. -type DatabaseColumnsClientListByDatabaseOptions struct { - Column []string - OrderBy []string - Schema []string - // An opaque token that identifies a starting point in the collection. - Skiptoken *string - Table []string -} - -// DatabaseColumnsClientListByTableOptions contains the optional parameters for the DatabaseColumnsClient.NewListByTablePager -// method. -type DatabaseColumnsClientListByTableOptions struct { - // An OData filter expression that filters elements in the collection. - Filter *string + TemporalType *TableTemporalType } // DatabaseExtensions - An export managed database operation result resource. type DatabaseExtensions struct { // Resource properties. - Properties *DatabaseExtensionsProperties `json:"properties,omitempty"` + Properties *DatabaseExtensionsProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// DatabaseExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabaseExtensionsClient.BeginCreateOrUpdate -// method. -type DatabaseExtensionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DatabaseExtensionsClientGetOptions contains the optional parameters for the DatabaseExtensionsClient.Get method. -type DatabaseExtensionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// DatabaseExtensionsClientListByDatabaseOptions contains the optional parameters for the DatabaseExtensionsClient.NewListByDatabasePager -// method. -type DatabaseExtensionsClientListByDatabaseOptions struct { - // placeholder for future optional parameters + Type *string } // DatabaseExtensionsProperties - Contains the database information after successful export. type DatabaseExtensionsProperties struct { // REQUIRED; Operation Mode. - OperationMode *OperationMode `json:"operationMode,omitempty"` + OperationMode *OperationMode // REQUIRED; Storage key. - StorageKey *string `json:"storageKey,omitempty"` + StorageKey *string // REQUIRED; Storage key type. - StorageKeyType *StorageKeyType `json:"storageKeyType,omitempty"` + StorageKeyType *StorageKeyType // REQUIRED; Storage Uri. - StorageURI *string `json:"storageUri,omitempty"` + StorageURI *string } // DatabaseIdentity - Azure Active Directory identity configuration for a resource. type DatabaseIdentity struct { // The identity type - Type *DatabaseIdentityType `json:"type,omitempty"` + Type *DatabaseIdentityType // The resource ids of the user assigned identities to use - UserAssignedIdentities map[string]*DatabaseUserIdentity `json:"userAssignedIdentities,omitempty"` + UserAssignedIdentities map[string]*DatabaseUserIdentity // READ-ONLY; The Azure Active Directory tenant id. - TenantID *string `json:"tenantId,omitempty" azure:"ro"` + TenantID *string +} + +// DatabaseKey - Database level key used for encryption at rest. +type DatabaseKey struct { + // READ-ONLY; The database key creation date. + CreationDate *time.Time + + // READ-ONLY; Subregion of the server key. + Subregion *string + + // READ-ONLY; Thumbprint of the database key. + Thumbprint *string + + // READ-ONLY; The database key type. Only supported value is 'AzureKeyVault'. + Type *DatabaseKeyType } // DatabaseListResult - A list of databases. type DatabaseListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*Database `json:"value,omitempty" azure:"ro"` + Value []*Database } // DatabaseOperation - A database operation. type DatabaseOperation struct { // Resource properties. - Properties *DatabaseOperationProperties `json:"properties,omitempty"` + Properties *DatabaseOperationProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // DatabaseOperationListResult - The response to a list database operations request type DatabaseOperationListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*DatabaseOperation `json:"value,omitempty" azure:"ro"` + Value []*DatabaseOperation } // DatabaseOperationProperties - The properties of a database operation. type DatabaseOperationProperties struct { // READ-ONLY; The name of the database the operation is being performed on. - DatabaseName *string `json:"databaseName,omitempty" azure:"ro"` + DatabaseName *string // READ-ONLY; The operation description. - Description *string `json:"description,omitempty" azure:"ro"` + Description *string // READ-ONLY; The operation error code. - ErrorCode *int32 `json:"errorCode,omitempty" azure:"ro"` + ErrorCode *int32 // READ-ONLY; The operation error description. - ErrorDescription *string `json:"errorDescription,omitempty" azure:"ro"` + ErrorDescription *string // READ-ONLY; The operation error severity. - ErrorSeverity *int32 `json:"errorSeverity,omitempty" azure:"ro"` + ErrorSeverity *int32 // READ-ONLY; The estimated completion time of the operation. - EstimatedCompletionTime *time.Time `json:"estimatedCompletionTime,omitempty" azure:"ro"` + EstimatedCompletionTime *time.Time // READ-ONLY; Whether the operation can be cancelled. - IsCancellable *bool `json:"isCancellable,omitempty" azure:"ro"` + IsCancellable *bool // READ-ONLY; Whether or not the error is a user error. - IsUserError *bool `json:"isUserError,omitempty" azure:"ro"` + IsUserError *bool // READ-ONLY; The name of operation. - Operation *string `json:"operation,omitempty" azure:"ro"` + Operation *string // READ-ONLY; The friendly name of operation. - OperationFriendlyName *string `json:"operationFriendlyName,omitempty" azure:"ro"` + OperationFriendlyName *string // READ-ONLY; The percentage of the operation completed. - PercentComplete *int32 `json:"percentComplete,omitempty" azure:"ro"` + PercentComplete *int32 // READ-ONLY; The name of the server. - ServerName *string `json:"serverName,omitempty" azure:"ro"` + ServerName *string // READ-ONLY; The operation start time. - StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` + StartTime *time.Time // READ-ONLY; The operation state. - State *ManagementOperationState `json:"state,omitempty" azure:"ro"` -} - -// DatabaseOperationsClientCancelOptions contains the optional parameters for the DatabaseOperationsClient.Cancel method. -type DatabaseOperationsClientCancelOptions struct { - // placeholder for future optional parameters -} - -// DatabaseOperationsClientListByDatabaseOptions contains the optional parameters for the DatabaseOperationsClient.NewListByDatabasePager -// method. -type DatabaseOperationsClientListByDatabaseOptions struct { - // placeholder for future optional parameters + State *ManagementOperationState } // DatabaseProperties - The database's properties. type DatabaseProperties struct { // Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled - AutoPauseDelay *int32 `json:"autoPauseDelay,omitempty"` + AutoPauseDelay *int32 + + // Specifies the availability zone the database is pinned to. + AvailabilityZone *AvailabilityZoneType // Collation of the metadata catalog. - CatalogCollation *CatalogCollationType `json:"catalogCollation,omitempty"` + CatalogCollation *CatalogCollationType // The collation of the database. - Collation *string `json:"collation,omitempty"` + Collation *string // Specifies the mode of database creation. // Default: regular database creation. @@ -1034,300 +885,386 @@ type DatabaseProperties struct { // RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId // must be specified as the recovery point resource ID. // Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - CreateMode *CreateMode `json:"createMode,omitempty"` + CreateMode *CreateMode // The resource identifier of the elastic pool containing this database. - ElasticPoolID *string `json:"elasticPoolId,omitempty"` + ElasticPoolID *string + + // The azure key vault URI of the database if it's configured with per Database Customer Managed Keys. + EncryptionProtector *string // The Client id used for cross tenant per database CMK scenario - FederatedClientID *string `json:"federatedClientId,omitempty"` + FederatedClientID *string // The number of secondary replicas associated with the database that are used to provide high availability. Not applicable // to a Hyperscale database within an elastic pool. - HighAvailabilityReplicaCount *int32 `json:"highAvailabilityReplicaCount,omitempty"` + HighAvailabilityReplicaCount *int32 // Whether or not this database is a ledger database, which means all tables in the database are ledger tables. Note: the // value of this property cannot be changed after the database has been created. - IsLedgerOn *bool `json:"isLedgerOn,omitempty"` + IsLedgerOn *bool + + // The resource ids of the user assigned identities to use + Keys map[string]*DatabaseKey // The license type to apply for this database. LicenseIncluded if you need a license, or BasePrice if you have a license // and are eligible for the Azure Hybrid Benefit. - LicenseType *DatabaseLicenseType `json:"licenseType,omitempty"` + LicenseType *DatabaseLicenseType // The resource identifier of the long term retention backup associated with create operation of this database. - LongTermRetentionBackupResourceID *string `json:"longTermRetentionBackupResourceId,omitempty"` + LongTermRetentionBackupResourceID *string // Maintenance configuration id assigned to the database. This configuration defines the period when the maintenance updates // will occur. - MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"` + MaintenanceConfigurationID *string + + // Whether or not customer controlled manual cutover needs to be done during Update Database operation to Hyperscale tier. + // This property is only applicable when scaling database from Business Critical/General Purpose/Premium/Standard tier to + // Hyperscale tier. + // When manualCutover is specified, the scaling operation will wait for user input to trigger cutover to Hyperscale database. + // To trigger cutover, please provide 'performCutover' parameter when the Scaling operation is in Waiting state. + ManualCutover *bool // The max size of the database expressed in bytes. - MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"` + MaxSizeBytes *int64 // Minimal capacity that database will always have allocated, if not paused - MinCapacity *float64 `json:"minCapacity,omitempty"` + MinCapacity *float64 + + // To trigger customer controlled manual cutover during the wait state while Scaling operation is in progress. + // This property parameter is only applicable for scaling operations that are initiated along with 'manualCutover' parameter. + // This property is only applicable when scaling database from Business Critical/General Purpose/Premium/Standard tier to + // Hyperscale tier is already in progress. + // When performCutover is specified, the scaling operation will trigger cutover and perform role-change to Hyperscale database. + PerformCutover *bool + + // Type of enclave requested on the database i.e. Default or VBS enclaves. + PreferredEnclaveType *AlwaysEncryptedEnclaveType // The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection // string may be routed to a readonly secondary replica in the same region. Not // applicable to a Hyperscale database within an elastic pool. - ReadScale *DatabaseReadScale `json:"readScale,omitempty"` + ReadScale *DatabaseReadScale // The resource identifier of the recoverable database associated with create operation of this database. - RecoverableDatabaseID *string `json:"recoverableDatabaseId,omitempty"` + RecoverableDatabaseID *string // The resource identifier of the recovery point associated with create operation of this database. - RecoveryServicesRecoveryPointID *string `json:"recoveryServicesRecoveryPointId,omitempty"` + RecoveryServicesRecoveryPointID *string // The storage account type to be used to store backups for this database. - RequestedBackupStorageRedundancy *BackupStorageRedundancy `json:"requestedBackupStorageRedundancy,omitempty"` + RequestedBackupStorageRedundancy *BackupStorageRedundancy // The resource identifier of the restorable dropped database associated with create operation of this database. - RestorableDroppedDatabaseID *string `json:"restorableDroppedDatabaseId,omitempty"` + RestorableDroppedDatabaseID *string // Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. - RestorePointInTime *time.Time `json:"restorePointInTime,omitempty"` + RestorePointInTime *time.Time // The name of the sample schema to apply when creating this database. - SampleName *SampleName `json:"sampleName,omitempty"` + SampleName *SampleName - // The secondary type of the database if it is a secondary. Valid values are Geo and Named. - SecondaryType *SecondaryType `json:"secondaryType,omitempty"` + // The secondary type of the database if it is a secondary. Valid values are Geo, Named and Standby. + SecondaryType *SecondaryType // Specifies the time that the database was deleted. - SourceDatabaseDeletionDate *time.Time `json:"sourceDatabaseDeletionDate,omitempty"` + SourceDatabaseDeletionDate *time.Time // The resource identifier of the source database associated with create operation of this database. - SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"` + SourceDatabaseID *string // 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 - SourceResourceID *string `json:"sourceResourceId,omitempty"` + SourceResourceID *string // Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple // availability zones. - ZoneRedundant *bool `json:"zoneRedundant,omitempty"` + ZoneRedundant *bool // READ-ONLY; The creation date of the database (ISO8601 format). - CreationDate *time.Time `json:"creationDate,omitempty" azure:"ro"` + CreationDate *time.Time // READ-ONLY; The storage account type used to store backups for this database. - CurrentBackupStorageRedundancy *BackupStorageRedundancy `json:"currentBackupStorageRedundancy,omitempty" azure:"ro"` + CurrentBackupStorageRedundancy *BackupStorageRedundancy // READ-ONLY; The name and tier of the SKU. - CurrentSKU *SKU `json:"currentSku,omitempty" azure:"ro"` + CurrentSKU *SKU // READ-ONLY; The current service level objective name of the database. - CurrentServiceObjectiveName *string `json:"currentServiceObjectiveName,omitempty" azure:"ro"` + CurrentServiceObjectiveName *string // READ-ONLY; The ID of the database. - DatabaseID *string `json:"databaseId,omitempty" azure:"ro"` + DatabaseID *string // READ-ONLY; The default secondary region for this database. - DefaultSecondaryLocation *string `json:"defaultSecondaryLocation,omitempty" azure:"ro"` + DefaultSecondaryLocation *string // READ-ONLY; This records the earliest start date and time that restore is available for this database (ISO8601 format). - EarliestRestoreDate *time.Time `json:"earliestRestoreDate,omitempty" azure:"ro"` + EarliestRestoreDate *time.Time // READ-ONLY; Failover Group resource identifier that this database belongs to. - FailoverGroupID *string `json:"failoverGroupId,omitempty" azure:"ro"` + FailoverGroupID *string // READ-ONLY; Infra encryption is enabled for this database. - IsInfraEncryptionEnabled *bool `json:"isInfraEncryptionEnabled,omitempty" azure:"ro"` + IsInfraEncryptionEnabled *bool // READ-ONLY; The max log size for this database. - MaxLogSizeBytes *int64 `json:"maxLogSizeBytes,omitempty" azure:"ro"` + MaxLogSizeBytes *int64 // READ-ONLY; The date when database was paused by user configuration or action(ISO8601 format). Null if the database is ready. - PausedDate *time.Time `json:"pausedDate,omitempty" azure:"ro"` + PausedDate *time.Time // READ-ONLY; The requested service level objective name of the database. - RequestedServiceObjectiveName *string `json:"requestedServiceObjectiveName,omitempty" azure:"ro"` + RequestedServiceObjectiveName *string // READ-ONLY; The date when database was resumed by user action or database login (ISO8601 format). Null if the database is // paused. - ResumedDate *time.Time `json:"resumedDate,omitempty" azure:"ro"` + ResumedDate *time.Time // READ-ONLY; The status of the database. - Status *DatabaseStatus `json:"status,omitempty" azure:"ro"` + Status *DatabaseStatus } -// DatabaseRecommendedActionsClientGetOptions contains the optional parameters for the DatabaseRecommendedActionsClient.Get -// method. -type DatabaseRecommendedActionsClientGetOptions struct { - // placeholder for future optional parameters +// DatabaseSQLVulnerabilityAssessmentBaselineSet - A database sql vulnerability assessment baseline set. +type DatabaseSQLVulnerabilityAssessmentBaselineSet struct { + // Resource properties. + Properties *DatabaseSQLVulnerabilityAssessmentBaselineSetProperties + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; SystemData of DatabaseSqlVulnerabilityAssessmentBaselineSetResource. + SystemData *SystemData + + // READ-ONLY; Resource type. + Type *string } -// DatabaseRecommendedActionsClientListByDatabaseAdvisorOptions contains the optional parameters for the DatabaseRecommendedActionsClient.ListByDatabaseAdvisor -// method. -type DatabaseRecommendedActionsClientListByDatabaseAdvisorOptions struct { - // placeholder for future optional parameters +// DatabaseSQLVulnerabilityAssessmentBaselineSetListResult - A list of SQL Vulnerability Assessments baseline set. +type DatabaseSQLVulnerabilityAssessmentBaselineSetListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string + + // READ-ONLY; Array of results. + Value []*DatabaseSQLVulnerabilityAssessmentBaselineSet } -// DatabaseRecommendedActionsClientUpdateOptions contains the optional parameters for the DatabaseRecommendedActionsClient.Update -// method. -type DatabaseRecommendedActionsClientUpdateOptions struct { - // placeholder for future optional parameters +// DatabaseSQLVulnerabilityAssessmentBaselineSetProperties - Properties of a database Sql Vulnerability Assessment baseline +// set. +type DatabaseSQLVulnerabilityAssessmentBaselineSetProperties struct { + // REQUIRED; The baseline set result + Results map[string][][]*string } -// DatabaseSchema - A database schema resource. -type DatabaseSchema struct { +// DatabaseSQLVulnerabilityAssessmentRuleBaseline - A database sql vulnerability assessment rule baseline. +type DatabaseSQLVulnerabilityAssessmentRuleBaseline struct { + // Resource properties. + Properties *DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties + // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string + + // READ-ONLY; SystemData of DatabaseSqlVulnerabilityAssessmentRuleBaselineResource. + SystemData *SystemData // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } -// DatabaseSchemaListResult - A list of database schemas. -type DatabaseSchemaListResult struct { - // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` +// DatabaseSQLVulnerabilityAssessmentRuleBaselineInput - A database sql vulnerability assessment rule baseline input. +type DatabaseSQLVulnerabilityAssessmentRuleBaselineInput struct { + // Resource properties. + Properties *DatabaseSQLVulnerabilityAssessmentRuleBaselineInputProperties - // READ-ONLY; Array of results. - Value []*DatabaseSchema `json:"value,omitempty" azure:"ro"` + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; SystemData of DatabaseSqlVulnerabilityAssessmentRuleBaselineInputResource. + SystemData *SystemData + + // READ-ONLY; Resource type. + Type *string } -// DatabaseSchemasClientGetOptions contains the optional parameters for the DatabaseSchemasClient.Get method. -type DatabaseSchemasClientGetOptions struct { - // placeholder for future optional parameters +// DatabaseSQLVulnerabilityAssessmentRuleBaselineInputProperties - Properties of a database Sql Vulnerability Assessment rule +// baseline. +type DatabaseSQLVulnerabilityAssessmentRuleBaselineInputProperties struct { + // REQUIRED; The latest scan flag + LatestScan *bool + + // REQUIRED; The rule baseline result + Results [][]*string } -// DatabaseSchemasClientListByDatabaseOptions contains the optional parameters for the DatabaseSchemasClient.NewListByDatabasePager -// method. -type DatabaseSchemasClientListByDatabaseOptions struct { - // An OData filter expression that filters elements in the collection. - Filter *string +// DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput - A database sql vulnerability assessment rule baseline list input. +type DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput struct { + // Resource properties. + Properties *DatabaseSQLVulnerabilityAssessmentRuleBaselineListInputProperties + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; SystemData of DatabaseSqlVulnerabilityAssessmentRuleBaselineListInputResource. + SystemData *SystemData + + // READ-ONLY; Resource type. + Type *string } -// DatabaseSecurityAlertListResult - A list of the database's security alert policies. -type DatabaseSecurityAlertListResult struct { +// DatabaseSQLVulnerabilityAssessmentRuleBaselineListInputProperties - Properties of a database Sql Vulnerability Assessment +// rule baseline. +type DatabaseSQLVulnerabilityAssessmentRuleBaselineListInputProperties struct { + // REQUIRED; The latest scan flag + LatestScan *bool + + // REQUIRED; The rule baseline result list + Results map[string][][]*string +} + +// DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult - A list of SQL Vulnerability Assessments rule baseline. +type DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*DatabaseSecurityAlertPolicy `json:"value,omitempty" azure:"ro"` + Value []*DatabaseSQLVulnerabilityAssessmentRuleBaseline +} + +// DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties - Properties of a database Sql Vulnerability Assessment rule baseline. +type DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties struct { + // REQUIRED; The rule baseline result + Results [][]*string } -// DatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions contains the optional parameters for the DatabaseSecurityAlertPoliciesClient.CreateOrUpdate -// method. -type DatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters +// DatabaseSchema - A database schema resource. +type DatabaseSchema struct { + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string } -// DatabaseSecurityAlertPoliciesClientGetOptions contains the optional parameters for the DatabaseSecurityAlertPoliciesClient.Get -// method. -type DatabaseSecurityAlertPoliciesClientGetOptions struct { - // placeholder for future optional parameters +// DatabaseSchemaListResult - A list of database schemas. +type DatabaseSchemaListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string + + // READ-ONLY; Array of results. + Value []*DatabaseSchema } -// DatabaseSecurityAlertPoliciesClientListByDatabaseOptions contains the optional parameters for the DatabaseSecurityAlertPoliciesClient.NewListByDatabasePager -// method. -type DatabaseSecurityAlertPoliciesClientListByDatabaseOptions struct { - // placeholder for future optional parameters +// DatabaseSecurityAlertListResult - A list of the database's security alert policies. +type DatabaseSecurityAlertListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string + + // READ-ONLY; Array of results. + Value []*DatabaseSecurityAlertPolicy } // DatabaseSecurityAlertPolicy - A database security alert policy. type DatabaseSecurityAlertPolicy struct { // Resource properties. - Properties *SecurityAlertsPolicyProperties `json:"properties,omitempty"` + Properties *SecurityAlertsPolicyProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; SystemData of SecurityAlertPolicyResource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // DatabaseTable - A database table resource. type DatabaseTable struct { // Resource properties. - Properties *DatabaseTableProperties `json:"properties,omitempty"` + Properties *DatabaseTableProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // DatabaseTableListResult - A list of database tables. type DatabaseTableListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*DatabaseTable `json:"value,omitempty" azure:"ro"` + Value []*DatabaseTable } // DatabaseTableProperties - Database table properties. type DatabaseTableProperties struct { // Whether or not the table is memory optimized. - MemoryOptimized *bool `json:"memoryOptimized,omitempty"` + MemoryOptimized *bool // The table temporal type. - TemporalType *TableTemporalType `json:"temporalType,omitempty"` -} - -// DatabaseTablesClientGetOptions contains the optional parameters for the DatabaseTablesClient.Get method. -type DatabaseTablesClientGetOptions struct { - // placeholder for future optional parameters -} - -// DatabaseTablesClientListBySchemaOptions contains the optional parameters for the DatabaseTablesClient.NewListBySchemaPager -// method. -type DatabaseTablesClientListBySchemaOptions struct { - // An OData filter expression that filters elements in the collection. - Filter *string + TemporalType *TableTemporalType } // DatabaseUpdate - A database update resource. type DatabaseUpdate struct { // Database identity - Identity *DatabaseIdentity `json:"identity,omitempty"` + Identity *DatabaseIdentity // Resource properties. - Properties *DatabaseUpdateProperties `json:"properties,omitempty"` + Properties *DatabaseUpdateProperties // The name and tier of the SKU. - SKU *SKU `json:"sku,omitempty"` + SKU *SKU // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // DatabaseUpdateProperties - A database update properties. type DatabaseUpdateProperties struct { // Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled - AutoPauseDelay *int32 `json:"autoPauseDelay,omitempty"` + AutoPauseDelay *int32 // Collation of the metadata catalog. - CatalogCollation *CatalogCollationType `json:"catalogCollation,omitempty"` + CatalogCollation *CatalogCollationType // The collation of the database. - Collation *string `json:"collation,omitempty"` + Collation *string // Specifies the mode of database creation. // Default: regular database creation. @@ -1348,610 +1285,409 @@ type DatabaseUpdateProperties struct { // RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId // must be specified as the recovery point resource ID. // Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - CreateMode *CreateMode `json:"createMode,omitempty"` + CreateMode *CreateMode // The resource identifier of the elastic pool containing this database. - ElasticPoolID *string `json:"elasticPoolId,omitempty"` + ElasticPoolID *string + + // The azure key vault URI of the database if it's configured with per Database Customer Managed Keys. + EncryptionProtector *string // The Client id used for cross tenant per database CMK scenario - FederatedClientID *string `json:"federatedClientId,omitempty"` + FederatedClientID *string // The number of secondary replicas associated with the database that are used to provide high availability. Not applicable // to a Hyperscale database within an elastic pool. - HighAvailabilityReplicaCount *int32 `json:"highAvailabilityReplicaCount,omitempty"` + HighAvailabilityReplicaCount *int32 // Whether or not this database is a ledger database, which means all tables in the database are ledger tables. Note: the // value of this property cannot be changed after the database has been created. - IsLedgerOn *bool `json:"isLedgerOn,omitempty"` + IsLedgerOn *bool + + // The resource ids of the user assigned identities to use + Keys map[string]*DatabaseKey // The license type to apply for this database. LicenseIncluded if you need a license, or BasePrice if you have a license // and are eligible for the Azure Hybrid Benefit. - LicenseType *DatabaseLicenseType `json:"licenseType,omitempty"` + LicenseType *DatabaseLicenseType // The resource identifier of the long term retention backup associated with create operation of this database. - LongTermRetentionBackupResourceID *string `json:"longTermRetentionBackupResourceId,omitempty"` + LongTermRetentionBackupResourceID *string // Maintenance configuration id assigned to the database. This configuration defines the period when the maintenance updates // will occur. - MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"` + MaintenanceConfigurationID *string + + // Whether or not customer controlled manual cutover needs to be done during Update Database operation to Hyperscale tier. + // This property is only applicable when scaling database from Business Critical/General Purpose/Premium/Standard tier to + // Hyperscale tier. + // When manualCutover is specified, the scaling operation will wait for user input to trigger cutover to Hyperscale database. + // To trigger cutover, please provide 'performCutover' parameter when the Scaling operation is in Waiting state. + ManualCutover *bool // The max size of the database expressed in bytes. - MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"` + MaxSizeBytes *int64 // Minimal capacity that database will always have allocated, if not paused - MinCapacity *float64 `json:"minCapacity,omitempty"` + MinCapacity *float64 + + // To trigger customer controlled manual cutover during the wait state while Scaling operation is in progress. + // This property parameter is only applicable for scaling operations that are initiated along with 'manualCutover' parameter. + // This property is only applicable when scaling database from Business Critical/General Purpose/Premium/Standard tier to + // Hyperscale tier is already in progress. + // When performCutover is specified, the scaling operation will trigger cutover and perform role-change to Hyperscale database. + PerformCutover *bool + + // Type of enclave requested on the database i.e. Default or VBS enclaves. + PreferredEnclaveType *AlwaysEncryptedEnclaveType // The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection // string may be routed to a readonly secondary replica in the same region. Not // applicable to a Hyperscale database within an elastic pool. - ReadScale *DatabaseReadScale `json:"readScale,omitempty"` + ReadScale *DatabaseReadScale // The resource identifier of the recoverable database associated with create operation of this database. - RecoverableDatabaseID *string `json:"recoverableDatabaseId,omitempty"` + RecoverableDatabaseID *string // The resource identifier of the recovery point associated with create operation of this database. - RecoveryServicesRecoveryPointID *string `json:"recoveryServicesRecoveryPointId,omitempty"` + RecoveryServicesRecoveryPointID *string // The storage account type to be used to store backups for this database. - RequestedBackupStorageRedundancy *BackupStorageRedundancy `json:"requestedBackupStorageRedundancy,omitempty"` + RequestedBackupStorageRedundancy *BackupStorageRedundancy // The resource identifier of the restorable dropped database associated with create operation of this database. - RestorableDroppedDatabaseID *string `json:"restorableDroppedDatabaseId,omitempty"` + RestorableDroppedDatabaseID *string // Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. - RestorePointInTime *time.Time `json:"restorePointInTime,omitempty"` + RestorePointInTime *time.Time // The name of the sample schema to apply when creating this database. - SampleName *SampleName `json:"sampleName,omitempty"` + SampleName *SampleName - // The secondary type of the database if it is a secondary. Valid values are Geo and Named. - SecondaryType *SecondaryType `json:"secondaryType,omitempty"` + // The secondary type of the database if it is a secondary. Valid values are Geo, Named and Standby. + SecondaryType *SecondaryType // Specifies the time that the database was deleted. - SourceDatabaseDeletionDate *time.Time `json:"sourceDatabaseDeletionDate,omitempty"` + SourceDatabaseDeletionDate *time.Time // The resource identifier of the source database associated with create operation of this database. - SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"` + SourceDatabaseID *string // Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple // availability zones. - ZoneRedundant *bool `json:"zoneRedundant,omitempty"` + ZoneRedundant *bool // READ-ONLY; The creation date of the database (ISO8601 format). - CreationDate *time.Time `json:"creationDate,omitempty" azure:"ro"` + CreationDate *time.Time // READ-ONLY; The storage account type used to store backups for this database. - CurrentBackupStorageRedundancy *BackupStorageRedundancy `json:"currentBackupStorageRedundancy,omitempty" azure:"ro"` + CurrentBackupStorageRedundancy *BackupStorageRedundancy // READ-ONLY; The name and tier of the SKU. - CurrentSKU *SKU `json:"currentSku,omitempty" azure:"ro"` + CurrentSKU *SKU // READ-ONLY; The current service level objective name of the database. - CurrentServiceObjectiveName *string `json:"currentServiceObjectiveName,omitempty" azure:"ro"` + CurrentServiceObjectiveName *string // READ-ONLY; The ID of the database. - DatabaseID *string `json:"databaseId,omitempty" azure:"ro"` + DatabaseID *string // READ-ONLY; The default secondary region for this database. - DefaultSecondaryLocation *string `json:"defaultSecondaryLocation,omitempty" azure:"ro"` + DefaultSecondaryLocation *string // READ-ONLY; This records the earliest start date and time that restore is available for this database (ISO8601 format). - EarliestRestoreDate *time.Time `json:"earliestRestoreDate,omitempty" azure:"ro"` + EarliestRestoreDate *time.Time // READ-ONLY; Failover Group resource identifier that this database belongs to. - FailoverGroupID *string `json:"failoverGroupId,omitempty" azure:"ro"` + FailoverGroupID *string // READ-ONLY; Infra encryption is enabled for this database. - IsInfraEncryptionEnabled *bool `json:"isInfraEncryptionEnabled,omitempty" azure:"ro"` + IsInfraEncryptionEnabled *bool // READ-ONLY; The max log size for this database. - MaxLogSizeBytes *int64 `json:"maxLogSizeBytes,omitempty" azure:"ro"` + MaxLogSizeBytes *int64 // READ-ONLY; The date when database was paused by user configuration or action(ISO8601 format). Null if the database is ready. - PausedDate *time.Time `json:"pausedDate,omitempty" azure:"ro"` + PausedDate *time.Time // READ-ONLY; The requested service level objective name of the database. - RequestedServiceObjectiveName *string `json:"requestedServiceObjectiveName,omitempty" azure:"ro"` + RequestedServiceObjectiveName *string // READ-ONLY; The date when database was resumed by user action or database login (ISO8601 format). Null if the database is // paused. - ResumedDate *time.Time `json:"resumedDate,omitempty" azure:"ro"` + ResumedDate *time.Time // READ-ONLY; The status of the database. - Status *DatabaseStatus `json:"status,omitempty" azure:"ro"` + Status *DatabaseStatus } // DatabaseUsage - Usage metric of a database. type DatabaseUsage struct { // Resource properties. - Properties *DatabaseUsageProperties `json:"properties,omitempty"` + Properties *DatabaseUsageProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // DatabaseUsageListResult - A list of database usage metrics. type DatabaseUsageListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*DatabaseUsage `json:"value,omitempty" azure:"ro"` + Value []*DatabaseUsage } // DatabaseUsageProperties - Properties of a database usage. type DatabaseUsageProperties struct { // READ-ONLY; Current value of the metric. - CurrentValue *float64 `json:"currentValue,omitempty" azure:"ro"` + CurrentValue *float64 // READ-ONLY; User-readable name of the metric. - DisplayName *string `json:"displayName,omitempty" azure:"ro"` + DisplayName *string // READ-ONLY; Boundary value of the metric. - Limit *float64 `json:"limit,omitempty" azure:"ro"` + Limit *float64 // READ-ONLY; Unit of the metric. - Unit *string `json:"unit,omitempty" azure:"ro"` -} - -// DatabaseUsagesClientListByDatabaseOptions contains the optional parameters for the DatabaseUsagesClient.NewListByDatabasePager -// method. -type DatabaseUsagesClientListByDatabaseOptions struct { - // placeholder for future optional parameters + Unit *string } // DatabaseUserIdentity - Azure Active Directory identity configuration for a resource. type DatabaseUserIdentity struct { // READ-ONLY; The Azure Active Directory client id. - ClientID *string `json:"clientId,omitempty" azure:"ro"` + ClientID *string // READ-ONLY; The Azure Active Directory principal id. - PrincipalID *string `json:"principalId,omitempty" azure:"ro"` + PrincipalID *string } // DatabaseVulnerabilityAssessment - A database vulnerability assessment. type DatabaseVulnerabilityAssessment struct { // Resource properties. - Properties *DatabaseVulnerabilityAssessmentProperties `json:"properties,omitempty"` + Properties *DatabaseVulnerabilityAssessmentProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // DatabaseVulnerabilityAssessmentListResult - A list of the database's vulnerability assessments. type DatabaseVulnerabilityAssessmentListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*DatabaseVulnerabilityAssessment `json:"value,omitempty" azure:"ro"` + Value []*DatabaseVulnerabilityAssessment } // DatabaseVulnerabilityAssessmentProperties - Properties of a database Vulnerability Assessment. type DatabaseVulnerabilityAssessmentProperties struct { // The recurring scans settings - RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"` + RecurringScans *VulnerabilityAssessmentRecurringScansProperties // Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' // isn't specified, storageAccountAccessKey is required. - StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` + StorageAccountAccessKey *string // A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/). It is required // if server level vulnerability assessment policy doesn't set - StorageContainerPath *string `json:"storageContainerPath,omitempty"` + StorageContainerPath *string // A shared access signature (SAS Key) that has write access to the blob container specified in 'storageContainerPath' parameter. // If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is // required. - StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"` + StorageContainerSasKey *string } // DatabaseVulnerabilityAssessmentRuleBaseline - A database vulnerability assessment rule baseline. type DatabaseVulnerabilityAssessmentRuleBaseline struct { // Resource properties. - Properties *DatabaseVulnerabilityAssessmentRuleBaselineProperties `json:"properties,omitempty"` + Properties *DatabaseVulnerabilityAssessmentRuleBaselineProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // DatabaseVulnerabilityAssessmentRuleBaselineItem - Properties for an Azure SQL Database Vulnerability Assessment rule baseline's // result. type DatabaseVulnerabilityAssessmentRuleBaselineItem struct { // REQUIRED; The rule baseline result - Result []*string `json:"result,omitempty"` + Result []*string } // DatabaseVulnerabilityAssessmentRuleBaselineProperties - Properties of a database Vulnerability Assessment rule baseline. type DatabaseVulnerabilityAssessmentRuleBaselineProperties struct { // REQUIRED; The rule baseline result - BaselineResults []*DatabaseVulnerabilityAssessmentRuleBaselineItem `json:"baselineResults,omitempty"` -} - -// DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate -// method. -type DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// DatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentRuleBaselinesClient.Delete -// method. -type DatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// DatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentRuleBaselinesClient.Get -// method. -type DatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions struct { - // placeholder for future optional parameters + BaselineResults []*DatabaseVulnerabilityAssessmentRuleBaselineItem } // DatabaseVulnerabilityAssessmentScanExportProperties - Properties of the export operation's result. type DatabaseVulnerabilityAssessmentScanExportProperties struct { // READ-ONLY; Location of the exported report (e.g. https://myStorage.blob.core.windows.net/VaScans/scans/serverName/databaseName/scan_scanId.xlsx). - ExportedReportLocation *string `json:"exportedReportLocation,omitempty" azure:"ro"` -} - -// DatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.BeginInitiateScan -// method. -type DatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DatabaseVulnerabilityAssessmentScansClientExportOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.Export -// method. -type DatabaseVulnerabilityAssessmentScansClientExportOptions struct { - // placeholder for future optional parameters -} - -// DatabaseVulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.Get -// method. -type DatabaseVulnerabilityAssessmentScansClientGetOptions struct { - // placeholder for future optional parameters -} - -// DatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.NewListByDatabasePager -// method. -type DatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions struct { - // placeholder for future optional parameters + ExportedReportLocation *string } // DatabaseVulnerabilityAssessmentScansExport - A database Vulnerability Assessment scan export resource. type DatabaseVulnerabilityAssessmentScansExport struct { // Resource properties. - Properties *DatabaseVulnerabilityAssessmentScanExportProperties `json:"properties,omitempty"` + Properties *DatabaseVulnerabilityAssessmentScanExportProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// DatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.CreateOrUpdate -// method. -type DatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// DatabaseVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.Delete -// method. -type DatabaseVulnerabilityAssessmentsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// DatabaseVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.Get -// method. -type DatabaseVulnerabilityAssessmentsClientGetOptions struct { - // placeholder for future optional parameters -} - -// DatabaseVulnerabilityAssessmentsClientListByDatabaseOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.NewListByDatabasePager -// method. -type DatabaseVulnerabilityAssessmentsClientListByDatabaseOptions struct { - // placeholder for future optional parameters -} - -// DatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabasesClient.BeginCreateOrUpdate -// method. -type DatabasesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DatabasesClientBeginDeleteOptions contains the optional parameters for the DatabasesClient.BeginDelete method. -type DatabasesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DatabasesClientBeginExportOptions contains the optional parameters for the DatabasesClient.BeginExport method. -type DatabasesClientBeginExportOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DatabasesClientBeginFailoverOptions contains the optional parameters for the DatabasesClient.BeginFailover method. -type DatabasesClientBeginFailoverOptions struct { - // The type of replica to be failed over. - ReplicaType *ReplicaType - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DatabasesClientBeginImportOptions contains the optional parameters for the DatabasesClient.BeginImport method. -type DatabasesClientBeginImportOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DatabasesClientBeginPauseOptions contains the optional parameters for the DatabasesClient.BeginPause method. -type DatabasesClientBeginPauseOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DatabasesClientBeginResumeOptions contains the optional parameters for the DatabasesClient.BeginResume method. -type DatabasesClientBeginResumeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DatabasesClientBeginUpdateOptions contains the optional parameters for the DatabasesClient.BeginUpdate method. -type DatabasesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DatabasesClientBeginUpgradeDataWarehouseOptions contains the optional parameters for the DatabasesClient.BeginUpgradeDataWarehouse -// method. -type DatabasesClientBeginUpgradeDataWarehouseOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DatabasesClientGetOptions contains the optional parameters for the DatabasesClient.Get method. -type DatabasesClientGetOptions struct { - // placeholder for future optional parameters -} - -// DatabasesClientListByElasticPoolOptions contains the optional parameters for the DatabasesClient.NewListByElasticPoolPager -// method. -type DatabasesClientListByElasticPoolOptions struct { - // placeholder for future optional parameters -} - -// DatabasesClientListByServerOptions contains the optional parameters for the DatabasesClient.NewListByServerPager method. -type DatabasesClientListByServerOptions struct { - SkipToken *string -} - -// DatabasesClientListInaccessibleByServerOptions contains the optional parameters for the DatabasesClient.NewListInaccessibleByServerPager -// method. -type DatabasesClientListInaccessibleByServerOptions struct { - // placeholder for future optional parameters -} - -// DatabasesClientListMetricDefinitionsOptions contains the optional parameters for the DatabasesClient.NewListMetricDefinitionsPager -// method. -type DatabasesClientListMetricDefinitionsOptions struct { - // placeholder for future optional parameters -} - -// DatabasesClientListMetricsOptions contains the optional parameters for the DatabasesClient.NewListMetricsPager method. -type DatabasesClientListMetricsOptions struct { - // placeholder for future optional parameters -} - -// DatabasesClientRenameOptions contains the optional parameters for the DatabasesClient.Rename method. -type DatabasesClientRenameOptions struct { - // placeholder for future optional parameters + Type *string } // DeletedServer - A deleted server. type DeletedServer struct { // Resource properties. - Properties *DeletedServerProperties `json:"properties,omitempty"` + Properties *DeletedServerProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // DeletedServerListResult - A list of deleted servers. type DeletedServerListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*DeletedServer `json:"value,omitempty" azure:"ro"` + Value []*DeletedServer } // DeletedServerProperties - The properties of a deleted server. type DeletedServerProperties struct { // READ-ONLY; The deletion time of the deleted server. - DeletionTime *time.Time `json:"deletionTime,omitempty" azure:"ro"` + DeletionTime *time.Time // READ-ONLY; The fully qualified domain name of the server. - FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty" azure:"ro"` + FullyQualifiedDomainName *string // READ-ONLY; The original ID of the server before deletion. - OriginalID *string `json:"originalId,omitempty" azure:"ro"` + OriginalID *string // READ-ONLY; The version of the deleted server. - Version *string `json:"version,omitempty" azure:"ro"` -} - -// DeletedServersClientBeginRecoverOptions contains the optional parameters for the DeletedServersClient.BeginRecover method. -type DeletedServersClientBeginRecoverOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DeletedServersClientGetOptions contains the optional parameters for the DeletedServersClient.Get method. -type DeletedServersClientGetOptions struct { - // placeholder for future optional parameters -} - -// DeletedServersClientListByLocationOptions contains the optional parameters for the DeletedServersClient.NewListByLocationPager -// method. -type DeletedServersClientListByLocationOptions struct { - // placeholder for future optional parameters -} - -// DeletedServersClientListOptions contains the optional parameters for the DeletedServersClient.NewListPager method. -type DeletedServersClientListOptions struct { - // placeholder for future optional parameters + Version *string } // DistributedAvailabilityGroup - Distributed availability group between box and Sql Managed Instance. type DistributedAvailabilityGroup struct { // Resource properties. - Properties *DistributedAvailabilityGroupProperties `json:"properties,omitempty"` + Properties *DistributedAvailabilityGroupProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // DistributedAvailabilityGroupProperties - The properties of a distributed availability group. type DistributedAvailabilityGroupProperties struct { // The primary availability group name - PrimaryAvailabilityGroupName *string `json:"primaryAvailabilityGroupName,omitempty"` + PrimaryAvailabilityGroupName *string // The replication mode of a distributed availability group. Parameter will be ignored during link creation. - ReplicationMode *ReplicationMode `json:"replicationMode,omitempty"` + ReplicationMode *ReplicationMode // The secondary availability group name - SecondaryAvailabilityGroupName *string `json:"secondaryAvailabilityGroupName,omitempty"` + SecondaryAvailabilityGroupName *string // The source endpoint - SourceEndpoint *string `json:"sourceEndpoint,omitempty"` + SourceEndpoint *string // The name of the target database - TargetDatabase *string `json:"targetDatabase,omitempty"` + TargetDatabase *string // READ-ONLY; The distributed availability group id - DistributedAvailabilityGroupID *string `json:"distributedAvailabilityGroupId,omitempty" azure:"ro"` + DistributedAvailabilityGroupID *string // READ-ONLY; The last hardened lsn - LastHardenedLsn *string `json:"lastHardenedLsn,omitempty" azure:"ro"` + LastHardenedLsn *string // READ-ONLY; The link state - LinkState *string `json:"linkState,omitempty" azure:"ro"` + LinkState *string // READ-ONLY; The source replica id - SourceReplicaID *string `json:"sourceReplicaId,omitempty" azure:"ro"` + SourceReplicaID *string // READ-ONLY; The target replica id - TargetReplicaID *string `json:"targetReplicaId,omitempty" azure:"ro"` -} - -// DistributedAvailabilityGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.BeginCreateOrUpdate -// method. -type DistributedAvailabilityGroupsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DistributedAvailabilityGroupsClientBeginDeleteOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.BeginDelete -// method. -type DistributedAvailabilityGroupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DistributedAvailabilityGroupsClientBeginUpdateOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.BeginUpdate -// method. -type DistributedAvailabilityGroupsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DistributedAvailabilityGroupsClientGetOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.Get -// method. -type DistributedAvailabilityGroupsClientGetOptions struct { - // placeholder for future optional parameters -} - -// DistributedAvailabilityGroupsClientListByInstanceOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.NewListByInstancePager -// method. -type DistributedAvailabilityGroupsClientListByInstanceOptions struct { - // placeholder for future optional parameters + TargetReplicaID *string } // DistributedAvailabilityGroupsListResult - A list of distributed availability groups in instance. type DistributedAvailabilityGroupsListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*DistributedAvailabilityGroup `json:"value,omitempty" azure:"ro"` + Value []*DistributedAvailabilityGroup } // EditionCapability - The edition capability. type EditionCapability struct { // The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` + Reason *string // READ-ONLY; The database edition name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The read scale capability for the edition. - ReadScale *ReadScaleCapability `json:"readScale,omitempty" azure:"ro"` + ReadScale *ReadScaleCapability // READ-ONLY; The status of the capability. - Status *CapabilityStatus `json:"status,omitempty" azure:"ro"` + Status *CapabilityStatus // READ-ONLY; The list of supported service objectives for the edition. - SupportedServiceLevelObjectives []*ServiceObjectiveCapability `json:"supportedServiceLevelObjectives,omitempty" azure:"ro"` + SupportedServiceLevelObjectives []*ServiceObjectiveCapability // READ-ONLY; The list of supported storage capabilities for this edition - SupportedStorageCapabilities []*StorageCapability `json:"supportedStorageCapabilities,omitempty" azure:"ro"` + SupportedStorageCapabilities []*StorageCapability // READ-ONLY; Whether or not zone redundancy is supported for the edition. - ZoneRedundant *bool `json:"zoneRedundant,omitempty" azure:"ro"` + ZoneRedundant *bool } // ElasticPool - An elastic pool. type ElasticPool struct { // REQUIRED; Resource location. - Location *string `json:"location,omitempty"` + Location *string // Resource properties. - Properties *ElasticPoolProperties `json:"properties,omitempty"` + Properties *ElasticPoolProperties // The elastic pool SKU. // The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, @@ -1959,683 +1695,592 @@ type ElasticPool struct { // use the Capabilities_ListByLocation REST API or the following command: // az sql elastic-pool list-editions -l -o table // ` - SKU *SKU `json:"sku,omitempty"` + SKU *SKU // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Kind of elastic pool. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty" azure:"ro"` + Kind *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ElasticPoolActivitiesClientListByElasticPoolOptions contains the optional parameters for the ElasticPoolActivitiesClient.NewListByElasticPoolPager -// method. -type ElasticPoolActivitiesClientListByElasticPoolOptions struct { - // placeholder for future optional parameters + Type *string } // ElasticPoolActivity - Represents the activity on an elastic pool. type ElasticPoolActivity struct { // The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // The properties representing the resource. - Properties *ElasticPoolActivityProperties `json:"properties,omitempty"` + Properties *ElasticPoolActivityProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ElasticPoolActivityListResult - Represents the response to a list elastic pool activity request. type ElasticPoolActivityListResult struct { // REQUIRED; The list of elastic pool activities. - Value []*ElasticPoolActivity `json:"value,omitempty"` + Value []*ElasticPoolActivity } // ElasticPoolActivityProperties - Represents the properties of an elastic pool. type ElasticPoolActivityProperties struct { // READ-ONLY; The name of the elastic pool. - ElasticPoolName *string `json:"elasticPoolName,omitempty" azure:"ro"` + ElasticPoolName *string // READ-ONLY; The time the operation finished (ISO8601 format). - EndTime *time.Time `json:"endTime,omitempty" azure:"ro"` + EndTime *time.Time // READ-ONLY; The error code if available. - ErrorCode *int32 `json:"errorCode,omitempty" azure:"ro"` + ErrorCode *int32 // READ-ONLY; The error message if available. - ErrorMessage *string `json:"errorMessage,omitempty" azure:"ro"` + ErrorMessage *string // READ-ONLY; The error severity if available. - ErrorSeverity *int32 `json:"errorSeverity,omitempty" azure:"ro"` + ErrorSeverity *int32 // READ-ONLY; The operation name. - Operation *string `json:"operation,omitempty" azure:"ro"` + Operation *string // READ-ONLY; The unique operation ID. - OperationID *string `json:"operationId,omitempty" azure:"ro"` + OperationID *string // READ-ONLY; The percentage complete if available. - PercentComplete *int32 `json:"percentComplete,omitempty" azure:"ro"` + PercentComplete *int32 // READ-ONLY; The requested per database DTU cap. - RequestedDatabaseDtuCap *int32 `json:"requestedDatabaseDtuCap,omitempty" azure:"ro"` + RequestedDatabaseDtuCap *int32 // READ-ONLY; The requested per database DTU guarantee. - RequestedDatabaseDtuGuarantee *int32 `json:"requestedDatabaseDtuGuarantee,omitempty" azure:"ro"` + RequestedDatabaseDtuGuarantee *int32 // READ-ONLY; The requested max DTU per database if available. - RequestedDatabaseDtuMax *int32 `json:"requestedDatabaseDtuMax,omitempty" azure:"ro"` + RequestedDatabaseDtuMax *int32 // READ-ONLY; The requested min DTU per database if available. - RequestedDatabaseDtuMin *int32 `json:"requestedDatabaseDtuMin,omitempty" azure:"ro"` + RequestedDatabaseDtuMin *int32 // READ-ONLY; The requested DTU for the pool if available. - RequestedDtu *int32 `json:"requestedDtu,omitempty" azure:"ro"` + RequestedDtu *int32 // READ-ONLY; The requested DTU guarantee. - RequestedDtuGuarantee *int32 `json:"requestedDtuGuarantee,omitempty" azure:"ro"` + RequestedDtuGuarantee *int32 // READ-ONLY; The requested name for the elastic pool if available. - RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty" azure:"ro"` + RequestedElasticPoolName *string // READ-ONLY; The requested storage limit for the pool in GB if available. - RequestedStorageLimitInGB *int64 `json:"requestedStorageLimitInGB,omitempty" azure:"ro"` + RequestedStorageLimitInGB *int64 // READ-ONLY; The requested storage limit in MB. - RequestedStorageLimitInMB *int32 `json:"requestedStorageLimitInMB,omitempty" azure:"ro"` + RequestedStorageLimitInMB *int32 // READ-ONLY; The name of the server the elastic pool is in. - ServerName *string `json:"serverName,omitempty" azure:"ro"` + ServerName *string // READ-ONLY; The time the operation started (ISO8601 format). - StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` + StartTime *time.Time // READ-ONLY; The current state of the operation. - State *string `json:"state,omitempty" azure:"ro"` -} - -// ElasticPoolDatabaseActivitiesClientListByElasticPoolOptions contains the optional parameters for the ElasticPoolDatabaseActivitiesClient.NewListByElasticPoolPager -// method. -type ElasticPoolDatabaseActivitiesClientListByElasticPoolOptions struct { - // placeholder for future optional parameters + State *string } // ElasticPoolDatabaseActivity - Represents the activity on an elastic pool. type ElasticPoolDatabaseActivity struct { // The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // The properties representing the resource. - Properties *ElasticPoolDatabaseActivityProperties `json:"properties,omitempty"` + Properties *ElasticPoolDatabaseActivityProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ElasticPoolDatabaseActivityListResult - Represents the response to a list elastic pool database activity request. type ElasticPoolDatabaseActivityListResult struct { // REQUIRED; The list of elastic pool database activities. - Value []*ElasticPoolDatabaseActivity `json:"value,omitempty"` + Value []*ElasticPoolDatabaseActivity } // ElasticPoolDatabaseActivityProperties - Represents the properties of an elastic pool database activity. type ElasticPoolDatabaseActivityProperties struct { // READ-ONLY; The name of the current elastic pool the database is in if available. - CurrentElasticPoolName *string `json:"currentElasticPoolName,omitempty" azure:"ro"` + CurrentElasticPoolName *string // READ-ONLY; The name of the current service objective if available. - CurrentServiceObjective *string `json:"currentServiceObjective,omitempty" azure:"ro"` + CurrentServiceObjective *string // READ-ONLY; The database name. - DatabaseName *string `json:"databaseName,omitempty" azure:"ro"` + DatabaseName *string // READ-ONLY; The time the operation finished (ISO8601 format). - EndTime *time.Time `json:"endTime,omitempty" azure:"ro"` + EndTime *time.Time // READ-ONLY; The error code if available. - ErrorCode *int32 `json:"errorCode,omitempty" azure:"ro"` + ErrorCode *int32 // READ-ONLY; The error message if available. - ErrorMessage *string `json:"errorMessage,omitempty" azure:"ro"` + ErrorMessage *string // READ-ONLY; The error severity if available. - ErrorSeverity *int32 `json:"errorSeverity,omitempty" azure:"ro"` + ErrorSeverity *int32 // READ-ONLY; The operation name. - Operation *string `json:"operation,omitempty" azure:"ro"` + Operation *string // READ-ONLY; The unique operation ID. - OperationID *string `json:"operationId,omitempty" azure:"ro"` + OperationID *string // READ-ONLY; The percentage complete if available. - PercentComplete *int32 `json:"percentComplete,omitempty" azure:"ro"` + PercentComplete *int32 // READ-ONLY; The name for the elastic pool the database is moving into if available. - RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty" azure:"ro"` + RequestedElasticPoolName *string // READ-ONLY; The name of the requested service objective if available. - RequestedServiceObjective *string `json:"requestedServiceObjective,omitempty" azure:"ro"` + RequestedServiceObjective *string // READ-ONLY; The name of the server the elastic pool is in. - ServerName *string `json:"serverName,omitempty" azure:"ro"` + ServerName *string // READ-ONLY; The time the operation started (ISO8601 format). - StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` + StartTime *time.Time // READ-ONLY; The current state of the operation. - State *string `json:"state,omitempty" azure:"ro"` + State *string } // ElasticPoolEditionCapability - The elastic pool edition capability. type ElasticPoolEditionCapability struct { // The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` + Reason *string // READ-ONLY; The elastic pool edition name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The status of the capability. - Status *CapabilityStatus `json:"status,omitempty" azure:"ro"` + Status *CapabilityStatus // READ-ONLY; The list of supported elastic pool DTU levels for the edition. - SupportedElasticPoolPerformanceLevels []*ElasticPoolPerformanceLevelCapability `json:"supportedElasticPoolPerformanceLevels,omitempty" azure:"ro"` + SupportedElasticPoolPerformanceLevels []*ElasticPoolPerformanceLevelCapability // READ-ONLY; Whether or not zone redundancy is supported for the edition. - ZoneRedundant *bool `json:"zoneRedundant,omitempty" azure:"ro"` + ZoneRedundant *bool } // ElasticPoolListResult - The result of an elastic pool list request. type ElasticPoolListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ElasticPool `json:"value,omitempty" azure:"ro"` + Value []*ElasticPool } // ElasticPoolOperation - A elastic pool operation. type ElasticPoolOperation struct { // Resource properties. - Properties *ElasticPoolOperationProperties `json:"properties,omitempty"` + Properties *ElasticPoolOperationProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ElasticPoolOperationListResult - The response to a list elastic pool operations request type ElasticPoolOperationListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ElasticPoolOperation `json:"value,omitempty" azure:"ro"` + Value []*ElasticPoolOperation } // ElasticPoolOperationProperties - The properties of a elastic pool operation. type ElasticPoolOperationProperties struct { // READ-ONLY; The operation description. - Description *string `json:"description,omitempty" azure:"ro"` + Description *string // READ-ONLY; The name of the elastic pool the operation is being performed on. - ElasticPoolName *string `json:"elasticPoolName,omitempty" azure:"ro"` + ElasticPoolName *string // READ-ONLY; The operation error code. - ErrorCode *int32 `json:"errorCode,omitempty" azure:"ro"` + ErrorCode *int32 // READ-ONLY; The operation error description. - ErrorDescription *string `json:"errorDescription,omitempty" azure:"ro"` + ErrorDescription *string // READ-ONLY; The operation error severity. - ErrorSeverity *int32 `json:"errorSeverity,omitempty" azure:"ro"` + ErrorSeverity *int32 // READ-ONLY; The estimated completion time of the operation. - EstimatedCompletionTime *time.Time `json:"estimatedCompletionTime,omitempty" azure:"ro"` + EstimatedCompletionTime *time.Time // READ-ONLY; Whether the operation can be cancelled. - IsCancellable *bool `json:"isCancellable,omitempty" azure:"ro"` + IsCancellable *bool // READ-ONLY; Whether or not the error is a user error. - IsUserError *bool `json:"isUserError,omitempty" azure:"ro"` + IsUserError *bool // READ-ONLY; The name of operation. - Operation *string `json:"operation,omitempty" azure:"ro"` + Operation *string // READ-ONLY; The friendly name of operation. - OperationFriendlyName *string `json:"operationFriendlyName,omitempty" azure:"ro"` + OperationFriendlyName *string // READ-ONLY; The percentage of the operation completed. - PercentComplete *int32 `json:"percentComplete,omitempty" azure:"ro"` + PercentComplete *int32 // READ-ONLY; The name of the server. - ServerName *string `json:"serverName,omitempty" azure:"ro"` + ServerName *string // READ-ONLY; The operation start time. - StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` + StartTime *time.Time // READ-ONLY; The operation state. - State *string `json:"state,omitempty" azure:"ro"` -} - -// ElasticPoolOperationsClientCancelOptions contains the optional parameters for the ElasticPoolOperationsClient.Cancel method. -type ElasticPoolOperationsClientCancelOptions struct { - // placeholder for future optional parameters -} - -// ElasticPoolOperationsClientListByElasticPoolOptions contains the optional parameters for the ElasticPoolOperationsClient.NewListByElasticPoolPager -// method. -type ElasticPoolOperationsClientListByElasticPoolOptions struct { - // placeholder for future optional parameters + State *string } // ElasticPoolPerDatabaseMaxPerformanceLevelCapability - The max per-database performance level capability. type ElasticPoolPerDatabaseMaxPerformanceLevelCapability struct { // The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` + Reason *string // READ-ONLY; The maximum performance level per database. - Limit *float64 `json:"limit,omitempty" azure:"ro"` + Limit *float64 // READ-ONLY; The status of the capability. - Status *CapabilityStatus `json:"status,omitempty" azure:"ro"` + Status *CapabilityStatus // READ-ONLY; The list of supported min database performance levels. - SupportedPerDatabaseMinPerformanceLevels []*ElasticPoolPerDatabaseMinPerformanceLevelCapability `json:"supportedPerDatabaseMinPerformanceLevels,omitempty" azure:"ro"` + SupportedPerDatabaseMinPerformanceLevels []*ElasticPoolPerDatabaseMinPerformanceLevelCapability // READ-ONLY; Unit type used to measure performance level. - Unit *PerformanceLevelUnit `json:"unit,omitempty" azure:"ro"` + Unit *PerformanceLevelUnit } // ElasticPoolPerDatabaseMinPerformanceLevelCapability - The minimum per-database performance level capability. type ElasticPoolPerDatabaseMinPerformanceLevelCapability struct { // The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` + Reason *string // READ-ONLY; The minimum performance level per database. - Limit *float64 `json:"limit,omitempty" azure:"ro"` + Limit *float64 // READ-ONLY; The status of the capability. - Status *CapabilityStatus `json:"status,omitempty" azure:"ro"` + Status *CapabilityStatus // READ-ONLY; Unit type used to measure performance level. - Unit *PerformanceLevelUnit `json:"unit,omitempty" azure:"ro"` + Unit *PerformanceLevelUnit } // ElasticPoolPerDatabaseSettings - Per database settings of an elastic pool. type ElasticPoolPerDatabaseSettings struct { // The maximum capacity any one database can consume. - MaxCapacity *float64 `json:"maxCapacity,omitempty"` + MaxCapacity *float64 // The minimum capacity all databases are guaranteed. - MinCapacity *float64 `json:"minCapacity,omitempty"` + MinCapacity *float64 } // ElasticPoolPerformanceLevelCapability - The Elastic Pool performance level capability. type ElasticPoolPerformanceLevelCapability struct { // The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` + Reason *string // READ-ONLY; The included (free) max size for this performance level. - IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty" azure:"ro"` + IncludedMaxSize *MaxSizeCapability // READ-ONLY; The maximum number of databases supported. - MaxDatabaseCount *int32 `json:"maxDatabaseCount,omitempty" azure:"ro"` + MaxDatabaseCount *int32 // READ-ONLY; The performance level for the pool. - PerformanceLevel *PerformanceLevelCapability `json:"performanceLevel,omitempty" azure:"ro"` + PerformanceLevel *PerformanceLevelCapability // READ-ONLY; The sku. - SKU *SKU `json:"sku,omitempty" azure:"ro"` + SKU *SKU // READ-ONLY; The status of the capability. - Status *CapabilityStatus `json:"status,omitempty" azure:"ro"` + Status *CapabilityStatus // READ-ONLY; List of supported license types. - SupportedLicenseTypes []*LicenseTypeCapability `json:"supportedLicenseTypes,omitempty" azure:"ro"` + SupportedLicenseTypes []*LicenseTypeCapability // READ-ONLY; List of supported maintenance configurations - SupportedMaintenanceConfigurations []*MaintenanceConfigurationCapability `json:"supportedMaintenanceConfigurations,omitempty" azure:"ro"` + SupportedMaintenanceConfigurations []*MaintenanceConfigurationCapability // READ-ONLY; The list of supported max sizes. - SupportedMaxSizes []*MaxSizeRangeCapability `json:"supportedMaxSizes,omitempty" azure:"ro"` + SupportedMaxSizes []*MaxSizeRangeCapability // READ-ONLY; The list of supported per database max performance levels. - SupportedPerDatabaseMaxPerformanceLevels []*ElasticPoolPerDatabaseMaxPerformanceLevelCapability `json:"supportedPerDatabaseMaxPerformanceLevels,omitempty" azure:"ro"` + SupportedPerDatabaseMaxPerformanceLevels []*ElasticPoolPerDatabaseMaxPerformanceLevelCapability // READ-ONLY; The list of supported per database max sizes. - SupportedPerDatabaseMaxSizes []*MaxSizeRangeCapability `json:"supportedPerDatabaseMaxSizes,omitempty" azure:"ro"` + SupportedPerDatabaseMaxSizes []*MaxSizeRangeCapability // READ-ONLY; Whether or not zone redundancy is supported for the performance level. - ZoneRedundant *bool `json:"zoneRedundant,omitempty" azure:"ro"` + ZoneRedundant *bool } // ElasticPoolProperties - Properties of an elastic pool type ElasticPoolProperties struct { - // The number of secondary replicas associated with the elastic pool that are used to provide high availability. - HighAvailabilityReplicaCount *int32 `json:"highAvailabilityReplicaCount,omitempty"` + // Specifies the availability zone the pool's primary replica is pinned to. + AvailabilityZone *AvailabilityZoneType + + // The number of secondary replicas associated with the elastic pool that are used to provide high availability. Applicable + // only to Hyperscale elastic pools. + HighAvailabilityReplicaCount *int32 // The license type to apply for this elastic pool. - LicenseType *ElasticPoolLicenseType `json:"licenseType,omitempty"` + LicenseType *ElasticPoolLicenseType // Maintenance configuration id assigned to the elastic pool. This configuration defines the period when the maintenance updates // will will occur. - MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"` + MaintenanceConfigurationID *string // The storage limit for the database elastic pool in bytes. - MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"` + MaxSizeBytes *int64 + + // Minimal capacity that serverless pool will not shrink below, if not paused + MinCapacity *float64 // The per database settings for the elastic pool. - PerDatabaseSettings *ElasticPoolPerDatabaseSettings `json:"perDatabaseSettings,omitempty"` + PerDatabaseSettings *ElasticPoolPerDatabaseSettings + + // Type of enclave requested on the elastic pool. + PreferredEnclaveType *AlwaysEncryptedEnclaveType // Whether or not this elastic pool is zone redundant, which means the replicas of this elastic pool will be spread across // multiple availability zones. - ZoneRedundant *bool `json:"zoneRedundant,omitempty"` + ZoneRedundant *bool // READ-ONLY; The creation date of the elastic pool (ISO8601 format). - CreationDate *time.Time `json:"creationDate,omitempty" azure:"ro"` + CreationDate *time.Time // READ-ONLY; The state of the elastic pool. - State *ElasticPoolState `json:"state,omitempty" azure:"ro"` + State *ElasticPoolState } // ElasticPoolUpdate - An elastic pool update. type ElasticPoolUpdate struct { // Resource properties. - Properties *ElasticPoolUpdateProperties `json:"properties,omitempty"` + Properties *ElasticPoolUpdateProperties // An ARM Resource SKU. - SKU *SKU `json:"sku,omitempty"` + SKU *SKU // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // ElasticPoolUpdateProperties - Properties of an elastic pool type ElasticPoolUpdateProperties struct { + // Specifies the availability zone the pool's primary replica is pinned to. + AvailabilityZone *AvailabilityZoneType + // The number of secondary replicas associated with the elastic pool that are used to provide high availability. Applicable // only to Hyperscale elastic pools. - HighAvailabilityReplicaCount *int32 `json:"highAvailabilityReplicaCount,omitempty"` + HighAvailabilityReplicaCount *int32 // The license type to apply for this elastic pool. - LicenseType *ElasticPoolLicenseType `json:"licenseType,omitempty"` + LicenseType *ElasticPoolLicenseType // Maintenance configuration id assigned to the elastic pool. This configuration defines the period when the maintenance updates // will will occur. - MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"` + MaintenanceConfigurationID *string // The storage limit for the database elastic pool in bytes. - MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"` + MaxSizeBytes *int64 + + // Minimal capacity that serverless pool will not shrink below, if not paused + MinCapacity *float64 // The per database settings for the elastic pool. - PerDatabaseSettings *ElasticPoolPerDatabaseSettings `json:"perDatabaseSettings,omitempty"` + PerDatabaseSettings *ElasticPoolPerDatabaseSettings + + // Type of enclave requested on the elastic pool. + PreferredEnclaveType *AlwaysEncryptedEnclaveType // Whether or not this elastic pool is zone redundant, which means the replicas of this elastic pool will be spread across // multiple availability zones. - ZoneRedundant *bool `json:"zoneRedundant,omitempty"` + ZoneRedundant *bool } -// ElasticPoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the ElasticPoolsClient.BeginCreateOrUpdate -// method. -type ElasticPoolsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} +// EncryptionProtector - The server encryption protector. +type EncryptionProtector struct { + // Resource properties. + Properties *EncryptionProtectorProperties -// ElasticPoolsClientBeginDeleteOptions contains the optional parameters for the ElasticPoolsClient.BeginDelete method. -type ElasticPoolsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ElasticPoolsClientBeginFailoverOptions contains the optional parameters for the ElasticPoolsClient.BeginFailover method. -type ElasticPoolsClientBeginFailoverOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ElasticPoolsClientBeginUpdateOptions contains the optional parameters for the ElasticPoolsClient.BeginUpdate method. -type ElasticPoolsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ElasticPoolsClientGetOptions contains the optional parameters for the ElasticPoolsClient.Get method. -type ElasticPoolsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ElasticPoolsClientListByServerOptions contains the optional parameters for the ElasticPoolsClient.NewListByServerPager -// method. -type ElasticPoolsClientListByServerOptions struct { - // The number of elements in the collection to skip. - Skip *int64 -} - -// ElasticPoolsClientListMetricDefinitionsOptions contains the optional parameters for the ElasticPoolsClient.NewListMetricDefinitionsPager -// method. -type ElasticPoolsClientListMetricDefinitionsOptions struct { - // placeholder for future optional parameters -} - -// ElasticPoolsClientListMetricsOptions contains the optional parameters for the ElasticPoolsClient.NewListMetricsPager method. -type ElasticPoolsClientListMetricsOptions struct { - // placeholder for future optional parameters -} - -// EncryptionProtector - The server encryption protector. -type EncryptionProtector struct { - // Resource properties. - Properties *EncryptionProtectorProperties `json:"properties,omitempty"` - - // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + // READ-ONLY; Resource ID. + ID *string // READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty" azure:"ro"` + Kind *string // READ-ONLY; Resource location. - Location *string `json:"location,omitempty" azure:"ro"` + Location *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // EncryptionProtectorListResult - A list of server encryption protectors. type EncryptionProtectorListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*EncryptionProtector `json:"value,omitempty" azure:"ro"` + Value []*EncryptionProtector } // EncryptionProtectorProperties - Properties for an encryption protector execution. type EncryptionProtectorProperties struct { // REQUIRED; The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. - ServerKeyType *ServerKeyType `json:"serverKeyType,omitempty"` + ServerKeyType *ServerKeyType // Key auto rotation opt-in flag. Either true or false. - AutoRotationEnabled *bool `json:"autoRotationEnabled,omitempty"` + AutoRotationEnabled *bool // The name of the server key. - ServerKeyName *string `json:"serverKeyName,omitempty"` + ServerKeyName *string // READ-ONLY; Subregion of the encryption protector. - Subregion *string `json:"subregion,omitempty" azure:"ro"` + Subregion *string // READ-ONLY; Thumbprint of the server key. - Thumbprint *string `json:"thumbprint,omitempty" azure:"ro"` + Thumbprint *string // READ-ONLY; The URI of the server key. - URI *string `json:"uri,omitempty" azure:"ro"` -} - -// EncryptionProtectorsClientBeginCreateOrUpdateOptions contains the optional parameters for the EncryptionProtectorsClient.BeginCreateOrUpdate -// method. -type EncryptionProtectorsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// EncryptionProtectorsClientBeginRevalidateOptions contains the optional parameters for the EncryptionProtectorsClient.BeginRevalidate -// method. -type EncryptionProtectorsClientBeginRevalidateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// EncryptionProtectorsClientGetOptions contains the optional parameters for the EncryptionProtectorsClient.Get method. -type EncryptionProtectorsClientGetOptions struct { - // placeholder for future optional parameters -} - -// EncryptionProtectorsClientListByServerOptions contains the optional parameters for the EncryptionProtectorsClient.NewListByServerPager -// method. -type EncryptionProtectorsClientListByServerOptions struct { - // placeholder for future optional parameters + URI *string } // EndpointCertificate - Certificate used on an endpoint on the Managed Instance. type EndpointCertificate struct { // Resource properties. - Properties *EndpointCertificateProperties `json:"properties,omitempty"` + Properties *EndpointCertificateProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // EndpointCertificateListResult - A list of endpoint certificates on the target instance. type EndpointCertificateListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*EndpointCertificate `json:"value,omitempty" azure:"ro"` + Value []*EndpointCertificate } // EndpointCertificateProperties - The properties of an endpoint certificate. type EndpointCertificateProperties struct { // The certificate public blob - PublicBlob *string `json:"publicBlob,omitempty"` + PublicBlob *string } -// EndpointCertificatesClientGetOptions contains the optional parameters for the EndpointCertificatesClient.Get method. -type EndpointCertificatesClientGetOptions struct { - // placeholder for future optional parameters +// EndpointDependency - A domain name that the managed instance service needs to communicate with, along with additional details. +type EndpointDependency struct { + // READ-ONLY; The domain name of the dependency. + DomainName *string + + // READ-ONLY; The IP Addresses and Ports used when connecting to DomainName. + EndpointDetails []*EndpointDetail } -// EndpointCertificatesClientListByInstanceOptions contains the optional parameters for the EndpointCertificatesClient.NewListByInstancePager -// method. -type EndpointCertificatesClientListByInstanceOptions struct { - // placeholder for future optional parameters +// EndpointDetail - A domain name that the managed instance service needs to communicate with, along with additional details. +type EndpointDetail struct { + // READ-ONLY; The port an endpoint is connected to. + Port *int32 } // ExportDatabaseDefinition - Contains the information necessary to perform export database operation. type ExportDatabaseDefinition struct { // REQUIRED; Administrator login name. - AdministratorLogin *string `json:"administratorLogin,omitempty"` + AdministratorLogin *string // REQUIRED; Administrator login password. - AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` + AdministratorLoginPassword *string // REQUIRED; Storage key. - StorageKey *string `json:"storageKey,omitempty"` + StorageKey *string // REQUIRED; Storage key type. - StorageKeyType *StorageKeyType `json:"storageKeyType,omitempty"` + StorageKeyType *StorageKeyType // REQUIRED; Storage Uri. - StorageURI *string `json:"storageUri,omitempty"` + StorageURI *string // Authentication type. - AuthenticationType *string `json:"authenticationType,omitempty"` + AuthenticationType *string // Optional resource information to enable network isolation for request. - NetworkIsolation *NetworkIsolationSettings `json:"networkIsolation,omitempty"` -} - -// ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ExtendedDatabaseBlobAuditingPoliciesClient.CreateOrUpdate -// method. -type ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ExtendedDatabaseBlobAuditingPoliciesClientGetOptions contains the optional parameters for the ExtendedDatabaseBlobAuditingPoliciesClient.Get -// method. -type ExtendedDatabaseBlobAuditingPoliciesClientGetOptions struct { - // placeholder for future optional parameters -} - -// ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseOptions contains the optional parameters for the ExtendedDatabaseBlobAuditingPoliciesClient.NewListByDatabasePager -// method. -type ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseOptions struct { - // placeholder for future optional parameters + NetworkIsolation *NetworkIsolationSettings } // ExtendedDatabaseBlobAuditingPolicy - An extended database blob auditing policy. type ExtendedDatabaseBlobAuditingPolicy struct { // Resource properties. - Properties *ExtendedDatabaseBlobAuditingPolicyProperties `json:"properties,omitempty"` + Properties *ExtendedDatabaseBlobAuditingPolicyProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ExtendedDatabaseBlobAuditingPolicyListResult - A list of database extended auditing settings. type ExtendedDatabaseBlobAuditingPolicyListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ExtendedDatabaseBlobAuditingPolicy `json:"value,omitempty" azure:"ro"` + Value []*ExtendedDatabaseBlobAuditingPolicy } // ExtendedDatabaseBlobAuditingPolicyProperties - Properties of an extended database blob auditing policy. type ExtendedDatabaseBlobAuditingPolicyProperties struct { // REQUIRED; Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. - State *BlobAuditingPolicyState `json:"state,omitempty"` + State *BlobAuditingPolicyState // Specifies the Actions-Groups and Actions to audit. // The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures @@ -2665,7 +2310,7 @@ type ExtendedDatabaseBlobAuditingPolicyProperties struct { // For example: SELECT on dbo.myTable by public SELECT on DATABASE::myDatabase by public SELECT on SCHEMA::mySchema by public // For more information, see Database-Level Audit Actions // [https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions] - AuditActionsAndGroups []*string `json:"auditActionsAndGroups,omitempty"` + AuditActionsAndGroups []*string // Specifies whether audit events are sent to Azure Monitor. In order to send the events to Azure Monitor, specify 'State' // as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true. @@ -2676,23 +2321,23 @@ type ExtendedDatabaseBlobAuditingPolicyProperties struct { // https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview // For more information, see Diagnostic Settings REST API [https://go.microsoft.com/fwlink/?linkid=2033207]or Diagnostic Settings // PowerShell [https://go.microsoft.com/fwlink/?linkid=2033043] - IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"` + IsAzureMonitorTargetEnabled *bool // Specifies whether Managed Identity is used to access blob storage - IsManagedIdentityInUse *bool `json:"isManagedIdentityInUse,omitempty"` + IsManagedIdentityInUse *bool // Specifies whether storageAccountAccessKey value is the storage's secondary key. - IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"` + IsStorageSecondaryKeyInUse *bool // Specifies condition of where clause when creating an audit. - PredicateExpression *string `json:"predicateExpression,omitempty"` + PredicateExpression *string // Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed. The default // minimum value is 1000 (1 second). The maximum is 2,147,483,647. - QueueDelayMs *int32 `json:"queueDelayMs,omitempty"` + QueueDelayMs *int32 // Specifies the number of days to keep in the audit logs in the storage account. - RetentionDays *int32 `json:"retentionDays,omitempty"` + RetentionDays *int32 // Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, not // specifying the storageAccountAccessKey will use SQL server system-assigned @@ -2701,63 +2346,44 @@ type ExtendedDatabaseBlobAuditingPolicyProperties struct { // 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server // identity. For more information, see Auditing to storage using Managed // Identity authentication [https://go.microsoft.com/fwlink/?linkid=2114355] - StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` + StorageAccountAccessKey *string // Specifies the blob storage subscription Id. - StorageAccountSubscriptionID *string `json:"storageAccountSubscriptionId,omitempty"` + StorageAccountSubscriptionID *string // Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint // or isAzureMonitorTargetEnabled is required. - StorageEndpoint *string `json:"storageEndpoint,omitempty"` -} - -// ExtendedServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ExtendedServerBlobAuditingPoliciesClient.BeginCreateOrUpdate -// method. -type ExtendedServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExtendedServerBlobAuditingPoliciesClientGetOptions contains the optional parameters for the ExtendedServerBlobAuditingPoliciesClient.Get -// method. -type ExtendedServerBlobAuditingPoliciesClientGetOptions struct { - // placeholder for future optional parameters -} - -// ExtendedServerBlobAuditingPoliciesClientListByServerOptions contains the optional parameters for the ExtendedServerBlobAuditingPoliciesClient.NewListByServerPager -// method. -type ExtendedServerBlobAuditingPoliciesClientListByServerOptions struct { - // placeholder for future optional parameters + StorageEndpoint *string } // ExtendedServerBlobAuditingPolicy - An extended server blob auditing policy. type ExtendedServerBlobAuditingPolicy struct { // Resource properties. - Properties *ExtendedServerBlobAuditingPolicyProperties `json:"properties,omitempty"` + Properties *ExtendedServerBlobAuditingPolicyProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ExtendedServerBlobAuditingPolicyListResult - A list of server extended auditing settings. type ExtendedServerBlobAuditingPolicyListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ExtendedServerBlobAuditingPolicy `json:"value,omitempty" azure:"ro"` + Value []*ExtendedServerBlobAuditingPolicy } // ExtendedServerBlobAuditingPolicyProperties - Properties of an extended server blob auditing policy. type ExtendedServerBlobAuditingPolicyProperties struct { // REQUIRED; Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. - State *BlobAuditingPolicyState `json:"state,omitempty"` + State *BlobAuditingPolicyState // Specifies the Actions-Groups and Actions to audit. // The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures @@ -2787,7 +2413,7 @@ type ExtendedServerBlobAuditingPolicyProperties struct { // For example: SELECT on dbo.myTable by public SELECT on DATABASE::myDatabase by public SELECT on SCHEMA::mySchema by public // For more information, see Database-Level Audit Actions // [https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions] - AuditActionsAndGroups []*string `json:"auditActionsAndGroups,omitempty"` + AuditActionsAndGroups []*string // Specifies whether audit events are sent to Azure Monitor. In order to send the events to Azure Monitor, specify 'State' // as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true. @@ -2798,7 +2424,7 @@ type ExtendedServerBlobAuditingPolicyProperties struct { // https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview // For more information, see Diagnostic Settings REST API [https://go.microsoft.com/fwlink/?linkid=2033207]or Diagnostic Settings // PowerShell [https://go.microsoft.com/fwlink/?linkid=2033043] - IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"` + IsAzureMonitorTargetEnabled *bool // Specifies the state of devops audit. If state is Enabled, devops logs will be sent to Azure Monitor. In order to send the // events to Azure Monitor, specify 'State' as 'Enabled', @@ -2809,23 +2435,23 @@ type ExtendedServerBlobAuditingPolicyProperties struct { // https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview // For more information, see Diagnostic Settings REST API [https://go.microsoft.com/fwlink/?linkid=2033207]or Diagnostic Settings // PowerShell [https://go.microsoft.com/fwlink/?linkid=2033043] - IsDevopsAuditEnabled *bool `json:"isDevopsAuditEnabled,omitempty"` + IsDevopsAuditEnabled *bool // Specifies whether Managed Identity is used to access blob storage - IsManagedIdentityInUse *bool `json:"isManagedIdentityInUse,omitempty"` + IsManagedIdentityInUse *bool // Specifies whether storageAccountAccessKey value is the storage's secondary key. - IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"` + IsStorageSecondaryKeyInUse *bool // Specifies condition of where clause when creating an audit. - PredicateExpression *string `json:"predicateExpression,omitempty"` + PredicateExpression *string // Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed. The default // minimum value is 1000 (1 second). The maximum is 2,147,483,647. - QueueDelayMs *int32 `json:"queueDelayMs,omitempty"` + QueueDelayMs *int32 // Specifies the number of days to keep in the audit logs in the storage account. - RetentionDays *int32 `json:"retentionDays,omitempty"` + RetentionDays *int32 // Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, not // specifying the storageAccountAccessKey will use SQL server system-assigned @@ -2834,3222 +2460,2344 @@ type ExtendedServerBlobAuditingPolicyProperties struct { // 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server // identity. For more information, see Auditing to storage using Managed // Identity authentication [https://go.microsoft.com/fwlink/?linkid=2114355] - StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` + StorageAccountAccessKey *string // Specifies the blob storage subscription Id. - StorageAccountSubscriptionID *string `json:"storageAccountSubscriptionId,omitempty"` + StorageAccountSubscriptionID *string // Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint // or isAzureMonitorTargetEnabled is required. - StorageEndpoint *string `json:"storageEndpoint,omitempty"` + StorageEndpoint *string } // FailoverGroup - A failover group. type FailoverGroup struct { // Resource properties. - Properties *FailoverGroupProperties `json:"properties,omitempty"` + Properties *FailoverGroupProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource location. - Location *string `json:"location,omitempty" azure:"ro"` + Location *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // FailoverGroupListResult - A list of failover groups. type FailoverGroupListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*FailoverGroup `json:"value,omitempty" azure:"ro"` + Value []*FailoverGroup } // FailoverGroupProperties - Properties of a failover group. type FailoverGroupProperties struct { // REQUIRED; List of partner server information for the failover group. - PartnerServers []*PartnerInfo `json:"partnerServers,omitempty"` + PartnerServers []*PartnerInfo // REQUIRED; Read-write endpoint of the failover group instance. - ReadWriteEndpoint *FailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"` + ReadWriteEndpoint *FailoverGroupReadWriteEndpoint // List of databases in the failover group. - Databases []*string `json:"databases,omitempty"` + Databases []*string // Read-only endpoint of the failover group instance. - ReadOnlyEndpoint *FailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"` + ReadOnlyEndpoint *FailoverGroupReadOnlyEndpoint // READ-ONLY; Local replication role of the failover group instance. - ReplicationRole *FailoverGroupReplicationRole `json:"replicationRole,omitempty" azure:"ro"` + ReplicationRole *FailoverGroupReplicationRole // READ-ONLY; Replication state of the failover group instance. - ReplicationState *string `json:"replicationState,omitempty" azure:"ro"` + ReplicationState *string } // FailoverGroupReadOnlyEndpoint - Read-only endpoint of the failover group instance. type FailoverGroupReadOnlyEndpoint struct { // Failover policy of the read-only endpoint for the failover group. - FailoverPolicy *ReadOnlyEndpointFailoverPolicy `json:"failoverPolicy,omitempty"` + FailoverPolicy *ReadOnlyEndpointFailoverPolicy } // FailoverGroupReadWriteEndpoint - Read-write endpoint of the failover group instance. type FailoverGroupReadWriteEndpoint struct { // REQUIRED; Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes // is required. - FailoverPolicy *ReadWriteEndpointFailoverPolicy `json:"failoverPolicy,omitempty"` + FailoverPolicy *ReadWriteEndpointFailoverPolicy // Grace period before failover with data loss is attempted for the read-write endpoint. If failoverPolicy is Automatic then // failoverWithDataLossGracePeriodMinutes is required. - FailoverWithDataLossGracePeriodMinutes *int32 `json:"failoverWithDataLossGracePeriodMinutes,omitempty"` + FailoverWithDataLossGracePeriodMinutes *int32 } // FailoverGroupUpdate - A failover group update request. type FailoverGroupUpdate struct { // Resource properties. - Properties *FailoverGroupUpdateProperties `json:"properties,omitempty"` + Properties *FailoverGroupUpdateProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // FailoverGroupUpdateProperties - Properties of a failover group update. type FailoverGroupUpdateProperties struct { // List of databases in the failover group. - Databases []*string `json:"databases,omitempty"` + Databases []*string // Read-only endpoint of the failover group instance. - ReadOnlyEndpoint *FailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"` + ReadOnlyEndpoint *FailoverGroupReadOnlyEndpoint // Read-write endpoint of the failover group instance. - ReadWriteEndpoint *FailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"` -} - -// FailoverGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the FailoverGroupsClient.BeginCreateOrUpdate -// method. -type FailoverGroupsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// FailoverGroupsClientBeginDeleteOptions contains the optional parameters for the FailoverGroupsClient.BeginDelete method. -type FailoverGroupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// FailoverGroupsClientBeginFailoverOptions contains the optional parameters for the FailoverGroupsClient.BeginFailover method. -type FailoverGroupsClientBeginFailoverOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// FailoverGroupsClientBeginForceFailoverAllowDataLossOptions contains the optional parameters for the FailoverGroupsClient.BeginForceFailoverAllowDataLoss -// method. -type FailoverGroupsClientBeginForceFailoverAllowDataLossOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// FailoverGroupsClientBeginUpdateOptions contains the optional parameters for the FailoverGroupsClient.BeginUpdate method. -type FailoverGroupsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// FailoverGroupsClientGetOptions contains the optional parameters for the FailoverGroupsClient.Get method. -type FailoverGroupsClientGetOptions struct { - // placeholder for future optional parameters -} - -// FailoverGroupsClientListByServerOptions contains the optional parameters for the FailoverGroupsClient.NewListByServerPager -// method. -type FailoverGroupsClientListByServerOptions struct { - // placeholder for future optional parameters + ReadWriteEndpoint *FailoverGroupReadWriteEndpoint } // FirewallRule - A server firewall rule. type FirewallRule struct { // Resource name. - Name *string `json:"name,omitempty"` + Name *string // Resource properties. - Properties *ServerFirewallRuleProperties `json:"properties,omitempty"` + Properties *ServerFirewallRuleProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // FirewallRuleList - A list of server firewall rules. type FirewallRuleList struct { - Values []*FirewallRule `json:"values,omitempty"` + Values []*FirewallRule } // FirewallRuleListResult - The response to a list firewall rules request type FirewallRuleListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*FirewallRule `json:"value,omitempty" azure:"ro"` -} - -// FirewallRulesClientCreateOrUpdateOptions contains the optional parameters for the FirewallRulesClient.CreateOrUpdate method. -type FirewallRulesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// FirewallRulesClientDeleteOptions contains the optional parameters for the FirewallRulesClient.Delete method. -type FirewallRulesClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// FirewallRulesClientGetOptions contains the optional parameters for the FirewallRulesClient.Get method. -type FirewallRulesClientGetOptions struct { - // placeholder for future optional parameters -} - -// FirewallRulesClientListByServerOptions contains the optional parameters for the FirewallRulesClient.NewListByServerPager -// method. -type FirewallRulesClientListByServerOptions struct { - // placeholder for future optional parameters -} - -// FirewallRulesClientReplaceOptions contains the optional parameters for the FirewallRulesClient.Replace method. -type FirewallRulesClientReplaceOptions struct { - // placeholder for future optional parameters -} - -// GeoBackupPoliciesClientCreateOrUpdateOptions contains the optional parameters for the GeoBackupPoliciesClient.CreateOrUpdate -// method. -type GeoBackupPoliciesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// GeoBackupPoliciesClientGetOptions contains the optional parameters for the GeoBackupPoliciesClient.Get method. -type GeoBackupPoliciesClientGetOptions struct { - // placeholder for future optional parameters -} - -// GeoBackupPoliciesClientListByDatabaseOptions contains the optional parameters for the GeoBackupPoliciesClient.NewListByDatabasePager -// method. -type GeoBackupPoliciesClientListByDatabaseOptions struct { - // placeholder for future optional parameters + Value []*FirewallRule } // GeoBackupPolicy - A database geo backup policy. type GeoBackupPolicy struct { // REQUIRED; The properties of the geo backup policy. - Properties *GeoBackupPolicyProperties `json:"properties,omitempty"` + Properties *GeoBackupPolicyProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Kind of geo backup policy. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty" azure:"ro"` + Kind *string // READ-ONLY; Backup policy location. - Location *string `json:"location,omitempty" azure:"ro"` + Location *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // GeoBackupPolicyListResult - The response to a list geo backup policies request. type GeoBackupPolicyListResult struct { // The list of geo backup policies. - Value []*GeoBackupPolicy `json:"value,omitempty"` + Value []*GeoBackupPolicy } // GeoBackupPolicyProperties - The properties of the geo backup policy. type GeoBackupPolicyProperties struct { // REQUIRED; The state of the geo backup policy. - State *GeoBackupPolicyState `json:"state,omitempty"` + State *GeoBackupPolicyState // READ-ONLY; The storage type of the geo backup policy. - StorageType *string `json:"storageType,omitempty" azure:"ro"` + StorageType *string } // IPv6FirewallRule - An IPv6 server firewall rule. type IPv6FirewallRule struct { // Resource name. - Name *string `json:"name,omitempty"` + Name *string // Resource properties. - Properties *IPv6ServerFirewallRuleProperties `json:"properties,omitempty"` + Properties *IPv6ServerFirewallRuleProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // IPv6FirewallRuleListResult - The response to a list IPv6 firewall rules request type IPv6FirewallRuleListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*IPv6FirewallRule `json:"value,omitempty" azure:"ro"` -} - -// IPv6FirewallRulesClientCreateOrUpdateOptions contains the optional parameters for the IPv6FirewallRulesClient.CreateOrUpdate -// method. -type IPv6FirewallRulesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// IPv6FirewallRulesClientDeleteOptions contains the optional parameters for the IPv6FirewallRulesClient.Delete method. -type IPv6FirewallRulesClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// IPv6FirewallRulesClientGetOptions contains the optional parameters for the IPv6FirewallRulesClient.Get method. -type IPv6FirewallRulesClientGetOptions struct { - // placeholder for future optional parameters -} - -// IPv6FirewallRulesClientListByServerOptions contains the optional parameters for the IPv6FirewallRulesClient.NewListByServerPager -// method. -type IPv6FirewallRulesClientListByServerOptions struct { - // placeholder for future optional parameters + Value []*IPv6FirewallRule } // IPv6ServerFirewallRuleProperties - The properties of an IPv6 server firewall rule. type IPv6ServerFirewallRuleProperties struct { - // The end IP address of the firewall rule. Must be IPv6 format. Must be greater than or equal to startIpAddress. - EndIPv6Address *string `json:"endIPv6Address,omitempty"` + // The end IP address of the firewall rule. Must be IPv6 format. Must be greater than or equal to startIpv6Address. + EndIPv6Address *string // The start IP address of the firewall rule. Must be IPv6 format. - StartIPv6Address *string `json:"startIPv6Address,omitempty"` + StartIPv6Address *string } // ImportExistingDatabaseDefinition - Contains the information necessary to perform import operation for existing database. type ImportExistingDatabaseDefinition struct { // REQUIRED; Administrator login name. - AdministratorLogin *string `json:"administratorLogin,omitempty"` + AdministratorLogin *string // REQUIRED; Administrator login password. - AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` + AdministratorLoginPassword *string // REQUIRED; Storage key. - StorageKey *string `json:"storageKey,omitempty"` + StorageKey *string // REQUIRED; Storage key type. - StorageKeyType *StorageKeyType `json:"storageKeyType,omitempty"` + StorageKeyType *StorageKeyType // REQUIRED; Storage Uri. - StorageURI *string `json:"storageUri,omitempty"` + StorageURI *string // Authentication type. - AuthenticationType *string `json:"authenticationType,omitempty"` + AuthenticationType *string // Optional resource information to enable network isolation for request. - NetworkIsolation *NetworkIsolationSettings `json:"networkIsolation,omitempty"` + NetworkIsolation *NetworkIsolationSettings } // ImportExportExtensionsOperationListResult - Import export operation extensions list. type ImportExportExtensionsOperationListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ImportExportExtensionsOperationResult `json:"value,omitempty" azure:"ro"` + Value []*ImportExportExtensionsOperationResult } // ImportExportExtensionsOperationResult - An Extension operation result resource. type ImportExportExtensionsOperationResult struct { // Resource properties. - Properties *ImportExportExtensionsOperationResultProperties `json:"properties,omitempty"` + Properties *ImportExportExtensionsOperationResultProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ImportExportExtensionsOperationResultProperties - Contains the operation result properties for import/export operation. type ImportExportExtensionsOperationResultProperties struct { // READ-ONLY; Database name. - DatabaseName *string `json:"databaseName,omitempty" azure:"ro"` + DatabaseName *string // READ-ONLY; Error message. - ErrorMessage *string `json:"errorMessage,omitempty" azure:"ro"` + ErrorMessage *string // READ-ONLY; Last modified time. - LastModifiedTime *string `json:"lastModifiedTime,omitempty" azure:"ro"` + LastModifiedTime *string // READ-ONLY; Request Id. - RequestID *string `json:"requestId,omitempty" azure:"ro"` + RequestID *string // READ-ONLY; Request type. - RequestType *string `json:"requestType,omitempty" azure:"ro"` + RequestType *string // READ-ONLY; Server name. - ServerName *string `json:"serverName,omitempty" azure:"ro"` + ServerName *string // READ-ONLY; Operation status. - Status *string `json:"status,omitempty" azure:"ro"` + Status *string } // ImportExportOperationResult - An ImportExport operation result resource. type ImportExportOperationResult struct { // Resource properties. - Properties *ImportExportOperationResultProperties `json:"properties,omitempty"` + Properties *ImportExportOperationResultProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ImportExportOperationResultProperties - Contains the operation result properties for import/export operation. type ImportExportOperationResultProperties struct { // READ-ONLY; Blob Uri. - BlobURI *string `json:"blobUri,omitempty" azure:"ro"` + BlobURI *string // READ-ONLY; Database name. - DatabaseName *string `json:"databaseName,omitempty" azure:"ro"` + DatabaseName *string // READ-ONLY; Error message. - ErrorMessage *string `json:"errorMessage,omitempty" azure:"ro"` + ErrorMessage *string // READ-ONLY; Last modified time. - LastModifiedTime *string `json:"lastModifiedTime,omitempty" azure:"ro"` + LastModifiedTime *string // READ-ONLY; Gets the status of private endpoints associated with this request. - PrivateEndpointConnections []*PrivateEndpointConnectionRequestStatus `json:"privateEndpointConnections,omitempty" azure:"ro"` + PrivateEndpointConnections []*PrivateEndpointConnectionRequestStatus // READ-ONLY; Queued time. - QueuedTime *string `json:"queuedTime,omitempty" azure:"ro"` + QueuedTime *string // READ-ONLY; Request Id. - RequestID *string `json:"requestId,omitempty" azure:"ro"` + RequestID *string // READ-ONLY; Request type. - RequestType *string `json:"requestType,omitempty" azure:"ro"` + RequestType *string // READ-ONLY; Server name. - ServerName *string `json:"serverName,omitempty" azure:"ro"` + ServerName *string // READ-ONLY; Operation status. - Status *string `json:"status,omitempty" azure:"ro"` + Status *string } // ImportNewDatabaseDefinition - Contains the information necessary to perform import operation for new database. type ImportNewDatabaseDefinition struct { // REQUIRED; Administrator login name. - AdministratorLogin *string `json:"administratorLogin,omitempty"` + AdministratorLogin *string // REQUIRED; Administrator login password. - AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` + AdministratorLoginPassword *string // REQUIRED; Storage key. - StorageKey *string `json:"storageKey,omitempty"` + StorageKey *string // REQUIRED; Storage key type. - StorageKeyType *StorageKeyType `json:"storageKeyType,omitempty"` + StorageKeyType *StorageKeyType // REQUIRED; Storage Uri. - StorageURI *string `json:"storageUri,omitempty"` + StorageURI *string // Authentication type. - AuthenticationType *string `json:"authenticationType,omitempty"` + AuthenticationType *string // Name of the import database. - DatabaseName *string `json:"databaseName,omitempty"` + DatabaseName *string // Edition of the import database. - Edition *string `json:"edition,omitempty"` + Edition *string // Max size in bytes for the import database. - MaxSizeBytes *string `json:"maxSizeBytes,omitempty"` + MaxSizeBytes *string // Optional resource information to enable network isolation for request. - NetworkIsolation *NetworkIsolationSettings `json:"networkIsolation,omitempty"` + NetworkIsolation *NetworkIsolationSettings // Service level objective name of the import database. - ServiceObjectiveName *string `json:"serviceObjectiveName,omitempty"` + ServiceObjectiveName *string } // InstanceFailoverGroup - An instance failover group. type InstanceFailoverGroup struct { // Resource properties. - Properties *InstanceFailoverGroupProperties `json:"properties,omitempty"` + Properties *InstanceFailoverGroupProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // InstanceFailoverGroupListResult - A list of instance failover groups. type InstanceFailoverGroupListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*InstanceFailoverGroup `json:"value,omitempty" azure:"ro"` + Value []*InstanceFailoverGroup } // InstanceFailoverGroupProperties - Properties of a instance failover group. type InstanceFailoverGroupProperties struct { // REQUIRED; List of managed instance pairs in the failover group. - ManagedInstancePairs []*ManagedInstancePairInfo `json:"managedInstancePairs,omitempty"` + ManagedInstancePairs []*ManagedInstancePairInfo // REQUIRED; Partner region information for the failover group. - PartnerRegions []*PartnerRegionInfo `json:"partnerRegions,omitempty"` + PartnerRegions []*PartnerRegionInfo // REQUIRED; Read-write endpoint of the failover group instance. - ReadWriteEndpoint *InstanceFailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"` + ReadWriteEndpoint *InstanceFailoverGroupReadWriteEndpoint // Read-only endpoint of the failover group instance. - ReadOnlyEndpoint *InstanceFailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"` + ReadOnlyEndpoint *InstanceFailoverGroupReadOnlyEndpoint + + // Type of the geo-secondary instance. Set 'Standby' if the instance is used as a DR option only. + SecondaryType *SecondaryInstanceType // READ-ONLY; Local replication role of the failover group instance. - ReplicationRole *InstanceFailoverGroupReplicationRole `json:"replicationRole,omitempty" azure:"ro"` + ReplicationRole *InstanceFailoverGroupReplicationRole // READ-ONLY; Replication state of the failover group instance. - ReplicationState *string `json:"replicationState,omitempty" azure:"ro"` + ReplicationState *string } // InstanceFailoverGroupReadOnlyEndpoint - Read-only endpoint of the failover group instance. type InstanceFailoverGroupReadOnlyEndpoint struct { // Failover policy of the read-only endpoint for the failover group. - FailoverPolicy *ReadOnlyEndpointFailoverPolicy `json:"failoverPolicy,omitempty"` + FailoverPolicy *ReadOnlyEndpointFailoverPolicy } // InstanceFailoverGroupReadWriteEndpoint - Read-write endpoint of the failover group instance. type InstanceFailoverGroupReadWriteEndpoint struct { // REQUIRED; Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes // is required. - FailoverPolicy *ReadWriteEndpointFailoverPolicy `json:"failoverPolicy,omitempty"` + FailoverPolicy *ReadWriteEndpointFailoverPolicy // Grace period before failover with data loss is attempted for the read-write endpoint. If failoverPolicy is Automatic then // failoverWithDataLossGracePeriodMinutes is required. - FailoverWithDataLossGracePeriodMinutes *int32 `json:"failoverWithDataLossGracePeriodMinutes,omitempty"` -} - -// InstanceFailoverGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the InstanceFailoverGroupsClient.BeginCreateOrUpdate -// method. -type InstanceFailoverGroupsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InstanceFailoverGroupsClientBeginDeleteOptions contains the optional parameters for the InstanceFailoverGroupsClient.BeginDelete -// method. -type InstanceFailoverGroupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InstanceFailoverGroupsClientBeginFailoverOptions contains the optional parameters for the InstanceFailoverGroupsClient.BeginFailover -// method. -type InstanceFailoverGroupsClientBeginFailoverOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InstanceFailoverGroupsClientBeginForceFailoverAllowDataLossOptions contains the optional parameters for the InstanceFailoverGroupsClient.BeginForceFailoverAllowDataLoss -// method. -type InstanceFailoverGroupsClientBeginForceFailoverAllowDataLossOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InstanceFailoverGroupsClientGetOptions contains the optional parameters for the InstanceFailoverGroupsClient.Get method. -type InstanceFailoverGroupsClientGetOptions struct { - // placeholder for future optional parameters -} - -// InstanceFailoverGroupsClientListByLocationOptions contains the optional parameters for the InstanceFailoverGroupsClient.NewListByLocationPager -// method. -type InstanceFailoverGroupsClientListByLocationOptions struct { - // placeholder for future optional parameters + FailoverWithDataLossGracePeriodMinutes *int32 } // InstancePool - An Azure SQL instance pool. type InstancePool struct { // REQUIRED; Resource location. - Location *string `json:"location,omitempty"` + Location *string // Resource properties. - Properties *InstancePoolProperties `json:"properties,omitempty"` + Properties *InstancePoolProperties // The name and tier of the SKU. - SKU *SKU `json:"sku,omitempty"` + SKU *SKU // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // InstancePoolEditionCapability - The instance pool capability type InstancePoolEditionCapability struct { // The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` + Reason *string // READ-ONLY; The instance pool version name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The status of the capability. - Status *CapabilityStatus `json:"status,omitempty" azure:"ro"` + Status *CapabilityStatus // READ-ONLY; The supported families. - SupportedFamilies []*InstancePoolFamilyCapability `json:"supportedFamilies,omitempty" azure:"ro"` + SupportedFamilies []*InstancePoolFamilyCapability } // InstancePoolFamilyCapability - The instance pool family capability. type InstancePoolFamilyCapability struct { // The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` + Reason *string // READ-ONLY; Family name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The status of the capability. - Status *CapabilityStatus `json:"status,omitempty" azure:"ro"` + Status *CapabilityStatus // READ-ONLY; List of supported license types. - SupportedLicenseTypes []*LicenseTypeCapability `json:"supportedLicenseTypes,omitempty" azure:"ro"` + SupportedLicenseTypes []*LicenseTypeCapability // READ-ONLY; List of supported virtual cores values. - SupportedVcoresValues []*InstancePoolVcoresCapability `json:"supportedVcoresValues,omitempty" azure:"ro"` + SupportedVcoresValues []*InstancePoolVcoresCapability } // InstancePoolListResult - A list of Azure SQL instance pools. type InstancePoolListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*InstancePool `json:"value,omitempty" azure:"ro"` + Value []*InstancePool } // InstancePoolProperties - Properties of an instance pool. type InstancePoolProperties struct { // REQUIRED; The license type. Possible values are 'LicenseIncluded' (price for SQL license is included) and 'BasePrice' (without // SQL license price). - LicenseType *InstancePoolLicenseType `json:"licenseType,omitempty"` + LicenseType *InstancePoolLicenseType // REQUIRED; Resource ID of the subnet to place this instance pool in. - SubnetID *string `json:"subnetId,omitempty"` + SubnetID *string // REQUIRED; Count of vCores belonging to this instance pool. - VCores *int32 `json:"vCores,omitempty"` + VCores *int32 } // InstancePoolUpdate - An update to an Instance pool. type InstancePoolUpdate struct { // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // InstancePoolVcoresCapability - The managed instance virtual cores capability. type InstancePoolVcoresCapability struct { // The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` + Reason *string // READ-ONLY; The virtual cores identifier. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The status of the capability. - Status *CapabilityStatus `json:"status,omitempty" azure:"ro"` + Status *CapabilityStatus // READ-ONLY; Storage limit. - StorageLimit *MaxSizeCapability `json:"storageLimit,omitempty" azure:"ro"` + StorageLimit *MaxSizeCapability // READ-ONLY; The virtual cores value. - Value *int32 `json:"value,omitempty" azure:"ro"` -} - -// InstancePoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the InstancePoolsClient.BeginCreateOrUpdate -// method. -type InstancePoolsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InstancePoolsClientBeginDeleteOptions contains the optional parameters for the InstancePoolsClient.BeginDelete method. -type InstancePoolsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InstancePoolsClientBeginUpdateOptions contains the optional parameters for the InstancePoolsClient.BeginUpdate method. -type InstancePoolsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InstancePoolsClientGetOptions contains the optional parameters for the InstancePoolsClient.Get method. -type InstancePoolsClientGetOptions struct { - // placeholder for future optional parameters -} - -// InstancePoolsClientListByResourceGroupOptions contains the optional parameters for the InstancePoolsClient.NewListByResourceGroupPager -// method. -type InstancePoolsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// InstancePoolsClientListOptions contains the optional parameters for the InstancePoolsClient.NewListPager method. -type InstancePoolsClientListOptions struct { - // placeholder for future optional parameters + Value *int32 } // Job - A job. type Job struct { // Resource properties. - Properties *JobProperties `json:"properties,omitempty"` + Properties *JobProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // JobAgent - An Azure SQL job agent. type JobAgent struct { // REQUIRED; Resource location. - Location *string `json:"location,omitempty"` + Location *string // Resource properties. - Properties *JobAgentProperties `json:"properties,omitempty"` + Properties *JobAgentProperties // The name and tier of the SKU. - SKU *SKU `json:"sku,omitempty"` + SKU *SKU // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // JobAgentListResult - A list of Azure SQL job agents. type JobAgentListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*JobAgent `json:"value,omitempty" azure:"ro"` + Value []*JobAgent } // JobAgentProperties - Properties of a job agent. type JobAgentProperties struct { // REQUIRED; Resource ID of the database to store job metadata in. - DatabaseID *string `json:"databaseId,omitempty"` + DatabaseID *string // READ-ONLY; The state of the job agent. - State *JobAgentState `json:"state,omitempty" azure:"ro"` + State *JobAgentState } // JobAgentUpdate - An update to an Azure SQL job agent. type JobAgentUpdate struct { // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` -} - -// JobAgentsClientBeginCreateOrUpdateOptions contains the optional parameters for the JobAgentsClient.BeginCreateOrUpdate -// method. -type JobAgentsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// JobAgentsClientBeginDeleteOptions contains the optional parameters for the JobAgentsClient.BeginDelete method. -type JobAgentsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// JobAgentsClientBeginUpdateOptions contains the optional parameters for the JobAgentsClient.BeginUpdate method. -type JobAgentsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// JobAgentsClientGetOptions contains the optional parameters for the JobAgentsClient.Get method. -type JobAgentsClientGetOptions struct { - // placeholder for future optional parameters -} - -// JobAgentsClientListByServerOptions contains the optional parameters for the JobAgentsClient.NewListByServerPager method. -type JobAgentsClientListByServerOptions struct { - // placeholder for future optional parameters + Tags map[string]*string } // JobCredential - A stored credential that can be used by a job to connect to target databases. type JobCredential struct { // Resource properties. - Properties *JobCredentialProperties `json:"properties,omitempty"` + Properties *JobCredentialProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // JobCredentialListResult - A list of job credentials. type JobCredentialListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*JobCredential `json:"value,omitempty" azure:"ro"` + Value []*JobCredential } // JobCredentialProperties - Properties of a job credential. type JobCredentialProperties struct { // REQUIRED; The credential password. - Password *string `json:"password,omitempty"` + Password *string // REQUIRED; The credential user name. - Username *string `json:"username,omitempty"` -} - -// JobCredentialsClientCreateOrUpdateOptions contains the optional parameters for the JobCredentialsClient.CreateOrUpdate -// method. -type JobCredentialsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// JobCredentialsClientDeleteOptions contains the optional parameters for the JobCredentialsClient.Delete method. -type JobCredentialsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// JobCredentialsClientGetOptions contains the optional parameters for the JobCredentialsClient.Get method. -type JobCredentialsClientGetOptions struct { - // placeholder for future optional parameters -} - -// JobCredentialsClientListByAgentOptions contains the optional parameters for the JobCredentialsClient.NewListByAgentPager -// method. -type JobCredentialsClientListByAgentOptions struct { - // placeholder for future optional parameters + Username *string } // JobExecution - An execution of a job type JobExecution struct { // Resource properties. - Properties *JobExecutionProperties `json:"properties,omitempty"` + Properties *JobExecutionProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // JobExecutionListResult - A list of job executions. type JobExecutionListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*JobExecution `json:"value,omitempty" azure:"ro"` + Value []*JobExecution } // JobExecutionProperties - Properties for an Azure SQL Database Elastic job execution. type JobExecutionProperties struct { // Number of times the job execution has been attempted. - CurrentAttempts *int32 `json:"currentAttempts,omitempty"` + CurrentAttempts *int32 // READ-ONLY; The time that the job execution was created. - CreateTime *time.Time `json:"createTime,omitempty" azure:"ro"` + CreateTime *time.Time // READ-ONLY; Start time of the current attempt. - CurrentAttemptStartTime *time.Time `json:"currentAttemptStartTime,omitempty" azure:"ro"` + CurrentAttemptStartTime *time.Time // READ-ONLY; The time that the job execution completed. - EndTime *time.Time `json:"endTime,omitempty" azure:"ro"` + EndTime *time.Time // READ-ONLY; The unique identifier of the job execution. - JobExecutionID *string `json:"jobExecutionId,omitempty" azure:"ro"` + JobExecutionID *string // READ-ONLY; The job version number. - JobVersion *int32 `json:"jobVersion,omitempty" azure:"ro"` + JobVersion *int32 // READ-ONLY; The last status or error message. - LastMessage *string `json:"lastMessage,omitempty" azure:"ro"` + LastMessage *string // READ-ONLY; The detailed state of the job execution. - Lifecycle *JobExecutionLifecycle `json:"lifecycle,omitempty" azure:"ro"` + Lifecycle *JobExecutionLifecycle // READ-ONLY; The ARM provisioning state of the job execution. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState // READ-ONLY; The time that the job execution started. - StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` + StartTime *time.Time // READ-ONLY; The job step id. - StepID *int32 `json:"stepId,omitempty" azure:"ro"` + StepID *int32 // READ-ONLY; The job step name. - StepName *string `json:"stepName,omitempty" azure:"ro"` + StepName *string // READ-ONLY; The target that this execution is executed on. - Target *JobExecutionTarget `json:"target,omitempty" azure:"ro"` + Target *JobExecutionTarget } // JobExecutionTarget - The target that a job execution is executed on. type JobExecutionTarget struct { // READ-ONLY; The database name. - DatabaseName *string `json:"databaseName,omitempty" azure:"ro"` + DatabaseName *string // READ-ONLY; The server name. - ServerName *string `json:"serverName,omitempty" azure:"ro"` + ServerName *string // READ-ONLY; The type of the target. - Type *JobTargetType `json:"type,omitempty" azure:"ro"` -} - -// JobExecutionsClientBeginCreateOptions contains the optional parameters for the JobExecutionsClient.BeginCreate method. -type JobExecutionsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// JobExecutionsClientBeginCreateOrUpdateOptions contains the optional parameters for the JobExecutionsClient.BeginCreateOrUpdate -// method. -type JobExecutionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// JobExecutionsClientCancelOptions contains the optional parameters for the JobExecutionsClient.Cancel method. -type JobExecutionsClientCancelOptions struct { - // placeholder for future optional parameters -} - -// JobExecutionsClientGetOptions contains the optional parameters for the JobExecutionsClient.Get method. -type JobExecutionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// JobExecutionsClientListByAgentOptions contains the optional parameters for the JobExecutionsClient.NewListByAgentPager -// method. -type JobExecutionsClientListByAgentOptions struct { - // If specified, only job executions created before the specified time are included. - CreateTimeMax *time.Time - // If specified, only job executions created at or after the specified time are included. - CreateTimeMin *time.Time - // If specified, only job executions completed before the specified time are included. - EndTimeMax *time.Time - // If specified, only job executions completed at or after the specified time are included. - EndTimeMin *time.Time - // If specified, only active or only completed job executions are included. - IsActive *bool - // The number of elements in the collection to skip. - Skip *int32 - // The number of elements to return from the collection. - Top *int32 -} - -// JobExecutionsClientListByJobOptions contains the optional parameters for the JobExecutionsClient.NewListByJobPager method. -type JobExecutionsClientListByJobOptions struct { - // If specified, only job executions created before the specified time are included. - CreateTimeMax *time.Time - // If specified, only job executions created at or after the specified time are included. - CreateTimeMin *time.Time - // If specified, only job executions completed before the specified time are included. - EndTimeMax *time.Time - // If specified, only job executions completed at or after the specified time are included. - EndTimeMin *time.Time - // If specified, only active or only completed job executions are included. - IsActive *bool - // The number of elements in the collection to skip. - Skip *int32 - // The number of elements to return from the collection. - Top *int32 + Type *JobTargetType } // JobListResult - A list of jobs. type JobListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*Job `json:"value,omitempty" azure:"ro"` + Value []*Job } // JobProperties - Properties of a job. type JobProperties struct { // User-defined description of the job. - Description *string `json:"description,omitempty"` + Description *string // Schedule properties of the job. - Schedule *JobSchedule `json:"schedule,omitempty"` + Schedule *JobSchedule // READ-ONLY; The job version number. - Version *int32 `json:"version,omitempty" azure:"ro"` + Version *int32 } // JobSchedule - Scheduling properties of a job. type JobSchedule struct { // Whether or not the schedule is enabled. - Enabled *bool `json:"enabled,omitempty"` + Enabled *bool // Schedule end time. - EndTime *time.Time `json:"endTime,omitempty"` + EndTime *time.Time // Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format. - Interval *string `json:"interval,omitempty"` + Interval *string // Schedule start time. - StartTime *time.Time `json:"startTime,omitempty"` + StartTime *time.Time // Schedule interval type - Type *JobScheduleType `json:"type,omitempty"` + Type *JobScheduleType } // JobStep - A job step. type JobStep struct { // Resource properties. - Properties *JobStepProperties `json:"properties,omitempty"` + Properties *JobStepProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // JobStepAction - The action to be executed by a job step. type JobStepAction struct { // REQUIRED; The action value, for example the text of the T-SQL script to execute. - Value *string `json:"value,omitempty"` + Value *string // The source of the action to execute. - Source *JobStepActionSource `json:"source,omitempty"` + Source *JobStepActionSource // Type of action being executed by the job step. - Type *JobStepActionType `json:"type,omitempty"` + Type *JobStepActionType } // JobStepExecutionOptions - The execution options of a job step. type JobStepExecutionOptions struct { // Initial delay between retries for job step execution. - InitialRetryIntervalSeconds *int32 `json:"initialRetryIntervalSeconds,omitempty"` + InitialRetryIntervalSeconds *int32 // The maximum amount of time to wait between retries for job step execution. - MaximumRetryIntervalSeconds *int32 `json:"maximumRetryIntervalSeconds,omitempty"` + MaximumRetryIntervalSeconds *int32 // Maximum number of times the job step will be reattempted if the first attempt fails. - RetryAttempts *int32 `json:"retryAttempts,omitempty"` + RetryAttempts *int32 // The backoff multiplier for the time between retries. - RetryIntervalBackoffMultiplier *float32 `json:"retryIntervalBackoffMultiplier,omitempty"` + RetryIntervalBackoffMultiplier *float32 // Execution timeout for the job step. - TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` -} - -// JobStepExecutionsClientGetOptions contains the optional parameters for the JobStepExecutionsClient.Get method. -type JobStepExecutionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// JobStepExecutionsClientListByJobExecutionOptions contains the optional parameters for the JobStepExecutionsClient.NewListByJobExecutionPager -// method. -type JobStepExecutionsClientListByJobExecutionOptions struct { - // If specified, only job executions created before the specified time are included. - CreateTimeMax *time.Time - // If specified, only job executions created at or after the specified time are included. - CreateTimeMin *time.Time - // If specified, only job executions completed before the specified time are included. - EndTimeMax *time.Time - // If specified, only job executions completed at or after the specified time are included. - EndTimeMin *time.Time - // If specified, only active or only completed job executions are included. - IsActive *bool - // The number of elements in the collection to skip. - Skip *int32 - // The number of elements to return from the collection. - Top *int32 + TimeoutSeconds *int32 } // JobStepListResult - A list of job steps. type JobStepListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*JobStep `json:"value,omitempty" azure:"ro"` + Value []*JobStep } // JobStepOutput - The output configuration of a job step. type JobStepOutput struct { // REQUIRED; The resource ID of the credential to use to connect to the output destination. - Credential *string `json:"credential,omitempty"` + Credential *string // REQUIRED; The output destination database. - DatabaseName *string `json:"databaseName,omitempty"` + DatabaseName *string // REQUIRED; The output destination server name. - ServerName *string `json:"serverName,omitempty"` + ServerName *string // REQUIRED; The output destination table. - TableName *string `json:"tableName,omitempty"` + TableName *string // The output destination resource group. - ResourceGroupName *string `json:"resourceGroupName,omitempty"` + ResourceGroupName *string // The output destination schema. - SchemaName *string `json:"schemaName,omitempty"` + SchemaName *string // The output destination subscription id. - SubscriptionID *string `json:"subscriptionId,omitempty"` + SubscriptionID *string // The output destination type. - Type *JobStepOutputType `json:"type,omitempty"` + Type *JobStepOutputType } // JobStepProperties - Properties of a job step. type JobStepProperties struct { // REQUIRED; The action payload of the job step. - Action *JobStepAction `json:"action,omitempty"` + Action *JobStepAction // REQUIRED; The resource ID of the job credential that will be used to connect to the targets. - Credential *string `json:"credential,omitempty"` + Credential *string // REQUIRED; The resource ID of the target group that the job step will be executed on. - TargetGroup *string `json:"targetGroup,omitempty"` + TargetGroup *string // Execution options for the job step. - ExecutionOptions *JobStepExecutionOptions `json:"executionOptions,omitempty"` + ExecutionOptions *JobStepExecutionOptions // Output destination properties of the job step. - Output *JobStepOutput `json:"output,omitempty"` + Output *JobStepOutput // The job step's index within the job. If not specified when creating the job step, it will be created as the last step. // If not specified when updating the job step, the step id is not modified. - StepID *int32 `json:"stepId,omitempty"` -} - -// JobStepsClientCreateOrUpdateOptions contains the optional parameters for the JobStepsClient.CreateOrUpdate method. -type JobStepsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// JobStepsClientDeleteOptions contains the optional parameters for the JobStepsClient.Delete method. -type JobStepsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// JobStepsClientGetByVersionOptions contains the optional parameters for the JobStepsClient.GetByVersion method. -type JobStepsClientGetByVersionOptions struct { - // placeholder for future optional parameters -} - -// JobStepsClientGetOptions contains the optional parameters for the JobStepsClient.Get method. -type JobStepsClientGetOptions struct { - // placeholder for future optional parameters -} - -// JobStepsClientListByJobOptions contains the optional parameters for the JobStepsClient.NewListByJobPager method. -type JobStepsClientListByJobOptions struct { - // placeholder for future optional parameters -} - -// JobStepsClientListByVersionOptions contains the optional parameters for the JobStepsClient.NewListByVersionPager method. -type JobStepsClientListByVersionOptions struct { - // placeholder for future optional parameters + StepID *int32 } // JobTarget - A job target, for example a specific database or a container of databases that is evaluated during job execution. type JobTarget struct { // REQUIRED; The target type. - Type *JobTargetType `json:"type,omitempty"` + Type *JobTargetType // The target database name. - DatabaseName *string `json:"databaseName,omitempty"` + DatabaseName *string // The target elastic pool name. - ElasticPoolName *string `json:"elasticPoolName,omitempty"` + ElasticPoolName *string // Whether the target is included or excluded from the group. - MembershipType *JobTargetGroupMembershipType `json:"membershipType,omitempty"` + MembershipType *JobTargetGroupMembershipType // The resource ID of the credential that is used during job execution to connect to the target and determine the list of // databases inside the target. - RefreshCredential *string `json:"refreshCredential,omitempty"` + RefreshCredential *string // The target server name. - ServerName *string `json:"serverName,omitempty"` + ServerName *string // The target shard map. - ShardMapName *string `json:"shardMapName,omitempty"` -} - -// JobTargetExecutionsClientGetOptions contains the optional parameters for the JobTargetExecutionsClient.Get method. -type JobTargetExecutionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// JobTargetExecutionsClientListByJobExecutionOptions contains the optional parameters for the JobTargetExecutionsClient.NewListByJobExecutionPager -// method. -type JobTargetExecutionsClientListByJobExecutionOptions struct { - // If specified, only job executions created before the specified time are included. - CreateTimeMax *time.Time - // If specified, only job executions created at or after the specified time are included. - CreateTimeMin *time.Time - // If specified, only job executions completed before the specified time are included. - EndTimeMax *time.Time - // If specified, only job executions completed at or after the specified time are included. - EndTimeMin *time.Time - // If specified, only active or only completed job executions are included. - IsActive *bool - // The number of elements in the collection to skip. - Skip *int32 - // The number of elements to return from the collection. - Top *int32 -} - -// JobTargetExecutionsClientListByStepOptions contains the optional parameters for the JobTargetExecutionsClient.NewListByStepPager -// method. -type JobTargetExecutionsClientListByStepOptions struct { - // If specified, only job executions created before the specified time are included. - CreateTimeMax *time.Time - // If specified, only job executions created at or after the specified time are included. - CreateTimeMin *time.Time - // If specified, only job executions completed before the specified time are included. - EndTimeMax *time.Time - // If specified, only job executions completed at or after the specified time are included. - EndTimeMin *time.Time - // If specified, only active or only completed job executions are included. - IsActive *bool - // The number of elements in the collection to skip. - Skip *int32 - // The number of elements to return from the collection. - Top *int32 + ShardMapName *string } // JobTargetGroup - A group of job targets. type JobTargetGroup struct { // Resource properties. - Properties *JobTargetGroupProperties `json:"properties,omitempty"` + Properties *JobTargetGroupProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // JobTargetGroupListResult - A list of target groups. type JobTargetGroupListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*JobTargetGroup `json:"value,omitempty" azure:"ro"` + Value []*JobTargetGroup } // JobTargetGroupProperties - Properties of job target group. type JobTargetGroupProperties struct { // REQUIRED; Members of the target group. - Members []*JobTarget `json:"members,omitempty"` -} - -// JobTargetGroupsClientCreateOrUpdateOptions contains the optional parameters for the JobTargetGroupsClient.CreateOrUpdate -// method. -type JobTargetGroupsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// JobTargetGroupsClientDeleteOptions contains the optional parameters for the JobTargetGroupsClient.Delete method. -type JobTargetGroupsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// JobTargetGroupsClientGetOptions contains the optional parameters for the JobTargetGroupsClient.Get method. -type JobTargetGroupsClientGetOptions struct { - // placeholder for future optional parameters -} - -// JobTargetGroupsClientListByAgentOptions contains the optional parameters for the JobTargetGroupsClient.NewListByAgentPager -// method. -type JobTargetGroupsClientListByAgentOptions struct { - // placeholder for future optional parameters + Members []*JobTarget } // JobVersion - A job version. type JobVersion struct { // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // JobVersionListResult - A list of job versions. type JobVersionListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*JobVersion `json:"value,omitempty" azure:"ro"` -} - -// JobVersionsClientGetOptions contains the optional parameters for the JobVersionsClient.Get method. -type JobVersionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// JobVersionsClientListByJobOptions contains the optional parameters for the JobVersionsClient.NewListByJobPager method. -type JobVersionsClientListByJobOptions struct { - // placeholder for future optional parameters -} - -// JobsClientCreateOrUpdateOptions contains the optional parameters for the JobsClient.CreateOrUpdate method. -type JobsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// JobsClientDeleteOptions contains the optional parameters for the JobsClient.Delete method. -type JobsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// JobsClientGetOptions contains the optional parameters for the JobsClient.Get method. -type JobsClientGetOptions struct { - // placeholder for future optional parameters -} - -// JobsClientListByAgentOptions contains the optional parameters for the JobsClient.NewListByAgentPager method. -type JobsClientListByAgentOptions struct { - // placeholder for future optional parameters + Value []*JobVersion } // LedgerDigestUploads - Azure SQL Database ledger digest upload settings. type LedgerDigestUploads struct { // Resource properties. - Properties *LedgerDigestUploadsProperties `json:"properties,omitempty"` + Properties *LedgerDigestUploadsProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// LedgerDigestUploadsClientBeginCreateOrUpdateOptions contains the optional parameters for the LedgerDigestUploadsClient.BeginCreateOrUpdate -// method. -type LedgerDigestUploadsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// LedgerDigestUploadsClientBeginDisableOptions contains the optional parameters for the LedgerDigestUploadsClient.BeginDisable -// method. -type LedgerDigestUploadsClientBeginDisableOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// LedgerDigestUploadsClientGetOptions contains the optional parameters for the LedgerDigestUploadsClient.Get method. -type LedgerDigestUploadsClientGetOptions struct { - // placeholder for future optional parameters -} - -// LedgerDigestUploadsClientListByDatabaseOptions contains the optional parameters for the LedgerDigestUploadsClient.NewListByDatabasePager -// method. -type LedgerDigestUploadsClientListByDatabaseOptions struct { - // placeholder for future optional parameters + Type *string } // LedgerDigestUploadsListResult - A list of ledger digest upload settings. type LedgerDigestUploadsListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*LedgerDigestUploads `json:"value,omitempty" azure:"ro"` + Value []*LedgerDigestUploads } // LedgerDigestUploadsProperties - The properties of a database ledger digest upload settings. type LedgerDigestUploadsProperties struct { // The digest storage endpoint, which must be either an Azure blob storage endpoint or an URI for Azure Confidential Ledger. - DigestStorageEndpoint *string `json:"digestStorageEndpoint,omitempty"` + DigestStorageEndpoint *string // READ-ONLY; Specifies the state of ledger digest upload. - State *LedgerDigestUploadsState `json:"state,omitempty" azure:"ro"` + State *LedgerDigestUploadsState } // LicenseTypeCapability - The license type capability type LicenseTypeCapability struct { // The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` + Reason *string // READ-ONLY; License type identifier. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The status of the capability. - Status *CapabilityStatus `json:"status,omitempty" azure:"ro"` + Status *CapabilityStatus } // LocationCapabilities - The location capability. type LocationCapabilities struct { // The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` + Reason *string // READ-ONLY; The location name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The status of the capability. - Status *CapabilityStatus `json:"status,omitempty" azure:"ro"` + Status *CapabilityStatus // READ-ONLY; The list of supported managed instance versions. - SupportedManagedInstanceVersions []*ManagedInstanceVersionCapability `json:"supportedManagedInstanceVersions,omitempty" azure:"ro"` + SupportedManagedInstanceVersions []*ManagedInstanceVersionCapability // READ-ONLY; The list of supported server versions. - SupportedServerVersions []*ServerVersionCapability `json:"supportedServerVersions,omitempty" azure:"ro"` + SupportedServerVersions []*ServerVersionCapability } // LogSizeCapability - The log size capability. type LogSizeCapability struct { // READ-ONLY; The log size limit (see 'unit' for the units). - Limit *int32 `json:"limit,omitempty" azure:"ro"` + Limit *int32 // READ-ONLY; The units that the limit is expressed in. - Unit *LogSizeUnit `json:"unit,omitempty" azure:"ro"` + Unit *LogSizeUnit } // LogicalDatabaseTransparentDataEncryption - A logical database transparent data encryption state. type LogicalDatabaseTransparentDataEncryption struct { // Resource properties. - Properties *TransparentDataEncryptionProperties `json:"properties,omitempty"` + Properties *TransparentDataEncryptionProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // LogicalDatabaseTransparentDataEncryptionListResult - A list of transparent data encryptions type LogicalDatabaseTransparentDataEncryptionListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*LogicalDatabaseTransparentDataEncryption `json:"value,omitempty" azure:"ro"` + Value []*LogicalDatabaseTransparentDataEncryption } // LogicalServerAdvancedThreatProtectionListResult - A list of the server's Advanced Threat Protection configurations. type LogicalServerAdvancedThreatProtectionListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ServerAdvancedThreatProtection `json:"value,omitempty" azure:"ro"` + Value []*ServerAdvancedThreatProtection } // LogicalServerSecurityAlertPolicyListResult - A list of the server's security alert policies. type LogicalServerSecurityAlertPolicyListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ServerSecurityAlertPolicy `json:"value,omitempty" azure:"ro"` + Value []*ServerSecurityAlertPolicy } // LongTermRetentionBackup - A long term retention backup. type LongTermRetentionBackup struct { // Resource properties. - Properties *LongTermRetentionBackupProperties `json:"properties,omitempty"` + Properties *LongTermRetentionBackupProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // LongTermRetentionBackupListResult - A list of long term retention backups. type LongTermRetentionBackupListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*LongTermRetentionBackup `json:"value,omitempty" azure:"ro"` + Value []*LongTermRetentionBackup } // LongTermRetentionBackupOperationResult - A LongTermRetentionBackup operation result resource. type LongTermRetentionBackupOperationResult struct { // Resource properties. - Properties *LongTermRetentionOperationResultProperties `json:"properties,omitempty"` + Properties *LongTermRetentionOperationResultProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // LongTermRetentionBackupProperties - Properties of a long term retention backup type LongTermRetentionBackupProperties struct { // The storage redundancy type of the backup - RequestedBackupStorageRedundancy *BackupStorageRedundancy `json:"requestedBackupStorageRedundancy,omitempty"` + RequestedBackupStorageRedundancy *BackupStorageRedundancy // READ-ONLY; The time the long term retention backup will expire. - BackupExpirationTime *time.Time `json:"backupExpirationTime,omitempty" azure:"ro"` + BackupExpirationTime *time.Time // READ-ONLY; The storage redundancy type of the backup - BackupStorageRedundancy *BackupStorageRedundancy `json:"backupStorageRedundancy,omitempty" azure:"ro"` + BackupStorageRedundancy *BackupStorageRedundancy // READ-ONLY; The time the backup was taken - BackupTime *time.Time `json:"backupTime,omitempty" azure:"ro"` + BackupTime *time.Time // READ-ONLY; The delete time of the database - DatabaseDeletionTime *time.Time `json:"databaseDeletionTime,omitempty" azure:"ro"` + DatabaseDeletionTime *time.Time // READ-ONLY; The name of the database the backup belong to - DatabaseName *string `json:"databaseName,omitempty" azure:"ro"` + DatabaseName *string // READ-ONLY; The create time of the server. - ServerCreateTime *time.Time `json:"serverCreateTime,omitempty" azure:"ro"` + ServerCreateTime *time.Time // READ-ONLY; The server name that the backup database belong to. - ServerName *string `json:"serverName,omitempty" azure:"ro"` -} - -// LongTermRetentionBackupsClientBeginCopyByResourceGroupOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginCopyByResourceGroup -// method. -type LongTermRetentionBackupsClientBeginCopyByResourceGroupOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// LongTermRetentionBackupsClientBeginCopyOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginCopy -// method. -type LongTermRetentionBackupsClientBeginCopyOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// LongTermRetentionBackupsClientBeginDeleteByResourceGroupOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginDeleteByResourceGroup -// method. -type LongTermRetentionBackupsClientBeginDeleteByResourceGroupOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// LongTermRetentionBackupsClientBeginDeleteOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginDelete -// method. -type LongTermRetentionBackupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// LongTermRetentionBackupsClientBeginUpdateByResourceGroupOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginUpdateByResourceGroup -// method. -type LongTermRetentionBackupsClientBeginUpdateByResourceGroupOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// LongTermRetentionBackupsClientBeginUpdateOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginUpdate -// method. -type LongTermRetentionBackupsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// LongTermRetentionBackupsClientGetByResourceGroupOptions contains the optional parameters for the LongTermRetentionBackupsClient.GetByResourceGroup -// method. -type LongTermRetentionBackupsClientGetByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// LongTermRetentionBackupsClientGetOptions contains the optional parameters for the LongTermRetentionBackupsClient.Get method. -type LongTermRetentionBackupsClientGetOptions struct { - // placeholder for future optional parameters -} - -// LongTermRetentionBackupsClientListByDatabaseOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByDatabasePager -// method. -type LongTermRetentionBackupsClientListByDatabaseOptions struct { - // Whether to query against just live databases, just deleted databases, or all databases. - DatabaseState *DatabaseState - // Whether or not to only get the latest backup for each database. - OnlyLatestPerDatabase *bool -} - -// LongTermRetentionBackupsClientListByLocationOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByLocationPager -// method. -type LongTermRetentionBackupsClientListByLocationOptions struct { - // Whether to query against just live databases, just deleted databases, or all databases. - DatabaseState *DatabaseState - // Whether or not to only get the latest backup for each database. - OnlyLatestPerDatabase *bool -} - -// LongTermRetentionBackupsClientListByResourceGroupDatabaseOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByResourceGroupDatabasePager -// method. -type LongTermRetentionBackupsClientListByResourceGroupDatabaseOptions struct { - // Whether to query against just live databases, just deleted databases, or all databases. - DatabaseState *DatabaseState - // Whether or not to only get the latest backup for each database. - OnlyLatestPerDatabase *bool -} - -// LongTermRetentionBackupsClientListByResourceGroupLocationOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByResourceGroupLocationPager -// method. -type LongTermRetentionBackupsClientListByResourceGroupLocationOptions struct { - // Whether to query against just live databases, just deleted databases, or all databases. - DatabaseState *DatabaseState - // Whether or not to only get the latest backup for each database. - OnlyLatestPerDatabase *bool -} - -// LongTermRetentionBackupsClientListByResourceGroupServerOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByResourceGroupServerPager -// method. -type LongTermRetentionBackupsClientListByResourceGroupServerOptions struct { - // Whether to query against just live databases, just deleted databases, or all databases. - DatabaseState *DatabaseState - // Whether or not to only get the latest backup for each database. - OnlyLatestPerDatabase *bool -} - -// LongTermRetentionBackupsClientListByServerOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByServerPager -// method. -type LongTermRetentionBackupsClientListByServerOptions struct { - // Whether to query against just live databases, just deleted databases, or all databases. - DatabaseState *DatabaseState - // Whether or not to only get the latest backup for each database. - OnlyLatestPerDatabase *bool -} - -// LongTermRetentionManagedInstanceBackupsClientBeginDeleteByResourceGroupOptions contains the optional parameters for the -// LongTermRetentionManagedInstanceBackupsClient.BeginDeleteByResourceGroup method. -type LongTermRetentionManagedInstanceBackupsClientBeginDeleteByResourceGroupOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// LongTermRetentionManagedInstanceBackupsClientBeginDeleteOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.BeginDelete -// method. -type LongTermRetentionManagedInstanceBackupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.GetByResourceGroup -// method. -type LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// LongTermRetentionManagedInstanceBackupsClientGetOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.Get -// method. -type LongTermRetentionManagedInstanceBackupsClientGetOptions struct { - // placeholder for future optional parameters -} - -// LongTermRetentionManagedInstanceBackupsClientListByDatabaseOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.NewListByDatabasePager -// method. -type LongTermRetentionManagedInstanceBackupsClientListByDatabaseOptions struct { - // Whether to query against just live databases, just deleted databases, or all databases. - DatabaseState *DatabaseState - // Whether or not to only get the latest backup for each database. - OnlyLatestPerDatabase *bool -} - -// LongTermRetentionManagedInstanceBackupsClientListByInstanceOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.NewListByInstancePager -// method. -type LongTermRetentionManagedInstanceBackupsClientListByInstanceOptions struct { - // Whether to query against just live databases, just deleted databases, or all databases. - DatabaseState *DatabaseState - // Whether or not to only get the latest backup for each database. - OnlyLatestPerDatabase *bool -} - -// LongTermRetentionManagedInstanceBackupsClientListByLocationOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.NewListByLocationPager -// method. -type LongTermRetentionManagedInstanceBackupsClientListByLocationOptions struct { - // Whether to query against just live databases, just deleted databases, or all databases. - DatabaseState *DatabaseState - // Whether or not to only get the latest backup for each database. - OnlyLatestPerDatabase *bool -} - -// LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseOptions contains the optional parameters for the -// LongTermRetentionManagedInstanceBackupsClient.NewListByResourceGroupDatabasePager method. -type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseOptions struct { - // Whether to query against just live databases, just deleted databases, or all databases. - DatabaseState *DatabaseState - // Whether or not to only get the latest backup for each database. - OnlyLatestPerDatabase *bool -} - -// LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceOptions contains the optional parameters for the -// LongTermRetentionManagedInstanceBackupsClient.NewListByResourceGroupInstancePager method. -type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceOptions struct { - // Whether to query against just live databases, just deleted databases, or all databases. - DatabaseState *DatabaseState - // Whether or not to only get the latest backup for each database. - OnlyLatestPerDatabase *bool -} - -// LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationOptions contains the optional parameters for the -// LongTermRetentionManagedInstanceBackupsClient.NewListByResourceGroupLocationPager method. -type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationOptions struct { - // Whether to query against just live databases, just deleted databases, or all databases. - DatabaseState *DatabaseState - // Whether or not to only get the latest backup for each database. - OnlyLatestPerDatabase *bool + ServerName *string } // LongTermRetentionOperationResultProperties - Contains the operation result properties for long term retention backup operation. type LongTermRetentionOperationResultProperties struct { // READ-ONLY; Source backup resource id - FromBackupResourceID *string `json:"fromBackupResourceId,omitempty" azure:"ro"` + FromBackupResourceID *string // READ-ONLY; Progress message - Message *string `json:"message,omitempty" azure:"ro"` + Message *string // READ-ONLY; Operation type. - OperationType *string `json:"operationType,omitempty" azure:"ro"` + OperationType *string // READ-ONLY; Request Id. - RequestID *string `json:"requestId,omitempty" azure:"ro"` + RequestID *string // READ-ONLY; Operation status - Status *string `json:"status,omitempty" azure:"ro"` + Status *string // READ-ONLY; The storage redundancy type of the copied backup - TargetBackupStorageRedundancy *BackupStorageRedundancy `json:"targetBackupStorageRedundancy,omitempty" azure:"ro"` + TargetBackupStorageRedundancy *BackupStorageRedundancy // READ-ONLY; Target backup resource id - ToBackupResourceID *string `json:"toBackupResourceId,omitempty" azure:"ro"` -} - -// LongTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the LongTermRetentionPoliciesClient.BeginCreateOrUpdate -// method. -type LongTermRetentionPoliciesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// LongTermRetentionPoliciesClientGetOptions contains the optional parameters for the LongTermRetentionPoliciesClient.Get -// method. -type LongTermRetentionPoliciesClientGetOptions struct { - // placeholder for future optional parameters -} - -// LongTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the LongTermRetentionPoliciesClient.NewListByDatabasePager -// method. -type LongTermRetentionPoliciesClientListByDatabaseOptions struct { - // placeholder for future optional parameters + ToBackupResourceID *string } // LongTermRetentionPolicy - A long term retention policy. type LongTermRetentionPolicy struct { // Resource properties. - Properties *BaseLongTermRetentionPolicyProperties `json:"properties,omitempty"` + Properties *BaseLongTermRetentionPolicyProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // LongTermRetentionPolicyListResult - A list of long term retention policies. type LongTermRetentionPolicyListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*LongTermRetentionPolicy `json:"value,omitempty" azure:"ro"` + Value []*LongTermRetentionPolicy } // MaintenanceConfigurationCapability - The maintenance configuration capability type MaintenanceConfigurationCapability struct { // The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` + Reason *string // READ-ONLY; Maintenance configuration name - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The status of the capability. - Status *CapabilityStatus `json:"status,omitempty" azure:"ro"` + Status *CapabilityStatus // READ-ONLY; Whether or not zone redundancy is supported for the maintenance configuration. - ZoneRedundant *bool `json:"zoneRedundant,omitempty" azure:"ro"` + ZoneRedundant *bool } // MaintenanceWindowOptions - Maintenance window options. type MaintenanceWindowOptions struct { // Resource properties. - Properties *MaintenanceWindowOptionsProperties `json:"properties,omitempty"` + Properties *MaintenanceWindowOptionsProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// MaintenanceWindowOptionsClientGetOptions contains the optional parameters for the MaintenanceWindowOptionsClient.Get method. -type MaintenanceWindowOptionsClientGetOptions struct { - // placeholder for future optional parameters + Type *string } // MaintenanceWindowOptionsProperties - Maintenance window options properties. type MaintenanceWindowOptionsProperties struct { // Whether we allow multiple maintenance windows per cycle. - AllowMultipleMaintenanceWindowsPerCycle *bool `json:"allowMultipleMaintenanceWindowsPerCycle,omitempty"` + AllowMultipleMaintenanceWindowsPerCycle *bool // Default duration for maintenance window. - DefaultDurationInMinutes *int32 `json:"defaultDurationInMinutes,omitempty"` + DefaultDurationInMinutes *int32 // Whether maintenance windows are enabled for the database. - IsEnabled *bool `json:"isEnabled,omitempty"` + IsEnabled *bool // Available maintenance cycles e.g. {Saturday, 0, 4860}, {Wednesday, 0, 2460}. - MaintenanceWindowCycles []*MaintenanceWindowTimeRange `json:"maintenanceWindowCycles,omitempty"` + MaintenanceWindowCycles []*MaintenanceWindowTimeRange // Minimum number of maintenance windows cycles to be set on the database. - MinCycles *int32 `json:"minCycles,omitempty"` + MinCycles *int32 // Minimum duration of maintenance window. - MinDurationInMinutes *int32 `json:"minDurationInMinutes,omitempty"` + MinDurationInMinutes *int32 // Time granularity in minutes for maintenance windows. - TimeGranularityInMinutes *int32 `json:"timeGranularityInMinutes,omitempty"` + TimeGranularityInMinutes *int32 } // MaintenanceWindowTimeRange - Maintenance window time range. type MaintenanceWindowTimeRange struct { // Day of maintenance window. - DayOfWeek *DayOfWeek `json:"dayOfWeek,omitempty"` + DayOfWeek *DayOfWeek // Duration of maintenance window in minutes. - Duration *string `json:"duration,omitempty"` + Duration *string // Start time minutes offset from 12am. - StartTime *string `json:"startTime,omitempty"` + StartTime *string } // MaintenanceWindows - Maintenance windows. type MaintenanceWindows struct { // Resource properties. - Properties *MaintenanceWindowsProperties `json:"properties,omitempty"` + Properties *MaintenanceWindowsProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// MaintenanceWindowsClientCreateOrUpdateOptions contains the optional parameters for the MaintenanceWindowsClient.CreateOrUpdate -// method. -type MaintenanceWindowsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// MaintenanceWindowsClientGetOptions contains the optional parameters for the MaintenanceWindowsClient.Get method. -type MaintenanceWindowsClientGetOptions struct { - // placeholder for future optional parameters + Type *string } // MaintenanceWindowsProperties - Maintenance windows resource properties. type MaintenanceWindowsProperties struct { - TimeRanges []*MaintenanceWindowTimeRange `json:"timeRanges,omitempty"` -} - -// ManagedBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedBackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate -// method. -type ManagedBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagedBackupShortTermRetentionPoliciesClientBeginUpdateOptions contains the optional parameters for the ManagedBackupShortTermRetentionPoliciesClient.BeginUpdate -// method. -type ManagedBackupShortTermRetentionPoliciesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagedBackupShortTermRetentionPoliciesClientGetOptions contains the optional parameters for the ManagedBackupShortTermRetentionPoliciesClient.Get -// method. -type ManagedBackupShortTermRetentionPoliciesClientGetOptions struct { - // placeholder for future optional parameters -} - -// ManagedBackupShortTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the ManagedBackupShortTermRetentionPoliciesClient.NewListByDatabasePager -// method. -type ManagedBackupShortTermRetentionPoliciesClientListByDatabaseOptions struct { - // placeholder for future optional parameters + TimeRanges []*MaintenanceWindowTimeRange } // ManagedBackupShortTermRetentionPolicy - A short term retention policy. type ManagedBackupShortTermRetentionPolicy struct { // Resource properties. - Properties *ManagedBackupShortTermRetentionPolicyProperties `json:"properties,omitempty"` + Properties *ManagedBackupShortTermRetentionPolicyProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ManagedBackupShortTermRetentionPolicyListResult - A list of short term retention policies. type ManagedBackupShortTermRetentionPolicyListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ManagedBackupShortTermRetentionPolicy `json:"value,omitempty" azure:"ro"` + Value []*ManagedBackupShortTermRetentionPolicy } // ManagedBackupShortTermRetentionPolicyProperties - Properties of a short term retention policy type ManagedBackupShortTermRetentionPolicyProperties struct { // The backup retention period in days. This is how many days Point-in-Time Restore will be supported. - RetentionDays *int32 `json:"retentionDays,omitempty"` + RetentionDays *int32 } // ManagedDatabase - A managed database resource. type ManagedDatabase struct { // REQUIRED; Resource location. - Location *string `json:"location,omitempty"` + Location *string // Resource properties. - Properties *ManagedDatabaseProperties `json:"properties,omitempty"` + Properties *ManagedDatabaseProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } -// ManagedDatabaseColumnsClientGetOptions contains the optional parameters for the ManagedDatabaseColumnsClient.Get method. -type ManagedDatabaseColumnsClientGetOptions struct { - // placeholder for future optional parameters -} +// ManagedDatabaseAdvancedThreatProtection - A managed database Advanced Threat Protection. +type ManagedDatabaseAdvancedThreatProtection struct { + // Resource properties. + Properties *AdvancedThreatProtectionProperties + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; SystemData of AdvancedThreatProtectionResource. + SystemData *SystemData -// ManagedDatabaseColumnsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseColumnsClient.NewListByDatabasePager -// method. -type ManagedDatabaseColumnsClientListByDatabaseOptions struct { - Column []string - OrderBy []string - Schema []string - // An opaque token that identifies a starting point in the collection. - Skiptoken *string - Table []string + // READ-ONLY; Resource type. + Type *string } -// ManagedDatabaseColumnsClientListByTableOptions contains the optional parameters for the ManagedDatabaseColumnsClient.NewListByTablePager -// method. -type ManagedDatabaseColumnsClientListByTableOptions struct { - // An OData filter expression that filters elements in the collection. - Filter *string +// 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 + + // READ-ONLY; Array of results. + Value []*ManagedDatabaseAdvancedThreatProtection } // ManagedDatabaseListResult - A list of managed databases. type ManagedDatabaseListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ManagedDatabase `json:"value,omitempty" azure:"ro"` + Value []*ManagedDatabase } -// ManagedDatabaseProperties - The managed database's properties. -type ManagedDatabaseProperties struct { - // Whether to auto complete restore of this managed database. - AutoCompleteRestore *bool `json:"autoCompleteRestore,omitempty"` +// ManagedDatabaseMoveDefinition - Contains the information necessary to perform a managed database move. +type ManagedDatabaseMoveDefinition struct { + // REQUIRED; The destination managed database ID + DestinationManagedDatabaseID *string +} - // Collation of the metadata catalog. - CatalogCollation *CatalogCollationType `json:"catalogCollation,omitempty"` +// ManagedDatabaseMoveOperationListResult - List of managed database move operations. +type ManagedDatabaseMoveOperationListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string - // Collation of the managed database. - Collation *string `json:"collation,omitempty"` + // READ-ONLY; Array of results. + Value []*ManagedDatabaseMoveOperationResult +} - // Managed database create mode. PointInTimeRestore: Create a database by restoring a point in time backup of an existing - // database. SourceDatabaseName, SourceManagedInstanceName and PointInTime must be - // specified. RestoreExternalBackup: Create a database by restoring from external backup files. Collation, StorageContainerUri +// ManagedDatabaseMoveOperationResult - A managed database move operation. +type ManagedDatabaseMoveOperationResult struct { + // Resource properties. + Properties *ManagedDatabaseMoveOperationResultProperties + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// ManagedDatabaseMoveOperationResultProperties - Contains the operation result properties for managed database move operation. +type ManagedDatabaseMoveOperationResultProperties struct { + // READ-ONLY; The operation error code. + ErrorCode *int32 + + // READ-ONLY; The operation error description. + ErrorDescription *string + + // READ-ONLY; The operation error severity. + ErrorSeverity *int32 + + // READ-ONLY; Is move operation cancellable. + IsCancellable *bool + + // READ-ONLY; Whether or not the error is a user error. + IsUserError *bool + + // READ-ONLY; The name of operation. + Operation *string + + // READ-ONLY; The friendly name of operation. + OperationFriendlyName *string + + // READ-ONLY; Operation mode. + OperationMode *MoveOperationMode + + // READ-ONLY; Source database name. + SourceDatabaseName *string + + // READ-ONLY; Source Managed Instance resource id. + SourceManagedInstanceID *string + + // READ-ONLY; Source Managed Instance name. + SourceManagedInstanceName *string + + // READ-ONLY; The operation start time. + StartTime *time.Time + + // READ-ONLY; The operation state. + State *ManagementOperationState + + // READ-ONLY; Target database name. + TargetDatabaseName *string + + // READ-ONLY; Target Managed instance resource id. + TargetManagedInstanceID *string + + // READ-ONLY; Target Managed Instance name. + TargetManagedInstanceName *string +} + +// ManagedDatabaseProperties - The managed database's properties. +type ManagedDatabaseProperties struct { + // Whether to auto complete restore of this managed database. + AutoCompleteRestore *bool + + // Collation of the metadata catalog. + CatalogCollation *CatalogCollationType + + // Collation of the managed database. + Collation *string + + // Managed database create mode. PointInTimeRestore: Create a database by restoring a point in time backup of an existing + // database. SourceDatabaseName, SourceManagedInstanceName and PointInTime must be + // specified. RestoreExternalBackup: Create a database by restoring from external backup files. Collation, StorageContainerUri // and StorageContainerSasToken must be specified. Recovery: Creates a database // by restoring a geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database resource ID to // restore. RestoreLongTermRetentionBackup: Create a database by restoring from a // long term retention backup (longTermRetentionBackupResourceId required). - CreateMode *ManagedDatabaseCreateMode `json:"createMode,omitempty"` + CreateMode *ManagedDatabaseCreateMode + + // The restorable cross-subscription dropped database resource id to restore when creating this database. + CrossSubscriptionRestorableDroppedDatabaseID *string + + // The resource identifier of the cross-subscription source database associated with create operation of this database. + CrossSubscriptionSourceDatabaseID *string + + // Target managed instance id used in cross-subscription restore. + CrossSubscriptionTargetManagedInstanceID *string + + // Whether or not this database is a ledger database, which means all tables in the database are ledger tables. Note: the + // value of this property cannot be changed after the database has been created. + IsLedgerOn *bool // Last backup file name for restore of this managed database. - LastBackupName *string `json:"lastBackupName,omitempty"` + LastBackupName *string // The name of the Long Term Retention backup to be used for restore of this managed database. - LongTermRetentionBackupResourceID *string `json:"longTermRetentionBackupResourceId,omitempty"` + LongTermRetentionBackupResourceID *string // The resource identifier of the recoverable database associated with create operation of this database. - RecoverableDatabaseID *string `json:"recoverableDatabaseId,omitempty"` + RecoverableDatabaseID *string // The restorable dropped database resource id to restore when creating this database. - RestorableDroppedDatabaseID *string `json:"restorableDroppedDatabaseId,omitempty"` + RestorableDroppedDatabaseID *string // Conditional. If createMode is PointInTimeRestore, this value is required. Specifies the point in time (ISO8601 format) // of the source database that will be restored to create the new database. - RestorePointInTime *time.Time `json:"restorePointInTime,omitempty"` + RestorePointInTime *time.Time // The resource identifier of the source database associated with create operation of this database. - SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"` + SourceDatabaseID *string + + // 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 - // Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the storage container sas token. - StorageContainerSasToken *string `json:"storageContainerSasToken,omitempty"` + // Conditional. If createMode is RestoreExternalBackup and storageContainerIdentity is not ManagedIdentity, this value is + // required. Specifies the storage container sas token. + StorageContainerSasToken *string // Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the uri of the storage container // where backups for this restore are stored. - StorageContainerURI *string `json:"storageContainerUri,omitempty"` + StorageContainerURI *string // READ-ONLY; Creation date of the database. - CreationDate *time.Time `json:"creationDate,omitempty" azure:"ro"` + CreationDate *time.Time // READ-ONLY; Geo paired region. - DefaultSecondaryLocation *string `json:"defaultSecondaryLocation,omitempty" azure:"ro"` + DefaultSecondaryLocation *string // READ-ONLY; Earliest restore point in time for point in time restore. - EarliestRestorePoint *time.Time `json:"earliestRestorePoint,omitempty" azure:"ro"` + EarliestRestorePoint *time.Time // READ-ONLY; Instance Failover Group resource identifier that this managed database belongs to. - FailoverGroupID *string `json:"failoverGroupId,omitempty" azure:"ro"` + FailoverGroupID *string // READ-ONLY; Status of the database. - Status *ManagedDatabaseStatus `json:"status,omitempty" azure:"ro"` + Status *ManagedDatabaseStatus } -// ManagedDatabaseQueriesClientGetOptions contains the optional parameters for the ManagedDatabaseQueriesClient.Get method. -type ManagedDatabaseQueriesClientGetOptions 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 -// ManagedDatabaseQueriesClientListByQueryOptions contains the optional parameters for the ManagedDatabaseQueriesClient.NewListByQueryPager -// method. -type ManagedDatabaseQueriesClientListByQueryOptions struct { - // End time for observed period. - EndTime *string - // The time step to be used to summarize the metric values. - Interval *QueryTimeGrainType - // Start time for observed period. - StartTime *string -} + // READ-ONLY; First stripe name. + FirstStripeName *string -// ManagedDatabaseRecommendedSensitivityLabelsClientUpdateOptions contains the optional parameters for the ManagedDatabaseRecommendedSensitivityLabelsClient.Update -// method. -type ManagedDatabaseRecommendedSensitivityLabelsClientUpdateOptions struct { - // placeholder for future optional parameters -} + // READ-ONLY; Number of stripes. + NumberOfStripes *int32 + + // READ-ONLY; Last restored file time. + RestoreFinishedTimestampUTC *time.Time + + // READ-ONLY; Last restored file time. + RestoreStartedTimestampUTC *time.Time -// ManagedDatabaseRestoreDetailsClientGetOptions contains the optional parameters for the ManagedDatabaseRestoreDetailsClient.Get -// method. -type ManagedDatabaseRestoreDetailsClientGetOptions struct { - // placeholder for future optional parameters + // READ-ONLY; Backup set status. + Status *string } // ManagedDatabaseRestoreDetailsProperties - The managed database's restore details properties. type ManagedDatabaseRestoreDetailsProperties struct { // READ-ONLY; The reason why restore is in Blocked state. - BlockReason *string `json:"blockReason,omitempty" azure:"ro"` + BlockReason *string + + // READ-ONLY; Current backup type. + CurrentBackupType *string + + // READ-ONLY; Current restore plan size MB. + CurrentRestorePlanSizeMB *int32 + + // READ-ONLY; Current restored size MB. + CurrentRestoredSizeMB *int32 // READ-ONLY; Current restoring file name. - CurrentRestoringFileName *string `json:"currentRestoringFileName,omitempty" azure:"ro"` + CurrentRestoringFileName *string + + // READ-ONLY; Diff backup sets. + DiffBackupSets []*ManagedDatabaseRestoreDetailsBackupSetProperties + + // READ-ONLY; Full backup sets. + FullBackupSets []*ManagedDatabaseRestoreDetailsBackupSetProperties // READ-ONLY; Last restored file name. - LastRestoredFileName *string `json:"lastRestoredFileName,omitempty" azure:"ro"` + LastRestoredFileName *string // READ-ONLY; Last restored file time. - LastRestoredFileTime *time.Time `json:"lastRestoredFileTime,omitempty" azure:"ro"` + LastRestoredFileTime *time.Time // READ-ONLY; Last uploaded file name. - LastUploadedFileName *string `json:"lastUploadedFileName,omitempty" azure:"ro"` + LastUploadedFileName *string // READ-ONLY; Last uploaded file time. - LastUploadedFileTime *time.Time `json:"lastUploadedFileTime,omitempty" azure:"ro"` + LastUploadedFileTime *time.Time + + // READ-ONLY; Log backup sets. + LogBackupSets []*ManagedDatabaseRestoreDetailsBackupSetProperties // READ-ONLY; Number of files detected. - NumberOfFilesDetected *int64 `json:"numberOfFilesDetected,omitempty" azure:"ro"` + NumberOfFilesDetected *int32 + + // READ-ONLY; Number of files queued. + NumberOfFilesQueued *int32 + + // READ-ONLY; Number of files restored. + NumberOfFilesRestored *int32 + + // READ-ONLY; Number of files restoring. + NumberOfFilesRestoring *int32 + + // READ-ONLY; Number of files skipped. + NumberOfFilesSkipped *int32 + + // READ-ONLY; Number of files unrestorable. + NumberOfFilesUnrestorable *int32 // READ-ONLY; Percent completed. - PercentCompleted *float64 `json:"percentCompleted,omitempty" azure:"ro"` + PercentCompleted *int32 // READ-ONLY; Restore status. - Status *string `json:"status,omitempty" azure:"ro"` + Status *string - // READ-ONLY; List of unrestorable files. - UnrestorableFiles []*string `json:"unrestorableFiles,omitempty" azure:"ro"` + // READ-ONLY; Restore type. + Type *string + + // READ-ONLY; Unrestorable files. + UnrestorableFiles []*ManagedDatabaseRestoreDetailsUnrestorableFileProperties } // ManagedDatabaseRestoreDetailsResult - A managed database restore details. type ManagedDatabaseRestoreDetailsResult struct { // Resource properties. - Properties *ManagedDatabaseRestoreDetailsProperties `json:"properties,omitempty"` + Properties *ManagedDatabaseRestoreDetailsProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ManagedDatabaseSchemasClientGetOptions contains the optional parameters for the ManagedDatabaseSchemasClient.Get method. -type ManagedDatabaseSchemasClientGetOptions struct { - // placeholder for future optional parameters -} - -// ManagedDatabaseSchemasClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSchemasClient.NewListByDatabasePager -// method. -type ManagedDatabaseSchemasClientListByDatabaseOptions struct { - // An OData filter expression that filters elements in the collection. - Filter *string -} - -// ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseSecurityAlertPoliciesClient.CreateOrUpdate -// method. -type ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ManagedDatabaseSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ManagedDatabaseSecurityAlertPoliciesClient.Get -// method. -type ManagedDatabaseSecurityAlertPoliciesClientGetOptions struct { - // placeholder for future optional parameters + Type *string } -// ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSecurityAlertPoliciesClient.NewListByDatabasePager -// method. -type ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseOptions struct { - // placeholder for future optional parameters +// ManagedDatabaseRestoreDetailsUnrestorableFileProperties - The managed database's restore details unrestorable file properties. +type ManagedDatabaseRestoreDetailsUnrestorableFileProperties struct { + // READ-ONLY; File name. + Name *string } // ManagedDatabaseSecurityAlertPolicy - A managed database security alert policy. type ManagedDatabaseSecurityAlertPolicy struct { // Resource properties. - Properties *SecurityAlertPolicyProperties `json:"properties,omitempty"` + Properties *SecurityAlertPolicyProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ManagedDatabaseSecurityAlertPolicyListResult - A list of the managed database's security alert policies. type ManagedDatabaseSecurityAlertPolicyListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ManagedDatabaseSecurityAlertPolicy `json:"value,omitempty" azure:"ro"` -} - -// ManagedDatabaseSecurityEventsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSecurityEventsClient.NewListByDatabasePager -// method. -type ManagedDatabaseSecurityEventsClientListByDatabaseOptions struct { - // An OData filter expression that filters elements in the collection. - Filter *string - // The number of elements in the collection to skip. - Skip *int32 - // An opaque token that identifies a starting point in the collection. - Skiptoken *string - // The number of elements to return from the collection. - Top *int32 -} - -// ManagedDatabaseSensitivityLabelsClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.CreateOrUpdate -// method. -type ManagedDatabaseSensitivityLabelsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ManagedDatabaseSensitivityLabelsClientDeleteOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.Delete -// method. -type ManagedDatabaseSensitivityLabelsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ManagedDatabaseSensitivityLabelsClientDisableRecommendationOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.DisableRecommendation -// method. -type ManagedDatabaseSensitivityLabelsClientDisableRecommendationOptions struct { - // placeholder for future optional parameters -} - -// ManagedDatabaseSensitivityLabelsClientEnableRecommendationOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.EnableRecommendation -// method. -type ManagedDatabaseSensitivityLabelsClientEnableRecommendationOptions struct { - // placeholder for future optional parameters -} - -// ManagedDatabaseSensitivityLabelsClientGetOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.Get -// method. -type ManagedDatabaseSensitivityLabelsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.NewListCurrentByDatabasePager -// method. -type ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseOptions struct { - Count *bool - // An OData filter expression that filters elements in the collection. - Filter *string - SkipToken *string -} - -// ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.NewListRecommendedByDatabasePager -// method. -type ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseOptions struct { - // An OData filter expression that filters elements in the collection. - Filter *string - // Specifies whether to include disabled recommendations or not. - IncludeDisabledRecommendations *bool - SkipToken *string -} - -// ManagedDatabaseSensitivityLabelsClientUpdateOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.Update -// method. -type ManagedDatabaseSensitivityLabelsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// ManagedDatabaseTablesClientGetOptions contains the optional parameters for the ManagedDatabaseTablesClient.Get method. -type ManagedDatabaseTablesClientGetOptions struct { - // placeholder for future optional parameters -} - -// ManagedDatabaseTablesClientListBySchemaOptions contains the optional parameters for the ManagedDatabaseTablesClient.NewListBySchemaPager -// method. -type ManagedDatabaseTablesClientListBySchemaOptions struct { - // An OData filter expression that filters elements in the collection. - Filter *string -} - -// ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseTransparentDataEncryptionClient.CreateOrUpdate -// method. -type ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters + Value []*ManagedDatabaseSecurityAlertPolicy } -// ManagedDatabaseTransparentDataEncryptionClientGetOptions contains the optional parameters for the ManagedDatabaseTransparentDataEncryptionClient.Get -// method. -type ManagedDatabaseTransparentDataEncryptionClientGetOptions 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 -// ManagedDatabaseTransparentDataEncryptionClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseTransparentDataEncryptionClient.NewListByDatabasePager -// method. -type ManagedDatabaseTransparentDataEncryptionClientListByDatabaseOptions struct { - // placeholder for future optional parameters + // The move operation mode. + OperationMode *MoveOperationMode } // ManagedDatabaseUpdate - An managed database update. type ManagedDatabaseUpdate struct { // Resource properties. - Properties *ManagedDatabaseProperties `json:"properties,omitempty"` + Properties *ManagedDatabaseProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` -} - -// ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions contains the optional parameters for the -// ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate method. -type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.Delete -// method. -type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.Get -// method. -type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions struct { - // placeholder for future optional parameters -} - -// ManagedDatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentScansClient.BeginInitiateScan -// method. -type ManagedDatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagedDatabaseVulnerabilityAssessmentScansClientExportOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentScansClient.Export -// method. -type ManagedDatabaseVulnerabilityAssessmentScansClientExportOptions struct { - // placeholder for future optional parameters -} - -// ManagedDatabaseVulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentScansClient.Get -// method. -type ManagedDatabaseVulnerabilityAssessmentScansClientGetOptions struct { - // placeholder for future optional parameters -} - -// ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentScansClient.NewListByDatabasePager -// method. -type ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions struct { - // placeholder for future optional parameters -} - -// ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.CreateOrUpdate -// method. -type ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ManagedDatabaseVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.Delete -// method. -type ManagedDatabaseVulnerabilityAssessmentsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ManagedDatabaseVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.Get -// method. -type ManagedDatabaseVulnerabilityAssessmentsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.NewListByDatabasePager -// method. -type ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseOptions struct { - // placeholder for future optional parameters -} - -// ManagedDatabasesClientBeginCompleteRestoreOptions contains the optional parameters for the ManagedDatabasesClient.BeginCompleteRestore -// method. -type ManagedDatabasesClientBeginCompleteRestoreOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagedDatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedDatabasesClient.BeginCreateOrUpdate -// method. -type ManagedDatabasesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagedDatabasesClientBeginDeleteOptions contains the optional parameters for the ManagedDatabasesClient.BeginDelete method. -type ManagedDatabasesClientBeginDeleteOptions 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. - ResumeToken string -} - -// ManagedDatabasesClientGetOptions contains the optional parameters for the ManagedDatabasesClient.Get method. -type ManagedDatabasesClientGetOptions struct { - // placeholder for future optional parameters -} - -// ManagedDatabasesClientListByInstanceOptions contains the optional parameters for the ManagedDatabasesClient.NewListByInstancePager -// method. -type ManagedDatabasesClientListByInstanceOptions struct { - // placeholder for future optional parameters -} - -// ManagedDatabasesClientListInaccessibleByInstanceOptions contains the optional parameters for the ManagedDatabasesClient.NewListInaccessibleByInstancePager -// method. -type ManagedDatabasesClientListInaccessibleByInstanceOptions struct { - // placeholder for future optional parameters + Tags map[string]*string } // ManagedInstance - An Azure SQL managed instance. type ManagedInstance struct { // REQUIRED; Resource location. - Location *string `json:"location,omitempty"` + Location *string // The Azure Active Directory identity of the managed instance. - Identity *ResourceIdentity `json:"identity,omitempty"` + Identity *ResourceIdentity // Resource properties. - Properties *ManagedInstanceProperties `json:"properties,omitempty"` + Properties *ManagedInstanceProperties - // Managed instance SKU. Allowed values for sku.name: GPGen4, GPGen5, BCGen4, BCGen5 - SKU *SKU `json:"sku,omitempty"` + // Managed instance SKU. Allowed values for sku.name: GPGen5, GPG8IM, GPG8IH, BCGen5, BCG8IM, BCG8IH + SKU *SKU // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ManagedInstanceAdministrator - An Azure SQL managed instance administrator. type ManagedInstanceAdministrator struct { // Resource properties. - Properties *ManagedInstanceAdministratorProperties `json:"properties,omitempty"` + Properties *ManagedInstanceAdministratorProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ManagedInstanceAdministratorListResult - A list of managed instance administrators. type ManagedInstanceAdministratorListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ManagedInstanceAdministrator `json:"value,omitempty" azure:"ro"` + Value []*ManagedInstanceAdministrator } // ManagedInstanceAdministratorProperties - The properties of a managed instance administrator. type ManagedInstanceAdministratorProperties struct { // REQUIRED; Type of the managed instance administrator. - AdministratorType *ManagedInstanceAdministratorType `json:"administratorType,omitempty"` + AdministratorType *ManagedInstanceAdministratorType // REQUIRED; Login name of the managed instance administrator. - Login *string `json:"login,omitempty"` + Login *string // REQUIRED; SID (object ID) of the managed instance administrator. - Sid *string `json:"sid,omitempty"` + Sid *string // Tenant ID of the managed instance administrator. - TenantID *string `json:"tenantId,omitempty"` + TenantID *string } -// ManagedInstanceAdministratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.BeginCreateOrUpdate -// method. -type ManagedInstanceAdministratorsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} +// ManagedInstanceAdvancedThreatProtection - A managed instance Advanced Threat Protection. +type ManagedInstanceAdvancedThreatProtection struct { + // Resource properties. + Properties *AdvancedThreatProtectionProperties -// ManagedInstanceAdministratorsClientBeginDeleteOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.BeginDelete -// method. -type ManagedInstanceAdministratorsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string -// ManagedInstanceAdministratorsClientGetOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.Get -// method. -type ManagedInstanceAdministratorsClientGetOptions struct { - // placeholder for future optional parameters + // READ-ONLY; SystemData of AdvancedThreatProtectionResource. + SystemData *SystemData + + // READ-ONLY; Resource type. + Type *string } -// ManagedInstanceAdministratorsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.NewListByInstancePager -// method. -type ManagedInstanceAdministratorsClientListByInstanceOptions struct { - // placeholder for future optional parameters +// 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 + + // READ-ONLY; Array of results. + Value []*ManagedInstanceAdvancedThreatProtection } // ManagedInstanceAzureADOnlyAuthListResult - A list of active directory only authentications. type ManagedInstanceAzureADOnlyAuthListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ManagedInstanceAzureADOnlyAuthentication `json:"value,omitempty" azure:"ro"` + Value []*ManagedInstanceAzureADOnlyAuthentication } // ManagedInstanceAzureADOnlyAuthProperties - Properties of a active directory only authentication for Managed Instance. type ManagedInstanceAzureADOnlyAuthProperties struct { // REQUIRED; Azure Active Directory only Authentication enabled. - AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty"` + AzureADOnlyAuthentication *bool } // ManagedInstanceAzureADOnlyAuthentication - Azure Active Directory only authentication. type ManagedInstanceAzureADOnlyAuthentication struct { // Resource properties. - Properties *ManagedInstanceAzureADOnlyAuthProperties `json:"properties,omitempty"` + Properties *ManagedInstanceAzureADOnlyAuthProperties + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// ManagedInstanceDtc - SQL Managed Instance DTC +type ManagedInstanceDtc struct { + // Resource properties. + Properties *ManagedInstanceDtcProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } -// ManagedInstanceAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceAzureADOnlyAuthenticationsClient.BeginCreateOrUpdate -// method. -type ManagedInstanceAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string +// ManagedInstanceDtcListResult - A list of managed instance's DTCs. +type ManagedInstanceDtcListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string + + // READ-ONLY; Array of results. + Value []*ManagedInstanceDtc } -// ManagedInstanceAzureADOnlyAuthenticationsClientBeginDeleteOptions contains the optional parameters for the ManagedInstanceAzureADOnlyAuthenticationsClient.BeginDelete -// method. -type ManagedInstanceAzureADOnlyAuthenticationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string +// ManagedInstanceDtcProperties - The properties of managed instance DTC. +type ManagedInstanceDtcProperties struct { + // Active status of managed instance DTC. + DtcEnabled *bool + + // External dns suffix search list of managed instance DTC. + ExternalDNSSuffixSearchList []*string + + // Security settings of managed instance DTC. + SecuritySettings *ManagedInstanceDtcSecuritySettings + + // READ-ONLY; Host name dns suffix of managed instance DTC. + DtcHostNameDNSSuffix *string + + // READ-ONLY; Provisioning state of managed instance DTC. + ProvisioningState *ProvisioningState } -// ManagedInstanceAzureADOnlyAuthenticationsClientGetOptions contains the optional parameters for the ManagedInstanceAzureADOnlyAuthenticationsClient.Get -// method. -type ManagedInstanceAzureADOnlyAuthenticationsClientGetOptions struct { - // placeholder for future optional parameters +// ManagedInstanceDtcSecuritySettings - The Security Settings of managed instance DTC. +type ManagedInstanceDtcSecuritySettings struct { + // Allow SNA LU 6.2 Transactions to managed instance DTC. + SnaLu6Point2TransactionsEnabled *bool + + // Transaction Manager communication settings of managed instance DTC. + TransactionManagerCommunicationSettings *ManagedInstanceDtcTransactionManagerCommunicationSettings + + // Default timeout for XA Transactions (in seconds). + XaTransactionsDefaultTimeout *int32 + + // Allow XA Transactions to managed instance DTC. + XaTransactionsEnabled *bool + + // Maximum timeout for XA Transactions (in seconds). + XaTransactionsMaximumTimeout *int32 } -// ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceAzureADOnlyAuthenticationsClient.NewListByInstancePager -// method. -type ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceOptions struct { - // placeholder for future optional parameters +// ManagedInstanceDtcTransactionManagerCommunicationSettings - The Transaction Manager Communication Settings of managed instance +// DTC. +type ManagedInstanceDtcTransactionManagerCommunicationSettings struct { + // Allow Inbound traffic to managed instance DTC. + AllowInboundEnabled *bool + + // Allow Outbound traffic of managed instance DTC. + AllowOutboundEnabled *bool + + // Authentication type of managed instance DTC. + Authentication *string } // ManagedInstanceEditionCapability - The managed server capability type ManagedInstanceEditionCapability struct { // The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` + Reason *string // READ-ONLY; The managed server version name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The status of the capability. - Status *CapabilityStatus `json:"status,omitempty" azure:"ro"` + Status *CapabilityStatus // READ-ONLY; The supported families. - SupportedFamilies []*ManagedInstanceFamilyCapability `json:"supportedFamilies,omitempty" azure:"ro"` + SupportedFamilies []*ManagedInstanceFamilyCapability // READ-ONLY; The list of supported storage capabilities for this edition - SupportedStorageCapabilities []*StorageCapability `json:"supportedStorageCapabilities,omitempty" azure:"ro"` + SupportedStorageCapabilities []*StorageCapability // READ-ONLY; Whether or not zone redundancy is supported for the edition. - ZoneRedundant *bool `json:"zoneRedundant,omitempty" azure:"ro"` + ZoneRedundant *bool } // ManagedInstanceEncryptionProtector - The managed instance encryption protector. type ManagedInstanceEncryptionProtector struct { // Resource properties. - Properties *ManagedInstanceEncryptionProtectorProperties `json:"properties,omitempty"` + Properties *ManagedInstanceEncryptionProtectorProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty" azure:"ro"` + Kind *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ManagedInstanceEncryptionProtectorListResult - A list of managed instance encryption protectors. type ManagedInstanceEncryptionProtectorListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ManagedInstanceEncryptionProtector `json:"value,omitempty" azure:"ro"` + Value []*ManagedInstanceEncryptionProtector } // ManagedInstanceEncryptionProtectorProperties - Properties for an encryption protector execution. type ManagedInstanceEncryptionProtectorProperties struct { // REQUIRED; The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. - ServerKeyType *ServerKeyType `json:"serverKeyType,omitempty"` + ServerKeyType *ServerKeyType // Key auto rotation opt-in flag. Either true or false. - AutoRotationEnabled *bool `json:"autoRotationEnabled,omitempty"` + AutoRotationEnabled *bool // The name of the managed instance key. - ServerKeyName *string `json:"serverKeyName,omitempty"` + ServerKeyName *string // READ-ONLY; Thumbprint of the server key. - Thumbprint *string `json:"thumbprint,omitempty" azure:"ro"` + Thumbprint *string // READ-ONLY; The URI of the server key. - URI *string `json:"uri,omitempty" azure:"ro"` -} - -// ManagedInstanceEncryptionProtectorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceEncryptionProtectorsClient.BeginCreateOrUpdate -// method. -type ManagedInstanceEncryptionProtectorsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagedInstanceEncryptionProtectorsClientBeginRevalidateOptions contains the optional parameters for the ManagedInstanceEncryptionProtectorsClient.BeginRevalidate -// method. -type ManagedInstanceEncryptionProtectorsClientBeginRevalidateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagedInstanceEncryptionProtectorsClientGetOptions contains the optional parameters for the ManagedInstanceEncryptionProtectorsClient.Get -// method. -type ManagedInstanceEncryptionProtectorsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ManagedInstanceEncryptionProtectorsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceEncryptionProtectorsClient.NewListByInstancePager -// method. -type ManagedInstanceEncryptionProtectorsClientListByInstanceOptions struct { - // placeholder for future optional parameters + URI *string } // ManagedInstanceExternalAdministrator - Properties of a active directory administrator. type ManagedInstanceExternalAdministrator struct { // Type of the sever administrator. - AdministratorType *AdministratorType `json:"administratorType,omitempty"` + AdministratorType *AdministratorType // Azure Active Directory only Authentication enabled. - AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty"` + AzureADOnlyAuthentication *bool // Login name of the server administrator. - Login *string `json:"login,omitempty"` + Login *string // Principal Type of the sever administrator. - PrincipalType *PrincipalType `json:"principalType,omitempty"` + PrincipalType *PrincipalType // SID (object ID) of the server administrator. - Sid *string `json:"sid,omitempty"` + Sid *string // Tenant ID of the administrator. - TenantID *string `json:"tenantId,omitempty"` + TenantID *string } // ManagedInstanceFamilyCapability - The managed server family capability. type ManagedInstanceFamilyCapability struct { // The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` + Reason *string // READ-ONLY; Family name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; SKU name. - SKU *string `json:"sku,omitempty" azure:"ro"` + SKU *string // READ-ONLY; The status of the capability. - Status *CapabilityStatus `json:"status,omitempty" azure:"ro"` + Status *CapabilityStatus // READ-ONLY; List of supported license types. - SupportedLicenseTypes []*LicenseTypeCapability `json:"supportedLicenseTypes,omitempty" azure:"ro"` + SupportedLicenseTypes []*LicenseTypeCapability // READ-ONLY; List of supported virtual cores values. - SupportedVcoresValues []*ManagedInstanceVcoresCapability `json:"supportedVcoresValues,omitempty" azure:"ro"` + SupportedVcoresValues []*ManagedInstanceVcoresCapability } // ManagedInstanceKey - A managed instance key. type ManagedInstanceKey struct { // Resource properties. - Properties *ManagedInstanceKeyProperties `json:"properties,omitempty"` + Properties *ManagedInstanceKeyProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty" azure:"ro"` + Kind *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ManagedInstanceKeyListResult - A list of managed instance keys. type ManagedInstanceKeyListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ManagedInstanceKey `json:"value,omitempty" azure:"ro"` + Value []*ManagedInstanceKey } // ManagedInstanceKeyProperties - Properties for a key execution. type ManagedInstanceKeyProperties struct { // REQUIRED; The key type like 'ServiceManaged', 'AzureKeyVault'. - ServerKeyType *ServerKeyType `json:"serverKeyType,omitempty"` + ServerKeyType *ServerKeyType // The URI of the key. If the ServerKeyType is AzureKeyVault, then the URI is required. - URI *string `json:"uri,omitempty"` + URI *string // READ-ONLY; Key auto rotation opt-in flag. Either true or false. - AutoRotationEnabled *bool `json:"autoRotationEnabled,omitempty" azure:"ro"` + AutoRotationEnabled *bool // READ-ONLY; The key creation date. - CreationDate *time.Time `json:"creationDate,omitempty" azure:"ro"` + CreationDate *time.Time // READ-ONLY; Thumbprint of the key. - Thumbprint *string `json:"thumbprint,omitempty" azure:"ro"` -} - -// ManagedInstanceKeysClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceKeysClient.BeginCreateOrUpdate -// method. -type ManagedInstanceKeysClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagedInstanceKeysClientBeginDeleteOptions contains the optional parameters for the ManagedInstanceKeysClient.BeginDelete -// method. -type ManagedInstanceKeysClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagedInstanceKeysClientGetOptions contains the optional parameters for the ManagedInstanceKeysClient.Get method. -type ManagedInstanceKeysClientGetOptions struct { - // placeholder for future optional parameters -} - -// ManagedInstanceKeysClientListByInstanceOptions contains the optional parameters for the ManagedInstanceKeysClient.NewListByInstancePager -// method. -type ManagedInstanceKeysClientListByInstanceOptions struct { - // An OData filter expression that filters elements in the collection. - Filter *string + Thumbprint *string } // ManagedInstanceListResult - A list of managed instances. type ManagedInstanceListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ManagedInstance `json:"value,omitempty" azure:"ro"` + Value []*ManagedInstance } // ManagedInstanceLongTermRetentionBackup - A long term retention backup for a managed database. type ManagedInstanceLongTermRetentionBackup struct { // Resource properties. - Properties *ManagedInstanceLongTermRetentionBackupProperties `json:"properties,omitempty"` + Properties *ManagedInstanceLongTermRetentionBackupProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ManagedInstanceLongTermRetentionBackupListResult - A list of long term retention backups for managed database(s). type ManagedInstanceLongTermRetentionBackupListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ManagedInstanceLongTermRetentionBackup `json:"value,omitempty" azure:"ro"` + Value []*ManagedInstanceLongTermRetentionBackup } // ManagedInstanceLongTermRetentionBackupProperties - Properties of a long term retention backup type ManagedInstanceLongTermRetentionBackupProperties struct { // READ-ONLY; The time the long term retention backup will expire. - BackupExpirationTime *time.Time `json:"backupExpirationTime,omitempty" azure:"ro"` + BackupExpirationTime *time.Time // READ-ONLY; The storage redundancy type of the backup - BackupStorageRedundancy *BackupStorageRedundancy `json:"backupStorageRedundancy,omitempty" azure:"ro"` + BackupStorageRedundancy *BackupStorageRedundancy // READ-ONLY; The time the backup was taken - BackupTime *time.Time `json:"backupTime,omitempty" azure:"ro"` + BackupTime *time.Time // READ-ONLY; The delete time of the database - DatabaseDeletionTime *time.Time `json:"databaseDeletionTime,omitempty" azure:"ro"` + DatabaseDeletionTime *time.Time // READ-ONLY; The name of the database the backup belong to - DatabaseName *string `json:"databaseName,omitempty" azure:"ro"` + DatabaseName *string // READ-ONLY; The create time of the instance. - ManagedInstanceCreateTime *time.Time `json:"managedInstanceCreateTime,omitempty" azure:"ro"` + ManagedInstanceCreateTime *time.Time // READ-ONLY; The managed instance that the backup database belongs to. - ManagedInstanceName *string `json:"managedInstanceName,omitempty" azure:"ro"` -} - -// ManagedInstanceLongTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceLongTermRetentionPoliciesClient.BeginCreateOrUpdate -// method. -type ManagedInstanceLongTermRetentionPoliciesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagedInstanceLongTermRetentionPoliciesClientGetOptions contains the optional parameters for the ManagedInstanceLongTermRetentionPoliciesClient.Get -// method. -type ManagedInstanceLongTermRetentionPoliciesClientGetOptions struct { - // placeholder for future optional parameters -} - -// ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the ManagedInstanceLongTermRetentionPoliciesClient.NewListByDatabasePager -// method. -type ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseOptions struct { - // placeholder for future optional parameters + ManagedInstanceName *string } // ManagedInstanceLongTermRetentionPolicy - A long term retention policy. type ManagedInstanceLongTermRetentionPolicy struct { // Resource properties. - Properties *BaseLongTermRetentionPolicyProperties `json:"properties,omitempty"` + Properties *BaseLongTermRetentionPolicyProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ManagedInstanceLongTermRetentionPolicyListResult - A list of long term retention policies. type ManagedInstanceLongTermRetentionPolicyListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ManagedInstanceLongTermRetentionPolicy `json:"value,omitempty" azure:"ro"` + Value []*ManagedInstanceLongTermRetentionPolicy } // ManagedInstanceMaintenanceConfigurationCapability - The maintenance configuration capability type ManagedInstanceMaintenanceConfigurationCapability struct { // The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` + Reason *string // READ-ONLY; Maintenance configuration name - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The status of the capability. - Status *CapabilityStatus `json:"status,omitempty" azure:"ro"` + Status *CapabilityStatus } // ManagedInstanceOperation - A managed instance operation. type ManagedInstanceOperation struct { // Resource properties. - Properties *ManagedInstanceOperationProperties `json:"properties,omitempty"` + Properties *ManagedInstanceOperationProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ManagedInstanceOperationListResult - The response to a list managed instance operations request type ManagedInstanceOperationListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ManagedInstanceOperation `json:"value,omitempty" azure:"ro"` + Value []*ManagedInstanceOperation } // ManagedInstanceOperationParametersPair - The parameters of a managed instance operation. type ManagedInstanceOperationParametersPair struct { // READ-ONLY; The current parameters. - CurrentParameters *UpsertManagedServerOperationParameters `json:"currentParameters,omitempty" azure:"ro"` + CurrentParameters *UpsertManagedServerOperationParameters // READ-ONLY; The requested parameters. - RequestedParameters *UpsertManagedServerOperationParameters `json:"requestedParameters,omitempty" azure:"ro"` + RequestedParameters *UpsertManagedServerOperationParameters } // ManagedInstanceOperationProperties - The properties of a managed instance operation. type ManagedInstanceOperationProperties struct { // READ-ONLY; The operation description. - Description *string `json:"description,omitempty" azure:"ro"` + Description *string // READ-ONLY; The operation error code. - ErrorCode *int32 `json:"errorCode,omitempty" azure:"ro"` + ErrorCode *int32 // READ-ONLY; The operation error description. - ErrorDescription *string `json:"errorDescription,omitempty" azure:"ro"` + ErrorDescription *string // READ-ONLY; The operation error severity. - ErrorSeverity *int32 `json:"errorSeverity,omitempty" azure:"ro"` + ErrorSeverity *int32 // READ-ONLY; The estimated completion time of the operation. - EstimatedCompletionTime *time.Time `json:"estimatedCompletionTime,omitempty" azure:"ro"` + EstimatedCompletionTime *time.Time // READ-ONLY; Whether the operation can be cancelled. - IsCancellable *bool `json:"isCancellable,omitempty" azure:"ro"` + IsCancellable *bool // READ-ONLY; Whether or not the error is a user error. - IsUserError *bool `json:"isUserError,omitempty" azure:"ro"` + IsUserError *bool // READ-ONLY; The name of the managed instance the operation is being performed on. - ManagedInstanceName *string `json:"managedInstanceName,omitempty" azure:"ro"` + ManagedInstanceName *string // READ-ONLY; The name of operation. - Operation *string `json:"operation,omitempty" azure:"ro"` + Operation *string // READ-ONLY; The friendly name of operation. - OperationFriendlyName *string `json:"operationFriendlyName,omitempty" azure:"ro"` + OperationFriendlyName *string // READ-ONLY; The operation parameters. - OperationParameters *ManagedInstanceOperationParametersPair `json:"operationParameters,omitempty" azure:"ro"` + OperationParameters *ManagedInstanceOperationParametersPair // READ-ONLY; The operation steps. - OperationSteps *ManagedInstanceOperationSteps `json:"operationSteps,omitempty" azure:"ro"` + OperationSteps *ManagedInstanceOperationSteps // READ-ONLY; The percentage of the operation completed. - PercentComplete *int32 `json:"percentComplete,omitempty" azure:"ro"` + PercentComplete *int32 // READ-ONLY; The operation start time. - StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` + StartTime *time.Time // READ-ONLY; The operation state. - State *ManagementOperationState `json:"state,omitempty" azure:"ro"` + State *ManagementOperationState } // ManagedInstanceOperationSteps - The steps of a managed instance operation. type ManagedInstanceOperationSteps struct { // READ-ONLY; The number of current operation steps. - CurrentStep *int32 `json:"currentStep,omitempty" azure:"ro"` + CurrentStep *int32 // READ-ONLY; The operation steps list. - StepsList []*UpsertManagedServerOperationStep `json:"stepsList,omitempty" azure:"ro"` + StepsList []*UpsertManagedServerOperationStep // READ-ONLY; The total number of operation steps. - TotalSteps *string `json:"totalSteps,omitempty" azure:"ro"` -} - -// ManagedInstanceOperationsClientCancelOptions contains the optional parameters for the ManagedInstanceOperationsClient.Cancel -// method. -type ManagedInstanceOperationsClientCancelOptions struct { - // placeholder for future optional parameters -} - -// ManagedInstanceOperationsClientGetOptions contains the optional parameters for the ManagedInstanceOperationsClient.Get -// method. -type ManagedInstanceOperationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ManagedInstanceOperationsClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstanceOperationsClient.NewListByManagedInstancePager -// method. -type ManagedInstanceOperationsClientListByManagedInstanceOptions struct { - // placeholder for future optional parameters + TotalSteps *string } // ManagedInstancePairInfo - Pairs of Managed Instances in the failover group. type ManagedInstancePairInfo struct { // Id of Partner Managed Instance in pair. - PartnerManagedInstanceID *string `json:"partnerManagedInstanceId,omitempty"` + PartnerManagedInstanceID *string // Id of Primary Managed Instance in pair. - PrimaryManagedInstanceID *string `json:"primaryManagedInstanceId,omitempty"` + PrimaryManagedInstanceID *string } // ManagedInstancePecProperty - A private endpoint connection under a managed instance type ManagedInstancePecProperty struct { // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Private endpoint connection properties - Properties *ManagedInstancePrivateEndpointConnectionProperties `json:"properties,omitempty" azure:"ro"` + Properties *ManagedInstancePrivateEndpointConnectionProperties } // ManagedInstancePrivateEndpointConnection - A private endpoint connection type ManagedInstancePrivateEndpointConnection struct { // Resource properties. - Properties *ManagedInstancePrivateEndpointConnectionProperties `json:"properties,omitempty"` + Properties *ManagedInstancePrivateEndpointConnectionProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ManagedInstancePrivateEndpointConnectionListResult - A list of private endpoint connections. type ManagedInstancePrivateEndpointConnectionListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ManagedInstancePrivateEndpointConnection `json:"value,omitempty" azure:"ro"` + Value []*ManagedInstancePrivateEndpointConnection } // ManagedInstancePrivateEndpointConnectionProperties - Properties of a private endpoint connection. type ManagedInstancePrivateEndpointConnectionProperties struct { // Private endpoint which the connection belongs to. - PrivateEndpoint *ManagedInstancePrivateEndpointProperty `json:"privateEndpoint,omitempty"` + PrivateEndpoint *ManagedInstancePrivateEndpointProperty // Connection State of the Private Endpoint Connection. - PrivateLinkServiceConnectionState *ManagedInstancePrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"` + PrivateLinkServiceConnectionState *ManagedInstancePrivateLinkServiceConnectionStateProperty // READ-ONLY; State of the Private Endpoint Connection. - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` -} - -// ManagedInstancePrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstancePrivateEndpointConnectionsClient.BeginCreateOrUpdate -// method. -type ManagedInstancePrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagedInstancePrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the ManagedInstancePrivateEndpointConnectionsClient.BeginDelete -// method. -type ManagedInstancePrivateEndpointConnectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagedInstancePrivateEndpointConnectionsClientGetOptions contains the optional parameters for the ManagedInstancePrivateEndpointConnectionsClient.Get -// method. -type ManagedInstancePrivateEndpointConnectionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstancePrivateEndpointConnectionsClient.NewListByManagedInstancePager -// method. -type ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceOptions struct { - // placeholder for future optional parameters + ProvisioningState *string } type ManagedInstancePrivateEndpointProperty struct { // Resource id of the private endpoint. - ID *string `json:"id,omitempty"` + ID *string } // ManagedInstancePrivateLink - A private link resource type ManagedInstancePrivateLink struct { // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The private link resource group id. - Properties *ManagedInstancePrivateLinkProperties `json:"properties,omitempty" azure:"ro"` + Properties *ManagedInstancePrivateLinkProperties // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ManagedInstancePrivateLinkListResult - A list of private link resources type ManagedInstancePrivateLinkListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ManagedInstancePrivateLink `json:"value,omitempty" azure:"ro"` + Value []*ManagedInstancePrivateLink } // ManagedInstancePrivateLinkProperties - Properties of a private link resource. type ManagedInstancePrivateLinkProperties struct { // READ-ONLY; The private link resource group id. - GroupID *string `json:"groupId,omitempty" azure:"ro"` + GroupID *string // READ-ONLY; The private link resource required member names. - RequiredMembers []*string `json:"requiredMembers,omitempty" azure:"ro"` -} - -// ManagedInstancePrivateLinkResourcesClientGetOptions contains the optional parameters for the ManagedInstancePrivateLinkResourcesClient.Get -// method. -type ManagedInstancePrivateLinkResourcesClientGetOptions struct { - // placeholder for future optional parameters -} - -// ManagedInstancePrivateLinkResourcesClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstancePrivateLinkResourcesClient.NewListByManagedInstancePager -// method. -type ManagedInstancePrivateLinkResourcesClientListByManagedInstanceOptions struct { - // placeholder for future optional parameters + RequiredMembers []*string } type ManagedInstancePrivateLinkServiceConnectionStateProperty struct { // REQUIRED; The private link service connection description. - Description *string `json:"description,omitempty"` + Description *string // REQUIRED; The private link service connection status. - Status *string `json:"status,omitempty"` + Status *string // READ-ONLY; The private link service connection description. - ActionsRequired *string `json:"actionsRequired,omitempty" azure:"ro"` + ActionsRequired *string } // ManagedInstanceProperties - The properties of a managed instance. type ManagedInstanceProperties struct { // Administrator username for the managed instance. Can only be specified when the managed instance is being created (and // is required for creation). - AdministratorLogin *string `json:"administratorLogin,omitempty"` + AdministratorLogin *string // The administrator login password (required for managed instance creation). - AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` + AdministratorLoginPassword *string - // The Azure Active Directory administrator of the server. - Administrators *ManagedInstanceExternalAdministrator `json:"administrators,omitempty"` + // The Azure Active Directory administrator of the instance. This can only be used at instance create time. If used for instance + // update, it will be ignored or it will result in an error. For updates + // individual APIs will need to be used. + Administrators *ManagedInstanceExternalAdministrator // Collation of the managed instance. - Collation *string `json:"collation,omitempty"` + Collation *string // The resource id of another managed instance whose DNS zone this managed instance will share after creation. - DNSZonePartner *string `json:"dnsZonePartner,omitempty"` + DNSZonePartner *string // The Id of the instance pool this managed server belongs to. - InstancePoolID *string `json:"instancePoolId,omitempty"` + InstancePoolID *string // A CMK URI of the key to use for encryption. - KeyID *string `json:"keyId,omitempty"` + KeyID *string // The license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice' // (discounted AHB price for bringing your own SQL licenses). - LicenseType *ManagedInstanceLicenseType `json:"licenseType,omitempty"` + LicenseType *ManagedInstanceLicenseType // Specifies maintenance configuration id to apply to this managed instance. - MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"` + MaintenanceConfigurationID *string // Specifies the mode of database creation. // Default: Regular instance creation. // Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId // must be specified. - ManagedInstanceCreateMode *ManagedServerCreateMode `json:"managedInstanceCreateMode,omitempty"` + ManagedInstanceCreateMode *ManagedServerCreateMode // Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2' - MinimalTLSVersion *string `json:"minimalTlsVersion,omitempty"` + MinimalTLSVersion *string // The resource id of a user assigned identity to be used by default. - PrimaryUserAssignedIdentityID *string `json:"primaryUserAssignedIdentityId,omitempty"` + PrimaryUserAssignedIdentityID *string // Connection type used for connecting to the instance. - ProxyOverride *ManagedInstanceProxyOverride `json:"proxyOverride,omitempty"` + ProxyOverride *ManagedInstanceProxyOverride // Whether or not the public data endpoint is enabled. - PublicDataEndpointEnabled *bool `json:"publicDataEndpointEnabled,omitempty"` + PublicDataEndpointEnabled *bool // The storage account type to be used to store backups for this instance. The options are Local (LocallyRedundantStorage), // Zone (ZoneRedundantStorage), Geo (GeoRedundantStorage) and // GeoZone(GeoZoneRedundantStorage) - RequestedBackupStorageRedundancy *BackupStorageRedundancy `json:"requestedBackupStorageRedundancy,omitempty"` + RequestedBackupStorageRedundancy *BackupStorageRedundancy // Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. - RestorePointInTime *time.Time `json:"restorePointInTime,omitempty"` + RestorePointInTime *time.Time // The managed instance's service principal. - ServicePrincipal *ServicePrincipal `json:"servicePrincipal,omitempty"` + ServicePrincipal *ServicePrincipal // The resource identifier of the source managed instance associated with create operation of this instance. - SourceManagedInstanceID *string `json:"sourceManagedInstanceId,omitempty"` + SourceManagedInstanceID *string - // Storage size in GB. Minimum value: 32. Maximum value: 8192. Increments of 32 GB allowed only. - StorageSizeInGB *int32 `json:"storageSizeInGB,omitempty"` + // Storage size in GB. Minimum value: 32. Maximum value: 16384. Increments of 32 GB allowed only. Maximum value depends on + // the selected hardware family and number of vCores. + StorageSizeInGB *int32 // Subnet resource ID for the managed instance. - SubnetID *string `json:"subnetId,omitempty"` + SubnetID *string // Id of the timezone. Allowed values are timezones supported by Windows. Windows keeps details on supported timezones, including // the id, in registry under KEYLOCALMACHINE\SOFTWARE\Microsoft\Windows @@ -6057,1078 +4805,973 @@ type ManagedInstanceProperties struct { // sys.timezone_info. List of Ids can also be obtained by executing // [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. An example of valid timezone id is "Pacific Standard Time" or // "W. Europe Standard Time". - TimezoneID *string `json:"timezoneId,omitempty"` + TimezoneID *string // The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. - VCores *int32 `json:"vCores,omitempty"` + VCores *int32 // Whether or not the multi-az is enabled. - ZoneRedundant *bool `json:"zoneRedundant,omitempty"` + ZoneRedundant *bool // READ-ONLY; The storage account type used to store backups for this instance. The options are Local (LocallyRedundantStorage), // Zone (ZoneRedundantStorage), Geo (GeoRedundantStorage) and // GeoZone(GeoZoneRedundantStorage) - CurrentBackupStorageRedundancy *BackupStorageRedundancy `json:"currentBackupStorageRedundancy,omitempty" azure:"ro"` + CurrentBackupStorageRedundancy *BackupStorageRedundancy // READ-ONLY; The Dns Zone that the managed instance is in. - DNSZone *string `json:"dnsZone,omitempty" azure:"ro"` + DNSZone *string // READ-ONLY; The fully qualified domain name of the managed instance. - FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty" azure:"ro"` + FullyQualifiedDomainName *string // READ-ONLY; List of private endpoint connections on a managed instance. - PrivateEndpointConnections []*ManagedInstancePecProperty `json:"privateEndpointConnections,omitempty" azure:"ro"` + PrivateEndpointConnections []*ManagedInstancePecProperty // READ-ONLY - ProvisioningState *ManagedInstancePropertiesProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ManagedInstancePropertiesProvisioningState // READ-ONLY; The state of the managed instance. - State *string `json:"state,omitempty" azure:"ro"` + State *string } // ManagedInstanceQuery - Database query. type ManagedInstanceQuery struct { // Resource properties. - Properties *QueryProperties `json:"properties,omitempty"` + Properties *QueryProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ManagedInstanceQueryStatistics - Execution statistics for one particular query type ManagedInstanceQueryStatistics struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*QueryStatistics `json:"value,omitempty" azure:"ro"` -} - -// ManagedInstanceTdeCertificatesClientBeginCreateOptions contains the optional parameters for the ManagedInstanceTdeCertificatesClient.BeginCreate -// method. -type ManagedInstanceTdeCertificatesClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string + Value []*QueryStatistics } // ManagedInstanceUpdate - An update request for an Azure SQL Database managed instance. type ManagedInstanceUpdate struct { // Managed instance identity - Identity *ResourceIdentity `json:"identity,omitempty"` + Identity *ResourceIdentity // Resource properties. - Properties *ManagedInstanceProperties `json:"properties,omitempty"` + Properties *ManagedInstanceProperties // Managed instance sku - SKU *SKU `json:"sku,omitempty"` + SKU *SKU // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // ManagedInstanceVcoresCapability - The managed instance virtual cores capability. type ManagedInstanceVcoresCapability struct { // The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` + Reason *string // READ-ONLY; Included size. - IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty" azure:"ro"` + IncludedMaxSize *MaxSizeCapability // READ-ONLY; True if this service objective is supported for managed instances in an instance pool. - InstancePoolSupported *bool `json:"instancePoolSupported,omitempty" azure:"ro"` + InstancePoolSupported *bool // READ-ONLY; The virtual cores identifier. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; True if this service objective is supported for standalone managed instances. - StandaloneSupported *bool `json:"standaloneSupported,omitempty" azure:"ro"` + StandaloneSupported *bool // READ-ONLY; The status of the capability. - Status *CapabilityStatus `json:"status,omitempty" azure:"ro"` + Status *CapabilityStatus // READ-ONLY; List of supported maintenance configurations - SupportedMaintenanceConfigurations []*ManagedInstanceMaintenanceConfigurationCapability `json:"supportedMaintenanceConfigurations,omitempty" azure:"ro"` + SupportedMaintenanceConfigurations []*ManagedInstanceMaintenanceConfigurationCapability // READ-ONLY; Storage size ranges. - SupportedStorageSizes []*MaxSizeRangeCapability `json:"supportedStorageSizes,omitempty" azure:"ro"` + SupportedStorageSizes []*MaxSizeRangeCapability // READ-ONLY; The virtual cores value. - Value *int32 `json:"value,omitempty" azure:"ro"` + Value *int32 } // ManagedInstanceVersionCapability - The managed instance capability type ManagedInstanceVersionCapability struct { // The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` + Reason *string // READ-ONLY; The server version name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The status of the capability. - Status *CapabilityStatus `json:"status,omitempty" azure:"ro"` + Status *CapabilityStatus // READ-ONLY; The list of supported managed instance editions. - SupportedEditions []*ManagedInstanceEditionCapability `json:"supportedEditions,omitempty" azure:"ro"` + SupportedEditions []*ManagedInstanceEditionCapability // READ-ONLY; The list of supported instance pool editions. - SupportedInstancePoolEditions []*InstancePoolEditionCapability `json:"supportedInstancePoolEditions,omitempty" azure:"ro"` + SupportedInstancePoolEditions []*InstancePoolEditionCapability } // ManagedInstanceVulnerabilityAssessment - A managed instance vulnerability assessment. type ManagedInstanceVulnerabilityAssessment struct { // Resource properties. - Properties *ManagedInstanceVulnerabilityAssessmentProperties `json:"properties,omitempty"` + Properties *ManagedInstanceVulnerabilityAssessmentProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ManagedInstanceVulnerabilityAssessmentListResult - A list of the ManagedInstance's vulnerability assessments. type ManagedInstanceVulnerabilityAssessmentListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ManagedInstanceVulnerabilityAssessment `json:"value,omitempty" azure:"ro"` + Value []*ManagedInstanceVulnerabilityAssessment } // ManagedInstanceVulnerabilityAssessmentProperties - Properties of a managed instance vulnerability assessment. type ManagedInstanceVulnerabilityAssessmentProperties struct { // REQUIRED; A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/). - StorageContainerPath *string `json:"storageContainerPath,omitempty"` + StorageContainerPath *string // The recurring scans settings - RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"` + RecurringScans *VulnerabilityAssessmentRecurringScansProperties // Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' // isn't specified, storageAccountAccessKey is required. Applies only if the // storage account is not behind a Vnet or a firewall - StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` + StorageAccountAccessKey *string // A shared access signature (SAS Key) that has write access to the blob container specified in 'storageContainerPath' parameter. // If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is // required. Applies only if the storage account is not behind a Vnet or a firewall - StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"` -} - -// ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.CreateOrUpdate -// method. -type ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters + StorageContainerSasKey *string } -// ManagedInstanceVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.Delete -// method. -type ManagedInstanceVulnerabilityAssessmentsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ManagedInstanceVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.Get -// method. -type ManagedInstanceVulnerabilityAssessmentsClientGetOptions struct { - // placeholder for future optional parameters -} +// ManagedLedgerDigestUploads - Azure SQL Database ledger digest upload settings. +type ManagedLedgerDigestUploads struct { + // Resource properties. + Properties *ManagedLedgerDigestUploadsProperties -// ManagedInstanceVulnerabilityAssessmentsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.NewListByInstancePager -// method. -type ManagedInstanceVulnerabilityAssessmentsClientListByInstanceOptions struct { - // placeholder for future optional parameters -} + // READ-ONLY; Resource ID. + ID *string -// ManagedInstancesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstancesClient.BeginCreateOrUpdate -// method. -type ManagedInstancesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} + // READ-ONLY; Resource name. + Name *string -// ManagedInstancesClientBeginDeleteOptions contains the optional parameters for the ManagedInstancesClient.BeginDelete method. -type ManagedInstancesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string + // READ-ONLY; Resource type. + Type *string } -// ManagedInstancesClientBeginFailoverOptions contains the optional parameters for the ManagedInstancesClient.BeginFailover -// method. -type ManagedInstancesClientBeginFailoverOptions struct { - // The type of replica to be failed over. - ReplicaType *ReplicaType - // Resumes the LRO from the provided token. - ResumeToken string -} +// ManagedLedgerDigestUploadsListResult - A list of ledger digest upload settings. +type ManagedLedgerDigestUploadsListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string -// ManagedInstancesClientBeginUpdateOptions contains the optional parameters for the ManagedInstancesClient.BeginUpdate method. -type ManagedInstancesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string + // READ-ONLY; Array of results. + Value []*ManagedLedgerDigestUploads } -// ManagedInstancesClientGetOptions contains the optional parameters for the ManagedInstancesClient.Get method. -type ManagedInstancesClientGetOptions struct { - // The child resources to include in the response. - Expand *string -} +// ManagedLedgerDigestUploadsProperties - The properties of a database ledger digest upload settings. +type ManagedLedgerDigestUploadsProperties struct { + // The digest storage endpoint, which must be either an Azure blob storage endpoint or an URI for Azure Confidential Ledger. + DigestStorageEndpoint *string -// ManagedInstancesClientListByInstancePoolOptions contains the optional parameters for the ManagedInstancesClient.NewListByInstancePoolPager -// method. -type ManagedInstancesClientListByInstancePoolOptions struct { - // The child resources to include in the response. - Expand *string + // READ-ONLY; Specifies the state of ledger digest upload. + State *ManagedLedgerDigestUploadsState } -// ManagedInstancesClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstancesClient.NewListByManagedInstancePager -// method. -type ManagedInstancesClientListByManagedInstanceOptions struct { - // Aggregation function to be used, default value is 'sum' - AggregationFunction *AggregationFunctionType - // Comma separated list of databases to be included into search. All DB's are included if this parameter is not specified. - Databases *string - // End time for observed period. - EndTime *string - // The time step to be used to summarize the metric values. Default value is PT1H - Interval *QueryTimeGrainType - // How many 'top queries' to return. Default is 5. - NumberOfQueries *int32 - // Metric to be used for ranking top queries. Default is 'cpu' - ObservationMetric *MetricType - // Start time for observed period. - StartTime *string -} +// ManagedServerDNSAlias - A managed server DNS alias. +type ManagedServerDNSAlias struct { + // Resource properties. + Properties *ManagedServerDNSAliasProperties -// ManagedInstancesClientListByResourceGroupOptions contains the optional parameters for the ManagedInstancesClient.NewListByResourceGroupPager -// method. -type ManagedInstancesClientListByResourceGroupOptions struct { - // The child resources to include in the response. - Expand *string -} + // READ-ONLY; Resource ID. + ID *string -// ManagedInstancesClientListOptions contains the optional parameters for the ManagedInstancesClient.NewListPager method. -type ManagedInstancesClientListOptions struct { - // The child resources to include in the response. - Expand *string -} + // READ-ONLY; Resource name. + Name *string -// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional -// parameters for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate method. -type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string + // READ-ONLY; Resource type. + Type *string } -// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginUpdateOptions contains the optional parameters -// for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.BeginUpdate method. -type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string +// 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 } -// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetOptions contains the optional parameters for the -// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.Get method. -type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetOptions struct { - // placeholder for future optional parameters +// ManagedServerDNSAliasCreation - A managed server dns alias creation request. +type ManagedServerDNSAliasCreation struct { + // Whether or not DNS record should be created for this alias. + CreateDNSRecord *bool } -// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseOptions contains the -// optional parameters for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.NewListByRestorableDroppedDatabasePager -// method. -type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseOptions struct { - // placeholder for future optional parameters -} +// ManagedServerDNSAliasListResult - A list of managed server DNS aliases. +type ManagedServerDNSAliasListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string -// ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedServerSecurityAlertPoliciesClient.BeginCreateOrUpdate -// method. -type ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string + // READ-ONLY; Array of results. + Value []*ManagedServerDNSAlias } -// ManagedServerSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ManagedServerSecurityAlertPoliciesClient.Get -// method. -type ManagedServerSecurityAlertPoliciesClientGetOptions struct { - // placeholder for future optional parameters -} +// ManagedServerDNSAliasProperties - Properties of a managed server DNS alias. +type ManagedServerDNSAliasProperties struct { + // READ-ONLY; The fully qualified DNS record for managed server alias + AzureDNSRecord *string -// ManagedServerSecurityAlertPoliciesClientListByInstanceOptions contains the optional parameters for the ManagedServerSecurityAlertPoliciesClient.NewListByInstancePager -// method. -type ManagedServerSecurityAlertPoliciesClientListByInstanceOptions struct { - // placeholder for future optional parameters + // READ-ONLY; The fully qualified public DNS record for managed server alias + PublicAzureDNSRecord *string } // ManagedServerSecurityAlertPolicy - A managed server security alert policy. type ManagedServerSecurityAlertPolicy struct { // Resource properties. - Properties *SecurityAlertsPolicyProperties `json:"properties,omitempty"` + Properties *SecurityAlertsPolicyProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; SystemData of SecurityAlertPolicyResource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ManagedServerSecurityAlertPolicyListResult - A list of the managed Server's security alert policies. type ManagedServerSecurityAlertPolicyListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ManagedServerSecurityAlertPolicy `json:"value,omitempty" azure:"ro"` + Value []*ManagedServerSecurityAlertPolicy } // ManagedTransparentDataEncryption - A managed database transparent data encryption state. type ManagedTransparentDataEncryption struct { // Resource properties. - Properties *ManagedTransparentDataEncryptionProperties `json:"properties,omitempty"` + Properties *ManagedTransparentDataEncryptionProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ManagedTransparentDataEncryptionListResult - A list of managed transparent data encryptions type ManagedTransparentDataEncryptionListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ManagedTransparentDataEncryption `json:"value,omitempty" azure:"ro"` + Value []*ManagedTransparentDataEncryption } // ManagedTransparentDataEncryptionProperties - Properties of a transparent data encryption. type ManagedTransparentDataEncryptionProperties struct { // REQUIRED; Specifies the state of the transparent data encryption. - State *TransparentDataEncryptionState `json:"state,omitempty"` + State *TransparentDataEncryptionState } // MaxSizeCapability - The maximum size capability. type MaxSizeCapability struct { // READ-ONLY; The maximum size limit (see 'unit' for the units). - Limit *int32 `json:"limit,omitempty" azure:"ro"` + Limit *int32 // READ-ONLY; The units that the limit is expressed in. - Unit *MaxSizeUnit `json:"unit,omitempty" azure:"ro"` + Unit *MaxSizeUnit } // MaxSizeRangeCapability - The maximum size range capability. type MaxSizeRangeCapability struct { // The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` + Reason *string // READ-ONLY; Size of transaction log. - LogSize *LogSizeCapability `json:"logSize,omitempty" azure:"ro"` + LogSize *LogSizeCapability // READ-ONLY; Maximum value. - MaxValue *MaxSizeCapability `json:"maxValue,omitempty" azure:"ro"` + MaxValue *MaxSizeCapability // READ-ONLY; Minimum value. - MinValue *MaxSizeCapability `json:"minValue,omitempty" azure:"ro"` + MinValue *MaxSizeCapability // READ-ONLY; Scale/step size for discrete values between the minimum value and the maximum value. - ScaleSize *MaxSizeCapability `json:"scaleSize,omitempty" azure:"ro"` + ScaleSize *MaxSizeCapability // READ-ONLY; The status of the capability. - Status *CapabilityStatus `json:"status,omitempty" azure:"ro"` + Status *CapabilityStatus } // Metric - Database metrics. type Metric struct { // READ-ONLY; The end time for the metric (ISO-8601 format). - EndTime *time.Time `json:"endTime,omitempty" azure:"ro"` + EndTime *time.Time // READ-ONLY; The metric values for the specified time window and timestep. - MetricValues []*MetricValue `json:"metricValues,omitempty" azure:"ro"` + MetricValues []*MetricValue // READ-ONLY; The name information for the metric. - Name *MetricName `json:"name,omitempty" azure:"ro"` + Name *MetricName // READ-ONLY; The start time for the metric (ISO-8601 format). - StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` + StartTime *time.Time // READ-ONLY; The time step to be used to summarize the metric values. - TimeGrain *string `json:"timeGrain,omitempty" azure:"ro"` + TimeGrain *string // READ-ONLY; The unit of the metric. - Unit *UnitType `json:"unit,omitempty" azure:"ro"` + Unit *UnitType } // MetricAvailability - A metric availability value. type MetricAvailability struct { // READ-ONLY; The length of retention for the database metric. - Retention *string `json:"retention,omitempty" azure:"ro"` + Retention *string // READ-ONLY; The granularity of the database metric. - TimeGrain *string `json:"timeGrain,omitempty" azure:"ro"` + TimeGrain *string } // MetricDefinition - A database metric definition. type MetricDefinition struct { // READ-ONLY; The list of database metric availabilities for the metric. - MetricAvailabilities []*MetricAvailability `json:"metricAvailabilities,omitempty" azure:"ro"` + MetricAvailabilities []*MetricAvailability // READ-ONLY; The name information for the metric. - Name *MetricName `json:"name,omitempty" azure:"ro"` + Name *MetricName // READ-ONLY; The primary aggregation type defining how metric values are displayed. - PrimaryAggregationType *PrimaryAggregationType `json:"primaryAggregationType,omitempty" azure:"ro"` + PrimaryAggregationType *PrimaryAggregationType // READ-ONLY; The resource uri of the database. - ResourceURI *string `json:"resourceUri,omitempty" azure:"ro"` + ResourceURI *string // READ-ONLY; The unit of the metric. - Unit *UnitDefinitionType `json:"unit,omitempty" azure:"ro"` + Unit *UnitDefinitionType } // MetricDefinitionListResult - The response to a list database metric definitions request. type MetricDefinitionListResult struct { // REQUIRED; The list of metric definitions for the database. - Value []*MetricDefinition `json:"value,omitempty"` + Value []*MetricDefinition } // MetricListResult - The response to a list database metrics request. type MetricListResult struct { // REQUIRED; The list of metrics for the database. - Value []*Metric `json:"value,omitempty"` + Value []*Metric } // MetricName - A database metric name. type MetricName struct { // READ-ONLY; The friendly name of the database metric. - LocalizedValue *string `json:"localizedValue,omitempty" azure:"ro"` + LocalizedValue *string // READ-ONLY; The name of the database metric. - Value *string `json:"value,omitempty" azure:"ro"` + Value *string } // MetricValue - Represents database metrics. type MetricValue struct { // READ-ONLY; The average value of the metric. - Average *float64 `json:"average,omitempty" azure:"ro"` + Average *float64 // READ-ONLY; The number of values for the metric. - Count *int32 `json:"count,omitempty" azure:"ro"` + Count *int32 // READ-ONLY; The max value of the metric. - Maximum *float64 `json:"maximum,omitempty" azure:"ro"` + Maximum *float64 // READ-ONLY; The min value of the metric. - Minimum *float64 `json:"minimum,omitempty" azure:"ro"` + Minimum *float64 // READ-ONLY; The metric timestamp (ISO-8601 format). - Timestamp *time.Time `json:"timestamp,omitempty" azure:"ro"` + Timestamp *time.Time // READ-ONLY; The total value of the metric. - Total *float64 `json:"total,omitempty" azure:"ro"` + Total *float64 } // MinCapacityCapability - The min capacity capability type MinCapacityCapability struct { // The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` + Reason *string // READ-ONLY; The status of the capability. - Status *CapabilityStatus `json:"status,omitempty" azure:"ro"` + Status *CapabilityStatus // READ-ONLY; Min capacity value - Value *float64 `json:"value,omitempty" azure:"ro"` + Value *float64 } // Name - ARM Usage Name type Name struct { // Usage name localized value. - LocalizedValue *string `json:"localizedValue,omitempty"` + LocalizedValue *string // Usage name value - Value *string `json:"value,omitempty"` + Value *string } // NetworkIsolationSettings - Contains the ARM resources for which to create private endpoint connection. type NetworkIsolationSettings struct { // The resource id for the SQL server which is the target of this request. If set, private endpoint connection will be created // for the SQL server. Must match server which is target of the operation. - SQLServerResourceID *string `json:"sqlServerResourceId,omitempty"` + SQLServerResourceID *string // The resource id for the storage account used to store BACPAC file. If set, private endpoint connection will be created // for the storage account. Must match storage account used for StorageUri // parameter. - StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"` + StorageAccountResourceID *string } // Operation - SQL REST API operation definition. type Operation struct { // READ-ONLY; The localized display information for this particular operation / action. - Display *OperationDisplay `json:"display,omitempty" azure:"ro"` + Display *OperationDisplay // READ-ONLY; The name of the operation being performed on this particular object. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The intended executor of the operation. - Origin *OperationOrigin `json:"origin,omitempty" azure:"ro"` + Origin *OperationOrigin // READ-ONLY; Additional descriptions for the operation. - Properties map[string]any `json:"properties,omitempty" azure:"ro"` + Properties map[string]any } // OperationDisplay - Display metadata associated with the operation. type OperationDisplay struct { // READ-ONLY; The localized friendly description for the operation. - Description *string `json:"description,omitempty" azure:"ro"` + Description *string // READ-ONLY; The localized friendly name for the operation. - Operation *string `json:"operation,omitempty" azure:"ro"` + Operation *string // READ-ONLY; The localized friendly form of the resource provider name. - Provider *string `json:"provider,omitempty" azure:"ro"` + Provider *string // READ-ONLY; The localized friendly form of the resource type related to this action/operation. - Resource *string `json:"resource,omitempty" azure:"ro"` + Resource *string } // OperationImpact - The impact of an operation, both in absolute and relative terms. type OperationImpact struct { // READ-ONLY; The absolute impact to dimension. - ChangeValueAbsolute *float64 `json:"changeValueAbsolute,omitempty" azure:"ro"` + ChangeValueAbsolute *float64 // READ-ONLY; The relative impact to dimension (null if not applicable) - ChangeValueRelative *float64 `json:"changeValueRelative,omitempty" azure:"ro"` + ChangeValueRelative *float64 // READ-ONLY; The name of the impact dimension. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The unit in which estimated impact to dimension is measured. - Unit *string `json:"unit,omitempty" azure:"ro"` + Unit *string } // OperationListResult - Result of the request to list SQL operations. type OperationListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*Operation `json:"value,omitempty" azure:"ro"` + Value []*Operation +} + +// OutboundEnvironmentEndpoint - An endpoint that the managed instance service requires outbound network access to. +type OutboundEnvironmentEndpoint struct { + // READ-ONLY; The type of service accessed by the managed instance service, e.g., Azure Storage, Azure Active Directory, etc. + Category *string + + // READ-ONLY; The endpoints that the managed instance service communicates with in order to function correctly. + Endpoints []*EndpointDependency } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters +// OutboundEnvironmentEndpointCollection - A collection of endpoints that the managed instance service requires outbound network +// access to. +type OutboundEnvironmentEndpointCollection struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string + + // READ-ONLY; Array of results. + Value []*OutboundEnvironmentEndpoint } // OutboundFirewallRule - An Azure SQL DB Server Outbound Firewall Rule. type OutboundFirewallRule struct { // Resource properties. - Properties *OutboundFirewallRuleProperties `json:"properties,omitempty"` + Properties *OutboundFirewallRuleProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // OutboundFirewallRuleListResult - A list of outbound rules. type OutboundFirewallRuleListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*OutboundFirewallRule `json:"value,omitempty" azure:"ro"` + Value []*OutboundFirewallRule } // OutboundFirewallRuleProperties - The properties of an outbound firewall rule. type OutboundFirewallRuleProperties struct { // READ-ONLY; The state of the outbound rule. - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` -} - -// OutboundFirewallRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the OutboundFirewallRulesClient.BeginCreateOrUpdate -// method. -type OutboundFirewallRulesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// OutboundFirewallRulesClientBeginDeleteOptions contains the optional parameters for the OutboundFirewallRulesClient.BeginDelete -// method. -type OutboundFirewallRulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// OutboundFirewallRulesClientGetOptions contains the optional parameters for the OutboundFirewallRulesClient.Get method. -type OutboundFirewallRulesClientGetOptions struct { - // placeholder for future optional parameters -} - -// OutboundFirewallRulesClientListByServerOptions contains the optional parameters for the OutboundFirewallRulesClient.NewListByServerPager -// method. -type OutboundFirewallRulesClientListByServerOptions struct { - // placeholder for future optional parameters + ProvisioningState *string } // PartnerInfo - Partner server information for the failover group. type PartnerInfo struct { // REQUIRED; Resource identifier of the partner server. - ID *string `json:"id,omitempty"` + ID *string // READ-ONLY; Geo location of the partner server. - Location *string `json:"location,omitempty" azure:"ro"` + Location *string // READ-ONLY; Replication role of the partner server. - ReplicationRole *FailoverGroupReplicationRole `json:"replicationRole,omitempty" azure:"ro"` + ReplicationRole *FailoverGroupReplicationRole } // PartnerRegionInfo - Partner region information for the failover group. type PartnerRegionInfo struct { // Geo location of the partner managed instances. - Location *string `json:"location,omitempty"` + Location *string // READ-ONLY; Replication role of the partner managed instances. - ReplicationRole *InstanceFailoverGroupReplicationRole `json:"replicationRole,omitempty" azure:"ro"` + ReplicationRole *InstanceFailoverGroupReplicationRole } // PerformanceLevelCapability - The performance level capability. type PerformanceLevelCapability struct { // READ-ONLY; Unit type used to measure performance level. - Unit *PerformanceLevelUnit `json:"unit,omitempty" azure:"ro"` + Unit *PerformanceLevelUnit // READ-ONLY; Performance level value. - Value *float64 `json:"value,omitempty" azure:"ro"` + Value *float64 } // PrivateEndpointConnection - A private endpoint connection type PrivateEndpointConnection struct { // Resource properties. - Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + Properties *PrivateEndpointConnectionProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // PrivateEndpointConnectionListResult - A list of private endpoint connections. type PrivateEndpointConnectionListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*PrivateEndpointConnection `json:"value,omitempty" azure:"ro"` + Value []*PrivateEndpointConnection } // PrivateEndpointConnectionProperties - Properties of a private endpoint connection. type PrivateEndpointConnectionProperties struct { // Private endpoint which the connection belongs to. - PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"` + PrivateEndpoint *PrivateEndpointProperty // Connection state of the private endpoint connection. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty + + // READ-ONLY; Group IDs. + GroupIDs []*string // READ-ONLY; State of the private endpoint connection. - ProvisioningState *PrivateEndpointProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *PrivateEndpointProvisioningState } // PrivateEndpointConnectionRequestStatus - Contains the private endpoint connection requests status. type PrivateEndpointConnectionRequestStatus struct { // READ-ONLY; The connection name for the private endpoint. - PrivateEndpointConnectionName *string `json:"privateEndpointConnectionName,omitempty" azure:"ro"` + PrivateEndpointConnectionName *string // READ-ONLY; Resource id for which the private endpoint is created. - PrivateLinkServiceID *string `json:"privateLinkServiceId,omitempty" azure:"ro"` + PrivateLinkServiceID *string // READ-ONLY; Status of this private endpoint connection. - Status *string `json:"status,omitempty" azure:"ro"` -} - -// PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate -// method. -type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete -// method. -type PrivateEndpointConnectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get -// method. -type PrivateEndpointConnectionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// PrivateEndpointConnectionsClientListByServerOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByServerPager -// method. -type PrivateEndpointConnectionsClientListByServerOptions struct { - // placeholder for future optional parameters + Status *string } type PrivateEndpointProperty struct { // Resource id of the private endpoint. - ID *string `json:"id,omitempty"` + ID *string } // PrivateLinkResource - A private link resource type PrivateLinkResource struct { // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The private link resource group id. - Properties *PrivateLinkResourceProperties `json:"properties,omitempty" azure:"ro"` + Properties *PrivateLinkResourceProperties // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // PrivateLinkResourceListResult - A list of private link resources type PrivateLinkResourceListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*PrivateLinkResource `json:"value,omitempty" azure:"ro"` + Value []*PrivateLinkResource } // PrivateLinkResourceProperties - Properties of a private link resource. type PrivateLinkResourceProperties struct { // READ-ONLY; The private link resource group id. - GroupID *string `json:"groupId,omitempty" azure:"ro"` + GroupID *string // READ-ONLY; The private link resource required member names. - RequiredMembers []*string `json:"requiredMembers,omitempty" azure:"ro"` + RequiredMembers []*string // READ-ONLY; The private link resource required zone names. - RequiredZoneNames []*string `json:"requiredZoneNames,omitempty" azure:"ro"` -} - -// PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get method. -type PrivateLinkResourcesClientGetOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkResourcesClientListByServerOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByServerPager -// method. -type PrivateLinkResourcesClientListByServerOptions struct { - // placeholder for future optional parameters + RequiredZoneNames []*string } type PrivateLinkServiceConnectionStateProperty struct { // REQUIRED; The private link service connection description. - Description *string `json:"description,omitempty"` + Description *string // REQUIRED; The private link service connection status. - Status *PrivateLinkServiceConnectionStateStatus `json:"status,omitempty"` + Status *PrivateLinkServiceConnectionStateStatus // READ-ONLY; The actions required for private link service connection. - ActionsRequired *PrivateLinkServiceConnectionStateActionsRequire `json:"actionsRequired,omitempty" azure:"ro"` + ActionsRequired *PrivateLinkServiceConnectionStateActionsRequire } // ProxyResource - ARM proxy resource. type ProxyResource struct { // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ProxyResourceWithWritableName - ARM proxy resource. type ProxyResourceWithWritableName struct { // Resource name. - Name *string `json:"name,omitempty"` + Name *string // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string +} + +// QueryCheck - SQL Vulnerability Assessment query check object. +type QueryCheck struct { + // READ-ONLY; SQL Vulnerability Assessment column names of query expected result. + ColumnNames []*string + + // READ-ONLY; SQL Vulnerability Assessment query expected result. + ExpectedResult [][]*string + + // READ-ONLY; SQL Vulnerability Assessment rule query. + Query *string } // QueryMetricInterval - Properties of a query metrics interval. type QueryMetricInterval struct { // List of metric objects for this interval - Metrics []*QueryMetricProperties `json:"metrics,omitempty"` + Metrics []*QueryMetricProperties // READ-ONLY; Execution count of a query in this interval. - ExecutionCount *int64 `json:"executionCount,omitempty" azure:"ro"` + ExecutionCount *int64 // READ-ONLY; The start time for the metric interval (ISO-8601 format). - IntervalStartTime *string `json:"intervalStartTime,omitempty" azure:"ro"` + IntervalStartTime *string // READ-ONLY; Interval type (length). - IntervalType *QueryTimeGrainType `json:"intervalType,omitempty" azure:"ro"` + IntervalType *QueryTimeGrainType } // QueryMetricProperties - Properties of a topquery metric in one interval. type QueryMetricProperties struct { // READ-ONLY; Metric value when avg() aggregate function is used over the interval. - Avg *float64 `json:"avg,omitempty" azure:"ro"` + Avg *float64 // READ-ONLY; The UI appropriate name for the metric. - DisplayName *string `json:"displayName,omitempty" azure:"ro"` + DisplayName *string // READ-ONLY; Metric value when max() aggregate function is used over the interval. - Max *float64 `json:"max,omitempty" azure:"ro"` + Max *float64 // READ-ONLY; Metric value when min() aggregate function is used over the interval. - Min *float64 `json:"min,omitempty" azure:"ro"` + Min *float64 // READ-ONLY; The name information for the metric. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metric value when stdev aggregate function is used over the interval. - Stdev *float64 `json:"stdev,omitempty" azure:"ro"` + Stdev *float64 // READ-ONLY; Metric value when sum() aggregate function is used over the interval. - Sum *float64 `json:"sum,omitempty" azure:"ro"` + Sum *float64 // READ-ONLY; The unit of the metric. - Unit *QueryMetricUnitType `json:"unit,omitempty" azure:"ro"` + Unit *QueryMetricUnitType // READ-ONLY; The value of the metric. - Value *float64 `json:"value,omitempty" azure:"ro"` + Value *float64 } // QueryProperties - Properties of a database query. type QueryProperties struct { // Query text. - QueryText *string `json:"queryText,omitempty"` + QueryText *string } type QueryStatistics struct { // Resource properties. - Properties *QueryStatisticsProperties `json:"properties,omitempty"` + Properties *QueryStatisticsProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // QueryStatisticsProperties - Properties of a query execution statistics. type QueryStatisticsProperties struct { // List of intervals with appropriate metric data - Intervals []*QueryMetricInterval `json:"intervals,omitempty"` + Intervals []*QueryMetricInterval // READ-ONLY; Database name of the database in which this query was executed. - DatabaseName *string `json:"databaseName,omitempty" azure:"ro"` + DatabaseName *string // READ-ONLY; The end time for the metric (ISO-8601 format). - EndTime *string `json:"endTime,omitempty" azure:"ro"` + EndTime *string // READ-ONLY; Unique query id (unique within one database). - QueryID *string `json:"queryId,omitempty" azure:"ro"` + QueryID *string // READ-ONLY; The start time for the metric (ISO-8601 format). - StartTime *string `json:"startTime,omitempty" azure:"ro"` + StartTime *string } // ReadScaleCapability - The read scale capability. type ReadScaleCapability struct { // The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` + Reason *string // READ-ONLY; The maximum number of read scale replicas. - MaxNumberOfReplicas *int32 `json:"maxNumberOfReplicas,omitempty" azure:"ro"` + MaxNumberOfReplicas *int32 // READ-ONLY; The status of the capability. - Status *CapabilityStatus `json:"status,omitempty" azure:"ro"` + Status *CapabilityStatus } // RecommendedAction - Database, Server or Elastic Pool Recommended Action. type RecommendedAction struct { // Resource properties. - Properties *RecommendedActionProperties `json:"properties,omitempty"` + Properties *RecommendedActionProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource kind. - Kind *string `json:"kind,omitempty" azure:"ro"` + Kind *string // READ-ONLY; Resource location. - Location *string `json:"location,omitempty" azure:"ro"` + Location *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // RecommendedActionErrorInfo - Contains error information for an Azure SQL Database, Server or Elastic Pool Recommended Action. type RecommendedActionErrorInfo struct { // READ-ONLY; Gets the reason why the recommended action was put to error state. e.g., DatabaseHasQdsOff, IndexAlreadyExists - ErrorCode *string `json:"errorCode,omitempty" azure:"ro"` + ErrorCode *string // READ-ONLY; Gets whether the error could be ignored and recommended action could be retried. Possible values are: Yes/No - IsRetryable *IsRetryable `json:"isRetryable,omitempty" azure:"ro"` + IsRetryable *IsRetryable } // RecommendedActionImpactRecord - Contains information of estimated or observed impact on various metrics for an Azure SQL // Database, Server or Elastic Pool Recommended Action. type RecommendedActionImpactRecord struct { // READ-ONLY; Gets the absolute value of this dimension if applicable. e.g., Number of Queries affected - AbsoluteValue *float64 `json:"absoluteValue,omitempty" azure:"ro"` + AbsoluteValue *float64 // READ-ONLY; Gets the absolute change in the value of this dimension. e.g., Absolute Disk space change in Megabytes - ChangeValueAbsolute *float64 `json:"changeValueAbsolute,omitempty" azure:"ro"` + ChangeValueAbsolute *float64 // READ-ONLY; Gets the relative change in the value of this dimension. e.g., Relative Disk space change in Percentage - ChangeValueRelative *float64 `json:"changeValueRelative,omitempty" azure:"ro"` + ChangeValueRelative *float64 // READ-ONLY; Gets the name of the impact dimension. e.g., CPUChange, DiskSpaceChange, NumberOfQueriesAffected. - DimensionName *string `json:"dimensionName,omitempty" azure:"ro"` + DimensionName *string // READ-ONLY; Gets the name of the impact dimension. e.g., CPUChange, DiskSpaceChange, NumberOfQueriesAffected. - Unit *string `json:"unit,omitempty" azure:"ro"` + Unit *string } // RecommendedActionImplementationInfo - Contains information for manual implementation for an Azure SQL Database, Server // or Elastic Pool Recommended Action. type RecommendedActionImplementationInfo struct { // READ-ONLY; Gets the method in which this recommended action can be manually implemented. e.g., TSql, AzurePowerShell. - Method *ImplementationMethod `json:"method,omitempty" azure:"ro"` + Method *ImplementationMethod // READ-ONLY; Gets the manual implementation script. e.g., T-SQL script that could be executed on the database. - Script *string `json:"script,omitempty" azure:"ro"` + Script *string } // RecommendedActionMetricInfo - Contains time series of various impacted metrics for an Azure SQL Database, Server or Elastic // Pool Recommended Action. type RecommendedActionMetricInfo struct { // READ-ONLY; Gets the name of the metric. e.g., CPU, Number of Queries. - MetricName *string `json:"metricName,omitempty" azure:"ro"` + MetricName *string // READ-ONLY; Gets the start time of time interval given by this MetricInfo. - StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` + StartTime *time.Time // READ-ONLY; Gets the duration of time interval for the value given by this MetricInfo. e.g., PT1H (1 hour) - TimeGrain *string `json:"timeGrain,omitempty" azure:"ro"` + TimeGrain *string // READ-ONLY; Gets the unit in which metric is measured. e.g., DTU, Frequency - Unit *string `json:"unit,omitempty" azure:"ro"` + Unit *string // READ-ONLY; Gets the value of the metric in the time interval given by this MetricInfo. - Value *float64 `json:"value,omitempty" azure:"ro"` + Value *float64 } // RecommendedActionProperties - Properties for a Database, Server or Elastic Pool Recommended Action. type RecommendedActionProperties struct { // REQUIRED; Gets the info of the current state the recommended action is in. - State *RecommendedActionStateInfo `json:"state,omitempty"` + State *RecommendedActionStateInfo // READ-ONLY; Gets additional details specific to this recommended action. - Details map[string]any `json:"details,omitempty" azure:"ro"` + Details map[string]any // READ-ONLY; Gets the error details if and why this recommended action is put to error state. - ErrorDetails *RecommendedActionErrorInfo `json:"errorDetails,omitempty" azure:"ro"` + ErrorDetails *RecommendedActionErrorInfo // READ-ONLY; Gets the estimated impact info for this recommended action e.g., Estimated CPU gain, Estimated Disk Space change - EstimatedImpact []*RecommendedActionImpactRecord `json:"estimatedImpact,omitempty" azure:"ro"` + EstimatedImpact []*RecommendedActionImpactRecord // READ-ONLY; Gets the time taken for applying this recommended action on user resource. e.g., time taken for index creation - ExecuteActionDuration *string `json:"executeActionDuration,omitempty" azure:"ro"` + ExecuteActionDuration *string // READ-ONLY; Gets if approval for applying this recommended action was given by user/system. - ExecuteActionInitiatedBy *RecommendedActionInitiatedBy `json:"executeActionInitiatedBy,omitempty" azure:"ro"` + ExecuteActionInitiatedBy *RecommendedActionInitiatedBy // READ-ONLY; Gets the time when this recommended action was approved for execution. - ExecuteActionInitiatedTime *time.Time `json:"executeActionInitiatedTime,omitempty" azure:"ro"` + ExecuteActionInitiatedTime *time.Time // READ-ONLY; Gets the time when system started applying this recommended action on the user resource. e.g., index creation // start time - ExecuteActionStartTime *time.Time `json:"executeActionStartTime,omitempty" azure:"ro"` + ExecuteActionStartTime *time.Time // READ-ONLY; Gets the implementation details of this recommended action for user to apply it manually. - ImplementationDetails *RecommendedActionImplementationInfo `json:"implementationDetails,omitempty" azure:"ro"` + ImplementationDetails *RecommendedActionImplementationInfo // READ-ONLY; Gets if this recommended action was suggested some time ago but user chose to ignore this and system added a // new recommended action again. - IsArchivedAction *bool `json:"isArchivedAction,omitempty" azure:"ro"` + IsArchivedAction *bool // READ-ONLY; Gets if this recommended action is actionable by user - IsExecutableAction *bool `json:"isExecutableAction,omitempty" azure:"ro"` + IsExecutableAction *bool // READ-ONLY; Gets if changes applied by this recommended action can be reverted by user - IsRevertableAction *bool `json:"isRevertableAction,omitempty" azure:"ro"` + IsRevertableAction *bool // READ-ONLY; Gets time when this recommended action was last refreshed. - LastRefresh *time.Time `json:"lastRefresh,omitempty" azure:"ro"` + LastRefresh *time.Time // READ-ONLY; Gets the linked objects, if any. - LinkedObjects []*string `json:"linkedObjects,omitempty" azure:"ro"` + LinkedObjects []*string // READ-ONLY; Gets the observed/actual impact info for this recommended action e.g., Actual CPU gain, Actual Disk Space change - ObservedImpact []*RecommendedActionImpactRecord `json:"observedImpact,omitempty" azure:"ro"` + ObservedImpact []*RecommendedActionImpactRecord // READ-ONLY; Gets the reason for recommending this action. e.g., DuplicateIndex - RecommendationReason *string `json:"recommendationReason,omitempty" azure:"ro"` + RecommendationReason *string // READ-ONLY; Gets the time taken for reverting changes of this recommended action on user resource. e.g., time taken for // dropping the created index. - RevertActionDuration *string `json:"revertActionDuration,omitempty" azure:"ro"` + RevertActionDuration *string // READ-ONLY; Gets if approval for reverting this recommended action was given by user/system. - RevertActionInitiatedBy *RecommendedActionInitiatedBy `json:"revertActionInitiatedBy,omitempty" azure:"ro"` + RevertActionInitiatedBy *RecommendedActionInitiatedBy // READ-ONLY; Gets the time when this recommended action was approved for revert. - RevertActionInitiatedTime *time.Time `json:"revertActionInitiatedTime,omitempty" azure:"ro"` + RevertActionInitiatedTime *time.Time // READ-ONLY; Gets the time when system started reverting changes of this recommended action on user resource. e.g., time // when index drop is executed. - RevertActionStartTime *time.Time `json:"revertActionStartTime,omitempty" azure:"ro"` + RevertActionStartTime *time.Time // READ-ONLY; Gets the impact of this recommended action. Possible values are 1 - Low impact, 2 - Medium Impact and 3 - High // Impact - Score *int32 `json:"score,omitempty" azure:"ro"` + Score *int32 // READ-ONLY; Gets the time series info of metrics for this recommended action e.g., CPU consumption time series - TimeSeries []*RecommendedActionMetricInfo `json:"timeSeries,omitempty" azure:"ro"` + TimeSeries []*RecommendedActionMetricInfo // READ-ONLY; Gets the time since when this recommended action is valid. - ValidSince *time.Time `json:"validSince,omitempty" azure:"ro"` + ValidSince *time.Time } // RecommendedActionStateInfo - Contains information of current state for an Azure SQL Database, Server or Elastic Pool Recommended @@ -7143,1021 +5786,818 @@ type RecommendedActionStateInfo struct { // reverted. Reverting -> changes made while applying recommended action are being reverted on the user database. Reverted // -> successfully reverted the changes made by recommended action on user // database. Ignored -> user explicitly ignored/discarded the recommended action. - CurrentValue *RecommendedActionCurrentState `json:"currentValue,omitempty"` + CurrentValue *RecommendedActionCurrentState // READ-ONLY; Gets who initiated the execution of this recommended action. Possible Value are: User -> When user explicity // notified system to apply the recommended action. System -> When auto-execute status of this // advisor was set to 'Enabled', in which case the system applied it. - ActionInitiatedBy *RecommendedActionInitiatedBy `json:"actionInitiatedBy,omitempty" azure:"ro"` + ActionInitiatedBy *RecommendedActionInitiatedBy // READ-ONLY; Gets the time when the state was last modified - LastModified *time.Time `json:"lastModified,omitempty" azure:"ro"` + LastModified *time.Time } // RecommendedSensitivityLabelUpdate - A recommended sensitivity label update operation. type RecommendedSensitivityLabelUpdate struct { // Resource properties. - Properties *RecommendedSensitivityLabelUpdateProperties `json:"properties,omitempty"` + Properties *RecommendedSensitivityLabelUpdateProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // RecommendedSensitivityLabelUpdateList - A list of recommended sensitivity label update operations. type RecommendedSensitivityLabelUpdateList struct { - Operations []*RecommendedSensitivityLabelUpdate `json:"operations,omitempty"` + Operations []*RecommendedSensitivityLabelUpdate } // RecommendedSensitivityLabelUpdateProperties - Properties of an operation executed on a recommended sensitivity label. type RecommendedSensitivityLabelUpdateProperties struct { // REQUIRED; Column name to update. - Column *string `json:"column,omitempty"` + Column *string // REQUIRED - Op *RecommendedSensitivityLabelUpdateKind `json:"op,omitempty"` + Op *RecommendedSensitivityLabelUpdateKind // REQUIRED; Schema name of the column to update. - Schema *string `json:"schema,omitempty"` + Schema *string // REQUIRED; Table name of the column to update. - Table *string `json:"table,omitempty"` + Table *string } -// RecommendedSensitivityLabelsClientUpdateOptions contains the optional parameters for the RecommendedSensitivityLabelsClient.Update -// method. -type RecommendedSensitivityLabelsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// RecoverableDatabase - A recoverable database +// RecoverableDatabase - A recoverable database resource. type RecoverableDatabase struct { - // The properties of a recoverable database - Properties *RecoverableDatabaseProperties `json:"properties,omitempty"` + // Resource properties. + Properties *RecoverableDatabaseProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } -// RecoverableDatabaseListResult - The response to a list recoverable databases request +// RecoverableDatabaseListResult - A list of recoverable databases. type RecoverableDatabaseListResult struct { - // REQUIRED; A list of recoverable databases - Value []*RecoverableDatabase `json:"value,omitempty"` + // READ-ONLY; Link to retrieve next page of results. + NextLink *string + + // READ-ONLY; Array of results. + Value []*RecoverableDatabase } -// RecoverableDatabaseProperties - The properties of a recoverable database +// RecoverableDatabaseProperties - The recoverable database's properties. type RecoverableDatabaseProperties struct { - // READ-ONLY; The edition of the database - Edition *string `json:"edition,omitempty" azure:"ro"` - - // READ-ONLY; The elastic pool name of the database - ElasticPoolName *string `json:"elasticPoolName,omitempty" azure:"ro"` + // The resource ids of the user assigned identities to use + Keys map[string]*DatabaseKey - // READ-ONLY; The last available backup date of the database (ISO8601 format) - LastAvailableBackupDate *time.Time `json:"lastAvailableBackupDate,omitempty" azure:"ro"` + // READ-ONLY; The edition of the database. + Edition *string - // READ-ONLY; The service level objective name of the database - ServiceLevelObjective *string `json:"serviceLevelObjective,omitempty" azure:"ro"` -} + // READ-ONLY; The elastic pool name of the database + ElasticPoolName *string -// RecoverableDatabasesClientGetOptions contains the optional parameters for the RecoverableDatabasesClient.Get method. -type RecoverableDatabasesClientGetOptions struct { - // placeholder for future optional parameters -} + // READ-ONLY; The last available backup date. + LastAvailableBackupDate *time.Time -// RecoverableDatabasesClientListByServerOptions contains the optional parameters for the RecoverableDatabasesClient.NewListByServerPager -// method. -type RecoverableDatabasesClientListByServerOptions struct { - // placeholder for future optional parameters + // READ-ONLY; The service level objective name of the database. + ServiceLevelObjective *string } // RecoverableManagedDatabase - A recoverable managed database resource. type RecoverableManagedDatabase struct { // Resource properties. - Properties *RecoverableManagedDatabaseProperties `json:"properties,omitempty"` + Properties *RecoverableManagedDatabaseProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // RecoverableManagedDatabaseListResult - A list of recoverable managed databases. type RecoverableManagedDatabaseListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*RecoverableManagedDatabase `json:"value,omitempty" azure:"ro"` + Value []*RecoverableManagedDatabase } // RecoverableManagedDatabaseProperties - The recoverable managed database's properties. type RecoverableManagedDatabaseProperties struct { // READ-ONLY; The last available backup date. - LastAvailableBackupDate *string `json:"lastAvailableBackupDate,omitempty" azure:"ro"` + LastAvailableBackupDate *string +} + +// RefreshExternalGovernanceStatusOperationResult - An RefreshExternalGovernanceStatus operation result resource. +type RefreshExternalGovernanceStatusOperationResult struct { + // Resource properties. + Properties *RefreshExternalGovernanceStatusOperationResultProperties + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string } -// RecoverableManagedDatabasesClientGetOptions contains the optional parameters for the RecoverableManagedDatabasesClient.Get -// method. -type RecoverableManagedDatabasesClientGetOptions struct { - // placeholder for future optional parameters +// RefreshExternalGovernanceStatusOperationResultProperties - Contains the operation result properties for refresh external +// governance status operation. +type RefreshExternalGovernanceStatusOperationResultProperties struct { + // READ-ONLY; Error message. + ErrorMessage *string + + // READ-ONLY; Queued time. + QueuedTime *string + + // READ-ONLY; Request Id. + RequestID *string + + // READ-ONLY; Request type. + RequestType *string + + // READ-ONLY; Server name. + ServerName *string + + // READ-ONLY; Operation status. + Status *string } -// RecoverableManagedDatabasesClientListByInstanceOptions contains the optional parameters for the RecoverableManagedDatabasesClient.NewListByInstancePager -// method. -type RecoverableManagedDatabasesClientListByInstanceOptions struct { - // placeholder for future optional parameters +// Remediation - SQL Vulnerability Assessment remediation Details. +type Remediation struct { + // READ-ONLY; SQL Vulnerability Assessment is remediation automated. + Automated *bool + + // READ-ONLY; SQL Vulnerability Assessment remediation description. + Description *string + + // READ-ONLY; SQL Vulnerability Assessment optional link to remediate in Azure Portal. + PortalLink *string + + // READ-ONLY; SQL Vulnerability Assessment remediation script. + Scripts []*string } // ReplicationLink - A replication link. type ReplicationLink struct { // Resource properties. - Properties *ReplicationLinkProperties `json:"properties,omitempty"` + Properties *ReplicationLinkProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ReplicationLinkListResult - A list of replication links. type ReplicationLinkListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ReplicationLink `json:"value,omitempty" azure:"ro"` + Value []*ReplicationLink } // ReplicationLinkProperties - Properties of a replication link. type ReplicationLinkProperties struct { // READ-ONLY; Whether the user is currently allowed to terminate the link. - IsTerminationAllowed *bool `json:"isTerminationAllowed,omitempty" azure:"ro"` + IsTerminationAllowed *bool - // READ-ONLY; Link type (GEO, NAMED). - LinkType *ReplicationLinkType `json:"linkType,omitempty" azure:"ro"` + // READ-ONLY; Link type (GEO, NAMED, STANDBY). + LinkType *ReplicationLinkType // READ-ONLY; Resource partner database. - PartnerDatabase *string `json:"partnerDatabase,omitempty" azure:"ro"` + PartnerDatabase *string // READ-ONLY; Resource partner location. - PartnerLocation *string `json:"partnerLocation,omitempty" azure:"ro"` + PartnerLocation *string // READ-ONLY; Partner replication role. - PartnerRole *ReplicationRole `json:"partnerRole,omitempty" azure:"ro"` + PartnerRole *ReplicationRole // READ-ONLY; Resource partner server. - PartnerServer *string `json:"partnerServer,omitempty" azure:"ro"` + PartnerServer *string // READ-ONLY; Seeding completion percentage for the link. - PercentComplete *int32 `json:"percentComplete,omitempty" azure:"ro"` + PercentComplete *int32 // READ-ONLY; Replication mode. - ReplicationMode *string `json:"replicationMode,omitempty" azure:"ro"` + ReplicationMode *string // READ-ONLY; Replication state (PENDING, SEEDING, CATCHUP, SUSPENDED). - ReplicationState *ReplicationState `json:"replicationState,omitempty" azure:"ro"` + ReplicationState *ReplicationState // READ-ONLY; Local replication role. - Role *ReplicationRole `json:"role,omitempty" azure:"ro"` + Role *ReplicationRole // READ-ONLY; Time at which the link was created. - StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` -} - -// ReplicationLinksClientBeginFailoverAllowDataLossOptions contains the optional parameters for the ReplicationLinksClient.BeginFailoverAllowDataLoss -// method. -type ReplicationLinksClientBeginFailoverAllowDataLossOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationLinksClientBeginFailoverOptions contains the optional parameters for the ReplicationLinksClient.BeginFailover -// method. -type ReplicationLinksClientBeginFailoverOptions struct { - // Resumes the LRO from the provided token. - 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 -} - -// ReplicationLinksClientListByDatabaseOptions contains the optional parameters for the ReplicationLinksClient.NewListByDatabasePager -// method. -type ReplicationLinksClientListByDatabaseOptions struct { - // placeholder for future optional parameters -} - -// ReplicationLinksClientListByServerOptions contains the optional parameters for the ReplicationLinksClient.NewListByServerPager -// method. -type ReplicationLinksClientListByServerOptions struct { - // placeholder for future optional parameters + StartTime *time.Time } // Resource - ARM resource. type Resource struct { // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ResourceIdentity - Azure Active Directory identity configuration for a resource. type ResourceIdentity struct { // The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal // for the resource. - Type *IdentityType `json:"type,omitempty"` + Type *IdentityType // The resource ids of the user assigned identities to use - UserAssignedIdentities map[string]*UserIdentity `json:"userAssignedIdentities,omitempty"` + UserAssignedIdentities map[string]*UserIdentity // READ-ONLY; The Azure Active Directory principal id. - PrincipalID *string `json:"principalId,omitempty" azure:"ro"` + PrincipalID *string // READ-ONLY; The Azure Active Directory tenant id. - TenantID *string `json:"tenantId,omitempty" azure:"ro"` + TenantID *string } // ResourceMoveDefinition - Contains the information necessary to perform a resource move (rename). type ResourceMoveDefinition struct { // REQUIRED; The target ID for the resource - ID *string `json:"id,omitempty"` + ID *string } // ResourceWithWritableName - ARM resource. type ResourceWithWritableName struct { // Resource name. - Name *string `json:"name,omitempty"` + Name *string // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // RestorableDroppedDatabase - A restorable dropped database resource. type RestorableDroppedDatabase struct { // Resource location. - Location *string `json:"location,omitempty"` + Location *string // Resource properties. - Properties *RestorableDroppedDatabaseProperties `json:"properties,omitempty"` + Properties *RestorableDroppedDatabaseProperties // The name and tier of the SKU. - SKU *SKU `json:"sku,omitempty"` + SKU *SKU // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // RestorableDroppedDatabaseListResult - A list of restorable dropped databases. type RestorableDroppedDatabaseListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*RestorableDroppedDatabase `json:"value,omitempty" azure:"ro"` + Value []*RestorableDroppedDatabase } // RestorableDroppedDatabaseProperties - The restorable dropped database's properties. type RestorableDroppedDatabaseProperties struct { + // The resource ids of the user assigned identities to use + Keys map[string]*DatabaseKey + // READ-ONLY; The storage account type used to store backups for this database. - BackupStorageRedundancy *BackupStorageRedundancy `json:"backupStorageRedundancy,omitempty" azure:"ro"` + BackupStorageRedundancy *BackupStorageRedundancy // READ-ONLY; The creation date of the database (ISO8601 format). - CreationDate *time.Time `json:"creationDate,omitempty" azure:"ro"` + CreationDate *time.Time // READ-ONLY; The name of the database. - DatabaseName *string `json:"databaseName,omitempty" azure:"ro"` + DatabaseName *string // READ-ONLY; The deletion date of the database (ISO8601 format). - DeletionDate *time.Time `json:"deletionDate,omitempty" azure:"ro"` + DeletionDate *time.Time // READ-ONLY; The earliest restore date of the database (ISO8601 format). - EarliestRestoreDate *time.Time `json:"earliestRestoreDate,omitempty" azure:"ro"` + EarliestRestoreDate *time.Time // READ-ONLY; The max size of the database expressed in bytes. - MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty" azure:"ro"` -} - -// RestorableDroppedDatabasesClientGetOptions contains the optional parameters for the RestorableDroppedDatabasesClient.Get -// method. -type RestorableDroppedDatabasesClientGetOptions struct { - // placeholder for future optional parameters -} - -// RestorableDroppedDatabasesClientListByServerOptions contains the optional parameters for the RestorableDroppedDatabasesClient.NewListByServerPager -// method. -type RestorableDroppedDatabasesClientListByServerOptions struct { - // placeholder for future optional parameters + MaxSizeBytes *int64 } // RestorableDroppedManagedDatabase - A restorable dropped managed database resource. type RestorableDroppedManagedDatabase struct { // REQUIRED; Resource location. - Location *string `json:"location,omitempty"` + Location *string // Resource properties. - Properties *RestorableDroppedManagedDatabaseProperties `json:"properties,omitempty"` + Properties *RestorableDroppedManagedDatabaseProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // RestorableDroppedManagedDatabaseListResult - A list of restorable dropped managed databases. type RestorableDroppedManagedDatabaseListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*RestorableDroppedManagedDatabase `json:"value,omitempty" azure:"ro"` + Value []*RestorableDroppedManagedDatabase } // RestorableDroppedManagedDatabaseProperties - The restorable dropped managed database's properties. type RestorableDroppedManagedDatabaseProperties struct { // READ-ONLY; The creation date of the database (ISO8601 format). - CreationDate *time.Time `json:"creationDate,omitempty" azure:"ro"` + CreationDate *time.Time // READ-ONLY; The name of the database. - DatabaseName *string `json:"databaseName,omitempty" azure:"ro"` + DatabaseName *string // READ-ONLY; The deletion date of the database (ISO8601 format). - DeletionDate *time.Time `json:"deletionDate,omitempty" azure:"ro"` + DeletionDate *time.Time // READ-ONLY; The earliest restore date of the database (ISO8601 format). - EarliestRestoreDate *time.Time `json:"earliestRestoreDate,omitempty" azure:"ro"` -} - -// RestorableDroppedManagedDatabasesClientGetOptions contains the optional parameters for the RestorableDroppedManagedDatabasesClient.Get -// method. -type RestorableDroppedManagedDatabasesClientGetOptions struct { - // placeholder for future optional parameters -} - -// RestorableDroppedManagedDatabasesClientListByInstanceOptions contains the optional parameters for the RestorableDroppedManagedDatabasesClient.NewListByInstancePager -// method. -type RestorableDroppedManagedDatabasesClientListByInstanceOptions struct { - // placeholder for future optional parameters + EarliestRestoreDate *time.Time } // RestorePoint - Database restore points. type RestorePoint struct { // Resource properties. - Properties *RestorePointProperties `json:"properties,omitempty"` + Properties *RestorePointProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource location. - Location *string `json:"location,omitempty" azure:"ro"` + Location *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // RestorePointListResult - A list of long term retention backups. type RestorePointListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*RestorePoint `json:"value,omitempty" azure:"ro"` + Value []*RestorePoint } // RestorePointProperties - Properties of a database restore point type RestorePointProperties struct { // READ-ONLY; The earliest time to which this database can be restored - EarliestRestoreDate *time.Time `json:"earliestRestoreDate,omitempty" azure:"ro"` + EarliestRestoreDate *time.Time // READ-ONLY; The time the backup was taken - RestorePointCreationDate *time.Time `json:"restorePointCreationDate,omitempty" azure:"ro"` + RestorePointCreationDate *time.Time // READ-ONLY; The label of restore point for backup request by user - RestorePointLabel *string `json:"restorePointLabel,omitempty" azure:"ro"` + RestorePointLabel *string // READ-ONLY; The type of restore point - RestorePointType *RestorePointType `json:"restorePointType,omitempty" azure:"ro"` -} - -// RestorePointsClientBeginCreateOptions contains the optional parameters for the RestorePointsClient.BeginCreate method. -type RestorePointsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RestorePointsClientDeleteOptions contains the optional parameters for the RestorePointsClient.Delete method. -type RestorePointsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// RestorePointsClientGetOptions contains the optional parameters for the RestorePointsClient.Get method. -type RestorePointsClientGetOptions struct { - // placeholder for future optional parameters -} - -// RestorePointsClientListByDatabaseOptions contains the optional parameters for the RestorePointsClient.NewListByDatabasePager -// method. -type RestorePointsClientListByDatabaseOptions struct { - // placeholder for future optional parameters + RestorePointType *RestorePointType } // SKU - An ARM Resource SKU. type SKU struct { // REQUIRED; The name of the SKU, typically, a letter + Number code, e.g. P3. - Name *string `json:"name,omitempty"` + Name *string // Capacity of the particular SKU. - Capacity *int32 `json:"capacity,omitempty"` + Capacity *int32 // If the service has different generations of hardware, for the same SKU, then that can be captured here. - Family *string `json:"family,omitempty"` + Family *string // Size of the particular SKU - Size *string `json:"size,omitempty"` + Size *string // The tier or edition of the particular SKU, e.g. Basic, Premium. - Tier *string `json:"tier,omitempty"` + Tier *string +} + +// ScheduleItem - Schedule info describing when the server should be started or stopped. +type ScheduleItem struct { + // REQUIRED; Start day. + StartDay *DayOfWeek + + // REQUIRED; Start time. + StartTime *string + + // REQUIRED; Stop day. + StopDay *DayOfWeek + + // REQUIRED; Stop time. + StopTime *string } // SecurityAlertPolicyProperties - Properties of a security alert policy. type SecurityAlertPolicyProperties struct { // REQUIRED; Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on // the specific database. - State *SecurityAlertPolicyState `json:"state,omitempty"` + State *SecurityAlertPolicyState // Specifies an array of alerts that are disabled. Allowed values are: SqlInjection, SqlInjectionVulnerability, AccessAnomaly, // DataExfiltration, UnsafeAction, Brute_Force - DisabledAlerts []*string `json:"disabledAlerts,omitempty"` + DisabledAlerts []*string // Specifies that the alert is sent to the account administrators. - EmailAccountAdmins *bool `json:"emailAccountAdmins,omitempty"` + EmailAccountAdmins *bool // Specifies an array of e-mail addresses to which the alert is sent. - EmailAddresses []*string `json:"emailAddresses,omitempty"` + EmailAddresses []*string // Specifies the number of days to keep in the Threat Detection audit logs. - RetentionDays *int32 `json:"retentionDays,omitempty"` + RetentionDays *int32 // Specifies the identifier key of the Threat Detection audit storage account. - StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` + StorageAccountAccessKey *string // Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat // Detection audit logs. - StorageEndpoint *string `json:"storageEndpoint,omitempty"` + StorageEndpoint *string // READ-ONLY; Specifies the UTC creation time of the policy. - CreationTime *time.Time `json:"creationTime,omitempty" azure:"ro"` + CreationTime *time.Time } // SecurityAlertsPolicyProperties - Properties of a security alert policy. type SecurityAlertsPolicyProperties struct { // REQUIRED; Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on // the specific database. - State *SecurityAlertsPolicyState `json:"state,omitempty"` + State *SecurityAlertsPolicyState // Specifies an array of alerts that are disabled. Allowed values are: SqlInjection, SqlInjectionVulnerability, AccessAnomaly, // DataExfiltration, UnsafeAction, Brute_Force - DisabledAlerts []*string `json:"disabledAlerts,omitempty"` + DisabledAlerts []*string // Specifies that the alert is sent to the account administrators. - EmailAccountAdmins *bool `json:"emailAccountAdmins,omitempty"` + EmailAccountAdmins *bool // Specifies an array of e-mail addresses to which the alert is sent. - EmailAddresses []*string `json:"emailAddresses,omitempty"` + EmailAddresses []*string // Specifies the number of days to keep in the Threat Detection audit logs. - RetentionDays *int32 `json:"retentionDays,omitempty"` + RetentionDays *int32 // Specifies the identifier key of the Threat Detection audit storage account. - StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` + StorageAccountAccessKey *string // Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat // Detection audit logs. - StorageEndpoint *string `json:"storageEndpoint,omitempty"` + StorageEndpoint *string // READ-ONLY; Specifies the UTC creation time of the policy. - CreationTime *time.Time `json:"creationTime,omitempty" azure:"ro"` + CreationTime *time.Time } // SecurityEvent - A security event. type SecurityEvent struct { // Resource properties. - Properties *SecurityEventProperties `json:"properties,omitempty"` + Properties *SecurityEventProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // SecurityEventCollection - A list of security events. type SecurityEventCollection struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*SecurityEvent `json:"value,omitempty" azure:"ro"` + Value []*SecurityEvent } // SecurityEventProperties - The properties of a security event. type SecurityEventProperties struct { // READ-ONLY; The application used to execute the statement. - ApplicationName *string `json:"applicationName,omitempty" azure:"ro"` + ApplicationName *string // READ-ONLY; The IP address of the client who executed the statement. - ClientIP *string `json:"clientIp,omitempty" azure:"ro"` + ClientIP *string // READ-ONLY; The database name - Database *string `json:"database,omitempty" azure:"ro"` + Database *string // READ-ONLY; The time when the security event occurred. - EventTime *time.Time `json:"eventTime,omitempty" azure:"ro"` + EventTime *time.Time // READ-ONLY; The principal user who executed the statement - PrincipalName *string `json:"principalName,omitempty" azure:"ro"` + PrincipalName *string // READ-ONLY; The sql injection additional properties, populated only if the type of the security event is sql injection. - SecurityEventSQLInjectionAdditionalProperties *SecurityEventSQLInjectionAdditionalProperties `json:"securityEventSqlInjectionAdditionalProperties,omitempty" azure:"ro"` + SecurityEventSQLInjectionAdditionalProperties *SecurityEventSQLInjectionAdditionalProperties // READ-ONLY; The type of the security event. - SecurityEventType *SecurityEventType `json:"securityEventType,omitempty" azure:"ro"` + SecurityEventType *SecurityEventType // READ-ONLY; The server name - Server *string `json:"server,omitempty" azure:"ro"` + Server *string // READ-ONLY; The subscription name - Subscription *string `json:"subscription,omitempty" azure:"ro"` + Subscription *string } // SecurityEventSQLInjectionAdditionalProperties - The properties of a security event sql injection additional properties. type SecurityEventSQLInjectionAdditionalProperties struct { // READ-ONLY; The sql error code - ErrorCode *int32 `json:"errorCode,omitempty" azure:"ro"` + ErrorCode *int32 // READ-ONLY; The sql error message - ErrorMessage *string `json:"errorMessage,omitempty" azure:"ro"` + ErrorMessage *string // READ-ONLY; The sql error severity - ErrorSeverity *int32 `json:"errorSeverity,omitempty" azure:"ro"` + ErrorSeverity *int32 // READ-ONLY; The statement - Statement *string `json:"statement,omitempty" azure:"ro"` + Statement *string // READ-ONLY; The statement highlight length - StatementHighlightLength *int32 `json:"statementHighlightLength,omitempty" azure:"ro"` + StatementHighlightLength *int32 // READ-ONLY; The statement highlight offset - StatementHighlightOffset *int32 `json:"statementHighlightOffset,omitempty" azure:"ro"` + StatementHighlightOffset *int32 // READ-ONLY; The threat ID. - ThreatID *string `json:"threatId,omitempty" azure:"ro"` + ThreatID *string } // SecurityEventsFilterParameters - The properties that are supported in the $filter operation. type SecurityEventsFilterParameters struct { // Filter on the event time. - EventTime *time.Time `json:"eventTime,omitempty"` + EventTime *time.Time // Whether to show server records or not. - ShowServerRecords *bool `json:"showServerRecords,omitempty"` + ShowServerRecords *bool } // SensitivityLabel - A sensitivity label. type SensitivityLabel struct { // Resource properties. - Properties *SensitivityLabelProperties `json:"properties,omitempty"` + Properties *SensitivityLabelProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource that manages the sensitivity label. - ManagedBy *string `json:"managedBy,omitempty" azure:"ro"` + ManagedBy *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // SensitivityLabelListResult - A list of sensitivity labels. type SensitivityLabelListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*SensitivityLabel `json:"value,omitempty" azure:"ro"` + Value []*SensitivityLabel } // SensitivityLabelProperties - Properties of a sensitivity label. type SensitivityLabelProperties struct { // The information type. - InformationType *string `json:"informationType,omitempty"` + InformationType *string // The information type ID. - InformationTypeID *string `json:"informationTypeId,omitempty"` + InformationTypeID *string // The label ID. - LabelID *string `json:"labelId,omitempty"` + LabelID *string // The label name. - LabelName *string `json:"labelName,omitempty"` - Rank *SensitivityLabelRank `json:"rank,omitempty"` + LabelName *string + Rank *SensitivityLabelRank // READ-ONLY; The column name. - ColumnName *string `json:"columnName,omitempty" azure:"ro"` + ColumnName *string // READ-ONLY; Is sensitivity recommendation disabled. Applicable for recommended sensitivity label only. Specifies whether // the sensitivity recommendation on this column is disabled (dismissed) or not. - IsDisabled *bool `json:"isDisabled,omitempty" azure:"ro"` + IsDisabled *bool // READ-ONLY; The schema name. - SchemaName *string `json:"schemaName,omitempty" azure:"ro"` + SchemaName *string // READ-ONLY; The table name. - TableName *string `json:"tableName,omitempty" azure:"ro"` + TableName *string } // SensitivityLabelUpdate - A sensitivity label update operation. type SensitivityLabelUpdate struct { // Resource properties. - Properties *SensitivityLabelUpdateProperties `json:"properties,omitempty"` + Properties *SensitivityLabelUpdateProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // SensitivityLabelUpdateList - A list of sensitivity label update operations. type SensitivityLabelUpdateList struct { - Operations []*SensitivityLabelUpdate `json:"operations,omitempty"` + Operations []*SensitivityLabelUpdate } // SensitivityLabelUpdateProperties - Properties of an operation executed on a sensitivity label. type SensitivityLabelUpdateProperties struct { // REQUIRED; Column name to update. - Column *string `json:"column,omitempty"` + Column *string // REQUIRED - Op *SensitivityLabelUpdateKind `json:"op,omitempty"` + Op *SensitivityLabelUpdateKind // REQUIRED; Schema name of the column to update. - Schema *string `json:"schema,omitempty"` + Schema *string // REQUIRED; Table name of the column to update. - Table *string `json:"table,omitempty"` + Table *string // The sensitivity label information to apply on a column. - SensitivityLabel *SensitivityLabel `json:"sensitivityLabel,omitempty"` -} - -// SensitivityLabelsClientCreateOrUpdateOptions contains the optional parameters for the SensitivityLabelsClient.CreateOrUpdate -// method. -type SensitivityLabelsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// SensitivityLabelsClientDeleteOptions contains the optional parameters for the SensitivityLabelsClient.Delete method. -type SensitivityLabelsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// SensitivityLabelsClientDisableRecommendationOptions contains the optional parameters for the SensitivityLabelsClient.DisableRecommendation -// method. -type SensitivityLabelsClientDisableRecommendationOptions struct { - // placeholder for future optional parameters -} - -// SensitivityLabelsClientEnableRecommendationOptions contains the optional parameters for the SensitivityLabelsClient.EnableRecommendation -// method. -type SensitivityLabelsClientEnableRecommendationOptions struct { - // placeholder for future optional parameters -} - -// SensitivityLabelsClientGetOptions contains the optional parameters for the SensitivityLabelsClient.Get method. -type SensitivityLabelsClientGetOptions struct { - // placeholder for future optional parameters -} - -// SensitivityLabelsClientListCurrentByDatabaseOptions contains the optional parameters for the SensitivityLabelsClient.NewListCurrentByDatabasePager -// method. -type SensitivityLabelsClientListCurrentByDatabaseOptions struct { - Count *bool - // An OData filter expression that filters elements in the collection. - Filter *string - SkipToken *string -} - -// SensitivityLabelsClientListRecommendedByDatabaseOptions contains the optional parameters for the SensitivityLabelsClient.NewListRecommendedByDatabasePager -// method. -type SensitivityLabelsClientListRecommendedByDatabaseOptions struct { - // An OData filter expression that filters elements in the collection. - Filter *string - // Specifies whether to include disabled recommendations or not. - IncludeDisabledRecommendations *bool - SkipToken *string -} - -// SensitivityLabelsClientUpdateOptions contains the optional parameters for the SensitivityLabelsClient.Update method. -type SensitivityLabelsClientUpdateOptions struct { - // placeholder for future optional parameters + SensitivityLabel *SensitivityLabel } // Server - An Azure SQL Database server. type Server struct { // REQUIRED; Resource location. - Location *string `json:"location,omitempty"` + Location *string // The Azure Active Directory identity of the server. - Identity *ResourceIdentity `json:"identity,omitempty"` + Identity *ResourceIdentity // Resource properties. - Properties *ServerProperties `json:"properties,omitempty"` + Properties *ServerProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Kind of sql server. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty" azure:"ro"` + Kind *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ServerAdvancedThreatProtection - A server Advanced Threat Protection. type ServerAdvancedThreatProtection struct { // Resource properties. - Properties *AdvancedThreatProtectionProperties `json:"properties,omitempty"` + Properties *AdvancedThreatProtectionProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; SystemData of AdvancedThreatProtectionResource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ServerAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerAdvancedThreatProtectionSettingsClient.BeginCreateOrUpdate -// method. -type ServerAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServerAdvancedThreatProtectionSettingsClientGetOptions contains the optional parameters for the ServerAdvancedThreatProtectionSettingsClient.Get -// method. -type ServerAdvancedThreatProtectionSettingsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ServerAdvancedThreatProtectionSettingsClientListByServerOptions contains the optional parameters for the ServerAdvancedThreatProtectionSettingsClient.NewListByServerPager -// method. -type ServerAdvancedThreatProtectionSettingsClientListByServerOptions struct { - // placeholder for future optional parameters -} - -// ServerAdvisorsClientGetOptions contains the optional parameters for the ServerAdvisorsClient.Get method. -type ServerAdvisorsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ServerAdvisorsClientListByServerOptions contains the optional parameters for the ServerAdvisorsClient.ListByServer method. -type ServerAdvisorsClientListByServerOptions struct { - // The child resources to include in the response. - Expand *string -} - -// ServerAdvisorsClientUpdateOptions contains the optional parameters for the ServerAdvisorsClient.Update method. -type ServerAdvisorsClientUpdateOptions struct { - // placeholder for future optional parameters + Type *string } // ServerAutomaticTuning - Server-level Automatic Tuning. type ServerAutomaticTuning struct { // Resource properties. - Properties *AutomaticTuningServerProperties `json:"properties,omitempty"` + Properties *AutomaticTuningServerProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ServerAutomaticTuningClientGetOptions contains the optional parameters for the ServerAutomaticTuningClient.Get method. -type ServerAutomaticTuningClientGetOptions struct { - // placeholder for future optional parameters -} - -// ServerAutomaticTuningClientUpdateOptions contains the optional parameters for the ServerAutomaticTuningClient.Update method. -type ServerAutomaticTuningClientUpdateOptions struct { - // placeholder for future optional parameters + Type *string } // ServerAzureADAdministrator - Azure Active Directory administrator. type ServerAzureADAdministrator struct { // Resource properties. - Properties *AdministratorProperties `json:"properties,omitempty"` + Properties *AdministratorProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ServerAzureADAdministratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerAzureADAdministratorsClient.BeginCreateOrUpdate -// method. -type ServerAzureADAdministratorsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServerAzureADAdministratorsClientBeginDeleteOptions contains the optional parameters for the ServerAzureADAdministratorsClient.BeginDelete -// method. -type ServerAzureADAdministratorsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServerAzureADAdministratorsClientGetOptions contains the optional parameters for the ServerAzureADAdministratorsClient.Get -// method. -type ServerAzureADAdministratorsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ServerAzureADAdministratorsClientListByServerOptions contains the optional parameters for the ServerAzureADAdministratorsClient.NewListByServerPager -// method. -type ServerAzureADAdministratorsClientListByServerOptions struct { - // placeholder for future optional parameters + Type *string } // ServerAzureADOnlyAuthentication - Azure Active Directory only authentication. type ServerAzureADOnlyAuthentication struct { // Resource properties. - Properties *AzureADOnlyAuthProperties `json:"properties,omitempty"` + Properties *AzureADOnlyAuthProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ServerAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.BeginCreateOrUpdate -// method. -type ServerAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServerAzureADOnlyAuthenticationsClientBeginDeleteOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.BeginDelete -// method. -type ServerAzureADOnlyAuthenticationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServerAzureADOnlyAuthenticationsClientGetOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.Get -// method. -type ServerAzureADOnlyAuthenticationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ServerAzureADOnlyAuthenticationsClientListByServerOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.NewListByServerPager -// method. -type ServerAzureADOnlyAuthenticationsClientListByServerOptions struct { - // placeholder for future optional parameters -} - -// ServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerBlobAuditingPoliciesClient.BeginCreateOrUpdate -// method. -type ServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServerBlobAuditingPoliciesClientGetOptions contains the optional parameters for the ServerBlobAuditingPoliciesClient.Get -// method. -type ServerBlobAuditingPoliciesClientGetOptions struct { - // placeholder for future optional parameters -} - -// ServerBlobAuditingPoliciesClientListByServerOptions contains the optional parameters for the ServerBlobAuditingPoliciesClient.NewListByServerPager -// method. -type ServerBlobAuditingPoliciesClientListByServerOptions struct { - // placeholder for future optional parameters + Type *string } // ServerBlobAuditingPolicy - A server blob auditing policy. type ServerBlobAuditingPolicy struct { // Resource properties. - Properties *ServerBlobAuditingPolicyProperties `json:"properties,omitempty"` + Properties *ServerBlobAuditingPolicyProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ServerBlobAuditingPolicyListResult - A list of server auditing settings. type ServerBlobAuditingPolicyListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ServerBlobAuditingPolicy `json:"value,omitempty" azure:"ro"` + Value []*ServerBlobAuditingPolicy } // ServerBlobAuditingPolicyProperties - Properties of a server blob auditing policy. type ServerBlobAuditingPolicyProperties struct { // REQUIRED; Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. - State *BlobAuditingPolicyState `json:"state,omitempty"` + State *BlobAuditingPolicyState // Specifies the Actions-Groups and Actions to audit. // The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures @@ -8187,7 +6627,7 @@ type ServerBlobAuditingPolicyProperties struct { // For example: SELECT on dbo.myTable by public SELECT on DATABASE::myDatabase by public SELECT on SCHEMA::mySchema by public // For more information, see Database-Level Audit Actions // [https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions] - AuditActionsAndGroups []*string `json:"auditActionsAndGroups,omitempty"` + AuditActionsAndGroups []*string // Specifies whether audit events are sent to Azure Monitor. In order to send the events to Azure Monitor, specify 'State' // as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true. @@ -8198,7 +6638,7 @@ type ServerBlobAuditingPolicyProperties struct { // https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview // For more information, see Diagnostic Settings REST API [https://go.microsoft.com/fwlink/?linkid=2033207]or Diagnostic Settings // PowerShell [https://go.microsoft.com/fwlink/?linkid=2033043] - IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"` + IsAzureMonitorTargetEnabled *bool // Specifies the state of devops audit. If state is Enabled, devops logs will be sent to Azure Monitor. In order to send the // events to Azure Monitor, specify 'State' as 'Enabled', @@ -8209,20 +6649,20 @@ type ServerBlobAuditingPolicyProperties struct { // https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview // For more information, see Diagnostic Settings REST API [https://go.microsoft.com/fwlink/?linkid=2033207]or Diagnostic Settings // PowerShell [https://go.microsoft.com/fwlink/?linkid=2033043] - IsDevopsAuditEnabled *bool `json:"isDevopsAuditEnabled,omitempty"` + IsDevopsAuditEnabled *bool // Specifies whether Managed Identity is used to access blob storage - IsManagedIdentityInUse *bool `json:"isManagedIdentityInUse,omitempty"` + IsManagedIdentityInUse *bool // Specifies whether storageAccountAccessKey value is the storage's secondary key. - IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"` + IsStorageSecondaryKeyInUse *bool // Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed. The default // minimum value is 1000 (1 second). The maximum is 2,147,483,647. - QueueDelayMs *int32 `json:"queueDelayMs,omitempty"` + QueueDelayMs *int32 // Specifies the number of days to keep in the audit logs in the storage account. - RetentionDays *int32 `json:"retentionDays,omitempty"` + RetentionDays *int32 // Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, not // specifying the storageAccountAccessKey will use SQL server system-assigned @@ -8231,229 +6671,170 @@ type ServerBlobAuditingPolicyProperties struct { // 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server // identity. For more information, see Auditing to storage using Managed // Identity authentication [https://go.microsoft.com/fwlink/?linkid=2114355] - StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` + StorageAccountAccessKey *string // Specifies the blob storage subscription Id. - StorageAccountSubscriptionID *string `json:"storageAccountSubscriptionId,omitempty"` + StorageAccountSubscriptionID *string // Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint // or isAzureMonitorTargetEnabled is required. - StorageEndpoint *string `json:"storageEndpoint,omitempty"` + StorageEndpoint *string } // ServerCommunicationLink - Server communication link. type ServerCommunicationLink struct { // The properties of resource. - Properties *ServerCommunicationLinkProperties `json:"properties,omitempty"` + Properties *ServerCommunicationLinkProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Communication link kind. This property is used for Azure Portal metadata. - Kind *string `json:"kind,omitempty" azure:"ro"` + Kind *string // READ-ONLY; Communication link location. - Location *string `json:"location,omitempty" azure:"ro"` + Location *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ServerCommunicationLinkListResult - A list of server communication links. type ServerCommunicationLinkListResult struct { // The list of server communication links. - Value []*ServerCommunicationLink `json:"value,omitempty"` + Value []*ServerCommunicationLink } // ServerCommunicationLinkProperties - The properties of a server communication link. type ServerCommunicationLinkProperties struct { // REQUIRED; The name of the partner server. - PartnerServer *string `json:"partnerServer,omitempty"` + PartnerServer *string // READ-ONLY; The state. - State *string `json:"state,omitempty" azure:"ro"` + State *string } -// ServerCommunicationLinksClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerCommunicationLinksClient.BeginCreateOrUpdate -// method. -type ServerCommunicationLinksClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} +// ServerConfigurationOption - A server configuration option +type ServerConfigurationOption struct { + // Resource properties. + Properties *ServerConfigurationOptionProperties -// ServerCommunicationLinksClientDeleteOptions contains the optional parameters for the ServerCommunicationLinksClient.Delete -// method. -type ServerCommunicationLinksClientDeleteOptions struct { - // placeholder for future optional parameters -} + // READ-ONLY; Resource ID. + ID *string -// ServerCommunicationLinksClientGetOptions contains the optional parameters for the ServerCommunicationLinksClient.Get method. -type ServerCommunicationLinksClientGetOptions struct { - // placeholder for future optional parameters -} + // READ-ONLY; Resource name. + Name *string -// ServerCommunicationLinksClientListByServerOptions contains the optional parameters for the ServerCommunicationLinksClient.NewListByServerPager -// method. -type ServerCommunicationLinksClientListByServerOptions struct { - // placeholder for future optional parameters + // READ-ONLY; Resource type. + Type *string } -// ServerConnectionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerConnectionPoliciesClient.BeginCreateOrUpdate -// method. -type ServerConnectionPoliciesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} +// ServerConfigurationOptionListResult - A list of server configuration options. +type ServerConfigurationOptionListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string -// ServerConnectionPoliciesClientGetOptions contains the optional parameters for the ServerConnectionPoliciesClient.Get method. -type ServerConnectionPoliciesClientGetOptions struct { - // placeholder for future optional parameters + // READ-ONLY; Array of results. + Value []*ServerConfigurationOption } -// ServerConnectionPoliciesClientListByServerOptions contains the optional parameters for the ServerConnectionPoliciesClient.NewListByServerPager -// method. -type ServerConnectionPoliciesClientListByServerOptions struct { - // placeholder for future optional parameters +// ServerConfigurationOptionProperties - The properties of server configuration option. +type ServerConfigurationOptionProperties struct { + // REQUIRED; Value of the server configuration option. + ServerConfigurationOptionValue *int32 + + // READ-ONLY; Provisioning state of server configuration option. + ProvisioningState *ProvisioningState } // ServerConnectionPolicy - A server connection policy type ServerConnectionPolicy struct { // Resource properties. - Properties *ServerConnectionPolicyProperties `json:"properties,omitempty"` + Properties *ServerConnectionPolicyProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty" azure:"ro"` + Kind *string // READ-ONLY; Resource location. - Location *string `json:"location,omitempty" azure:"ro"` + Location *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ServerConnectionPolicyListResult - A list of server connection policy objects. type ServerConnectionPolicyListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ServerConnectionPolicy `json:"value,omitempty" azure:"ro"` + Value []*ServerConnectionPolicy } // ServerConnectionPolicyProperties - The properties of a server connection policy. type ServerConnectionPolicyProperties struct { // REQUIRED; The server connection type. - ConnectionType *ServerConnectionType `json:"connectionType,omitempty"` + ConnectionType *ServerConnectionType } // ServerDNSAlias - A server DNS alias. type ServerDNSAlias struct { // Resource properties. - Properties *ServerDNSAliasProperties `json:"properties,omitempty"` + Properties *ServerDNSAliasProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ServerDNSAliasAcquisition - A server dns alias acquisition request. type ServerDNSAliasAcquisition struct { // REQUIRED; The id of the server alias that will be acquired to point to this server instead. - OldServerDNSAliasID *string `json:"oldServerDnsAliasId,omitempty"` + OldServerDNSAliasID *string } // ServerDNSAliasListResult - A list of server DNS aliases. type ServerDNSAliasListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ServerDNSAlias `json:"value,omitempty" azure:"ro"` + Value []*ServerDNSAlias } // ServerDNSAliasProperties - Properties of a server DNS alias. type ServerDNSAliasProperties struct { // READ-ONLY; The fully qualified DNS record for alias - AzureDNSRecord *string `json:"azureDnsRecord,omitempty" azure:"ro"` -} - -// ServerDNSAliasesClientBeginAcquireOptions contains the optional parameters for the ServerDNSAliasesClient.BeginAcquire -// method. -type ServerDNSAliasesClientBeginAcquireOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServerDNSAliasesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerDNSAliasesClient.BeginCreateOrUpdate -// method. -type ServerDNSAliasesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServerDNSAliasesClientBeginDeleteOptions contains the optional parameters for the ServerDNSAliasesClient.BeginDelete method. -type ServerDNSAliasesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServerDNSAliasesClientGetOptions contains the optional parameters for the ServerDNSAliasesClient.Get method. -type ServerDNSAliasesClientGetOptions struct { - // placeholder for future optional parameters -} - -// ServerDNSAliasesClientListByServerOptions contains the optional parameters for the ServerDNSAliasesClient.NewListByServerPager -// method. -type ServerDNSAliasesClientListByServerOptions struct { - // placeholder for future optional parameters -} - -// ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerDevOpsAuditSettingsClient.BeginCreateOrUpdate -// method. -type ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServerDevOpsAuditSettingsClientGetOptions contains the optional parameters for the ServerDevOpsAuditSettingsClient.Get -// method. -type ServerDevOpsAuditSettingsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ServerDevOpsAuditSettingsClientListByServerOptions contains the optional parameters for the ServerDevOpsAuditSettingsClient.NewListByServerPager -// method. -type ServerDevOpsAuditSettingsClientListByServerOptions struct { - // placeholder for future optional parameters + AzureDNSRecord *string } // ServerDevOpsAuditSettingsListResult - A list of server DevOps audit settings. type ServerDevOpsAuditSettingsListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ServerDevOpsAuditingSettings `json:"value,omitempty" azure:"ro"` + Value []*ServerDevOpsAuditingSettings } // ServerDevOpsAuditSettingsProperties - Properties of a server DevOps audit settings. type ServerDevOpsAuditSettingsProperties struct { // REQUIRED; Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. - State *BlobAuditingPolicyState `json:"state,omitempty"` + State *BlobAuditingPolicyState // Specifies whether DevOps audit events are sent to Azure Monitor. In order to send the events to Azure Monitor, specify // 'State' as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true. @@ -8463,7 +6844,10 @@ type ServerDevOpsAuditSettingsProperties struct { // https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview // For more information, see Diagnostic Settings REST API [https://go.microsoft.com/fwlink/?linkid=2033207]or Diagnostic Settings // PowerShell [https://go.microsoft.com/fwlink/?linkid=2033043] - IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"` + IsAzureMonitorTargetEnabled *bool + + // Specifies whether Managed Identity is used to access blob storage + IsManagedIdentityInUse *bool // Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, not // specifying the storageAccountAccessKey will use SQL server system-assigned @@ -8472,1932 +6856,1734 @@ type ServerDevOpsAuditSettingsProperties struct { // 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server // identity. For more information, see Auditing to storage using Managed // Identity authentication [https://go.microsoft.com/fwlink/?linkid=2114355] - StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` + StorageAccountAccessKey *string // Specifies the blob storage subscription Id. - StorageAccountSubscriptionID *string `json:"storageAccountSubscriptionId,omitempty"` + StorageAccountSubscriptionID *string // Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint // or isAzureMonitorTargetEnabled is required. - StorageEndpoint *string `json:"storageEndpoint,omitempty"` + StorageEndpoint *string } // ServerDevOpsAuditingSettings - A server DevOps auditing settings. type ServerDevOpsAuditingSettings struct { // Resource properties. - Properties *ServerDevOpsAuditSettingsProperties `json:"properties,omitempty"` + Properties *ServerDevOpsAuditSettingsProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; SystemData of ServerDevOpsAuditSettingsResource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ServerExternalAdministrator - Properties of a active directory administrator. type ServerExternalAdministrator struct { // Type of the sever administrator. - AdministratorType *AdministratorType `json:"administratorType,omitempty"` + AdministratorType *AdministratorType // Azure Active Directory only Authentication enabled. - AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty"` + AzureADOnlyAuthentication *bool // Login name of the server administrator. - Login *string `json:"login,omitempty"` + Login *string // Principal Type of the sever administrator. - PrincipalType *PrincipalType `json:"principalType,omitempty"` + PrincipalType *PrincipalType // SID (object ID) of the server administrator. - Sid *string `json:"sid,omitempty"` + Sid *string // Tenant ID of the administrator. - TenantID *string `json:"tenantId,omitempty"` + TenantID *string } // ServerFirewallRuleProperties - The properties of a server firewall rule. type ServerFirewallRuleProperties struct { // The end IP address of the firewall rule. Must be IPv4 format. Must be greater than or equal to startIpAddress. Use value // '0.0.0.0' for all Azure-internal IP addresses. - EndIPAddress *string `json:"endIpAddress,omitempty"` + EndIPAddress *string // The start IP address of the firewall rule. Must be IPv4 format. Use value '0.0.0.0' for all Azure-internal IP addresses. - StartIPAddress *string `json:"startIpAddress,omitempty"` + StartIPAddress *string } // ServerInfo - Server info for the server trust group. type ServerInfo struct { // REQUIRED; Server Id. - ServerID *string `json:"serverId,omitempty"` + ServerID *string } // ServerKey - A server key. type ServerKey struct { // Resource properties. - Properties *ServerKeyProperties `json:"properties,omitempty"` + Properties *ServerKeyProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty" azure:"ro"` + Kind *string // READ-ONLY; Resource location. - Location *string `json:"location,omitempty" azure:"ro"` + Location *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ServerKeyListResult - A list of server keys. type ServerKeyListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ServerKey `json:"value,omitempty" azure:"ro"` + Value []*ServerKey } // ServerKeyProperties - Properties for a server key execution. type ServerKeyProperties struct { // REQUIRED; The server key type like 'ServiceManaged', 'AzureKeyVault'. - ServerKeyType *ServerKeyType `json:"serverKeyType,omitempty"` + ServerKeyType *ServerKeyType // The URI of the server key. If the ServerKeyType is AzureKeyVault, then the URI is required. - URI *string `json:"uri,omitempty"` + URI *string // READ-ONLY; Key auto rotation opt-in flag. Either true or false. - AutoRotationEnabled *bool `json:"autoRotationEnabled,omitempty" azure:"ro"` + AutoRotationEnabled *bool // READ-ONLY; The server key creation date. - CreationDate *time.Time `json:"creationDate,omitempty" azure:"ro"` + CreationDate *time.Time // READ-ONLY; Subregion of the server key. - Subregion *string `json:"subregion,omitempty" azure:"ro"` + Subregion *string // READ-ONLY; Thumbprint of the server key. - Thumbprint *string `json:"thumbprint,omitempty" azure:"ro"` -} - -// ServerKeysClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerKeysClient.BeginCreateOrUpdate -// method. -type ServerKeysClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServerKeysClientBeginDeleteOptions contains the optional parameters for the ServerKeysClient.BeginDelete method. -type ServerKeysClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServerKeysClientGetOptions contains the optional parameters for the ServerKeysClient.Get method. -type ServerKeysClientGetOptions struct { - // placeholder for future optional parameters -} - -// ServerKeysClientListByServerOptions contains the optional parameters for the ServerKeysClient.NewListByServerPager method. -type ServerKeysClientListByServerOptions struct { - // placeholder for future optional parameters + Thumbprint *string } // ServerListResult - A list of servers. type ServerListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*Server `json:"value,omitempty" azure:"ro"` + Value []*Server } // ServerOperation - A server operation. type ServerOperation struct { // Resource properties. - Properties *ServerOperationProperties `json:"properties,omitempty"` + Properties *ServerOperationProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ServerOperationListResult - The response to a list server operations request type ServerOperationListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ServerOperation `json:"value,omitempty" azure:"ro"` + Value []*ServerOperation } // ServerOperationProperties - The properties of a server operation. type ServerOperationProperties struct { // READ-ONLY; The operation description. - Description *string `json:"description,omitempty" azure:"ro"` + Description *string // READ-ONLY; The operation error code. - ErrorCode *int32 `json:"errorCode,omitempty" azure:"ro"` + ErrorCode *int32 // READ-ONLY; The operation error description. - ErrorDescription *string `json:"errorDescription,omitempty" azure:"ro"` + ErrorDescription *string // READ-ONLY; The operation error severity. - ErrorSeverity *int32 `json:"errorSeverity,omitempty" azure:"ro"` + ErrorSeverity *int32 // READ-ONLY; The estimated completion time of the operation. - EstimatedCompletionTime *time.Time `json:"estimatedCompletionTime,omitempty" azure:"ro"` + EstimatedCompletionTime *time.Time // READ-ONLY; Whether the operation can be cancelled. - IsCancellable *bool `json:"isCancellable,omitempty" azure:"ro"` + IsCancellable *bool // READ-ONLY; Whether or not the error is a user error. - IsUserError *bool `json:"isUserError,omitempty" azure:"ro"` + IsUserError *bool // READ-ONLY; The name of operation. - Operation *string `json:"operation,omitempty" azure:"ro"` + Operation *string // READ-ONLY; The friendly name of operation. - OperationFriendlyName *string `json:"operationFriendlyName,omitempty" azure:"ro"` + OperationFriendlyName *string // READ-ONLY; The percentage of the operation completed. - PercentComplete *int32 `json:"percentComplete,omitempty" azure:"ro"` + PercentComplete *int32 // READ-ONLY; The name of the server. - ServerName *string `json:"serverName,omitempty" azure:"ro"` + ServerName *string // READ-ONLY; The operation start time. - StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` + StartTime *time.Time // READ-ONLY; The operation state. - State *ManagementOperationState `json:"state,omitempty" azure:"ro"` -} - -// ServerOperationsClientListByServerOptions contains the optional parameters for the ServerOperationsClient.NewListByServerPager -// method. -type ServerOperationsClientListByServerOptions struct { - // placeholder for future optional parameters + State *ManagementOperationState } // ServerPrivateEndpointConnection - A private endpoint connection under a server type ServerPrivateEndpointConnection struct { // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Private endpoint connection properties - Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty" azure:"ro"` + Properties *PrivateEndpointConnectionProperties } // ServerProperties - The properties of a server. type ServerProperties struct { // Administrator username for the server. Once created it cannot be changed. - AdministratorLogin *string `json:"administratorLogin,omitempty"` + AdministratorLogin *string // The administrator login password (required for server creation). - AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` + AdministratorLoginPassword *string - // The Azure Active Directory identity of the server. - Administrators *ServerExternalAdministrator `json:"administrators,omitempty"` + // The Azure Active Directory administrator of the server. This can only be used at server create time. If used for server + // update, it will be ignored or it will result in an error. For updates individual + // APIs will need to be used. + Administrators *ServerExternalAdministrator // The Client id used for cross tenant CMK scenario - FederatedClientID *string `json:"federatedClientId,omitempty"` + FederatedClientID *string // A CMK URI of the key to use for encryption. - KeyID *string `json:"keyId,omitempty"` + KeyID *string - // Minimal TLS version. Allowed values: '1.0', '1.1', '1.2' - MinimalTLSVersion *string `json:"minimalTlsVersion,omitempty"` + // Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2' + MinimalTLSVersion *string // The resource id of a user assigned identity to be used by default. - PrimaryUserAssignedIdentityID *string `json:"primaryUserAssignedIdentityId,omitempty"` + PrimaryUserAssignedIdentityID *string // Whether or not public endpoint access is allowed for this server. Value is optional but if passed in, must be 'Enabled' - // or 'Disabled' - PublicNetworkAccess *ServerNetworkAccessFlag `json:"publicNetworkAccess,omitempty"` + // or 'Disabled' or 'SecuredByPerimeter' + PublicNetworkAccess *ServerPublicNetworkAccessFlag // Whether or not to restrict outbound network access for this server. Value is optional but if passed in, must be 'Enabled' // or 'Disabled' - RestrictOutboundNetworkAccess *ServerNetworkAccessFlag `json:"restrictOutboundNetworkAccess,omitempty"` + RestrictOutboundNetworkAccess *ServerNetworkAccessFlag // The version of the server. - Version *string `json:"version,omitempty"` + Version *string + + // READ-ONLY; Status of external governance. + ExternalGovernanceStatus *ExternalGovernanceStatus // READ-ONLY; The fully qualified domain name of the server. - FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty" azure:"ro"` + FullyQualifiedDomainName *string // READ-ONLY; List of private endpoint connections on a server - PrivateEndpointConnections []*ServerPrivateEndpointConnection `json:"privateEndpointConnections,omitempty" azure:"ro"` + PrivateEndpointConnections []*ServerPrivateEndpointConnection // READ-ONLY; The state of the server. - State *string `json:"state,omitempty" azure:"ro"` + State *string // READ-ONLY; Whether or not existing server has a workspace created and if it allows connection from workspace - WorkspaceFeature *ServerWorkspaceFeature `json:"workspaceFeature,omitempty" azure:"ro"` -} - -// ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate -// method. -type ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServerSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.Get -// method. -type ServerSecurityAlertPoliciesClientGetOptions struct { - // placeholder for future optional parameters -} - -// ServerSecurityAlertPoliciesClientListByServerOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.NewListByServerPager -// method. -type ServerSecurityAlertPoliciesClientListByServerOptions struct { - // placeholder for future optional parameters + WorkspaceFeature *ServerWorkspaceFeature } // ServerSecurityAlertPolicy - A server security alert policy. type ServerSecurityAlertPolicy struct { // Resource properties. - Properties *SecurityAlertsPolicyProperties `json:"properties,omitempty"` + Properties *SecurityAlertsPolicyProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; SystemData of SecurityAlertPolicyResource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ServerTrustCertificate - Server trust certificate imported from box to enable connection between box and Sql Managed Instance. type ServerTrustCertificate struct { // Resource properties. - Properties *ServerTrustCertificateProperties `json:"properties,omitempty"` + Properties *ServerTrustCertificateProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ServerTrustCertificateProperties - The properties of a server trust certificate. type ServerTrustCertificateProperties struct { // The certificate public blob - PublicBlob *string `json:"publicBlob,omitempty"` + PublicBlob *string // READ-ONLY; The certificate name - CertificateName *string `json:"certificateName,omitempty" azure:"ro"` + CertificateName *string // READ-ONLY; The certificate thumbprint - Thumbprint *string `json:"thumbprint,omitempty" azure:"ro"` -} - -// ServerTrustCertificatesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerTrustCertificatesClient.BeginCreateOrUpdate -// method. -type ServerTrustCertificatesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServerTrustCertificatesClientBeginDeleteOptions contains the optional parameters for the ServerTrustCertificatesClient.BeginDelete -// method. -type ServerTrustCertificatesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServerTrustCertificatesClientGetOptions contains the optional parameters for the ServerTrustCertificatesClient.Get method. -type ServerTrustCertificatesClientGetOptions struct { - // placeholder for future optional parameters -} - -// ServerTrustCertificatesClientListByInstanceOptions contains the optional parameters for the ServerTrustCertificatesClient.NewListByInstancePager -// method. -type ServerTrustCertificatesClientListByInstanceOptions struct { - // placeholder for future optional parameters + Thumbprint *string } // ServerTrustCertificatesListResult - A list of server trust certificates in instance. type ServerTrustCertificatesListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ServerTrustCertificate `json:"value,omitempty" azure:"ro"` + Value []*ServerTrustCertificate } // ServerTrustGroup - A server trust group. type ServerTrustGroup struct { // Resource properties. - Properties *ServerTrustGroupProperties `json:"properties,omitempty"` + Properties *ServerTrustGroupProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ServerTrustGroupListResult - A list of server trust groups. type ServerTrustGroupListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ServerTrustGroup `json:"value,omitempty" azure:"ro"` + Value []*ServerTrustGroup } // ServerTrustGroupProperties - Properties of a server trust group. type ServerTrustGroupProperties struct { // REQUIRED; Group members information for the server trust group. - GroupMembers []*ServerInfo `json:"groupMembers,omitempty"` + GroupMembers []*ServerInfo // REQUIRED; Trust scope of the server trust group. - TrustScopes []*ServerTrustGroupPropertiesTrustScopesItem `json:"trustScopes,omitempty"` -} - -// ServerTrustGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerTrustGroupsClient.BeginCreateOrUpdate -// method. -type ServerTrustGroupsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServerTrustGroupsClientBeginDeleteOptions contains the optional parameters for the ServerTrustGroupsClient.BeginDelete -// method. -type ServerTrustGroupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServerTrustGroupsClientGetOptions contains the optional parameters for the ServerTrustGroupsClient.Get method. -type ServerTrustGroupsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ServerTrustGroupsClientListByInstanceOptions contains the optional parameters for the ServerTrustGroupsClient.NewListByInstancePager -// method. -type ServerTrustGroupsClientListByInstanceOptions struct { - // placeholder for future optional parameters -} - -// ServerTrustGroupsClientListByLocationOptions contains the optional parameters for the ServerTrustGroupsClient.NewListByLocationPager -// method. -type ServerTrustGroupsClientListByLocationOptions struct { - // placeholder for future optional parameters + TrustScopes []*ServerTrustGroupPropertiesTrustScopesItem } // ServerUpdate - An update request for an Azure SQL Database server. type ServerUpdate struct { // Server identity - Identity *ResourceIdentity `json:"identity,omitempty"` + Identity *ResourceIdentity // Resource properties. - Properties *ServerProperties `json:"properties,omitempty"` + Properties *ServerProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // ServerUsage - Represents server metrics. type ServerUsage struct { // READ-ONLY; The current value of the metric. - CurrentValue *float64 `json:"currentValue,omitempty" azure:"ro"` + CurrentValue *float64 // READ-ONLY; The metric display name. - DisplayName *string `json:"displayName,omitempty" azure:"ro"` + DisplayName *string // READ-ONLY; The current limit of the metric. - Limit *float64 `json:"limit,omitempty" azure:"ro"` + Limit *float64 // READ-ONLY; Name of the server usage metric. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The next reset time for the metric (ISO8601 format). - NextResetTime *time.Time `json:"nextResetTime,omitempty" azure:"ro"` + NextResetTime *time.Time // READ-ONLY; The name of the resource. - ResourceName *string `json:"resourceName,omitempty" azure:"ro"` + ResourceName *string // READ-ONLY; The units of the metric. - Unit *string `json:"unit,omitempty" azure:"ro"` + Unit *string } // ServerUsageListResult - Represents the response to a list server metrics request. type ServerUsageListResult struct { // REQUIRED; The list of server metrics for the server. - Value []*ServerUsage `json:"value,omitempty"` -} - -// ServerUsagesClientListByServerOptions contains the optional parameters for the ServerUsagesClient.NewListByServerPager -// method. -type ServerUsagesClientListByServerOptions struct { - // placeholder for future optional parameters + Value []*ServerUsage } // ServerVersionCapability - The server capability type ServerVersionCapability struct { // The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` + Reason *string // READ-ONLY; The server version name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The status of the capability. - Status *CapabilityStatus `json:"status,omitempty" azure:"ro"` + Status *CapabilityStatus // READ-ONLY; The list of supported database editions. - SupportedEditions []*EditionCapability `json:"supportedEditions,omitempty" azure:"ro"` + SupportedEditions []*EditionCapability // READ-ONLY; The list of supported elastic pool editions. - SupportedElasticPoolEditions []*ElasticPoolEditionCapability `json:"supportedElasticPoolEditions,omitempty" azure:"ro"` + SupportedElasticPoolEditions []*ElasticPoolEditionCapability } // ServerVulnerabilityAssessment - A server vulnerability assessment. type ServerVulnerabilityAssessment struct { // Resource properties. - Properties *ServerVulnerabilityAssessmentProperties `json:"properties,omitempty"` + Properties *ServerVulnerabilityAssessmentProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ServerVulnerabilityAssessmentListResult - A list of the server's vulnerability assessments. type ServerVulnerabilityAssessmentListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*ServerVulnerabilityAssessment `json:"value,omitempty" azure:"ro"` + Value []*ServerVulnerabilityAssessment } // ServerVulnerabilityAssessmentProperties - Properties of a server Vulnerability Assessment. type ServerVulnerabilityAssessmentProperties struct { // REQUIRED; A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/). - StorageContainerPath *string `json:"storageContainerPath,omitempty"` + StorageContainerPath *string // The recurring scans settings - RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"` + RecurringScans *VulnerabilityAssessmentRecurringScansProperties // Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' // isn't specified, storageAccountAccessKey is required. Applies only if the // storage account is not behind a Vnet or a firewall - StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` + StorageAccountAccessKey *string // A shared access signature (SAS Key) that has write access to the blob container specified in 'storageContainerPath' parameter. // If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is // required. Applies only if the storage account is not behind a Vnet or a firewall - StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"` -} - -// ServerVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.CreateOrUpdate -// method. -type ServerVulnerabilityAssessmentsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ServerVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.Delete -// method. -type ServerVulnerabilityAssessmentsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ServerVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.Get -// method. -type ServerVulnerabilityAssessmentsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ServerVulnerabilityAssessmentsClientListByServerOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.NewListByServerPager -// method. -type ServerVulnerabilityAssessmentsClientListByServerOptions struct { - // placeholder for future optional parameters -} - -// ServersClientBeginCreateOrUpdateOptions contains the optional parameters for the ServersClient.BeginCreateOrUpdate method. -type ServersClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServersClientBeginDeleteOptions contains the optional parameters for the ServersClient.BeginDelete method. -type ServersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServersClientBeginImportDatabaseOptions contains the optional parameters for the ServersClient.BeginImportDatabase method. -type ServersClientBeginImportDatabaseOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServersClientBeginUpdateOptions contains the optional parameters for the ServersClient.BeginUpdate method. -type ServersClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServersClientCheckNameAvailabilityOptions contains the optional parameters for the ServersClient.CheckNameAvailability -// method. -type ServersClientCheckNameAvailabilityOptions struct { - // placeholder for future optional parameters -} - -// ServersClientGetOptions contains the optional parameters for the ServersClient.Get method. -type ServersClientGetOptions struct { - // The child resources to include in the response. - Expand *string -} - -// ServersClientListByResourceGroupOptions contains the optional parameters for the ServersClient.NewListByResourceGroupPager -// method. -type ServersClientListByResourceGroupOptions struct { - // The child resources to include in the response. - Expand *string -} - -// ServersClientListOptions contains the optional parameters for the ServersClient.NewListPager method. -type ServersClientListOptions struct { - // The child resources to include in the response. - Expand *string + StorageContainerSasKey *string } // ServiceObjective - Represents a database service objective. type ServiceObjective struct { // Represents the properties of the resource. - Properties *ServiceObjectiveProperties `json:"properties,omitempty"` + Properties *ServiceObjectiveProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ServiceObjectiveCapability - The service objectives capability. type ServiceObjectiveCapability struct { // The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` + Reason *string // READ-ONLY; The compute model - ComputeModel *string `json:"computeModel,omitempty" azure:"ro"` + ComputeModel *string // READ-ONLY; The unique ID of the service objective. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The included (free) max size. - IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty" azure:"ro"` + IncludedMaxSize *MaxSizeCapability // READ-ONLY; The service objective name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The performance level. - PerformanceLevel *PerformanceLevelCapability `json:"performanceLevel,omitempty" azure:"ro"` + PerformanceLevel *PerformanceLevelCapability // READ-ONLY; The sku. - SKU *SKU `json:"sku,omitempty" azure:"ro"` + SKU *SKU // READ-ONLY; The status of the capability. - Status *CapabilityStatus `json:"status,omitempty" azure:"ro"` + Status *CapabilityStatus // READ-ONLY; Supported time range for auto pause delay - SupportedAutoPauseDelay *AutoPauseDelayTimeRange `json:"supportedAutoPauseDelay,omitempty" azure:"ro"` + SupportedAutoPauseDelay *AutoPauseDelayTimeRange // READ-ONLY; List of supported license types. - SupportedLicenseTypes []*LicenseTypeCapability `json:"supportedLicenseTypes,omitempty" azure:"ro"` + SupportedLicenseTypes []*LicenseTypeCapability // READ-ONLY; List of supported maintenance configurations - SupportedMaintenanceConfigurations []*MaintenanceConfigurationCapability `json:"supportedMaintenanceConfigurations,omitempty" azure:"ro"` + SupportedMaintenanceConfigurations []*MaintenanceConfigurationCapability // READ-ONLY; The list of supported maximum database sizes. - SupportedMaxSizes []*MaxSizeRangeCapability `json:"supportedMaxSizes,omitempty" azure:"ro"` + SupportedMaxSizes []*MaxSizeRangeCapability // READ-ONLY; List of supported min capacities - SupportedMinCapacities []*MinCapacityCapability `json:"supportedMinCapacities,omitempty" azure:"ro"` + SupportedMinCapacities []*MinCapacityCapability // READ-ONLY; Whether or not zone redundancy is supported for the service objective. - ZoneRedundant *bool `json:"zoneRedundant,omitempty" azure:"ro"` + ZoneRedundant *bool } // ServiceObjectiveListResult - Represents the response to a get database service objectives request. type ServiceObjectiveListResult struct { // REQUIRED; The list of database service objectives. - Value []*ServiceObjective `json:"value,omitempty"` + Value []*ServiceObjective } // ServiceObjectiveProperties - Represents the properties of a database service objective. type ServiceObjectiveProperties struct { // READ-ONLY; The description for the service level objective. - Description *string `json:"description,omitempty" azure:"ro"` + Description *string // READ-ONLY; Gets whether the service level objective is enabled. - Enabled *bool `json:"enabled,omitempty" azure:"ro"` + Enabled *bool // READ-ONLY; Gets whether the service level objective is the default service objective. - IsDefault *bool `json:"isDefault,omitempty" azure:"ro"` + IsDefault *bool // READ-ONLY; Gets whether the service level objective is a system service objective. - IsSystem *bool `json:"isSystem,omitempty" azure:"ro"` + IsSystem *bool // READ-ONLY; The name for the service objective. - ServiceObjectiveName *string `json:"serviceObjectiveName,omitempty" azure:"ro"` -} - -// ServiceObjectivesClientGetOptions contains the optional parameters for the ServiceObjectivesClient.Get method. -type ServiceObjectivesClientGetOptions struct { - // placeholder for future optional parameters -} - -// ServiceObjectivesClientListByServerOptions contains the optional parameters for the ServiceObjectivesClient.NewListByServerPager -// method. -type ServiceObjectivesClientListByServerOptions struct { - // placeholder for future optional parameters + ServiceObjectiveName *string } // ServicePrincipal - The managed instance's service principal configuration for a resource. type ServicePrincipal struct { // Service principal type. - Type *ServicePrincipalType `json:"type,omitempty"` + Type *ServicePrincipalType // READ-ONLY; The Azure Active Directory application client id. - ClientID *string `json:"clientId,omitempty" azure:"ro"` + ClientID *string // READ-ONLY; The Azure Active Directory application object id. - PrincipalID *string `json:"principalId,omitempty" azure:"ro"` + PrincipalID *string // READ-ONLY; The Azure Active Directory tenant id. - TenantID *string `json:"tenantId,omitempty" azure:"ro"` + TenantID *string } // SloUsageMetric - A Slo Usage Metric. type SloUsageMetric struct { // READ-ONLY; Gets or sets inRangeTimeRatio for SLO usage metric. - InRangeTimeRatio *float64 `json:"inRangeTimeRatio,omitempty" azure:"ro"` + InRangeTimeRatio *float64 // READ-ONLY; The serviceLevelObjective for SLO usage metric. - ServiceLevelObjective *ServiceObjectiveName `json:"serviceLevelObjective,omitempty" azure:"ro"` + ServiceLevelObjective *ServiceObjectiveName // READ-ONLY; The serviceLevelObjectiveId for SLO usage metric. - ServiceLevelObjectiveID *string `json:"serviceLevelObjectiveId,omitempty" azure:"ro"` + ServiceLevelObjectiveID *string +} + +// StartStopManagedInstanceSchedule - Managed instance's Start/Stop schedule. +type StartStopManagedInstanceSchedule struct { + // Resource properties. + Properties *StartStopManagedInstanceScheduleProperties + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; System data of the scheduled resource. + SystemData *SystemData + + // READ-ONLY; Resource type. + Type *string +} + +// StartStopManagedInstanceScheduleListResult - Managed instance's Start/Stop schedule list result. +type StartStopManagedInstanceScheduleListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string + + // READ-ONLY; Array of results. + Value []*StartStopManagedInstanceSchedule +} + +// StartStopManagedInstanceScheduleProperties - Properties of managed instance's Start/Stop schedule. +type StartStopManagedInstanceScheduleProperties struct { + // REQUIRED; Schedule list. + ScheduleList []*ScheduleItem + + // The description of the schedule. + Description *string + + // The time zone of the schedule. + TimeZoneID *string + + // READ-ONLY; Timestamp when the next action will be executed in the corresponding schedule time zone. + NextExecutionTime *string + + // READ-ONLY; Next action to be executed (Start or Stop) + NextRunAction *string } // StorageCapability - The storage account type capability. type StorageCapability struct { // The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` + Reason *string // READ-ONLY; The status of the capability. - Status *CapabilityStatus `json:"status,omitempty" azure:"ro"` + Status *CapabilityStatus // READ-ONLY; The storage account type for the database's backups. - StorageAccountType *StorageCapabilityStorageAccountType `json:"storageAccountType,omitempty" azure:"ro"` + StorageAccountType *StorageCapabilityStorageAccountType } // SubscriptionUsage - Usage Metric of a Subscription in a Location. type SubscriptionUsage struct { // Resource properties. - Properties *SubscriptionUsageProperties `json:"properties,omitempty"` + Properties *SubscriptionUsageProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // SubscriptionUsageListResult - A list of subscription usage metrics in a location. type SubscriptionUsageListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*SubscriptionUsage `json:"value,omitempty" azure:"ro"` + Value []*SubscriptionUsage } // SubscriptionUsageProperties - Properties of a subscription usage. type SubscriptionUsageProperties struct { // READ-ONLY; Current value of the metric. - CurrentValue *float64 `json:"currentValue,omitempty" azure:"ro"` + CurrentValue *float64 // READ-ONLY; User-readable name of the metric. - DisplayName *string `json:"displayName,omitempty" azure:"ro"` + DisplayName *string // READ-ONLY; Boundary value of the metric. - Limit *float64 `json:"limit,omitempty" azure:"ro"` + Limit *float64 // READ-ONLY; Unit of the metric. - Unit *string `json:"unit,omitempty" azure:"ro"` + Unit *string } -// SubscriptionUsagesClientGetOptions contains the optional parameters for the SubscriptionUsagesClient.Get method. -type SubscriptionUsagesClientGetOptions struct { - // placeholder for future optional parameters +// SynapseLinkWorkspace - Synapse link workspace resource +type SynapseLinkWorkspace struct { + // Resource properties. + Properties *SynapseLinkWorkspaceProperties + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// SynapseLinkWorkspaceInfoProperties - Properties of a Synapse link workspaces +type SynapseLinkWorkspaceInfoProperties struct { + // Link connection name. + LinkConnectionName *string + + // Synapse link workspace id. + WorkspaceID *string +} + +// SynapseLinkWorkspaceListResult - A list of synapselink workspaces +type SynapseLinkWorkspaceListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string + + // READ-ONLY; Array of results. + Value []*SynapseLinkWorkspace } -// SubscriptionUsagesClientListByLocationOptions contains the optional parameters for the SubscriptionUsagesClient.NewListByLocationPager -// method. -type SubscriptionUsagesClientListByLocationOptions struct { - // placeholder for future optional parameters +// SynapseLinkWorkspaceProperties - Properties of a Synapse link workspaces +type SynapseLinkWorkspaceProperties struct { + // List of all synapselink workspaces + Workspaces []*SynapseLinkWorkspaceInfoProperties } // SyncAgent - An Azure SQL Database sync agent. type SyncAgent struct { // Resource properties. - Properties *SyncAgentProperties `json:"properties,omitempty"` + Properties *SyncAgentProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // SyncAgentKeyProperties - Properties of an Azure SQL Database sync agent key. type SyncAgentKeyProperties struct { // READ-ONLY; Key of sync agent. - SyncAgentKey *string `json:"syncAgentKey,omitempty" azure:"ro"` + SyncAgentKey *string } // SyncAgentLinkedDatabase - An Azure SQL Database sync agent linked database. type SyncAgentLinkedDatabase struct { // Resource properties. - Properties *SyncAgentLinkedDatabaseProperties `json:"properties,omitempty"` + Properties *SyncAgentLinkedDatabaseProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // SyncAgentLinkedDatabaseListResult - A list of sync agent linked databases. type SyncAgentLinkedDatabaseListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*SyncAgentLinkedDatabase `json:"value,omitempty" azure:"ro"` + Value []*SyncAgentLinkedDatabase } // SyncAgentLinkedDatabaseProperties - Properties of an Azure SQL Database sync agent linked database. type SyncAgentLinkedDatabaseProperties struct { // READ-ONLY; Id of the sync agent linked database. - DatabaseID *string `json:"databaseId,omitempty" azure:"ro"` + DatabaseID *string // READ-ONLY; Database name of the sync agent linked database. - DatabaseName *string `json:"databaseName,omitempty" azure:"ro"` + DatabaseName *string // READ-ONLY; Type of the sync agent linked database. - DatabaseType *SyncMemberDbType `json:"databaseType,omitempty" azure:"ro"` + DatabaseType *SyncMemberDbType // READ-ONLY; Description of the sync agent linked database. - Description *string `json:"description,omitempty" azure:"ro"` + Description *string // READ-ONLY; Server name of the sync agent linked database. - ServerName *string `json:"serverName,omitempty" azure:"ro"` + ServerName *string // READ-ONLY; User name of the sync agent linked database. - UserName *string `json:"userName,omitempty" azure:"ro"` + UserName *string } // SyncAgentListResult - A list of sync agents. type SyncAgentListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*SyncAgent `json:"value,omitempty" azure:"ro"` + Value []*SyncAgent } // SyncAgentProperties - Properties of an Azure SQL Database sync agent. type SyncAgentProperties struct { // ARM resource id of the sync database in the sync agent. - SyncDatabaseID *string `json:"syncDatabaseId,omitempty"` + SyncDatabaseID *string // READ-ONLY; Expiration time of the sync agent version. - ExpiryTime *time.Time `json:"expiryTime,omitempty" azure:"ro"` + ExpiryTime *time.Time // READ-ONLY; If the sync agent version is up to date. - IsUpToDate *bool `json:"isUpToDate,omitempty" azure:"ro"` + IsUpToDate *bool // READ-ONLY; Last alive time of the sync agent. - LastAliveTime *time.Time `json:"lastAliveTime,omitempty" azure:"ro"` + LastAliveTime *time.Time // READ-ONLY; Name of the sync agent. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; State of the sync agent. - State *SyncAgentState `json:"state,omitempty" azure:"ro"` + State *SyncAgentState // READ-ONLY; Version of the sync agent. - Version *string `json:"version,omitempty" azure:"ro"` -} - -// SyncAgentsClientBeginCreateOrUpdateOptions contains the optional parameters for the SyncAgentsClient.BeginCreateOrUpdate -// method. -type SyncAgentsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SyncAgentsClientBeginDeleteOptions contains the optional parameters for the SyncAgentsClient.BeginDelete method. -type SyncAgentsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SyncAgentsClientGenerateKeyOptions contains the optional parameters for the SyncAgentsClient.GenerateKey method. -type SyncAgentsClientGenerateKeyOptions struct { - // placeholder for future optional parameters -} - -// SyncAgentsClientGetOptions contains the optional parameters for the SyncAgentsClient.Get method. -type SyncAgentsClientGetOptions struct { - // placeholder for future optional parameters -} - -// SyncAgentsClientListByServerOptions contains the optional parameters for the SyncAgentsClient.NewListByServerPager method. -type SyncAgentsClientListByServerOptions struct { - // placeholder for future optional parameters -} - -// SyncAgentsClientListLinkedDatabasesOptions contains the optional parameters for the SyncAgentsClient.NewListLinkedDatabasesPager -// method. -type SyncAgentsClientListLinkedDatabasesOptions struct { - // placeholder for future optional parameters + Version *string } // SyncDatabaseIDListResult - A list of sync database ID properties. type SyncDatabaseIDListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*SyncDatabaseIDProperties `json:"value,omitempty" azure:"ro"` + Value []*SyncDatabaseIDProperties } // SyncDatabaseIDProperties - Properties of the sync database id. type SyncDatabaseIDProperties struct { // READ-ONLY; ARM resource id of sync database. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string } // SyncFullSchemaProperties - Properties of the database full schema. type SyncFullSchemaProperties struct { // READ-ONLY; Last update time of the database schema. - LastUpdateTime *time.Time `json:"lastUpdateTime,omitempty" azure:"ro"` + LastUpdateTime *time.Time // READ-ONLY; List of tables in the database full schema. - Tables []*SyncFullSchemaTable `json:"tables,omitempty" azure:"ro"` + Tables []*SyncFullSchemaTable } // SyncFullSchemaPropertiesListResult - A list of sync schema properties. type SyncFullSchemaPropertiesListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*SyncFullSchemaProperties `json:"value,omitempty" azure:"ro"` + Value []*SyncFullSchemaProperties } // SyncFullSchemaTable - Properties of the table in the database full schema. type SyncFullSchemaTable struct { // READ-ONLY; List of columns in the table of database full schema. - Columns []*SyncFullSchemaTableColumn `json:"columns,omitempty" azure:"ro"` + Columns []*SyncFullSchemaTableColumn // READ-ONLY; Error id of the table. - ErrorID *string `json:"errorId,omitempty" azure:"ro"` + ErrorID *string // READ-ONLY; If there is error in the table. - HasError *bool `json:"hasError,omitempty" azure:"ro"` + HasError *bool // READ-ONLY; Name of the table. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Quoted name of the table. - QuotedName *string `json:"quotedName,omitempty" azure:"ro"` + QuotedName *string } // SyncFullSchemaTableColumn - Properties of the column in the table of database full schema. type SyncFullSchemaTableColumn struct { // READ-ONLY; Data size of the column. - DataSize *string `json:"dataSize,omitempty" azure:"ro"` + DataSize *string // READ-ONLY; Data type of the column. - DataType *string `json:"dataType,omitempty" azure:"ro"` + DataType *string // READ-ONLY; Error id of the column. - ErrorID *string `json:"errorId,omitempty" azure:"ro"` + ErrorID *string // READ-ONLY; If there is error in the table. - HasError *bool `json:"hasError,omitempty" azure:"ro"` + HasError *bool // READ-ONLY; If it is the primary key of the table. - IsPrimaryKey *bool `json:"isPrimaryKey,omitempty" azure:"ro"` + IsPrimaryKey *bool // READ-ONLY; Name of the column. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Quoted name of the column. - QuotedName *string `json:"quotedName,omitempty" azure:"ro"` + QuotedName *string } // SyncGroup - An Azure SQL Database sync group. type SyncGroup struct { // Resource properties. - Properties *SyncGroupProperties `json:"properties,omitempty"` + Properties *SyncGroupProperties // The name and capacity of the SKU. - SKU *SKU `json:"sku,omitempty"` + SKU *SKU // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // SyncGroupListResult - A list of sync groups. type SyncGroupListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*SyncGroup `json:"value,omitempty" azure:"ro"` + Value []*SyncGroup } // SyncGroupLogListResult - A list of sync group log properties. type SyncGroupLogListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*SyncGroupLogProperties `json:"value,omitempty" azure:"ro"` + Value []*SyncGroupLogProperties } // SyncGroupLogProperties - Properties of an Azure SQL Database sync group log. type SyncGroupLogProperties struct { // READ-ONLY; Details of the sync group log. - Details *string `json:"details,omitempty" azure:"ro"` + Details *string // READ-ONLY; OperationStatus of the sync group log. - OperationStatus *string `json:"operationStatus,omitempty" azure:"ro"` + OperationStatus *string // READ-ONLY; Source of the sync group log. - Source *string `json:"source,omitempty" azure:"ro"` + Source *string // READ-ONLY; Timestamp of the sync group log. - Timestamp *time.Time `json:"timestamp,omitempty" azure:"ro"` + Timestamp *time.Time // READ-ONLY; TracingId of the sync group log. - TracingID *string `json:"tracingId,omitempty" azure:"ro"` + TracingID *string // READ-ONLY; Type of the sync group log. - Type *SyncGroupLogType `json:"type,omitempty" azure:"ro"` + Type *SyncGroupLogType } // SyncGroupProperties - Properties of a sync group. type SyncGroupProperties struct { // Conflict logging retention period. - ConflictLoggingRetentionInDays *int32 `json:"conflictLoggingRetentionInDays,omitempty"` + ConflictLoggingRetentionInDays *int32 // Conflict resolution policy of the sync group. - ConflictResolutionPolicy *SyncConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` + ConflictResolutionPolicy *SyncConflictResolutionPolicy // If conflict logging is enabled. - EnableConflictLogging *bool `json:"enableConflictLogging,omitempty"` + EnableConflictLogging *bool // Password for the sync group hub database credential. - HubDatabasePassword *string `json:"hubDatabasePassword,omitempty"` + HubDatabasePassword *string // User name for the sync group hub database credential. - HubDatabaseUserName *string `json:"hubDatabaseUserName,omitempty"` + HubDatabaseUserName *string // Sync interval of the sync group. - Interval *int32 `json:"interval,omitempty"` + Interval *int32 // Sync schema of the sync group. - Schema *SyncGroupSchema `json:"schema,omitempty"` + Schema *SyncGroupSchema // ARM resource id of the sync database in the sync group. - SyncDatabaseID *string `json:"syncDatabaseId,omitempty"` + SyncDatabaseID *string // If use private link connection is enabled. - UsePrivateLinkConnection *bool `json:"usePrivateLinkConnection,omitempty"` + UsePrivateLinkConnection *bool // READ-ONLY; Last sync time of the sync group. - LastSyncTime *time.Time `json:"lastSyncTime,omitempty" azure:"ro"` + LastSyncTime *time.Time // READ-ONLY; Private endpoint name of the sync group if use private link connection is enabled. - PrivateEndpointName *string `json:"privateEndpointName,omitempty" azure:"ro"` + PrivateEndpointName *string // READ-ONLY; Sync state of the sync group. - SyncState *SyncGroupState `json:"syncState,omitempty" azure:"ro"` + SyncState *SyncGroupState } // SyncGroupSchema - Properties of sync group schema. type SyncGroupSchema struct { // Name of master sync member where the schema is from. - MasterSyncMemberName *string `json:"masterSyncMemberName,omitempty"` + MasterSyncMemberName *string // List of tables in sync group schema. - Tables []*SyncGroupSchemaTable `json:"tables,omitempty"` + Tables []*SyncGroupSchemaTable } // SyncGroupSchemaTable - Properties of table in sync group schema. type SyncGroupSchemaTable struct { // List of columns in sync group schema. - Columns []*SyncGroupSchemaTableColumn `json:"columns,omitempty"` + Columns []*SyncGroupSchemaTableColumn // Quoted name of sync group schema table. - QuotedName *string `json:"quotedName,omitempty"` + QuotedName *string } // SyncGroupSchemaTableColumn - Properties of column in sync group table. type SyncGroupSchemaTableColumn struct { // Data size of the column. - DataSize *string `json:"dataSize,omitempty"` + DataSize *string // Data type of the column. - DataType *string `json:"dataType,omitempty"` + DataType *string // Quoted name of sync group table column. - QuotedName *string `json:"quotedName,omitempty"` -} - -// SyncGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the SyncGroupsClient.BeginCreateOrUpdate -// method. -type SyncGroupsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SyncGroupsClientBeginDeleteOptions contains the optional parameters for the SyncGroupsClient.BeginDelete method. -type SyncGroupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SyncGroupsClientBeginRefreshHubSchemaOptions contains the optional parameters for the SyncGroupsClient.BeginRefreshHubSchema -// method. -type SyncGroupsClientBeginRefreshHubSchemaOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SyncGroupsClientBeginUpdateOptions contains the optional parameters for the SyncGroupsClient.BeginUpdate method. -type SyncGroupsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SyncGroupsClientCancelSyncOptions contains the optional parameters for the SyncGroupsClient.CancelSync method. -type SyncGroupsClientCancelSyncOptions struct { - // placeholder for future optional parameters -} - -// SyncGroupsClientGetOptions contains the optional parameters for the SyncGroupsClient.Get method. -type SyncGroupsClientGetOptions struct { - // placeholder for future optional parameters -} - -// SyncGroupsClientListByDatabaseOptions contains the optional parameters for the SyncGroupsClient.NewListByDatabasePager -// method. -type SyncGroupsClientListByDatabaseOptions struct { - // placeholder for future optional parameters -} - -// SyncGroupsClientListHubSchemasOptions contains the optional parameters for the SyncGroupsClient.NewListHubSchemasPager -// method. -type SyncGroupsClientListHubSchemasOptions struct { - // placeholder for future optional parameters -} - -// SyncGroupsClientListLogsOptions contains the optional parameters for the SyncGroupsClient.NewListLogsPager method. -type SyncGroupsClientListLogsOptions struct { - // The continuation token for this operation. - ContinuationToken *string -} - -// SyncGroupsClientListSyncDatabaseIDsOptions contains the optional parameters for the SyncGroupsClient.NewListSyncDatabaseIDsPager -// method. -type SyncGroupsClientListSyncDatabaseIDsOptions struct { - // placeholder for future optional parameters -} - -// SyncGroupsClientTriggerSyncOptions contains the optional parameters for the SyncGroupsClient.TriggerSync method. -type SyncGroupsClientTriggerSyncOptions struct { - // placeholder for future optional parameters + QuotedName *string } // SyncMember - An Azure SQL Database sync member. type SyncMember struct { // Resource properties. - Properties *SyncMemberProperties `json:"properties,omitempty"` + Properties *SyncMemberProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // SyncMemberListResult - A list of Azure SQL Database sync members. type SyncMemberListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*SyncMember `json:"value,omitempty" azure:"ro"` + Value []*SyncMember } // SyncMemberProperties - Properties of a sync member. type SyncMemberProperties struct { // Database name of the member database in the sync member. - DatabaseName *string `json:"databaseName,omitempty"` + DatabaseName *string // Database type of the sync member. - DatabaseType *SyncMemberDbType `json:"databaseType,omitempty"` + DatabaseType *SyncMemberDbType // Password of the member database in the sync member. - Password *string `json:"password,omitempty"` + Password *string // SQL Server database id of the sync member. - SQLServerDatabaseID *string `json:"sqlServerDatabaseId,omitempty"` + SQLServerDatabaseID *string // Server name of the member database in the sync member - ServerName *string `json:"serverName,omitempty"` + ServerName *string // ARM resource id of the sync agent in the sync member. - SyncAgentID *string `json:"syncAgentId,omitempty"` + SyncAgentID *string // Sync direction of the sync member. - SyncDirection *SyncDirection `json:"syncDirection,omitempty"` + SyncDirection *SyncDirection // ARM resource id of the sync member logical database, for sync members in Azure. - SyncMemberAzureDatabaseResourceID *string `json:"syncMemberAzureDatabaseResourceId,omitempty"` + SyncMemberAzureDatabaseResourceID *string // Whether to use private link connection. - UsePrivateLinkConnection *bool `json:"usePrivateLinkConnection,omitempty"` + UsePrivateLinkConnection *bool // User name of the member database in the sync member. - UserName *string `json:"userName,omitempty"` + UserName *string // READ-ONLY; Private endpoint name of the sync member if use private link connection is enabled, for sync members in Azure. - PrivateEndpointName *string `json:"privateEndpointName,omitempty" azure:"ro"` + PrivateEndpointName *string // READ-ONLY; Sync state of the sync member. - SyncState *SyncMemberState `json:"syncState,omitempty" azure:"ro"` -} - -// SyncMembersClientBeginCreateOrUpdateOptions contains the optional parameters for the SyncMembersClient.BeginCreateOrUpdate -// method. -type SyncMembersClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SyncMembersClientBeginDeleteOptions contains the optional parameters for the SyncMembersClient.BeginDelete method. -type SyncMembersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SyncMembersClientBeginRefreshMemberSchemaOptions contains the optional parameters for the SyncMembersClient.BeginRefreshMemberSchema -// method. -type SyncMembersClientBeginRefreshMemberSchemaOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SyncMembersClientBeginUpdateOptions contains the optional parameters for the SyncMembersClient.BeginUpdate method. -type SyncMembersClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SyncMembersClientGetOptions contains the optional parameters for the SyncMembersClient.Get method. -type SyncMembersClientGetOptions struct { - // placeholder for future optional parameters -} - -// SyncMembersClientListBySyncGroupOptions contains the optional parameters for the SyncMembersClient.NewListBySyncGroupPager -// method. -type SyncMembersClientListBySyncGroupOptions struct { - // placeholder for future optional parameters -} - -// SyncMembersClientListMemberSchemasOptions contains the optional parameters for the SyncMembersClient.NewListMemberSchemasPager -// method. -type SyncMembersClientListMemberSchemasOptions struct { - // placeholder for future optional parameters + SyncState *SyncMemberState } // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt *time.Time // The identity that created the resource. - CreatedBy *string `json:"createdBy,omitempty"` + CreatedBy *string // The type of identity that created the resource. - CreatedByType *CreatedByType `json:"createdByType,omitempty"` + CreatedByType *CreatedByType // The timestamp of resource last modification (UTC) - LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` + LastModifiedAt *time.Time // The identity that last modified the resource. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + LastModifiedBy *string // The type of identity that last modified the resource. - LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` + LastModifiedByType *CreatedByType } // TdeCertificate - A TDE certificate that can be uploaded into a server. type TdeCertificate struct { // Resource properties. - Properties *TdeCertificateProperties `json:"properties,omitempty"` + Properties *TdeCertificateProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // TdeCertificateProperties - Properties of a TDE certificate. type TdeCertificateProperties struct { // REQUIRED; The base64 encoded certificate private blob. - PrivateBlob *string `json:"privateBlob,omitempty"` + PrivateBlob *string // The certificate password. - CertPassword *string `json:"certPassword,omitempty"` -} - -// TdeCertificatesClientBeginCreateOptions contains the optional parameters for the TdeCertificatesClient.BeginCreate method. -type TdeCertificatesClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string + CertPassword *string } // TimeZone - Time Zone. type TimeZone struct { // Resource properties. - Properties *TimeZoneProperties `json:"properties,omitempty"` + Properties *TimeZoneProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // TimeZoneListResult - A list of time zones. type TimeZoneListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*TimeZone `json:"value,omitempty" azure:"ro"` + Value []*TimeZone } // TimeZoneProperties - The properties of a time zone. type TimeZoneProperties struct { // READ-ONLY; The time zone display name - DisplayName *string `json:"displayName,omitempty" azure:"ro"` + DisplayName *string // READ-ONLY; The time zone id - TimeZoneID *string `json:"timeZoneId,omitempty" azure:"ro"` -} - -// TimeZonesClientGetOptions contains the optional parameters for the TimeZonesClient.Get method. -type TimeZonesClientGetOptions struct { - // placeholder for future optional parameters -} - -// TimeZonesClientListByLocationOptions contains the optional parameters for the TimeZonesClient.NewListByLocationPager method. -type TimeZonesClientListByLocationOptions struct { - // placeholder for future optional parameters + TimeZoneID *string } type TopQueries struct { // List of top resource consuming queries with appropriate metric data - Queries []*QueryStatisticsProperties `json:"queries,omitempty"` + Queries []*QueryStatisticsProperties // READ-ONLY; Aggregation function used to calculate query metrics. - AggregationFunction *string `json:"aggregationFunction,omitempty" azure:"ro"` + AggregationFunction *string // READ-ONLY; The end time for the metric (ISO-8601 format). - EndTime *string `json:"endTime,omitempty" azure:"ro"` + EndTime *string // READ-ONLY; Interval type (length). - IntervalType *QueryTimeGrainType `json:"intervalType,omitempty" azure:"ro"` + IntervalType *QueryTimeGrainType // READ-ONLY; Requested number of top queries. - NumberOfQueries *int32 `json:"numberOfQueries,omitempty" azure:"ro"` + NumberOfQueries *int32 // READ-ONLY; Metric used to rank queries. - ObservationMetric *string `json:"observationMetric,omitempty" azure:"ro"` + ObservationMetric *string // READ-ONLY; The start time for the metric (ISO-8601 format). - StartTime *string `json:"startTime,omitempty" azure:"ro"` + StartTime *string } // TopQueriesListResult - A list of top resource consuming queries on managed instance type TopQueriesListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*TopQueries `json:"value,omitempty" azure:"ro"` + Value []*TopQueries } // TrackedResource - ARM tracked top level resource. type TrackedResource struct { // REQUIRED; Resource location. - Location *string `json:"location,omitempty"` + Location *string // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // TransparentDataEncryptionProperties - Properties of a transparent data encryption. type TransparentDataEncryptionProperties struct { // REQUIRED; Specifies the state of the transparent data encryption. - State *TransparentDataEncryptionState `json:"state,omitempty"` -} - -// TransparentDataEncryptionsClientCreateOrUpdateOptions contains the optional parameters for the TransparentDataEncryptionsClient.CreateOrUpdate -// method. -type TransparentDataEncryptionsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// TransparentDataEncryptionsClientGetOptions contains the optional parameters for the TransparentDataEncryptionsClient.Get -// method. -type TransparentDataEncryptionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// TransparentDataEncryptionsClientListByDatabaseOptions contains the optional parameters for the TransparentDataEncryptionsClient.NewListByDatabasePager -// method. -type TransparentDataEncryptionsClientListByDatabaseOptions struct { - // placeholder for future optional parameters + State *TransparentDataEncryptionState } // UpdateLongTermRetentionBackupParameters - Contains the information necessary to perform long term retention backup update // operation. type UpdateLongTermRetentionBackupParameters struct { // Resource properties. - Properties *UpdateLongTermRetentionBackupParametersProperties `json:"properties,omitempty"` + Properties *UpdateLongTermRetentionBackupParametersProperties } // UpdateLongTermRetentionBackupParametersProperties - Contains the properties to perform long term retention backup copy // operation. type UpdateLongTermRetentionBackupParametersProperties struct { // The storage redundancy type of the copied backup - RequestedBackupStorageRedundancy *BackupStorageRedundancy `json:"requestedBackupStorageRedundancy,omitempty"` + RequestedBackupStorageRedundancy *BackupStorageRedundancy } -// UpdateManagedInstanceDNSServersOperation - A recoverable managed database resource. -type UpdateManagedInstanceDNSServersOperation struct { +// UpdateVirtualClusterDNSServersOperation - A refresh DNS servers operation. +type UpdateVirtualClusterDNSServersOperation struct { // Resource properties. - Properties *DNSRefreshConfigurationProperties `json:"properties,omitempty"` + Properties *VirtualClusterDNSServersProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } type UpsertManagedServerOperationParameters struct { - Family *string `json:"family,omitempty"` - StorageSizeInGB *int32 `json:"storageSizeInGB,omitempty"` - Tier *string `json:"tier,omitempty"` - VCores *int32 `json:"vCores,omitempty"` + Family *string + StorageSizeInGB *int32 + Tier *string + VCores *int32 } type UpsertManagedServerOperationStep struct { - Name *string `json:"name,omitempty"` - Order *int32 `json:"order,omitempty"` - Status *UpsertManagedServerOperationStepStatus `json:"status,omitempty"` + Name *string + Order *int32 + Status *UpsertManagedServerOperationStepStatus } // Usage - ARM usage. type Usage struct { // READ-ONLY; Usage current value. - CurrentValue *int32 `json:"currentValue,omitempty" azure:"ro"` + CurrentValue *int32 // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Usage limit. - Limit *int32 `json:"limit,omitempty" azure:"ro"` + Limit *int32 // READ-ONLY; Resource name. - Name *Name `json:"name,omitempty" azure:"ro"` + Name *Name // READ-ONLY; Usage requested limit. - RequestedLimit *int32 `json:"requestedLimit,omitempty" azure:"ro"` + RequestedLimit *int32 // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string // READ-ONLY; Usage unit. - Unit *string `json:"unit,omitempty" azure:"ro"` + Unit *string } // UsageListResult - A list of usages. type UsageListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*Usage `json:"value,omitempty" azure:"ro"` -} - -// UsagesClientListByInstancePoolOptions contains the optional parameters for the UsagesClient.NewListByInstancePoolPager -// method. -type UsagesClientListByInstancePoolOptions struct { - // Optional request parameter to include managed instance usages within the instance pool. - ExpandChildren *bool + Value []*Usage } // UserIdentity - Azure Active Directory identity configuration for a resource. type UserIdentity struct { // READ-ONLY; The Azure Active Directory client id. - ClientID *string `json:"clientId,omitempty" azure:"ro"` + ClientID *string // READ-ONLY; The Azure Active Directory principal id. - PrincipalID *string `json:"principalId,omitempty" azure:"ro"` + PrincipalID *string +} + +// VaRule - SQL Vulnerability Assessment rule metadata details. +type VaRule struct { + // READ-ONLY; SQL Vulnerability Assessment benchmark references. + BenchmarkReferences []*BenchmarkReference + + // READ-ONLY; SQL Vulnerability Assessment rule category. + Category *string + + // READ-ONLY; SQL Vulnerability Assessment rule description. + Description *string + + // READ-ONLY; SQL Vulnerability Assessment rule query details. + QueryCheck *QueryCheck + + // READ-ONLY; SQL Vulnerability Assessment rule rationale. + Rationale *string + + // READ-ONLY; SQL Vulnerability Assessment rule Id. + RuleID *string + + // READ-ONLY; SQL Vulnerability Assessment rule type. + RuleType *RuleType + + // READ-ONLY; SQL Vulnerability Assessment rule severity. + Severity *RuleSeverity + + // READ-ONLY; SQL Vulnerability Assessment rule title. + Title *string } // VirtualCluster - An Azure SQL virtual cluster. type VirtualCluster struct { // REQUIRED; Resource location. - Location *string `json:"location,omitempty"` + Location *string // Resource properties. - Properties *VirtualClusterProperties `json:"properties,omitempty"` + Properties *VirtualClusterProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string +} + +// VirtualClusterDNSServersProperties - The properties of dns servers on virtual cluster. +type VirtualClusterDNSServersProperties struct { + // READ-ONLY; The status of the DNS refresh operation. + Status *DNSRefreshOperationStatus } // VirtualClusterListResult - A list of virtual clusters. type VirtualClusterListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*VirtualCluster `json:"value,omitempty" azure:"ro"` + Value []*VirtualCluster } // VirtualClusterProperties - The properties of a virtual cluster. type VirtualClusterProperties struct { - // If the service has different generations of hardware, for the same SKU, then that can be captured here. - Family *string `json:"family,omitempty"` - - // Specifies maintenance configuration id to apply to this virtual cluster. - MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"` + // Virtual cluster version. + Version *string // READ-ONLY; List of resources in this virtual cluster. - ChildResources []*string `json:"childResources,omitempty" azure:"ro"` + ChildResources []*string // READ-ONLY; Subnet resource ID for the virtual cluster. - SubnetID *string `json:"subnetId,omitempty" azure:"ro"` + SubnetID *string } -// VirtualClusterUpdate - An update request for an Azure SQL Database virtual cluster. +// VirtualClusterUpdate - An update request for virtual cluster. type VirtualClusterUpdate struct { // Resource properties. - Properties *VirtualClusterProperties `json:"properties,omitempty"` + Properties *VirtualClusterProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` -} - -// VirtualClustersClientBeginDeleteOptions contains the optional parameters for the VirtualClustersClient.BeginDelete method. -type VirtualClustersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualClustersClientBeginUpdateOptions contains the optional parameters for the VirtualClustersClient.BeginUpdate method. -type VirtualClustersClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualClustersClientGetOptions contains the optional parameters for the VirtualClustersClient.Get method. -type VirtualClustersClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualClustersClientListByResourceGroupOptions contains the optional parameters for the VirtualClustersClient.NewListByResourceGroupPager -// method. -type VirtualClustersClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// VirtualClustersClientListOptions contains the optional parameters for the VirtualClustersClient.NewListPager method. -type VirtualClustersClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualClustersClientUpdateDNSServersOptions contains the optional parameters for the VirtualClustersClient.UpdateDNSServers -// method. -type VirtualClustersClientUpdateDNSServersOptions struct { - // placeholder for future optional parameters + Tags map[string]*string } // VirtualNetworkRule - A virtual network rule. type VirtualNetworkRule struct { // Resource properties. - Properties *VirtualNetworkRuleProperties `json:"properties,omitempty"` + Properties *VirtualNetworkRuleProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // VirtualNetworkRuleListResult - A list of virtual network rules. type VirtualNetworkRuleListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*VirtualNetworkRule `json:"value,omitempty" azure:"ro"` + Value []*VirtualNetworkRule } // VirtualNetworkRuleProperties - Properties of a virtual network rule. type VirtualNetworkRuleProperties struct { // REQUIRED; The ARM resource id of the virtual network subnet. - VirtualNetworkSubnetID *string `json:"virtualNetworkSubnetId,omitempty"` + VirtualNetworkSubnetID *string // Create firewall rule before the virtual network has vnet service endpoint enabled. - IgnoreMissingVnetServiceEndpoint *bool `json:"ignoreMissingVnetServiceEndpoint,omitempty"` + IgnoreMissingVnetServiceEndpoint *bool // READ-ONLY; Virtual Network Rule State - State *VirtualNetworkRuleState `json:"state,omitempty" azure:"ro"` + State *VirtualNetworkRuleState } -// VirtualNetworkRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginCreateOrUpdate -// method. -type VirtualNetworkRulesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} +// VulnerabilityAssessment - A SQL Vulnerability Assessment. +type VulnerabilityAssessment struct { + // Resource properties. + Properties *VulnerabilityAssessmentPolicyProperties + + // READ-ONLY; Resource ID. + ID *string -// VirtualNetworkRulesClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginDelete -// method. -type VirtualNetworkRulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; SystemData of SqlVulnerabilityAssessmentResource. + SystemData *SystemData + + // READ-ONLY; Resource type. + Type *string } -// VirtualNetworkRulesClientGetOptions contains the optional parameters for the VirtualNetworkRulesClient.Get method. -type VirtualNetworkRulesClientGetOptions struct { - // placeholder for future optional parameters +// VulnerabilityAssessmentListResult - A list of SQL Vulnerability Assessments. +type VulnerabilityAssessmentListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string + + // READ-ONLY; Array of results. + Value []*VulnerabilityAssessment } -// VirtualNetworkRulesClientListByServerOptions contains the optional parameters for the VirtualNetworkRulesClient.NewListByServerPager -// method. -type VirtualNetworkRulesClientListByServerOptions struct { - // placeholder for future optional parameters +type VulnerabilityAssessmentPolicyProperties struct { + // Specifies the state of the SQL Vulnerability Assessment, whether it is enabled or disabled or a state has not been applied + // yet on the specific database or server. + State *SQLVulnerabilityAssessmentState } // VulnerabilityAssessmentRecurringScansProperties - Properties of a Vulnerability Assessment recurring scans. type VulnerabilityAssessmentRecurringScansProperties struct { // Specifies that the schedule scan notification will be is sent to the subscription administrators. - EmailSubscriptionAdmins *bool `json:"emailSubscriptionAdmins,omitempty"` + EmailSubscriptionAdmins *bool // Specifies an array of e-mail addresses to which the scan notification is sent. - Emails []*string `json:"emails,omitempty"` + Emails []*string // Recurring scans state. - IsEnabled *bool `json:"isEnabled,omitempty"` + IsEnabled *bool } // VulnerabilityAssessmentScanError - Properties of a vulnerability assessment scan error. type VulnerabilityAssessmentScanError struct { // READ-ONLY; The error code. - Code *string `json:"code,omitempty" azure:"ro"` + Code *string // READ-ONLY; The error message. - Message *string `json:"message,omitempty" azure:"ro"` + Message *string +} + +// VulnerabilityAssessmentScanForSQLError - Properties of a vulnerability assessment scan error. +type VulnerabilityAssessmentScanForSQLError struct { + // READ-ONLY; The error code. + Code *string + + // READ-ONLY; The error message. + Message *string +} + +// VulnerabilityAssessmentScanListResult - A list of vulnerability assessment scan results. +type VulnerabilityAssessmentScanListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string + + // READ-ONLY; Array of results. + Value []*VulnerabilityAssessmentScanResults } // VulnerabilityAssessmentScanRecord - A vulnerability assessment scan record. type VulnerabilityAssessmentScanRecord struct { // Resource properties. - Properties *VulnerabilityAssessmentScanRecordProperties `json:"properties,omitempty"` + Properties *VulnerabilityAssessmentScanRecordProperties + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// VulnerabilityAssessmentScanRecordForSQL - A vulnerability assessment scan record. +type VulnerabilityAssessmentScanRecordForSQL struct { + // Resource properties. + Properties *VulnerabilityAssessmentScanRecordForSQLProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string + + // READ-ONLY; SystemData of SqlVulnerabilityAssessmentScanRecordResource. + SystemData *SystemData // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string +} + +// VulnerabilityAssessmentScanRecordForSQLListResult - A list of vulnerability assessment scan records. +type VulnerabilityAssessmentScanRecordForSQLListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string + + // READ-ONLY; Array of results. + Value []*VulnerabilityAssessmentScanRecordForSQL +} + +// VulnerabilityAssessmentScanRecordForSQLProperties - Properties of a vulnerability assessment scan record. +type VulnerabilityAssessmentScanRecordForSQLProperties struct { + // READ-ONLY; The database name. + Database *string + + // READ-ONLY; The scan end time (UTC). + EndTime *time.Time + + // READ-ONLY; The scan errors. + Errors []*VulnerabilityAssessmentScanForSQLError + + // READ-ONLY; The number of failed rules with high severity. + HighSeverityFailedRulesCount *int32 + + // READ-ONLY; Baseline created for this database, and has one or more rules. + IsBaselineApplied *bool + + // READ-ONLY; The last scan time. + LastScanTime *time.Time + + // READ-ONLY; The number of failed rules with low severity. + LowSeverityFailedRulesCount *int32 + + // READ-ONLY; The number of failed rules with medium severity. + MediumSeverityFailedRulesCount *int32 + + // READ-ONLY; The SQL version. + SQLVersion *string + + // READ-ONLY; The scan ID. + ScanID *string + + // READ-ONLY; The server name. + Server *string + + // READ-ONLY; The scan start time (UTC). + StartTime *time.Time + + // READ-ONLY; The scan status. + State *VulnerabilityAssessmentScanState + + // READ-ONLY; The number of total failed rules. + TotalFailedRulesCount *int32 + + // READ-ONLY; The number of total passed rules. + TotalPassedRulesCount *int32 + + // READ-ONLY; The number of total rules assessed. + TotalRulesCount *int32 + + // READ-ONLY; The scan trigger type. + TriggerType *VulnerabilityAssessmentScanTriggerType } // VulnerabilityAssessmentScanRecordListResult - A list of vulnerability assessment scan records. type VulnerabilityAssessmentScanRecordListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*VulnerabilityAssessmentScanRecord `json:"value,omitempty" azure:"ro"` + Value []*VulnerabilityAssessmentScanRecord } // VulnerabilityAssessmentScanRecordProperties - Properties of a vulnerability assessment scan record. type VulnerabilityAssessmentScanRecordProperties struct { // READ-ONLY; The scan end time (UTC). - EndTime *time.Time `json:"endTime,omitempty" azure:"ro"` + EndTime *time.Time // READ-ONLY; The scan errors. - Errors []*VulnerabilityAssessmentScanError `json:"errors,omitempty" azure:"ro"` + Errors []*VulnerabilityAssessmentScanError // READ-ONLY; The number of failed security checks. - NumberOfFailedSecurityChecks *int32 `json:"numberOfFailedSecurityChecks,omitempty" azure:"ro"` + NumberOfFailedSecurityChecks *int32 // READ-ONLY; The scan ID. - ScanID *string `json:"scanId,omitempty" azure:"ro"` + ScanID *string // READ-ONLY; The scan start time (UTC). - StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` + StartTime *time.Time // READ-ONLY; The scan status. - State *VulnerabilityAssessmentScanState `json:"state,omitempty" azure:"ro"` + State *VulnerabilityAssessmentScanState // READ-ONLY; The scan results storage container path. - StorageContainerPath *string `json:"storageContainerPath,omitempty" azure:"ro"` + StorageContainerPath *string // READ-ONLY; The scan trigger type. - TriggerType *VulnerabilityAssessmentScanTriggerType `json:"triggerType,omitempty" azure:"ro"` + TriggerType *VulnerabilityAssessmentScanTriggerType +} + +// VulnerabilityAssessmentScanResultProperties - SQL Vulnerability Assessment scan result properties for a single rule. +type VulnerabilityAssessmentScanResultProperties struct { + // READ-ONLY; SQL Vulnerability Assessment rule result adjusted with baseline. + BaselineAdjustedResult *BaselineAdjustedResult + + // READ-ONLY; SQL Vulnerability Assessment error message. + ErrorMessage *string + + // READ-ONLY; SQL Vulnerability Assessment is the query results trimmed. + IsTrimmed *bool + + // READ-ONLY; SQL Vulnerability Assessment query results that was run. + QueryResults [][]*string + + // READ-ONLY; SQL Vulnerability Assessment the remediation details. + Remediation *Remediation + + // READ-ONLY; SQL Vulnerability Assessment rule Id. + RuleID *string + + // READ-ONLY; SQL Vulnerability Assessment rule metadata. + RuleMetadata *VaRule + + // READ-ONLY; SQL Vulnerability Assessment rule result status. + Status *RuleStatus +} + +type VulnerabilityAssessmentScanResults struct { + // Resource properties. + Properties *VulnerabilityAssessmentScanResultProperties + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; SystemData of AdvancedThreatProtectionResource. + SystemData *SystemData + + // READ-ONLY; Resource type. + Type *string } // WorkloadClassifier - Workload classifier operations for a data warehouse type WorkloadClassifier struct { // Resource properties. - Properties *WorkloadClassifierProperties `json:"properties,omitempty"` + Properties *WorkloadClassifierProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // WorkloadClassifierListResult - A list of workload classifiers for a workload group. type WorkloadClassifierListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*WorkloadClassifier `json:"value,omitempty" azure:"ro"` + Value []*WorkloadClassifier } // WorkloadClassifierProperties - Workload classifier definition. For more information look at sys.workloadmanagementworkload_classifiers // (DMV). type WorkloadClassifierProperties struct { // REQUIRED; The workload classifier member name. - MemberName *string `json:"memberName,omitempty"` + MemberName *string // The workload classifier context. - Context *string `json:"context,omitempty"` + Context *string // The workload classifier end time for classification. - EndTime *string `json:"endTime,omitempty"` + EndTime *string // The workload classifier importance. - Importance *string `json:"importance,omitempty"` + Importance *string // The workload classifier label. - Label *string `json:"label,omitempty"` + Label *string // The workload classifier start time for classification. - StartTime *string `json:"startTime,omitempty"` -} - -// WorkloadClassifiersClientBeginCreateOrUpdateOptions contains the optional parameters for the WorkloadClassifiersClient.BeginCreateOrUpdate -// method. -type WorkloadClassifiersClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WorkloadClassifiersClientBeginDeleteOptions contains the optional parameters for the WorkloadClassifiersClient.BeginDelete -// method. -type WorkloadClassifiersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WorkloadClassifiersClientGetOptions contains the optional parameters for the WorkloadClassifiersClient.Get method. -type WorkloadClassifiersClientGetOptions struct { - // placeholder for future optional parameters -} - -// WorkloadClassifiersClientListByWorkloadGroupOptions contains the optional parameters for the WorkloadClassifiersClient.NewListByWorkloadGroupPager -// method. -type WorkloadClassifiersClientListByWorkloadGroupOptions struct { - // placeholder for future optional parameters + StartTime *string } // WorkloadGroup - Workload group operations for a data warehouse type WorkloadGroup struct { // Resource properties. - Properties *WorkloadGroupProperties `json:"properties,omitempty"` + Properties *WorkloadGroupProperties // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // WorkloadGroupListResult - A list of workload groups. type WorkloadGroupListResult struct { // READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Array of results. - Value []*WorkloadGroup `json:"value,omitempty" azure:"ro"` + Value []*WorkloadGroup } // WorkloadGroupProperties - Workload group definition. For more information look at sys.workloadmanagementworkload_groups // (DMV). type WorkloadGroupProperties struct { // REQUIRED; The workload group cap percentage resource. - MaxResourcePercent *int32 `json:"maxResourcePercent,omitempty"` + MaxResourcePercent *int32 // REQUIRED; The workload group minimum percentage resource. - MinResourcePercent *int32 `json:"minResourcePercent,omitempty"` + MinResourcePercent *int32 // REQUIRED; The workload group request minimum grant percentage. - MinResourcePercentPerRequest *float64 `json:"minResourcePercentPerRequest,omitempty"` + MinResourcePercentPerRequest *float64 // The workload group importance level. - Importance *string `json:"importance,omitempty"` + Importance *string // The workload group request maximum grant percentage. - MaxResourcePercentPerRequest *float64 `json:"maxResourcePercentPerRequest,omitempty"` + MaxResourcePercentPerRequest *float64 // The workload group query execution timeout. - QueryExecutionTimeout *int32 `json:"queryExecutionTimeout,omitempty"` -} - -// WorkloadGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the WorkloadGroupsClient.BeginCreateOrUpdate -// method. -type WorkloadGroupsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WorkloadGroupsClientBeginDeleteOptions contains the optional parameters for the WorkloadGroupsClient.BeginDelete method. -type WorkloadGroupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WorkloadGroupsClientGetOptions contains the optional parameters for the WorkloadGroupsClient.Get method. -type WorkloadGroupsClientGetOptions struct { - // placeholder for future optional parameters -} - -// WorkloadGroupsClientListByDatabaseOptions contains the optional parameters for the WorkloadGroupsClient.NewListByDatabasePager -// method. -type WorkloadGroupsClientListByDatabaseOptions struct { - // placeholder for future optional parameters + QueryExecutionTimeout *int32 } diff --git a/sdk/resourcemanager/sql/armsql/models_serde.go b/sdk/resourcemanager/sql/armsql/models_serde.go index e1686b004d78..33cb5960236c 100644 --- a/sdk/resourcemanager/sql/armsql/models_serde.go +++ b/sdk/resourcemanager/sql/armsql/models_serde.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -639,6 +638,107 @@ func (b *BaseLongTermRetentionPolicyProperties) UnmarshalJSON(data []byte) error return nil } +// MarshalJSON implements the json.Marshaller interface for type Baseline. +func (b Baseline) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "expectedResults", b.ExpectedResults) + populateTimeRFC3339(objectMap, "updatedTime", b.UpdatedTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Baseline. +func (b *Baseline) UnmarshalJSON(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 "expectedResults": + err = unpopulate(val, "ExpectedResults", &b.ExpectedResults) + delete(rawMsg, key) + case "updatedTime": + err = unpopulateTimeRFC3339(val, "UpdatedTime", &b.UpdatedTime) + 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 BaselineAdjustedResult. +func (b BaselineAdjustedResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "baseline", b.Baseline) + populate(objectMap, "resultsNotInBaseline", b.ResultsNotInBaseline) + populate(objectMap, "resultsOnlyInBaseline", b.ResultsOnlyInBaseline) + populate(objectMap, "status", b.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BaselineAdjustedResult. +func (b *BaselineAdjustedResult) UnmarshalJSON(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 "baseline": + err = unpopulate(val, "Baseline", &b.Baseline) + delete(rawMsg, key) + case "resultsNotInBaseline": + err = unpopulate(val, "ResultsNotInBaseline", &b.ResultsNotInBaseline) + delete(rawMsg, key) + case "resultsOnlyInBaseline": + err = unpopulate(val, "ResultsOnlyInBaseline", &b.ResultsOnlyInBaseline) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &b.Status) + 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 BenchmarkReference. +func (b BenchmarkReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "benchmark", b.Benchmark) + populate(objectMap, "reference", b.Reference) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BenchmarkReference. +func (b *BenchmarkReference) UnmarshalJSON(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 "benchmark": + err = unpopulate(val, "Benchmark", &b.Benchmark) + delete(rawMsg, key) + case "reference": + err = unpopulate(val, "Reference", &b.Reference) + 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]any) @@ -837,33 +937,6 @@ func (c *CreateDatabaseRestorePointDefinition) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type DNSRefreshConfigurationProperties. -func (d DNSRefreshConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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]any) @@ -1762,6 +1835,45 @@ func (d *DatabaseIdentity) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DatabaseKey. +func (d DatabaseKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "creationDate", d.CreationDate) + populate(objectMap, "subregion", d.Subregion) + populate(objectMap, "thumbprint", d.Thumbprint) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseKey. +func (d *DatabaseKey) UnmarshalJSON(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 "creationDate": + err = unpopulateTimeRFC3339(val, "CreationDate", &d.CreationDate) + delete(rawMsg, key) + case "subregion": + err = unpopulate(val, "Subregion", &d.Subregion) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &d.Thumbprint) + 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 DatabaseListResult. func (d DatabaseListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1946,6 +2058,7 @@ func (d *DatabaseOperationProperties) UnmarshalJSON(data []byte) error { func (d DatabaseProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "autoPauseDelay", d.AutoPauseDelay) + populate(objectMap, "availabilityZone", d.AvailabilityZone) populate(objectMap, "catalogCollation", d.CatalogCollation) populate(objectMap, "collation", d.Collation) populate(objectMap, "createMode", d.CreateMode) @@ -1957,18 +2070,23 @@ func (d DatabaseProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "defaultSecondaryLocation", d.DefaultSecondaryLocation) populateTimeRFC3339(objectMap, "earliestRestoreDate", d.EarliestRestoreDate) populate(objectMap, "elasticPoolId", d.ElasticPoolID) + populate(objectMap, "encryptionProtector", d.EncryptionProtector) 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, "keys", d.Keys) populate(objectMap, "licenseType", d.LicenseType) populate(objectMap, "longTermRetentionBackupResourceId", d.LongTermRetentionBackupResourceID) populate(objectMap, "maintenanceConfigurationId", d.MaintenanceConfigurationID) + populate(objectMap, "manualCutover", d.ManualCutover) populate(objectMap, "maxLogSizeBytes", d.MaxLogSizeBytes) populate(objectMap, "maxSizeBytes", d.MaxSizeBytes) populate(objectMap, "minCapacity", d.MinCapacity) populateTimeRFC3339(objectMap, "pausedDate", d.PausedDate) + populate(objectMap, "performCutover", d.PerformCutover) + populate(objectMap, "preferredEnclaveType", d.PreferredEnclaveType) populate(objectMap, "readScale", d.ReadScale) populate(objectMap, "recoverableDatabaseId", d.RecoverableDatabaseID) populate(objectMap, "recoveryServicesRecoveryPointId", d.RecoveryServicesRecoveryPointID) @@ -1999,6 +2117,9 @@ func (d *DatabaseProperties) UnmarshalJSON(data []byte) error { case "autoPauseDelay": err = unpopulate(val, "AutoPauseDelay", &d.AutoPauseDelay) delete(rawMsg, key) + case "availabilityZone": + err = unpopulate(val, "AvailabilityZone", &d.AvailabilityZone) + delete(rawMsg, key) case "catalogCollation": err = unpopulate(val, "CatalogCollation", &d.CatalogCollation) delete(rawMsg, key) @@ -2032,6 +2153,9 @@ func (d *DatabaseProperties) UnmarshalJSON(data []byte) error { case "elasticPoolId": err = unpopulate(val, "ElasticPoolID", &d.ElasticPoolID) delete(rawMsg, key) + case "encryptionProtector": + err = unpopulate(val, "EncryptionProtector", &d.EncryptionProtector) + delete(rawMsg, key) case "failoverGroupId": err = unpopulate(val, "FailoverGroupID", &d.FailoverGroupID) delete(rawMsg, key) @@ -2047,6 +2171,9 @@ func (d *DatabaseProperties) UnmarshalJSON(data []byte) error { case "isLedgerOn": err = unpopulate(val, "IsLedgerOn", &d.IsLedgerOn) delete(rawMsg, key) + case "keys": + err = unpopulate(val, "Keys", &d.Keys) + delete(rawMsg, key) case "licenseType": err = unpopulate(val, "LicenseType", &d.LicenseType) delete(rawMsg, key) @@ -2056,6 +2183,9 @@ func (d *DatabaseProperties) UnmarshalJSON(data []byte) error { case "maintenanceConfigurationId": err = unpopulate(val, "MaintenanceConfigurationID", &d.MaintenanceConfigurationID) delete(rawMsg, key) + case "manualCutover": + err = unpopulate(val, "ManualCutover", &d.ManualCutover) + delete(rawMsg, key) case "maxLogSizeBytes": err = unpopulate(val, "MaxLogSizeBytes", &d.MaxLogSizeBytes) delete(rawMsg, key) @@ -2068,6 +2198,12 @@ func (d *DatabaseProperties) UnmarshalJSON(data []byte) error { case "pausedDate": err = unpopulateTimeRFC3339(val, "PausedDate", &d.PausedDate) delete(rawMsg, key) + case "performCutover": + err = unpopulate(val, "PerformCutover", &d.PerformCutover) + delete(rawMsg, key) + case "preferredEnclaveType": + err = unpopulate(val, "PreferredEnclaveType", &d.PreferredEnclaveType) + delete(rawMsg, key) case "readScale": err = unpopulate(val, "ReadScale", &d.ReadScale) delete(rawMsg, key) @@ -2121,17 +2257,19 @@ func (d *DatabaseProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseSchema. -func (d DatabaseSchema) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseSQLVulnerabilityAssessmentBaselineSet. +func (d DatabaseSQLVulnerabilityAssessmentBaselineSet) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 DatabaseSchema. -func (d *DatabaseSchema) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSQLVulnerabilityAssessmentBaselineSet. +func (d *DatabaseSQLVulnerabilityAssessmentBaselineSet) UnmarshalJSON(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) @@ -2145,6 +2283,12 @@ func (d *DatabaseSchema) UnmarshalJSON(data []byte) error { 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) @@ -2156,16 +2300,16 @@ func (d *DatabaseSchema) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseSchemaListResult. -func (d DatabaseSchemaListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseSQLVulnerabilityAssessmentBaselineSetListResult. +func (d DatabaseSQLVulnerabilityAssessmentBaselineSetListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSQLVulnerabilityAssessmentBaselineSetListResult. +func (d *DatabaseSQLVulnerabilityAssessmentBaselineSetListResult) UnmarshalJSON(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) @@ -2187,16 +2331,15 @@ func (d *DatabaseSchemaListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseSecurityAlertListResult. -func (d DatabaseSecurityAlertListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseSQLVulnerabilityAssessmentBaselineSetProperties. +func (d DatabaseSQLVulnerabilityAssessmentBaselineSetProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) + populate(objectMap, "results", d.Results) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSecurityAlertListResult. -func (d *DatabaseSecurityAlertListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSQLVulnerabilityAssessmentBaselineSetProperties. +func (d *DatabaseSQLVulnerabilityAssessmentBaselineSetProperties) UnmarshalJSON(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) @@ -2204,11 +2347,8 @@ func (d *DatabaseSecurityAlertListResult) UnmarshalJSON(data []byte) error { 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) + case "results": + err = unpopulate(val, "Results", &d.Results) delete(rawMsg, key) } if err != nil { @@ -2218,8 +2358,8 @@ func (d *DatabaseSecurityAlertListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseSecurityAlertPolicy. -func (d DatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseSQLVulnerabilityAssessmentRuleBaseline. +func (d DatabaseSQLVulnerabilityAssessmentRuleBaseline) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", d.ID) populate(objectMap, "name", d.Name) @@ -2229,8 +2369,8 @@ func (d DatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSecurityAlertPolicy. -func (d *DatabaseSecurityAlertPolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSQLVulnerabilityAssessmentRuleBaseline. +func (d *DatabaseSQLVulnerabilityAssessmentRuleBaseline) UnmarshalJSON(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) @@ -2261,18 +2401,19 @@ func (d *DatabaseSecurityAlertPolicy) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseTable. -func (d DatabaseTable) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseSQLVulnerabilityAssessmentRuleBaselineInput. +func (d DatabaseSQLVulnerabilityAssessmentRuleBaselineInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 DatabaseTable. -func (d *DatabaseTable) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSQLVulnerabilityAssessmentRuleBaselineInput. +func (d *DatabaseSQLVulnerabilityAssessmentRuleBaselineInput) UnmarshalJSON(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) @@ -2289,6 +2430,9 @@ func (d *DatabaseTable) UnmarshalJSON(data []byte) error { 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) @@ -2300,16 +2444,16 @@ func (d *DatabaseTable) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseTableListResult. -func (d DatabaseTableListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseSQLVulnerabilityAssessmentRuleBaselineInputProperties. +func (d DatabaseSQLVulnerabilityAssessmentRuleBaselineInputProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) + populate(objectMap, "latestScan", d.LatestScan) + populate(objectMap, "results", d.Results) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseTableListResult. -func (d *DatabaseTableListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSQLVulnerabilityAssessmentRuleBaselineInputProperties. +func (d *DatabaseSQLVulnerabilityAssessmentRuleBaselineInputProperties) UnmarshalJSON(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) @@ -2317,11 +2461,11 @@ func (d *DatabaseTableListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) + case "latestScan": + err = unpopulate(val, "LatestScan", &d.LatestScan) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) + case "results": + err = unpopulate(val, "Results", &d.Results) delete(rawMsg, key) } if err != nil { @@ -2331,16 +2475,19 @@ func (d *DatabaseTableListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseTableProperties. -func (d DatabaseTableProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput. +func (d DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "memoryOptimized", d.MemoryOptimized) - populate(objectMap, "temporalType", d.TemporalType) + 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 DatabaseTableProperties. -func (d *DatabaseTableProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput. +func (d *DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput) UnmarshalJSON(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) @@ -2348,11 +2495,20 @@ func (d *DatabaseTableProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "memoryOptimized": - err = unpopulate(val, "MemoryOptimized", &d.MemoryOptimized) + case "id": + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) - case "temporalType": - err = unpopulate(val, "TemporalType", &d.TemporalType) + 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 { @@ -2362,18 +2518,16 @@ func (d *DatabaseTableProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseUpdate. -func (d DatabaseUpdate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseSQLVulnerabilityAssessmentRuleBaselineListInputProperties. +func (d DatabaseSQLVulnerabilityAssessmentRuleBaselineListInputProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "identity", d.Identity) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "tags", d.Tags) + populate(objectMap, "latestScan", d.LatestScan) + populate(objectMap, "results", d.Results) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseUpdate. -func (d *DatabaseUpdate) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSQLVulnerabilityAssessmentRuleBaselineListInputProperties. +func (d *DatabaseSQLVulnerabilityAssessmentRuleBaselineListInputProperties) UnmarshalJSON(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) @@ -2381,17 +2535,42 @@ func (d *DatabaseUpdate) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "identity": - err = unpopulate(val, "Identity", &d.Identity) + case "latestScan": + err = unpopulate(val, "LatestScan", &d.LatestScan) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) + case "results": + err = unpopulate(val, "Results", &d.Results) delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &d.SKU) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult. +func (d DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult. +func (d *DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult) UnmarshalJSON(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 "tags": - err = unpopulate(val, "Tags", &d.Tags) + case "value": + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { @@ -2401,52 +2580,15 @@ func (d *DatabaseUpdate) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseUpdateProperties. -func (d DatabaseUpdateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties. +func (d DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "results", d.Results) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseUpdateProperties. -func (d *DatabaseUpdateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties. +func (d *DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties) UnmarshalJSON(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) @@ -2454,119 +2596,8 @@ func (d *DatabaseUpdateProperties) UnmarshalJSON(data []byte) error { 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) + case "results": + err = unpopulate(val, "Results", &d.Results) delete(rawMsg, key) } if err != nil { @@ -2576,18 +2607,17 @@ func (d *DatabaseUpdateProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseUsage. -func (d DatabaseUsage) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseSchema. +func (d DatabaseSchema) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -2601,9 +2631,6 @@ func (d *DatabaseUsage) UnmarshalJSON(data []byte) error { 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) @@ -2615,16 +2642,16 @@ func (d *DatabaseUsage) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseUsageListResult. -func (d DatabaseUsageListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseSchemaListResult. +func (d DatabaseSchemaListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -2646,18 +2673,16 @@ func (d *DatabaseUsageListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseUsageProperties. -func (d DatabaseUsageProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseSecurityAlertListResult. +func (d DatabaseSecurityAlertListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "currentValue", d.CurrentValue) - populate(objectMap, "displayName", d.DisplayName) - populate(objectMap, "limit", d.Limit) - populate(objectMap, "unit", d.Unit) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseUsageProperties. -func (d *DatabaseUsageProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -2665,17 +2690,11 @@ func (d *DatabaseUsageProperties) UnmarshalJSON(data []byte) error { 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) + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &d.Unit) + case "value": + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { @@ -2685,16 +2704,19 @@ func (d *DatabaseUsageProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseUserIdentity. -func (d DatabaseUserIdentity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseSecurityAlertPolicy. +func (d DatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientId", d.ClientID) - populate(objectMap, "principalId", d.PrincipalID) + 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 DatabaseUserIdentity. -func (d *DatabaseUserIdentity) UnmarshalJSON(data []byte) error { +// 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) @@ -2702,11 +2724,20 @@ func (d *DatabaseUserIdentity) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "clientId": - err = unpopulate(val, "ClientID", &d.ClientID) + case "id": + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) - case "principalId": - err = unpopulate(val, "PrincipalID", &d.PrincipalID) + 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 { @@ -2716,8 +2747,8 @@ func (d *DatabaseUserIdentity) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessment. -func (d DatabaseVulnerabilityAssessment) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseTable. +func (d DatabaseTable) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", d.ID) populate(objectMap, "name", d.Name) @@ -2726,8 +2757,8 @@ func (d DatabaseVulnerabilityAssessment) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseVulnerabilityAssessment. -func (d *DatabaseVulnerabilityAssessment) UnmarshalJSON(data []byte) error { +// 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) @@ -2755,16 +2786,16 @@ func (d *DatabaseVulnerabilityAssessment) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentListResult. -func (d DatabaseVulnerabilityAssessmentListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseTableListResult. +func (d DatabaseTableListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -2786,18 +2817,16 @@ func (d *DatabaseVulnerabilityAssessmentListResult) UnmarshalJSON(data []byte) e return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentProperties. -func (d DatabaseVulnerabilityAssessmentProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseTableProperties. +func (d DatabaseTableProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "recurringScans", d.RecurringScans) - populate(objectMap, "storageAccountAccessKey", d.StorageAccountAccessKey) - populate(objectMap, "storageContainerPath", d.StorageContainerPath) - populate(objectMap, "storageContainerSasKey", d.StorageContainerSasKey) + populate(objectMap, "memoryOptimized", d.MemoryOptimized) + populate(objectMap, "temporalType", d.TemporalType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseVulnerabilityAssessmentProperties. -func (d *DatabaseVulnerabilityAssessmentProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -2805,17 +2834,11 @@ func (d *DatabaseVulnerabilityAssessmentProperties) UnmarshalJSON(data []byte) e 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) + case "memoryOptimized": + err = unpopulate(val, "MemoryOptimized", &d.MemoryOptimized) delete(rawMsg, key) - case "storageContainerSasKey": - err = unpopulate(val, "StorageContainerSasKey", &d.StorageContainerSasKey) + case "temporalType": + err = unpopulate(val, "TemporalType", &d.TemporalType) delete(rawMsg, key) } if err != nil { @@ -2825,18 +2848,18 @@ func (d *DatabaseVulnerabilityAssessmentProperties) UnmarshalJSON(data []byte) e return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentRuleBaseline. -func (d DatabaseVulnerabilityAssessmentRuleBaseline) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseUpdate. +func (d DatabaseUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) + populate(objectMap, "identity", d.Identity) populate(objectMap, "properties", d.Properties) - populate(objectMap, "type", d.Type) + populate(objectMap, "sku", d.SKU) + populate(objectMap, "tags", d.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseVulnerabilityAssessmentRuleBaseline. -func (d *DatabaseVulnerabilityAssessmentRuleBaseline) UnmarshalJSON(data []byte) error { +// 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) @@ -2844,17 +2867,17 @@ func (d *DatabaseVulnerabilityAssessmentRuleBaseline) UnmarshalJSON(data []byte) 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) + case "identity": + err = unpopulate(val, "Identity", &d.Identity) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) + 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 { @@ -2864,15 +2887,57 @@ func (d *DatabaseVulnerabilityAssessmentRuleBaseline) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentRuleBaselineItem. -func (d DatabaseVulnerabilityAssessmentRuleBaselineItem) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseUpdateProperties. +func (d DatabaseUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "result", d.Result) + 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, "encryptionProtector", d.EncryptionProtector) + 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, "keys", d.Keys) + populate(objectMap, "licenseType", d.LicenseType) + populate(objectMap, "longTermRetentionBackupResourceId", d.LongTermRetentionBackupResourceID) + populate(objectMap, "maintenanceConfigurationId", d.MaintenanceConfigurationID) + populate(objectMap, "manualCutover", d.ManualCutover) + populate(objectMap, "maxLogSizeBytes", d.MaxLogSizeBytes) + populate(objectMap, "maxSizeBytes", d.MaxSizeBytes) + populate(objectMap, "minCapacity", d.MinCapacity) + populateTimeRFC3339(objectMap, "pausedDate", d.PausedDate) + populate(objectMap, "performCutover", d.PerformCutover) + populate(objectMap, "preferredEnclaveType", d.PreferredEnclaveType) + 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 DatabaseVulnerabilityAssessmentRuleBaselineItem. -func (d *DatabaseVulnerabilityAssessmentRuleBaselineItem) UnmarshalJSON(data []byte) error { +// 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) @@ -2880,8 +2945,134 @@ func (d *DatabaseVulnerabilityAssessmentRuleBaselineItem) UnmarshalJSON(data []b for key, val := range rawMsg { var err error switch key { - case "result": - err = unpopulate(val, "Result", &d.Result) + 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 "encryptionProtector": + err = unpopulate(val, "EncryptionProtector", &d.EncryptionProtector) + 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 "keys": + err = unpopulate(val, "Keys", &d.Keys) + 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 "manualCutover": + err = unpopulate(val, "ManualCutover", &d.ManualCutover) + 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 "performCutover": + err = unpopulate(val, "PerformCutover", &d.PerformCutover) + delete(rawMsg, key) + case "preferredEnclaveType": + err = unpopulate(val, "PreferredEnclaveType", &d.PreferredEnclaveType) + 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 { @@ -2891,15 +3082,18 @@ func (d *DatabaseVulnerabilityAssessmentRuleBaselineItem) UnmarshalJSON(data []b return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentRuleBaselineProperties. -func (d DatabaseVulnerabilityAssessmentRuleBaselineProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseUsage. +func (d DatabaseUsage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "baselineResults", d.BaselineResults) + 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 DatabaseVulnerabilityAssessmentRuleBaselineProperties. -func (d *DatabaseVulnerabilityAssessmentRuleBaselineProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -2907,8 +3101,17 @@ func (d *DatabaseVulnerabilityAssessmentRuleBaselineProperties) UnmarshalJSON(da for key, val := range rawMsg { var err error switch key { - case "baselineResults": - err = unpopulate(val, "BaselineResults", &d.BaselineResults) + 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 { @@ -2918,15 +3121,16 @@ func (d *DatabaseVulnerabilityAssessmentRuleBaselineProperties) UnmarshalJSON(da return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentScanExportProperties. -func (d DatabaseVulnerabilityAssessmentScanExportProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseUsageListResult. +func (d DatabaseUsageListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "exportedReportLocation", d.ExportedReportLocation) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseVulnerabilityAssessmentScanExportProperties. -func (d *DatabaseVulnerabilityAssessmentScanExportProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -2934,8 +3138,11 @@ func (d *DatabaseVulnerabilityAssessmentScanExportProperties) UnmarshalJSON(data for key, val := range rawMsg { var err error switch key { - case "exportedReportLocation": - err = unpopulate(val, "ExportedReportLocation", &d.ExportedReportLocation) + 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 { @@ -2945,18 +3152,18 @@ func (d *DatabaseVulnerabilityAssessmentScanExportProperties) UnmarshalJSON(data return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentScansExport. -func (d DatabaseVulnerabilityAssessmentScansExport) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseUsageProperties. +func (d DatabaseUsageProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "type", d.Type) + 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 DatabaseVulnerabilityAssessmentScansExport. -func (d *DatabaseVulnerabilityAssessmentScansExport) UnmarshalJSON(data []byte) error { +// 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) @@ -2964,17 +3171,17 @@ func (d *DatabaseVulnerabilityAssessmentScansExport) UnmarshalJSON(data []byte) for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) + case "currentValue": + err = unpopulate(val, "CurrentValue", &d.CurrentValue) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) + case "displayName": + err = unpopulate(val, "DisplayName", &d.DisplayName) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) + case "limit": + err = unpopulate(val, "Limit", &d.Limit) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) + case "unit": + err = unpopulate(val, "Unit", &d.Unit) delete(rawMsg, key) } if err != nil { @@ -2984,8 +3191,39 @@ func (d *DatabaseVulnerabilityAssessmentScansExport) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type DeletedServer. -func (d DeletedServer) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseUserIdentity. +func (d DatabaseUserIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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]any) populate(objectMap, "id", d.ID) populate(objectMap, "name", d.Name) @@ -2994,8 +3232,8 @@ func (d DeletedServer) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedServer. -func (d *DeletedServer) UnmarshalJSON(data []byte) error { +// 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) @@ -3023,16 +3261,16 @@ func (d *DeletedServer) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DeletedServerListResult. -func (d DeletedServerListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentListResult. +func (d DatabaseVulnerabilityAssessmentListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -3054,18 +3292,18 @@ func (d *DeletedServerListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DeletedServerProperties. -func (d DeletedServerProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentProperties. +func (d DatabaseVulnerabilityAssessmentProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateTimeRFC3339(objectMap, "deletionTime", d.DeletionTime) - populate(objectMap, "fullyQualifiedDomainName", d.FullyQualifiedDomainName) - populate(objectMap, "originalId", d.OriginalID) - populate(objectMap, "version", d.Version) + 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 DeletedServerProperties. -func (d *DeletedServerProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -3073,17 +3311,17 @@ func (d *DeletedServerProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "deletionTime": - err = unpopulateTimeRFC3339(val, "DeletionTime", &d.DeletionTime) + case "recurringScans": + err = unpopulate(val, "RecurringScans", &d.RecurringScans) delete(rawMsg, key) - case "fullyQualifiedDomainName": - err = unpopulate(val, "FullyQualifiedDomainName", &d.FullyQualifiedDomainName) + case "storageAccountAccessKey": + err = unpopulate(val, "StorageAccountAccessKey", &d.StorageAccountAccessKey) delete(rawMsg, key) - case "originalId": - err = unpopulate(val, "OriginalID", &d.OriginalID) + case "storageContainerPath": + err = unpopulate(val, "StorageContainerPath", &d.StorageContainerPath) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &d.Version) + case "storageContainerSasKey": + err = unpopulate(val, "StorageContainerSasKey", &d.StorageContainerSasKey) delete(rawMsg, key) } if err != nil { @@ -3093,8 +3331,8 @@ func (d *DeletedServerProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DistributedAvailabilityGroup. -func (d DistributedAvailabilityGroup) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentRuleBaseline. +func (d DatabaseVulnerabilityAssessmentRuleBaseline) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", d.ID) populate(objectMap, "name", d.Name) @@ -3103,8 +3341,8 @@ func (d DistributedAvailabilityGroup) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DistributedAvailabilityGroup. -func (d *DistributedAvailabilityGroup) UnmarshalJSON(data []byte) error { +// 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) @@ -3132,24 +3370,15 @@ func (d *DistributedAvailabilityGroup) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DistributedAvailabilityGroupProperties. -func (d DistributedAvailabilityGroupProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentRuleBaselineItem. +func (d DatabaseVulnerabilityAssessmentRuleBaselineItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "result", d.Result) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DistributedAvailabilityGroupProperties. -func (d *DistributedAvailabilityGroupProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -3157,35 +3386,8 @@ func (d *DistributedAvailabilityGroupProperties) UnmarshalJSON(data []byte) erro 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) + case "result": + err = unpopulate(val, "Result", &d.Result) delete(rawMsg, key) } if err != nil { @@ -3195,16 +3397,15 @@ func (d *DistributedAvailabilityGroupProperties) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type DistributedAvailabilityGroupsListResult. -func (d DistributedAvailabilityGroupsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentRuleBaselineProperties. +func (d DatabaseVulnerabilityAssessmentRuleBaselineProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) + populate(objectMap, "baselineResults", d.BaselineResults) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DistributedAvailabilityGroupsListResult. -func (d *DistributedAvailabilityGroupsListResult) UnmarshalJSON(data []byte) error { +// 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) @@ -3212,11 +3413,8 @@ func (d *DistributedAvailabilityGroupsListResult) UnmarshalJSON(data []byte) 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) + case "baselineResults": + err = unpopulate(val, "BaselineResults", &d.BaselineResults) delete(rawMsg, key) } if err != nil { @@ -3226,378 +3424,329 @@ func (d *DistributedAvailabilityGroupsListResult) UnmarshalJSON(data []byte) err return nil } -// MarshalJSON implements the json.Marshaller interface for type EditionCapability. -func (e EditionCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentScanExportProperties. +func (d DatabaseVulnerabilityAssessmentScanExportProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "exportedReportLocation", d.ExportedReportLocation) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EditionCapability. -func (e *EditionCapability) UnmarshalJSON(data []byte) error { +// 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, 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) + case "exportedReportLocation": + err = unpopulate(val, "ExportedReportLocation", &d.ExportedReportLocation) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticPool. -func (e ElasticPool) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentScansExport. +func (d DatabaseVulnerabilityAssessmentScansExport) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 ElasticPool. -func (e *ElasticPool) UnmarshalJSON(data []byte) error { +// 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", e, err) + 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", &e.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &e.Kind) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &e.Location) + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &e.Name) + err = unpopulate(val, "Name", &d.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) + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &e.Type) + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolActivity. -func (e ElasticPoolActivity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DeletedServer. +func (d DeletedServer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 ElasticPoolActivity. -func (e *ElasticPoolActivity) UnmarshalJSON(data []byte) error { +// 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", e, err) + 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", &e.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &e.Location) + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &e.Name) + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &e.Properties) + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &e.Type) + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolActivityListResult. -func (e ElasticPoolActivityListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DeletedServerListResult. +func (d DeletedServerListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", e.Value) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolActivityListResult. -func (e *ElasticPoolActivityListResult) UnmarshalJSON(data []byte) error { +// 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", e, err) + 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", &e.Value) + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolActivityProperties. -func (e ElasticPoolActivityProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DeletedServerProperties. +func (d DeletedServerProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 ElasticPoolActivityProperties. -func (e *ElasticPoolActivityProperties) UnmarshalJSON(data []byte) error { +// 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, 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) + case "deletionTime": + err = unpopulateTimeRFC3339(val, "DeletionTime", &d.DeletionTime) delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &e.ServerName) + case "fullyQualifiedDomainName": + err = unpopulate(val, "FullyQualifiedDomainName", &d.FullyQualifiedDomainName) delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &e.StartTime) + case "originalId": + err = unpopulate(val, "OriginalID", &d.OriginalID) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &e.State) + case "version": + err = unpopulate(val, "Version", &d.Version) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolDatabaseActivity. -func (e ElasticPoolDatabaseActivity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DistributedAvailabilityGroup. +func (d DistributedAvailabilityGroup) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 ElasticPoolDatabaseActivity. -func (e *ElasticPoolDatabaseActivity) UnmarshalJSON(data []byte) error { +// 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", e, err) + 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", &e.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &e.Location) + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &e.Name) + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &e.Properties) + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &e.Type) + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolDatabaseActivityListResult. -func (e ElasticPoolDatabaseActivityListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DistributedAvailabilityGroupProperties. +func (d DistributedAvailabilityGroupProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", e.Value) + 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 ElasticPoolDatabaseActivityListResult. -func (e *ElasticPoolDatabaseActivityListResult) UnmarshalJSON(data []byte) error { +// 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", e, err) + 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", &e.Value) + 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolDatabaseActivityProperties. -func (e ElasticPoolDatabaseActivityProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DistributedAvailabilityGroupsListResult. +func (d DistributedAvailabilityGroupsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolDatabaseActivityProperties. -func (e *ElasticPoolDatabaseActivityProperties) UnmarshalJSON(data []byte) error { +// 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]any) + 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) @@ -3605,50 +3754,81 @@ func (e *ElasticPoolDatabaseActivityProperties) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "currentElasticPoolName": - err = unpopulate(val, "CurrentElasticPoolName", &e.CurrentElasticPoolName) + case "name": + err = unpopulate(val, "Name", &e.Name) delete(rawMsg, key) - case "currentServiceObjective": - err = unpopulate(val, "CurrentServiceObjective", &e.CurrentServiceObjective) + case "readScale": + err = unpopulate(val, "ReadScale", &e.ReadScale) delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &e.DatabaseName) + case "reason": + err = unpopulate(val, "Reason", &e.Reason) delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &e.EndTime) + case "status": + err = unpopulate(val, "Status", &e.Status) delete(rawMsg, key) - case "errorCode": - err = unpopulate(val, "ErrorCode", &e.ErrorCode) + case "supportedServiceLevelObjectives": + err = unpopulate(val, "SupportedServiceLevelObjectives", &e.SupportedServiceLevelObjectives) delete(rawMsg, key) - case "errorMessage": - err = unpopulate(val, "ErrorMessage", &e.ErrorMessage) + case "supportedStorageCapabilities": + err = unpopulate(val, "SupportedStorageCapabilities", &e.SupportedStorageCapabilities) delete(rawMsg, key) - case "errorSeverity": - err = unpopulate(val, "ErrorSeverity", &e.ErrorSeverity) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &e.ZoneRedundant) delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &e.Operation) + } + 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]any) + 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 "operationId": - err = unpopulate(val, "OperationID", &e.OperationID) + case "kind": + err = unpopulate(val, "Kind", &e.Kind) delete(rawMsg, key) - case "percentComplete": - err = unpopulate(val, "PercentComplete", &e.PercentComplete) + case "location": + err = unpopulate(val, "Location", &e.Location) delete(rawMsg, key) - case "requestedElasticPoolName": - err = unpopulate(val, "RequestedElasticPoolName", &e.RequestedElasticPoolName) + case "name": + err = unpopulate(val, "Name", &e.Name) delete(rawMsg, key) - case "requestedServiceObjective": - err = unpopulate(val, "RequestedServiceObjective", &e.RequestedServiceObjective) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &e.ServerName) + case "sku": + err = unpopulate(val, "SKU", &e.SKU) delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &e.StartTime) + case "tags": + err = unpopulate(val, "Tags", &e.Tags) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &e.State) + case "type": + err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { @@ -3658,19 +3838,19 @@ func (e *ElasticPoolDatabaseActivityProperties) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolEditionCapability. -func (e ElasticPoolEditionCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ElasticPoolActivity. +func (e ElasticPoolActivity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + populate(objectMap, "location", e.Location) 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) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolEditionCapability. -func (e *ElasticPoolEditionCapability) UnmarshalJSON(data []byte) error { +// 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) @@ -3678,20 +3858,20 @@ func (e *ElasticPoolEditionCapability) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &e.Name) + case "id": + err = unpopulate(val, "ID", &e.ID) delete(rawMsg, key) - case "reason": - err = unpopulate(val, "Reason", &e.Reason) + case "location": + err = unpopulate(val, "Location", &e.Location) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &e.Status) + case "name": + err = unpopulate(val, "Name", &e.Name) delete(rawMsg, key) - case "supportedElasticPoolPerformanceLevels": - err = unpopulate(val, "SupportedElasticPoolPerformanceLevels", &e.SupportedElasticPoolPerformanceLevels) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) - case "zoneRedundant": - err = unpopulate(val, "ZoneRedundant", &e.ZoneRedundant) + case "type": + err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { @@ -3701,16 +3881,15 @@ func (e *ElasticPoolEditionCapability) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolListResult. -func (e ElasticPoolListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ElasticPoolActivityListResult. +func (e ElasticPoolActivityListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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 { +// 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) @@ -3718,9 +3897,6 @@ func (e *ElasticPoolListResult) UnmarshalJSON(data []byte) error { 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) @@ -3732,4036 +3908,6321 @@ func (e *ElasticPoolListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolOperation. -func (e ElasticPoolOperation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ElasticPoolActivityProperties. +func (e ElasticPoolActivityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + populate(objectMap, "availabilityZone", e.AvailabilityZone) + 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, "minCapacity", e.MinCapacity) + populate(objectMap, "perDatabaseSettings", e.PerDatabaseSettings) + populate(objectMap, "preferredEnclaveType", e.PreferredEnclaveType) + 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 "availabilityZone": + err = unpopulate(val, "AvailabilityZone", &e.AvailabilityZone) + delete(rawMsg, 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 "minCapacity": + err = unpopulate(val, "MinCapacity", &e.MinCapacity) + delete(rawMsg, key) + case "perDatabaseSettings": + err = unpopulate(val, "PerDatabaseSettings", &e.PerDatabaseSettings) + delete(rawMsg, key) + case "preferredEnclaveType": + err = unpopulate(val, "PreferredEnclaveType", &e.PreferredEnclaveType) + 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]any) + 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]any) + populate(objectMap, "availabilityZone", e.AvailabilityZone) + populate(objectMap, "highAvailabilityReplicaCount", e.HighAvailabilityReplicaCount) + populate(objectMap, "licenseType", e.LicenseType) + populate(objectMap, "maintenanceConfigurationId", e.MaintenanceConfigurationID) + populate(objectMap, "maxSizeBytes", e.MaxSizeBytes) + populate(objectMap, "minCapacity", e.MinCapacity) + populate(objectMap, "perDatabaseSettings", e.PerDatabaseSettings) + populate(objectMap, "preferredEnclaveType", e.PreferredEnclaveType) + 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 "availabilityZone": + err = unpopulate(val, "AvailabilityZone", &e.AvailabilityZone) + 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 "minCapacity": + err = unpopulate(val, "MinCapacity", &e.MinCapacity) + delete(rawMsg, key) + case "perDatabaseSettings": + err = unpopulate(val, "PerDatabaseSettings", &e.PerDatabaseSettings) + delete(rawMsg, key) + case "preferredEnclaveType": + err = unpopulate(val, "PreferredEnclaveType", &e.PreferredEnclaveType) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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 EndpointDependency. +func (e EndpointDependency) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "domainName", e.DomainName) + populate(objectMap, "endpointDetails", e.EndpointDetails) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDependency. +func (e *EndpointDependency) UnmarshalJSON(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 "domainName": + err = unpopulate(val, "DomainName", &e.DomainName) + delete(rawMsg, key) + case "endpointDetails": + err = unpopulate(val, "EndpointDetails", &e.EndpointDetails) + 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 EndpointDetail. +func (e EndpointDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "port", e.Port) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDetail. +func (e *EndpointDetail) UnmarshalJSON(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 "port": + err = unpopulate(val, "Port", &e.Port) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) - populate(objectMap, "id", e.ID) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "type", e.Type) + 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 ElasticPoolOperation. -func (e *ElasticPoolOperation) UnmarshalJSON(data []byte) error { +// 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", e, err) + 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", &e.ID) + err = unpopulate(val, "ID", &i.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &e.Name) + err = unpopulate(val, "Name", &i.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &e.Properties) + err = unpopulate(val, "Properties", &i.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &e.Type) + err = unpopulate(val, "Type", &i.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolOperationListResult. -func (e ElasticPoolOperationListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type InstanceFailoverGroupListResult. +func (i InstanceFailoverGroupListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolOperationListResult. -func (e *ElasticPoolOperationListResult) UnmarshalJSON(data []byte) error { +// 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", e, err) + 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", &e.NextLink) + err = unpopulate(val, "NextLink", &i.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &e.Value) + err = unpopulate(val, "Value", &i.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolOperationProperties. -func (e ElasticPoolOperationProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type InstanceFailoverGroupProperties. +func (i InstanceFailoverGroupProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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) + populate(objectMap, "secondaryType", i.SecondaryType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolOperationProperties. -func (e *ElasticPoolOperationProperties) UnmarshalJSON(data []byte) error { +// 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, 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) + case "managedInstancePairs": + err = unpopulate(val, "ManagedInstancePairs", &i.ManagedInstancePairs) delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &e.Operation) + case "partnerRegions": + err = unpopulate(val, "PartnerRegions", &i.PartnerRegions) delete(rawMsg, key) - case "operationFriendlyName": - err = unpopulate(val, "OperationFriendlyName", &e.OperationFriendlyName) + case "readOnlyEndpoint": + err = unpopulate(val, "ReadOnlyEndpoint", &i.ReadOnlyEndpoint) delete(rawMsg, key) - case "percentComplete": - err = unpopulate(val, "PercentComplete", &e.PercentComplete) + case "readWriteEndpoint": + err = unpopulate(val, "ReadWriteEndpoint", &i.ReadWriteEndpoint) delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &e.ServerName) + case "replicationRole": + err = unpopulate(val, "ReplicationRole", &i.ReplicationRole) delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &e.StartTime) + case "replicationState": + err = unpopulate(val, "ReplicationState", &i.ReplicationState) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &e.State) + case "secondaryType": + err = unpopulate(val, "SecondaryType", &i.SecondaryType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolPerDatabaseMaxPerformanceLevelCapability. -func (e ElasticPoolPerDatabaseMaxPerformanceLevelCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type InstanceFailoverGroupReadOnlyEndpoint. +func (i InstanceFailoverGroupReadOnlyEndpoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "failoverPolicy", i.FailoverPolicy) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolPerDatabaseMaxPerformanceLevelCapability. -func (e *ElasticPoolPerDatabaseMaxPerformanceLevelCapability) UnmarshalJSON(data []byte) error { +// 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, 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) + case "failoverPolicy": + err = unpopulate(val, "FailoverPolicy", &i.FailoverPolicy) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolPerDatabaseMinPerformanceLevelCapability. -func (e ElasticPoolPerDatabaseMinPerformanceLevelCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type InstanceFailoverGroupReadWriteEndpoint. +func (i InstanceFailoverGroupReadWriteEndpoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "limit", e.Limit) - populate(objectMap, "reason", e.Reason) - populate(objectMap, "status", e.Status) - populate(objectMap, "unit", e.Unit) + populate(objectMap, "failoverPolicy", i.FailoverPolicy) + populate(objectMap, "failoverWithDataLossGracePeriodMinutes", i.FailoverWithDataLossGracePeriodMinutes) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolPerDatabaseMinPerformanceLevelCapability. -func (e *ElasticPoolPerDatabaseMinPerformanceLevelCapability) UnmarshalJSON(data []byte) error { +// 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, 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) + case "failoverPolicy": + err = unpopulate(val, "FailoverPolicy", &i.FailoverPolicy) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &e.Unit) + case "failoverWithDataLossGracePeriodMinutes": + err = unpopulate(val, "FailoverWithDataLossGracePeriodMinutes", &i.FailoverWithDataLossGracePeriodMinutes) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolPerDatabaseSettings. -func (e ElasticPoolPerDatabaseSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type InstancePool. +func (i InstancePool) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "maxCapacity", e.MaxCapacity) - populate(objectMap, "minCapacity", e.MinCapacity) + 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 ElasticPoolPerDatabaseSettings. -func (e *ElasticPoolPerDatabaseSettings) UnmarshalJSON(data []byte) error { +// 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "maxCapacity": - err = unpopulate(val, "MaxCapacity", &e.MaxCapacity) + case "id": + err = unpopulate(val, "ID", &i.ID) delete(rawMsg, key) - case "minCapacity": - err = unpopulate(val, "MinCapacity", &e.MinCapacity) + 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolPerformanceLevelCapability. -func (e ElasticPoolPerformanceLevelCapability) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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) +// MarshalJSON implements the json.Marshaller interface for type InstancePoolEditionCapability. +func (i InstancePoolEditionCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 ElasticPoolPerformanceLevelCapability. -func (e *ElasticPoolPerformanceLevelCapability) UnmarshalJSON(data []byte) error { +// 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, 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) + case "name": + err = unpopulate(val, "Name", &i.Name) delete(rawMsg, key) case "reason": - err = unpopulate(val, "Reason", &e.Reason) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &e.SKU) + err = unpopulate(val, "Reason", &i.Reason) 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) + err = unpopulate(val, "Status", &i.Status) delete(rawMsg, key) - case "zoneRedundant": - err = unpopulate(val, "ZoneRedundant", &e.ZoneRedundant) + case "supportedFamilies": + err = unpopulate(val, "SupportedFamilies", &i.SupportedFamilies) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolProperties. -func (e ElasticPoolProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type InstancePoolFamilyCapability. +func (i InstancePoolFamilyCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 ElasticPoolProperties. -func (e *ElasticPoolProperties) UnmarshalJSON(data []byte) error { +// 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, 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) + case "name": + err = unpopulate(val, "Name", &i.Name) delete(rawMsg, key) - case "maxSizeBytes": - err = unpopulate(val, "MaxSizeBytes", &e.MaxSizeBytes) + case "reason": + err = unpopulate(val, "Reason", &i.Reason) delete(rawMsg, key) - case "perDatabaseSettings": - err = unpopulate(val, "PerDatabaseSettings", &e.PerDatabaseSettings) + case "status": + err = unpopulate(val, "Status", &i.Status) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &e.State) + case "supportedLicenseTypes": + err = unpopulate(val, "SupportedLicenseTypes", &i.SupportedLicenseTypes) delete(rawMsg, key) - case "zoneRedundant": - err = unpopulate(val, "ZoneRedundant", &e.ZoneRedundant) + case "supportedVcoresValues": + err = unpopulate(val, "SupportedVcoresValues", &i.SupportedVcoresValues) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolUpdate. -func (e ElasticPoolUpdate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type InstancePoolListResult. +func (i InstancePoolListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "sku", e.SKU) - populate(objectMap, "tags", e.Tags) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolUpdate. -func (e *ElasticPoolUpdate) UnmarshalJSON(data []byte) error { +// 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, 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) + case "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &e.Tags) + case "value": + err = unpopulate(val, "Value", &i.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolUpdateProperties. -func (e ElasticPoolUpdateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type InstancePoolProperties. +func (i InstancePoolProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 ElasticPoolUpdateProperties. -func (e *ElasticPoolUpdateProperties) UnmarshalJSON(data []byte) error { +// 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, 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) + err = unpopulate(val, "LicenseType", &i.LicenseType) delete(rawMsg, key) - case "perDatabaseSettings": - err = unpopulate(val, "PerDatabaseSettings", &e.PerDatabaseSettings) + case "subnetId": + err = unpopulate(val, "SubnetID", &i.SubnetID) delete(rawMsg, key) - case "zoneRedundant": - err = unpopulate(val, "ZoneRedundant", &e.ZoneRedundant) + case "vCores": + err = unpopulate(val, "VCores", &i.VCores) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EncryptionProtector. -func (e EncryptionProtector) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type InstancePoolUpdate. +func (i InstancePoolUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "tags", i.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionProtector. -func (e *EncryptionProtector) UnmarshalJSON(data []byte) error { +// 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", e, err) + 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", &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) + case "tags": + err = unpopulate(val, "Tags", &i.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EncryptionProtectorListResult. -func (e EncryptionProtectorListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type InstancePoolVcoresCapability. +func (i InstancePoolVcoresCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) + 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 EncryptionProtectorListResult. -func (e *EncryptionProtectorListResult) UnmarshalJSON(data []byte) error { +// 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", e, err) + 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", &e.NextLink) + 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", &e.Value) + err = unpopulate(val, "Value", &i.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EncryptionProtectorProperties. -func (e EncryptionProtectorProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Job. +func (j Job) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 EncryptionProtectorProperties. -func (e *EncryptionProtectorProperties) UnmarshalJSON(data []byte) error { +// 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", j, 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) + case "id": + err = unpopulate(val, "ID", &j.ID) delete(rawMsg, key) - case "subregion": - err = unpopulate(val, "Subregion", &e.Subregion) + case "name": + err = unpopulate(val, "Name", &j.Name) delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &e.Thumbprint) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &e.URI) + case "type": + err = unpopulate(val, "Type", &j.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EndpointCertificate. -func (e EndpointCertificate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobAgent. +func (j JobAgent) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", e.ID) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "type", e.Type) + 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 EndpointCertificate. -func (e *EndpointCertificate) UnmarshalJSON(data []byte) error { +// 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", e, err) + 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", &e.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", &e.Name) + err = unpopulate(val, "Name", &j.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &e.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", &e.Type) + err = unpopulate(val, "Type", &j.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EndpointCertificateListResult. -func (e EndpointCertificateListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobAgentListResult. +func (j JobAgentListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointCertificateListResult. -func (e *EndpointCertificateListResult) UnmarshalJSON(data []byte) error { +// 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", e, err) + 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", &e.NextLink) + err = unpopulate(val, "NextLink", &j.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &e.Value) + err = unpopulate(val, "Value", &j.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EndpointCertificateProperties. -func (e EndpointCertificateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobAgentProperties. +func (j JobAgentProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "publicBlob", e.PublicBlob) + populate(objectMap, "databaseId", j.DatabaseID) + populate(objectMap, "state", j.State) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointCertificateProperties. -func (e *EndpointCertificateProperties) UnmarshalJSON(data []byte) error { +// 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "publicBlob": - err = unpopulate(val, "PublicBlob", &e.PublicBlob) + 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ExportDatabaseDefinition. -func (e ExportDatabaseDefinition) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobAgentUpdate. +func (j JobAgentUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "tags", j.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExportDatabaseDefinition. -func (e *ExportDatabaseDefinition) UnmarshalJSON(data []byte) error { +// 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", j, 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) + case "tags": + err = unpopulate(val, "Tags", &j.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ExtendedDatabaseBlobAuditingPolicy. -func (e ExtendedDatabaseBlobAuditingPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobCredential. +func (j JobCredential) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", e.ID) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "type", e.Type) + 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 ExtendedDatabaseBlobAuditingPolicy. -func (e *ExtendedDatabaseBlobAuditingPolicy) UnmarshalJSON(data []byte) error { +// 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", e, err) + 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", &e.ID) + err = unpopulate(val, "ID", &j.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &e.Name) + err = unpopulate(val, "Name", &j.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &e.Properties) + err = unpopulate(val, "Properties", &j.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &e.Type) + err = unpopulate(val, "Type", &j.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ExtendedDatabaseBlobAuditingPolicyListResult. -func (e ExtendedDatabaseBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobCredentialListResult. +func (j JobCredentialListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedDatabaseBlobAuditingPolicyListResult. -func (e *ExtendedDatabaseBlobAuditingPolicyListResult) UnmarshalJSON(data []byte) error { +// 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", e, err) + 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", &e.NextLink) + err = unpopulate(val, "NextLink", &j.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &e.Value) + err = unpopulate(val, "Value", &j.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ExtendedDatabaseBlobAuditingPolicyProperties. -func (e ExtendedDatabaseBlobAuditingPolicyProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobCredentialProperties. +func (j JobCredentialProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "password", j.Password) + populate(objectMap, "username", j.Username) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedDatabaseBlobAuditingPolicyProperties. -func (e *ExtendedDatabaseBlobAuditingPolicyProperties) UnmarshalJSON(data []byte) error { +// 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", j, 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) + switch key { + case "password": + err = unpopulate(val, "Password", &j.Password) delete(rawMsg, key) - case "storageEndpoint": - err = unpopulate(val, "StorageEndpoint", &e.StorageEndpoint) + case "username": + err = unpopulate(val, "Username", &j.Username) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ExtendedServerBlobAuditingPolicy. -func (e ExtendedServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobExecution. +func (j JobExecution) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", e.ID) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "type", e.Type) + 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 ExtendedServerBlobAuditingPolicy. -func (e *ExtendedServerBlobAuditingPolicy) UnmarshalJSON(data []byte) error { +// 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", e, err) + 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", &e.ID) + err = unpopulate(val, "ID", &j.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &e.Name) + err = unpopulate(val, "Name", &j.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &e.Properties) + err = unpopulate(val, "Properties", &j.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &e.Type) + err = unpopulate(val, "Type", &j.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ExtendedServerBlobAuditingPolicyListResult. -func (e ExtendedServerBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobExecutionListResult. +func (j JobExecutionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedServerBlobAuditingPolicyListResult. -func (e *ExtendedServerBlobAuditingPolicyListResult) UnmarshalJSON(data []byte) error { +// 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", e, err) + 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", &e.NextLink) + err = unpopulate(val, "NextLink", &j.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &e.Value) + err = unpopulate(val, "Value", &j.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ExtendedServerBlobAuditingPolicyProperties. -func (e ExtendedServerBlobAuditingPolicyProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobExecutionProperties. +func (j JobExecutionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 ExtendedServerBlobAuditingPolicyProperties. -func (e *ExtendedServerBlobAuditingPolicyProperties) UnmarshalJSON(data []byte) error { +// 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "auditActionsAndGroups": - err = unpopulate(val, "AuditActionsAndGroups", &e.AuditActionsAndGroups) + case "createTime": + err = unpopulateTimeRFC3339(val, "CreateTime", &j.CreateTime) delete(rawMsg, key) - case "isAzureMonitorTargetEnabled": - err = unpopulate(val, "IsAzureMonitorTargetEnabled", &e.IsAzureMonitorTargetEnabled) + case "currentAttemptStartTime": + err = unpopulateTimeRFC3339(val, "CurrentAttemptStartTime", &j.CurrentAttemptStartTime) delete(rawMsg, key) - case "isDevopsAuditEnabled": - err = unpopulate(val, "IsDevopsAuditEnabled", &e.IsDevopsAuditEnabled) + case "currentAttempts": + err = unpopulate(val, "CurrentAttempts", &j.CurrentAttempts) delete(rawMsg, key) - case "isManagedIdentityInUse": - err = unpopulate(val, "IsManagedIdentityInUse", &e.IsManagedIdentityInUse) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &j.EndTime) delete(rawMsg, key) - case "isStorageSecondaryKeyInUse": - err = unpopulate(val, "IsStorageSecondaryKeyInUse", &e.IsStorageSecondaryKeyInUse) + case "jobExecutionId": + err = unpopulate(val, "JobExecutionID", &j.JobExecutionID) delete(rawMsg, key) - case "predicateExpression": - err = unpopulate(val, "PredicateExpression", &e.PredicateExpression) + case "jobVersion": + err = unpopulate(val, "JobVersion", &j.JobVersion) delete(rawMsg, key) - case "queueDelayMs": - err = unpopulate(val, "QueueDelayMs", &e.QueueDelayMs) + case "lastMessage": + err = unpopulate(val, "LastMessage", &j.LastMessage) delete(rawMsg, key) - case "retentionDays": - err = unpopulate(val, "RetentionDays", &e.RetentionDays) + case "lifecycle": + err = unpopulate(val, "Lifecycle", &j.Lifecycle) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &e.State) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &j.ProvisioningState) delete(rawMsg, key) - case "storageAccountAccessKey": - err = unpopulate(val, "StorageAccountAccessKey", &e.StorageAccountAccessKey) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) delete(rawMsg, key) - case "storageAccountSubscriptionId": - err = unpopulate(val, "StorageAccountSubscriptionID", &e.StorageAccountSubscriptionID) + case "stepId": + err = unpopulate(val, "StepID", &j.StepID) delete(rawMsg, key) - case "storageEndpoint": - err = unpopulate(val, "StorageEndpoint", &e.StorageEndpoint) + 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FailoverGroup. -func (f FailoverGroup) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobExecutionTarget. +func (j JobExecutionTarget) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 FailoverGroup. -func (f *FailoverGroup) UnmarshalJSON(data []byte) error { +// 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", f, err) + 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", &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) + case "databaseName": + err = unpopulate(val, "DatabaseName", &j.DatabaseName) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &f.Tags) + case "serverName": + err = unpopulate(val, "ServerName", &j.ServerName) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &f.Type) + err = unpopulate(val, "Type", &j.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FailoverGroupListResult. -func (f FailoverGroupListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobListResult. +func (j JobListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", f.NextLink) - populate(objectMap, "value", f.Value) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FailoverGroupListResult. -func (f *FailoverGroupListResult) UnmarshalJSON(data []byte) error { +// 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", f, err) + 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", &f.NextLink) + err = unpopulate(val, "NextLink", &j.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]any) - 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) + err = unpopulate(val, "Value", &j.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FailoverGroupReadOnlyEndpoint. -func (f FailoverGroupReadOnlyEndpoint) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobProperties. +func (j JobProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "failoverPolicy", f.FailoverPolicy) + 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 FailoverGroupReadOnlyEndpoint. -func (f *FailoverGroupReadOnlyEndpoint) UnmarshalJSON(data []byte) error { +// 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", f, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "failoverPolicy": - err = unpopulate(val, "FailoverPolicy", &f.FailoverPolicy) + 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", f, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FailoverGroupReadWriteEndpoint. -func (f FailoverGroupReadWriteEndpoint) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobSchedule. +func (j JobSchedule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "failoverPolicy", f.FailoverPolicy) - populate(objectMap, "failoverWithDataLossGracePeriodMinutes", f.FailoverWithDataLossGracePeriodMinutes) + 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 FailoverGroupReadWriteEndpoint. -func (f *FailoverGroupReadWriteEndpoint) UnmarshalJSON(data []byte) error { +// 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", f, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "failoverPolicy": - err = unpopulate(val, "FailoverPolicy", &f.FailoverPolicy) + case "enabled": + err = unpopulate(val, "Enabled", &j.Enabled) delete(rawMsg, key) - case "failoverWithDataLossGracePeriodMinutes": - err = unpopulate(val, "FailoverWithDataLossGracePeriodMinutes", &f.FailoverWithDataLossGracePeriodMinutes) + 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", f, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FailoverGroupUpdate. -func (f FailoverGroupUpdate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobStep. +func (j JobStep) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", f.Properties) - populate(objectMap, "tags", f.Tags) + 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 FailoverGroupUpdate. -func (f *FailoverGroupUpdate) UnmarshalJSON(data []byte) error { +// 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", f, err) + 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", &f.Properties) + err = unpopulate(val, "Properties", &j.Properties) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &f.Tags) + case "type": + err = unpopulate(val, "Type", &j.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FailoverGroupUpdateProperties. -func (f FailoverGroupUpdateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobStepAction. +func (j JobStepAction) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "databases", f.Databases) - populate(objectMap, "readOnlyEndpoint", f.ReadOnlyEndpoint) - populate(objectMap, "readWriteEndpoint", f.ReadWriteEndpoint) + 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 FailoverGroupUpdateProperties. -func (f *FailoverGroupUpdateProperties) UnmarshalJSON(data []byte) error { +// 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", f, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "databases": - err = unpopulate(val, "Databases", &f.Databases) + case "source": + err = unpopulate(val, "Source", &j.Source) delete(rawMsg, key) - case "readOnlyEndpoint": - err = unpopulate(val, "ReadOnlyEndpoint", &f.ReadOnlyEndpoint) + case "type": + err = unpopulate(val, "Type", &j.Type) delete(rawMsg, key) - case "readWriteEndpoint": - err = unpopulate(val, "ReadWriteEndpoint", &f.ReadWriteEndpoint) + case "value": + err = unpopulate(val, "Value", &j.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FirewallRule. -func (f FirewallRule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobStepExecutionOptions. +func (j JobStepExecutionOptions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", f.ID) - populate(objectMap, "name", f.Name) - populate(objectMap, "properties", f.Properties) - populate(objectMap, "type", f.Type) + 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 FirewallRule. -func (f *FirewallRule) UnmarshalJSON(data []byte) error { +// 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", f, err) + 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", &f.ID) + case "initialRetryIntervalSeconds": + err = unpopulate(val, "InitialRetryIntervalSeconds", &j.InitialRetryIntervalSeconds) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &f.Name) + case "maximumRetryIntervalSeconds": + err = unpopulate(val, "MaximumRetryIntervalSeconds", &j.MaximumRetryIntervalSeconds) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &f.Properties) + case "retryAttempts": + err = unpopulate(val, "RetryAttempts", &j.RetryAttempts) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &f.Type) + 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", f, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FirewallRuleList. -func (f FirewallRuleList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobStepListResult. +func (j JobStepListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "values", f.Values) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRuleList. -func (f *FirewallRuleList) UnmarshalJSON(data []byte) error { +// 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", f, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "values": - err = unpopulate(val, "Values", &f.Values) + 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", f, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FirewallRuleListResult. -func (f FirewallRuleListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobStepOutput. +func (j JobStepOutput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", f.NextLink) - populate(objectMap, "value", f.Value) + 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 FirewallRuleListResult. -func (f *FirewallRuleListResult) UnmarshalJSON(data []byte) error { +// 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", f, err) + 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", &f.NextLink) + case "credential": + err = unpopulate(val, "Credential", &j.Credential) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &f.Value) + 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", f, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GeoBackupPolicy. -func (g GeoBackupPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobStepProperties. +func (j JobStepProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 GeoBackupPolicy. -func (g *GeoBackupPolicy) UnmarshalJSON(data []byte) error { +// 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", g, err) + 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", &g.ID) + case "action": + err = unpopulate(val, "Action", &j.Action) delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &g.Kind) + case "credential": + err = unpopulate(val, "Credential", &j.Credential) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &g.Location) + case "executionOptions": + err = unpopulate(val, "ExecutionOptions", &j.ExecutionOptions) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) + case "output": + err = unpopulate(val, "Output", &j.Output) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) + case "stepId": + err = unpopulate(val, "StepID", &j.StepID) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) + case "targetGroup": + err = unpopulate(val, "TargetGroup", &j.TargetGroup) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GeoBackupPolicyListResult. -func (g GeoBackupPolicyListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobTarget. +func (j JobTarget) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", g.Value) + 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 GeoBackupPolicyListResult. -func (g *GeoBackupPolicyListResult) UnmarshalJSON(data []byte) error { +// 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", g, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &g.Value) + 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", g, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GeoBackupPolicyProperties. -func (g GeoBackupPolicyProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobTargetGroup. +func (j JobTargetGroup) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "state", g.State) - populate(objectMap, "storageType", g.StorageType) + 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 GeoBackupPolicyProperties. -func (g *GeoBackupPolicyProperties) UnmarshalJSON(data []byte) error { +// 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", g, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "state": - err = unpopulate(val, "State", &g.State) + case "id": + err = unpopulate(val, "ID", &j.ID) delete(rawMsg, key) - case "storageType": - err = unpopulate(val, "StorageType", &g.StorageType) + 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", g, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IPv6FirewallRule. -func (i IPv6FirewallRule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobTargetGroupListResult. +func (j JobTargetGroupListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", i.ID) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "type", i.Type) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IPv6FirewallRule. -func (i *IPv6FirewallRule) UnmarshalJSON(data []byte) error { +// 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", i, err) + 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", &i.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &i.Properties) + case "nextLink": + err = unpopulate(val, "NextLink", &j.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) + case "value": + err = unpopulate(val, "Value", &j.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IPv6FirewallRuleListResult. -func (i IPv6FirewallRuleListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobTargetGroupProperties. +func (j JobTargetGroupProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", i.NextLink) - populate(objectMap, "value", i.Value) + populate(objectMap, "members", j.Members) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IPv6FirewallRuleListResult. -func (i *IPv6FirewallRuleListResult) UnmarshalJSON(data []byte) error { +// 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", i, err) + 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", &i.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &i.Value) + case "members": + err = unpopulate(val, "Members", &j.Members) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IPv6ServerFirewallRuleProperties. -func (i IPv6ServerFirewallRuleProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobVersion. +func (j JobVersion) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "endIPv6Address", i.EndIPv6Address) - populate(objectMap, "startIPv6Address", i.StartIPv6Address) + 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 IPv6ServerFirewallRuleProperties. -func (i *IPv6ServerFirewallRuleProperties) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "endIPv6Address": - err = unpopulate(val, "EndIPv6Address", &i.EndIPv6Address) + case "id": + err = unpopulate(val, "ID", &j.ID) delete(rawMsg, key) - case "startIPv6Address": - err = unpopulate(val, "StartIPv6Address", &i.StartIPv6Address) + 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImportExistingDatabaseDefinition. -func (i ImportExistingDatabaseDefinition) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobVersionListResult. +func (j JobVersionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImportExistingDatabaseDefinition. -func (i *ImportExistingDatabaseDefinition) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", j, 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) + case "nextLink": + err = unpopulate(val, "NextLink", &j.NextLink) delete(rawMsg, key) - case "storageUri": - err = unpopulate(val, "StorageURI", &i.StorageURI) + case "value": + err = unpopulate(val, "Value", &j.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImportExportExtensionsOperationListResult. -func (i ImportExportExtensionsOperationListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LedgerDigestUploads. +func (l LedgerDigestUploads) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", i.NextLink) - populate(objectMap, "value", i.Value) + 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 ImportExportExtensionsOperationListResult. -func (i *ImportExportExtensionsOperationListResult) UnmarshalJSON(data []byte) error { +// 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", i, err) + 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", &i.NextLink) + case "id": + err = unpopulate(val, "ID", &l.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &i.Value) + 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImportExportExtensionsOperationResult. -func (i ImportExportExtensionsOperationResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LedgerDigestUploadsListResult. +func (l LedgerDigestUploadsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", i.ID) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "type", i.Type) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImportExportExtensionsOperationResult. -func (i *ImportExportExtensionsOperationResult) UnmarshalJSON(data []byte) error { +// 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", i, err) + 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", &i.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &i.Properties) + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) + case "value": + err = unpopulate(val, "Value", &l.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImportExportExtensionsOperationResultProperties. -func (i ImportExportExtensionsOperationResultProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LedgerDigestUploadsProperties. +func (l LedgerDigestUploadsProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "digestStorageEndpoint", l.DigestStorageEndpoint) + populate(objectMap, "state", l.State) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImportExportExtensionsOperationResultProperties. -func (i *ImportExportExtensionsOperationResultProperties) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, 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) + case "digestStorageEndpoint": + err = unpopulate(val, "DigestStorageEndpoint", &l.DigestStorageEndpoint) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &i.Status) + case "state": + err = unpopulate(val, "State", &l.State) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImportExportOperationResult. -func (i ImportExportOperationResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LicenseTypeCapability. +func (l LicenseTypeCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", i.ID) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "type", i.Type) + 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 ImportExportOperationResult. -func (i *ImportExportOperationResult) UnmarshalJSON(data []byte) error { +// 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", i, err) + 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", &i.ID) - delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &i.Name) + err = unpopulate(val, "Name", &l.Name) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &i.Properties) + case "reason": + err = unpopulate(val, "Reason", &l.Reason) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) + case "status": + err = unpopulate(val, "Status", &l.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImportExportOperationResultProperties. -func (i ImportExportOperationResultProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocationCapabilities. +func (l LocationCapabilities) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 ImportExportOperationResultProperties. -func (i *ImportExportOperationResultProperties) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, 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) + case "name": + err = unpopulate(val, "Name", &l.Name) delete(rawMsg, key) - case "requestId": - err = unpopulate(val, "RequestID", &i.RequestID) + case "reason": + err = unpopulate(val, "Reason", &l.Reason) delete(rawMsg, key) - case "requestType": - err = unpopulate(val, "RequestType", &i.RequestType) + case "status": + err = unpopulate(val, "Status", &l.Status) delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &i.ServerName) + case "supportedManagedInstanceVersions": + err = unpopulate(val, "SupportedManagedInstanceVersions", &l.SupportedManagedInstanceVersions) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &i.Status) + case "supportedServerVersions": + err = unpopulate(val, "SupportedServerVersions", &l.SupportedServerVersions) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImportNewDatabaseDefinition. -func (i ImportNewDatabaseDefinition) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LogSizeCapability. +func (l LogSizeCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "limit", l.Limit) + populate(objectMap, "unit", l.Unit) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImportNewDatabaseDefinition. -func (i *ImportNewDatabaseDefinition) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, 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) + case "limit": + err = unpopulate(val, "Limit", &l.Limit) delete(rawMsg, key) - case "storageUri": - err = unpopulate(val, "StorageURI", &i.StorageURI) + case "unit": + err = unpopulate(val, "Unit", &l.Unit) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InstanceFailoverGroup. -func (i InstanceFailoverGroup) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LogicalDatabaseTransparentDataEncryption. +func (l LogicalDatabaseTransparentDataEncryption) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", i.ID) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "type", i.Type) + 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 InstanceFailoverGroup. -func (i *InstanceFailoverGroup) UnmarshalJSON(data []byte) error { +// 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", i, err) + 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", &i.ID) + err = unpopulate(val, "ID", &l.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &i.Name) + err = unpopulate(val, "Name", &l.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &i.Properties) + err = unpopulate(val, "Properties", &l.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &i.Type) + err = unpopulate(val, "Type", &l.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InstanceFailoverGroupListResult. -func (i InstanceFailoverGroupListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LogicalDatabaseTransparentDataEncryptionListResult. +func (l LogicalDatabaseTransparentDataEncryptionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", i.NextLink) - populate(objectMap, "value", i.Value) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceFailoverGroupListResult. -func (i *InstanceFailoverGroupListResult) UnmarshalJSON(data []byte) error { +// 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", i, err) + 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", &i.NextLink) + err = unpopulate(val, "NextLink", &l.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &i.Value) + err = unpopulate(val, "Value", &l.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InstanceFailoverGroupProperties. -func (i InstanceFailoverGroupProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LogicalServerAdvancedThreatProtectionListResult. +func (l LogicalServerAdvancedThreatProtectionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceFailoverGroupProperties. -func (i *InstanceFailoverGroupProperties) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, 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) + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) delete(rawMsg, key) - case "replicationState": - err = unpopulate(val, "ReplicationState", &i.ReplicationState) + case "value": + err = unpopulate(val, "Value", &l.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InstanceFailoverGroupReadOnlyEndpoint. -func (i InstanceFailoverGroupReadOnlyEndpoint) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LogicalServerSecurityAlertPolicyListResult. +func (l LogicalServerSecurityAlertPolicyListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "failoverPolicy", i.FailoverPolicy) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceFailoverGroupReadOnlyEndpoint. -func (i *InstanceFailoverGroupReadOnlyEndpoint) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "failoverPolicy": - err = unpopulate(val, "FailoverPolicy", &i.FailoverPolicy) + 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InstanceFailoverGroupReadWriteEndpoint. -func (i InstanceFailoverGroupReadWriteEndpoint) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionBackup. +func (l LongTermRetentionBackup) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "failoverPolicy", i.FailoverPolicy) - populate(objectMap, "failoverWithDataLossGracePeriodMinutes", i.FailoverWithDataLossGracePeriodMinutes) + 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 InstanceFailoverGroupReadWriteEndpoint. -func (i *InstanceFailoverGroupReadWriteEndpoint) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "failoverPolicy": - err = unpopulate(val, "FailoverPolicy", &i.FailoverPolicy) + case "id": + err = unpopulate(val, "ID", &l.ID) delete(rawMsg, key) - case "failoverWithDataLossGracePeriodMinutes": - err = unpopulate(val, "FailoverWithDataLossGracePeriodMinutes", &i.FailoverWithDataLossGracePeriodMinutes) + 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InstancePool. -func (i InstancePool) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionBackupListResult. +func (l LongTermRetentionBackupListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type InstancePool. -func (i *InstancePool) UnmarshalJSON(data []byte) error { +// 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", i, err) + 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", &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) + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) + case "value": + err = unpopulate(val, "Value", &l.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InstancePoolEditionCapability. -func (i InstancePoolEditionCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionBackupOperationResult. +func (l LongTermRetentionBackupOperationResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", i.Name) - populate(objectMap, "reason", i.Reason) - populate(objectMap, "status", i.Status) - populate(objectMap, "supportedFamilies", i.SupportedFamilies) + 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 InstancePoolEditionCapability. -func (i *InstancePoolEditionCapability) UnmarshalJSON(data []byte) error { +// 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", i, err) + 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", &i.Name) + case "id": + err = unpopulate(val, "ID", &l.ID) delete(rawMsg, key) - case "reason": - err = unpopulate(val, "Reason", &i.Reason) + case "name": + err = unpopulate(val, "Name", &l.Name) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &i.Status) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) delete(rawMsg, key) - case "supportedFamilies": - err = unpopulate(val, "SupportedFamilies", &i.SupportedFamilies) + case "type": + err = unpopulate(val, "Type", &l.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InstancePoolFamilyCapability. -func (i InstancePoolFamilyCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionBackupProperties. +func (l LongTermRetentionBackupProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 InstancePoolFamilyCapability. -func (i *InstancePoolFamilyCapability) UnmarshalJSON(data []byte) error { +// 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", i, err) + 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", &i.Name) + case "backupExpirationTime": + err = unpopulateTimeRFC3339(val, "BackupExpirationTime", &l.BackupExpirationTime) delete(rawMsg, key) - case "reason": - err = unpopulate(val, "Reason", &i.Reason) + case "backupStorageRedundancy": + err = unpopulate(val, "BackupStorageRedundancy", &l.BackupStorageRedundancy) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &i.Status) + case "backupTime": + err = unpopulateTimeRFC3339(val, "BackupTime", &l.BackupTime) delete(rawMsg, key) - case "supportedLicenseTypes": - err = unpopulate(val, "SupportedLicenseTypes", &i.SupportedLicenseTypes) + case "databaseDeletionTime": + err = unpopulateTimeRFC3339(val, "DatabaseDeletionTime", &l.DatabaseDeletionTime) delete(rawMsg, key) - case "supportedVcoresValues": - err = unpopulate(val, "SupportedVcoresValues", &i.SupportedVcoresValues) + 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InstancePoolListResult. -func (i InstancePoolListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionOperationResultProperties. +func (l LongTermRetentionOperationResultProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", i.NextLink) - populate(objectMap, "value", i.Value) + 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 InstancePoolListResult. -func (i *InstancePoolListResult) UnmarshalJSON(data []byte) error { +// 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", i, err) + 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", &i.NextLink) + case "fromBackupResourceId": + err = unpopulate(val, "FromBackupResourceID", &l.FromBackupResourceID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &i.Value) + 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InstancePoolProperties. -func (i InstancePoolProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionPolicy. +func (l LongTermRetentionPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "licenseType", i.LicenseType) - populate(objectMap, "subnetId", i.SubnetID) - populate(objectMap, "vCores", i.VCores) + 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 InstancePoolProperties. -func (i *InstancePoolProperties) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "licenseType": - err = unpopulate(val, "LicenseType", &i.LicenseType) + case "id": + err = unpopulate(val, "ID", &l.ID) delete(rawMsg, key) - case "subnetId": - err = unpopulate(val, "SubnetID", &i.SubnetID) + case "name": + err = unpopulate(val, "Name", &l.Name) delete(rawMsg, key) - case "vCores": - err = unpopulate(val, "VCores", &i.VCores) + 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InstancePoolUpdate. -func (i InstancePoolUpdate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionPolicyListResult. +func (l LongTermRetentionPolicyListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "tags", i.Tags) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type InstancePoolUpdate. -func (i *InstancePoolUpdate) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "tags": - err = unpopulate(val, "Tags", &i.Tags) + 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InstancePoolVcoresCapability. -func (i InstancePoolVcoresCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MaintenanceConfigurationCapability. +func (m MaintenanceConfigurationCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 InstancePoolVcoresCapability. -func (i *InstancePoolVcoresCapability) UnmarshalJSON(data []byte) error { +// 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", i, err) + 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", &i.Name) + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) case "reason": - err = unpopulate(val, "Reason", &i.Reason) + err = unpopulate(val, "Reason", &m.Reason) delete(rawMsg, key) case "status": - err = unpopulate(val, "Status", &i.Status) - delete(rawMsg, key) - case "storageLimit": - err = unpopulate(val, "StorageLimit", &i.StorageLimit) + err = unpopulate(val, "Status", &m.Status) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &i.Value) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &m.ZoneRedundant) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Job. -func (j Job) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindowOptions. +func (m MaintenanceWindowOptions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", j.ID) - populate(objectMap, "name", j.Name) - populate(objectMap, "properties", j.Properties) - populate(objectMap, "type", j.Type) + 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 Job. -func (j *Job) UnmarshalJSON(data []byte) error { +// 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", j, err) + 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", &j.ID) + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &j.Name) + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &j.Properties) + err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &j.Type) + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobAgent. -func (j JobAgent) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindowOptionsProperties. +func (m MaintenanceWindowOptionsProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 JobAgent. -func (j *JobAgent) UnmarshalJSON(data []byte) error { +// 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", j, err) + 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", &j.ID) + case "allowMultipleMaintenanceWindowsPerCycle": + err = unpopulate(val, "AllowMultipleMaintenanceWindowsPerCycle", &m.AllowMultipleMaintenanceWindowsPerCycle) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &j.Location) + case "defaultDurationInMinutes": + err = unpopulate(val, "DefaultDurationInMinutes", &m.DefaultDurationInMinutes) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &j.Name) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &m.IsEnabled) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &j.Properties) + case "maintenanceWindowCycles": + err = unpopulate(val, "MaintenanceWindowCycles", &m.MaintenanceWindowCycles) delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &j.SKU) + case "minCycles": + err = unpopulate(val, "MinCycles", &m.MinCycles) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &j.Tags) + case "minDurationInMinutes": + err = unpopulate(val, "MinDurationInMinutes", &m.MinDurationInMinutes) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &j.Type) + case "timeGranularityInMinutes": + err = unpopulate(val, "TimeGranularityInMinutes", &m.TimeGranularityInMinutes) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobAgentListResult. -func (j JobAgentListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindowTimeRange. +func (m MaintenanceWindowTimeRange) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", j.NextLink) - populate(objectMap, "value", j.Value) + 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 JobAgentListResult. -func (j *JobAgentListResult) UnmarshalJSON(data []byte) error { +// 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", j, err) + 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", &j.NextLink) + case "dayOfWeek": + err = unpopulate(val, "DayOfWeek", &m.DayOfWeek) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &j.Value) + 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobAgentProperties. -func (j JobAgentProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindows. +func (m MaintenanceWindows) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "databaseId", j.DatabaseID) - populate(objectMap, "state", j.State) + 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 JobAgentProperties. -func (j *JobAgentProperties) UnmarshalJSON(data []byte) error { +// 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "databaseId": - err = unpopulate(val, "DatabaseID", &j.DatabaseID) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &j.State) + 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobAgentUpdate. -func (j JobAgentUpdate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindowsProperties. +func (m MaintenanceWindowsProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "tags", j.Tags) + populate(objectMap, "timeRanges", m.TimeRanges) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobAgentUpdate. -func (j *JobAgentUpdate) UnmarshalJSON(data []byte) error { +// 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "tags": - err = unpopulate(val, "Tags", &j.Tags) + case "timeRanges": + err = unpopulate(val, "TimeRanges", &m.TimeRanges) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobCredential. -func (j JobCredential) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedBackupShortTermRetentionPolicy. +func (m ManagedBackupShortTermRetentionPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", j.ID) - populate(objectMap, "name", j.Name) - populate(objectMap, "properties", j.Properties) - populate(objectMap, "type", j.Type) + 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 JobCredential. -func (j *JobCredential) UnmarshalJSON(data []byte) error { +// 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", j, err) + 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", &j.ID) + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &j.Name) + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &j.Properties) + err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &j.Type) + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobCredentialListResult. -func (j JobCredentialListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedBackupShortTermRetentionPolicyListResult. +func (m ManagedBackupShortTermRetentionPolicyListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", j.NextLink) - populate(objectMap, "value", j.Value) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobCredentialListResult. -func (j *JobCredentialListResult) UnmarshalJSON(data []byte) error { +// 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", j, err) + 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", &j.NextLink) + err = unpopulate(val, "NextLink", &m.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &j.Value) + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobCredentialProperties. -func (j JobCredentialProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedBackupShortTermRetentionPolicyProperties. +func (m ManagedBackupShortTermRetentionPolicyProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "password", j.Password) - populate(objectMap, "username", j.Username) + populate(objectMap, "retentionDays", m.RetentionDays) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobCredentialProperties. -func (j *JobCredentialProperties) UnmarshalJSON(data []byte) error { +// 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, 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) + case "retentionDays": + err = unpopulate(val, "RetentionDays", &m.RetentionDays) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobExecution. -func (j JobExecution) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabase. +func (m ManagedDatabase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", j.ID) - populate(objectMap, "name", j.Name) - populate(objectMap, "properties", j.Properties) - populate(objectMap, "type", j.Type) + 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 JobExecution. -func (j *JobExecution) UnmarshalJSON(data []byte) error { +// 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", j, err) + 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", &j.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", &j.Name) + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &j.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &j.Type) + err = unpopulate(val, "Properties", &m.Properties) 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]any) - 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) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &j.Value) + case "type": + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobExecutionProperties. -func (j JobExecutionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseAdvancedThreatProtection. +func (m ManagedDatabaseAdvancedThreatProtection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 JobExecutionProperties. -func (j *JobExecutionProperties) UnmarshalJSON(data []byte) error { +// 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, 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) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) + case "name": + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) - case "stepId": - err = unpopulate(val, "StepID", &j.StepID) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) - case "stepName": - err = unpopulate(val, "StepName", &j.StepName) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &j.Target) + case "type": + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobExecutionTarget. -func (j JobExecutionTarget) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseAdvancedThreatProtectionListResult. +func (m ManagedDatabaseAdvancedThreatProtectionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "databaseName", j.DatabaseName) - populate(objectMap, "serverName", j.ServerName) - populate(objectMap, "type", j.Type) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecutionTarget. -func (j *JobExecutionTarget) UnmarshalJSON(data []byte) error { +// 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, 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) + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &j.Type) + case "value": + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobListResult. -func (j JobListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseListResult. +func (m ManagedDatabaseListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", j.NextLink) - populate(objectMap, "value", j.Value) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobListResult. -func (j *JobListResult) UnmarshalJSON(data []byte) error { +// 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", j, err) + 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", &j.NextLink) + err = unpopulate(val, "NextLink", &m.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &j.Value) + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobProperties. -func (j JobProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseMoveDefinition. +func (m ManagedDatabaseMoveDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", j.Description) - populate(objectMap, "schedule", j.Schedule) - populate(objectMap, "version", j.Version) + populate(objectMap, "destinationManagedDatabaseId", m.DestinationManagedDatabaseID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobProperties. -func (j *JobProperties) UnmarshalJSON(data []byte) error { +// 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", j, err) + 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", &j.Description) - delete(rawMsg, key) - case "schedule": - err = unpopulate(val, "Schedule", &j.Schedule) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &j.Version) + case "destinationManagedDatabaseId": + err = unpopulate(val, "DestinationManagedDatabaseID", &m.DestinationManagedDatabaseID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobSchedule. -func (j JobSchedule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseMoveOperationListResult. +func (m ManagedDatabaseMoveOperationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobSchedule. -func (j *JobSchedule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseMoveOperationListResult. +func (m *ManagedDatabaseMoveOperationListResult) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", m, 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) + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &j.Type) + case "value": + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobStep. -func (j JobStep) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseMoveOperationResult. +func (m ManagedDatabaseMoveOperationResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", j.ID) - populate(objectMap, "name", j.Name) - populate(objectMap, "properties", j.Properties) - populate(objectMap, "type", j.Type) + 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 JobStep. -func (j *JobStep) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseMoveOperationResult. +func (m *ManagedDatabaseMoveOperationResult) UnmarshalJSON(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) + 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", &j.ID) + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &j.Name) + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &j.Properties) + err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &j.Type) + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobStepAction. -func (j JobStepAction) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseMoveOperationResultProperties. +func (m ManagedDatabaseMoveOperationResultProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "source", j.Source) - populate(objectMap, "type", j.Type) - populate(objectMap, "value", j.Value) + populate(objectMap, "errorCode", m.ErrorCode) + populate(objectMap, "errorDescription", m.ErrorDescription) + populate(objectMap, "errorSeverity", m.ErrorSeverity) + populate(objectMap, "isCancellable", m.IsCancellable) + populate(objectMap, "isUserError", m.IsUserError) + populate(objectMap, "operation", m.Operation) + populate(objectMap, "operationFriendlyName", m.OperationFriendlyName) + populate(objectMap, "operationMode", m.OperationMode) + populate(objectMap, "sourceDatabaseName", m.SourceDatabaseName) + populate(objectMap, "sourceManagedInstanceId", m.SourceManagedInstanceID) + populate(objectMap, "sourceManagedInstanceName", m.SourceManagedInstanceName) + populateTimeRFC3339(objectMap, "startTime", m.StartTime) + populate(objectMap, "state", m.State) + populate(objectMap, "targetDatabaseName", m.TargetDatabaseName) + populate(objectMap, "targetManagedInstanceId", m.TargetManagedInstanceID) + populate(objectMap, "targetManagedInstanceName", m.TargetManagedInstanceName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobStepAction. -func (j *JobStepAction) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseMoveOperationResultProperties. +func (m *ManagedDatabaseMoveOperationResultProperties) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "source": - err = unpopulate(val, "Source", &j.Source) + case "errorCode": + err = unpopulate(val, "ErrorCode", &m.ErrorCode) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &j.Type) + case "errorDescription": + err = unpopulate(val, "ErrorDescription", &m.ErrorDescription) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &j.Value) + case "errorSeverity": + err = unpopulate(val, "ErrorSeverity", &m.ErrorSeverity) + 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 "operation": + err = unpopulate(val, "Operation", &m.Operation) + delete(rawMsg, key) + case "operationFriendlyName": + err = unpopulate(val, "OperationFriendlyName", &m.OperationFriendlyName) + delete(rawMsg, key) + case "operationMode": + err = unpopulate(val, "OperationMode", &m.OperationMode) + delete(rawMsg, key) + case "sourceDatabaseName": + err = unpopulate(val, "SourceDatabaseName", &m.SourceDatabaseName) + delete(rawMsg, key) + case "sourceManagedInstanceId": + err = unpopulate(val, "SourceManagedInstanceID", &m.SourceManagedInstanceID) + delete(rawMsg, key) + case "sourceManagedInstanceName": + err = unpopulate(val, "SourceManagedInstanceName", &m.SourceManagedInstanceName) + 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) + case "targetDatabaseName": + err = unpopulate(val, "TargetDatabaseName", &m.TargetDatabaseName) + delete(rawMsg, key) + case "targetManagedInstanceId": + err = unpopulate(val, "TargetManagedInstanceID", &m.TargetManagedInstanceID) + delete(rawMsg, key) + case "targetManagedInstanceName": + err = unpopulate(val, "TargetManagedInstanceName", &m.TargetManagedInstanceName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobStepExecutionOptions. -func (j JobStepExecutionOptions) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseProperties. +func (m ManagedDatabaseProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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, "crossSubscriptionRestorableDroppedDatabaseId", m.CrossSubscriptionRestorableDroppedDatabaseID) + populate(objectMap, "crossSubscriptionSourceDatabaseId", m.CrossSubscriptionSourceDatabaseID) + populate(objectMap, "crossSubscriptionTargetManagedInstanceId", m.CrossSubscriptionTargetManagedInstanceID) + populate(objectMap, "defaultSecondaryLocation", m.DefaultSecondaryLocation) + populateTimeRFC3339(objectMap, "earliestRestorePoint", m.EarliestRestorePoint) + populate(objectMap, "failoverGroupId", m.FailoverGroupID) + populate(objectMap, "isLedgerOn", m.IsLedgerOn) + 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 JobStepExecutionOptions. -func (j *JobStepExecutionOptions) UnmarshalJSON(data []byte) error { +// 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "initialRetryIntervalSeconds": - err = unpopulate(val, "InitialRetryIntervalSeconds", &j.InitialRetryIntervalSeconds) + case "autoCompleteRestore": + err = unpopulate(val, "AutoCompleteRestore", &m.AutoCompleteRestore) delete(rawMsg, key) - case "maximumRetryIntervalSeconds": - err = unpopulate(val, "MaximumRetryIntervalSeconds", &j.MaximumRetryIntervalSeconds) + case "catalogCollation": + err = unpopulate(val, "CatalogCollation", &m.CatalogCollation) delete(rawMsg, key) - case "retryAttempts": - err = unpopulate(val, "RetryAttempts", &j.RetryAttempts) + case "collation": + err = unpopulate(val, "Collation", &m.Collation) delete(rawMsg, key) - case "retryIntervalBackoffMultiplier": - err = unpopulate(val, "RetryIntervalBackoffMultiplier", &j.RetryIntervalBackoffMultiplier) + case "createMode": + err = unpopulate(val, "CreateMode", &m.CreateMode) delete(rawMsg, key) - case "timeoutSeconds": - err = unpopulate(val, "TimeoutSeconds", &j.TimeoutSeconds) + case "creationDate": + err = unpopulateTimeRFC3339(val, "CreationDate", &m.CreationDate) + delete(rawMsg, key) + case "crossSubscriptionRestorableDroppedDatabaseId": + err = unpopulate(val, "CrossSubscriptionRestorableDroppedDatabaseID", &m.CrossSubscriptionRestorableDroppedDatabaseID) + delete(rawMsg, key) + case "crossSubscriptionSourceDatabaseId": + err = unpopulate(val, "CrossSubscriptionSourceDatabaseID", &m.CrossSubscriptionSourceDatabaseID) + delete(rawMsg, key) + case "crossSubscriptionTargetManagedInstanceId": + err = unpopulate(val, "CrossSubscriptionTargetManagedInstanceID", &m.CrossSubscriptionTargetManagedInstanceID) + 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 "isLedgerOn": + err = unpopulate(val, "IsLedgerOn", &m.IsLedgerOn) + 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobStepListResult. -func (j JobStepListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseRestoreDetailsBackupSetProperties. +func (m ManagedDatabaseRestoreDetailsBackupSetProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", j.NextLink) - populate(objectMap, "value", j.Value) + 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 JobStepListResult. -func (j *JobStepListResult) UnmarshalJSON(data []byte) error { +// 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", j, err) + 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", &j.NextLink) + case "backupSizeMB": + err = unpopulate(val, "BackupSizeMB", &m.BackupSizeMB) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &j.Value) + 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobStepOutput. -func (j JobStepOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseRestoreDetailsProperties. +func (m ManagedDatabaseRestoreDetailsProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 JobStepOutput. -func (j *JobStepOutput) UnmarshalJSON(data []byte) error { +// 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "credential": - err = unpopulate(val, "Credential", &j.Credential) + case "blockReason": + err = unpopulate(val, "BlockReason", &m.BlockReason) delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &j.DatabaseName) + case "currentBackupType": + err = unpopulate(val, "CurrentBackupType", &m.CurrentBackupType) delete(rawMsg, key) - case "resourceGroupName": - err = unpopulate(val, "ResourceGroupName", &j.ResourceGroupName) + case "currentRestorePlanSizeMB": + err = unpopulate(val, "CurrentRestorePlanSizeMB", &m.CurrentRestorePlanSizeMB) delete(rawMsg, key) - case "schemaName": - err = unpopulate(val, "SchemaName", &j.SchemaName) + case "currentRestoredSizeMB": + err = unpopulate(val, "CurrentRestoredSizeMB", &m.CurrentRestoredSizeMB) delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &j.ServerName) + case "currentRestoringFileName": + err = unpopulate(val, "CurrentRestoringFileName", &m.CurrentRestoringFileName) delete(rawMsg, key) - case "subscriptionId": - err = unpopulate(val, "SubscriptionID", &j.SubscriptionID) + case "diffBackupSets": + err = unpopulate(val, "DiffBackupSets", &m.DiffBackupSets) delete(rawMsg, key) - case "tableName": - err = unpopulate(val, "TableName", &j.TableName) + 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", &j.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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobStepProperties. -func (j JobStepProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseRestoreDetailsResult. +func (m ManagedDatabaseRestoreDetailsResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 JobStepProperties. -func (j *JobStepProperties) UnmarshalJSON(data []byte) error { +// 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, 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) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &j.Output) + case "name": + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) - case "stepId": - err = unpopulate(val, "StepID", &j.StepID) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) - case "targetGroup": - err = unpopulate(val, "TargetGroup", &j.TargetGroup) + case "type": + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobTarget. -func (j JobTarget) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseRestoreDetailsUnrestorableFileProperties. +func (m ManagedDatabaseRestoreDetailsUnrestorableFileProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "name", m.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobTarget. -func (j *JobTarget) UnmarshalJSON(data []byte) error { +// 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, 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) + case "name": + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobTargetGroup. -func (j JobTargetGroup) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseSecurityAlertPolicy. +func (m ManagedDatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", j.ID) - populate(objectMap, "name", j.Name) - populate(objectMap, "properties", j.Properties) - populate(objectMap, "type", j.Type) + 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 JobTargetGroup. -func (j *JobTargetGroup) UnmarshalJSON(data []byte) error { +// 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", j, err) + 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", &j.ID) + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &j.Name) + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &j.Properties) + err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &j.Type) + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobTargetGroupListResult. -func (j JobTargetGroupListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseSecurityAlertPolicyListResult. +func (m ManagedDatabaseSecurityAlertPolicyListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", j.NextLink) - populate(objectMap, "value", j.Value) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobTargetGroupListResult. -func (j *JobTargetGroupListResult) UnmarshalJSON(data []byte) error { +// 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", j, err) + 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", &j.NextLink) + err = unpopulate(val, "NextLink", &m.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &j.Value) + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobTargetGroupProperties. -func (j JobTargetGroupProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseStartMoveDefinition. +func (m ManagedDatabaseStartMoveDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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]any) - populate(objectMap, "members", j.Members) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "tags", m.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobTargetGroupProperties. -func (j *JobTargetGroupProperties) UnmarshalJSON(data []byte) error { +// 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "members": - err = unpopulate(val, "Members", &j.Members) + 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobVersion. -func (j JobVersion) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstance. +func (m ManagedInstance) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", j.ID) - populate(objectMap, "name", j.Name) - populate(objectMap, "type", j.Type) + 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 JobVersion. -func (j *JobVersion) UnmarshalJSON(data []byte) error { +// 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", j, err) + 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", &j.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", &j.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", &j.Type) + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobVersionListResult. -func (j JobVersionListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAdministrator. +func (m ManagedInstanceAdministrator) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", j.NextLink) - populate(objectMap, "value", j.Value) + 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 JobVersionListResult. -func (j *JobVersionListResult) UnmarshalJSON(data []byte) error { +// 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", j, err) + 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", &j.NextLink) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &j.Value) + 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LedgerDigestUploads. -func (l LedgerDigestUploads) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAdministratorListResult. +func (m ManagedInstanceAdministratorListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", l.ID) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - populate(objectMap, "type", l.Type) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LedgerDigestUploads. -func (l *LedgerDigestUploads) UnmarshalJSON(data []byte) error { +// 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", l, err) + 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", &l.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &l.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &l.Properties) + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &l.Type) + case "value": + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LedgerDigestUploadsListResult. -func (l LedgerDigestUploadsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAdministratorProperties. +func (m ManagedInstanceAdministratorProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) + 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 LedgerDigestUploadsListResult. -func (l *LedgerDigestUploadsListResult) UnmarshalJSON(data []byte) error { +// 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", l, err) + 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", &l.NextLink) + case "administratorType": + err = unpopulate(val, "AdministratorType", &m.AdministratorType) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) + 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LedgerDigestUploadsProperties. -func (l LedgerDigestUploadsProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAdvancedThreatProtection. +func (m ManagedInstanceAdvancedThreatProtection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "digestStorageEndpoint", l.DigestStorageEndpoint) - populate(objectMap, "state", l.State) + 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 LedgerDigestUploadsProperties. -func (l *LedgerDigestUploadsProperties) UnmarshalJSON(data []byte) error { +// 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "digestStorageEndpoint": - err = unpopulate(val, "DigestStorageEndpoint", &l.DigestStorageEndpoint) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &l.State) + 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LicenseTypeCapability. -func (l LicenseTypeCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAdvancedThreatProtectionListResult. +func (m ManagedInstanceAdvancedThreatProtectionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", l.Name) - populate(objectMap, "reason", l.Reason) - populate(objectMap, "status", l.Status) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LicenseTypeCapability. -func (l *LicenseTypeCapability) UnmarshalJSON(data []byte) error { +// 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", l, err) + 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", &l.Name) - delete(rawMsg, key) - case "reason": - err = unpopulate(val, "Reason", &l.Reason) + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &l.Status) + case "value": + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LocationCapabilities. -func (l LocationCapabilities) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAzureADOnlyAuthListResult. +func (m ManagedInstanceAzureADOnlyAuthListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LocationCapabilities. -func (l *LocationCapabilities) UnmarshalJSON(data []byte) error { +// 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", l, err) + 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", &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) + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) delete(rawMsg, key) - case "supportedServerVersions": - err = unpopulate(val, "SupportedServerVersions", &l.SupportedServerVersions) + case "value": + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LogSizeCapability. -func (l LogSizeCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAzureADOnlyAuthProperties. +func (m ManagedInstanceAzureADOnlyAuthProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "limit", l.Limit) - populate(objectMap, "unit", l.Unit) + populate(objectMap, "azureADOnlyAuthentication", m.AzureADOnlyAuthentication) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LogSizeCapability. -func (l *LogSizeCapability) UnmarshalJSON(data []byte) error { +// 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", l, err) + 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", &l.Limit) - delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &l.Unit) + case "azureADOnlyAuthentication": + err = unpopulate(val, "AzureADOnlyAuthentication", &m.AzureADOnlyAuthentication) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LogicalDatabaseTransparentDataEncryption. -func (l LogicalDatabaseTransparentDataEncryption) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAzureADOnlyAuthentication. +func (m ManagedInstanceAzureADOnlyAuthentication) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", l.ID) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - populate(objectMap, "type", l.Type) + 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 LogicalDatabaseTransparentDataEncryption. -func (l *LogicalDatabaseTransparentDataEncryption) UnmarshalJSON(data []byte) error { +// 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", l, err) + 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", &l.ID) + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &l.Name) + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &l.Properties) + err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &l.Type) + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LogicalDatabaseTransparentDataEncryptionListResult. -func (l LogicalDatabaseTransparentDataEncryptionListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceDtc. +func (m ManagedInstanceDtc) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) + 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 LogicalDatabaseTransparentDataEncryptionListResult. -func (l *LogicalDatabaseTransparentDataEncryptionListResult) UnmarshalJSON(data []byte) error { +// 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", l, err) + 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", &l.NextLink) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) + 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LogicalServerAdvancedThreatProtectionListResult. -func (l LogicalServerAdvancedThreatProtectionListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceDtcListResult. +func (m ManagedInstanceDtcListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LogicalServerAdvancedThreatProtectionListResult. -func (l *LogicalServerAdvancedThreatProtectionListResult) UnmarshalJSON(data []byte) error { +// 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", l, err) + 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", &l.NextLink) + err = unpopulate(val, "NextLink", &m.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &l.Value) + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LogicalServerSecurityAlertPolicyListResult. -func (l LogicalServerSecurityAlertPolicyListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceDtcProperties. +func (m ManagedInstanceDtcProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) + 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 LogicalServerSecurityAlertPolicyListResult. -func (l *LogicalServerSecurityAlertPolicyListResult) UnmarshalJSON(data []byte) error { +// 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", l, err) + 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", &l.NextLink) + case "dtcEnabled": + err = unpopulate(val, "DtcEnabled", &m.DtcEnabled) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) + 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionBackup. -func (l LongTermRetentionBackup) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceDtcSecuritySettings. +func (m ManagedInstanceDtcSecuritySettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", l.ID) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - populate(objectMap, "type", l.Type) + populate(objectMap, "snaLu6point2TransactionsEnabled", m.SnaLu6Point2TransactionsEnabled) + populate(objectMap, "transactionManagerCommunicationSettings", m.TransactionManagerCommunicationSettings) + populate(objectMap, "xaTransactionsDefaultTimeout", m.XaTransactionsDefaultTimeout) + populate(objectMap, "xaTransactionsEnabled", m.XaTransactionsEnabled) + populate(objectMap, "xaTransactionsMaximumTimeout", m.XaTransactionsMaximumTimeout) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LongTermRetentionBackup. -func (l *LongTermRetentionBackup) UnmarshalJSON(data []byte) error { +// 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", l, err) + 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", &l.ID) + case "snaLu6point2TransactionsEnabled": + err = unpopulate(val, "SnaLu6Point2TransactionsEnabled", &m.SnaLu6Point2TransactionsEnabled) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &l.Name) + case "transactionManagerCommunicationSettings": + err = unpopulate(val, "TransactionManagerCommunicationSettings", &m.TransactionManagerCommunicationSettings) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &l.Properties) + case "xaTransactionsDefaultTimeout": + err = unpopulate(val, "XaTransactionsDefaultTimeout", &m.XaTransactionsDefaultTimeout) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &l.Type) + case "xaTransactionsEnabled": + err = unpopulate(val, "XaTransactionsEnabled", &m.XaTransactionsEnabled) + delete(rawMsg, key) + case "xaTransactionsMaximumTimeout": + err = unpopulate(val, "XaTransactionsMaximumTimeout", &m.XaTransactionsMaximumTimeout) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionBackupListResult. -func (l LongTermRetentionBackupListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceDtcTransactionManagerCommunicationSettings. +func (m ManagedInstanceDtcTransactionManagerCommunicationSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) + 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 LongTermRetentionBackupListResult. -func (l *LongTermRetentionBackupListResult) UnmarshalJSON(data []byte) error { +// 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", l, err) + 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", &l.NextLink) + case "allowInboundEnabled": + err = unpopulate(val, "AllowInboundEnabled", &m.AllowInboundEnabled) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) + 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionBackupOperationResult. -func (l LongTermRetentionBackupOperationResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceEditionCapability. +func (m ManagedInstanceEditionCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", l.ID) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - populate(objectMap, "type", l.Type) + 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 LongTermRetentionBackupOperationResult. -func (l *LongTermRetentionBackupOperationResult) UnmarshalJSON(data []byte) error { +// 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", l, err) + 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", &l.ID) - delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &l.Name) + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &l.Properties) + case "reason": + err = unpopulate(val, "Reason", &m.Reason) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &l.Type) + 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionBackupProperties. -func (l LongTermRetentionBackupProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceEncryptionProtector. +func (m ManagedInstanceEncryptionProtector) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 LongTermRetentionBackupProperties. -func (l *LongTermRetentionBackupProperties) UnmarshalJSON(data []byte) error { +// 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", l, err) + 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", &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) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &l.DatabaseName) + case "kind": + err = unpopulate(val, "Kind", &m.Kind) delete(rawMsg, key) - case "requestedBackupStorageRedundancy": - err = unpopulate(val, "RequestedBackupStorageRedundancy", &l.RequestedBackupStorageRedundancy) + case "name": + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) - case "serverCreateTime": - err = unpopulateTimeRFC3339(val, "ServerCreateTime", &l.ServerCreateTime) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &l.ServerName) + case "type": + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionOperationResultProperties. -func (l LongTermRetentionOperationResultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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) +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceEncryptionProtectorListResult. +func (m ManagedInstanceEncryptionProtectorListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LongTermRetentionOperationResultProperties. -func (l *LongTermRetentionOperationResultProperties) UnmarshalJSON(data []byte) error { +// 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", m, 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) + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) delete(rawMsg, key) - case "toBackupResourceId": - err = unpopulate(val, "ToBackupResourceID", &l.ToBackupResourceID) + case "value": + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionPolicy. -func (l LongTermRetentionPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceEncryptionProtectorProperties. +func (m ManagedInstanceEncryptionProtectorProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", l.ID) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - populate(objectMap, "type", l.Type) + 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 LongTermRetentionPolicy. -func (l *LongTermRetentionPolicy) UnmarshalJSON(data []byte) error { +// 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", l, err) + 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", &l.ID) + case "autoRotationEnabled": + err = unpopulate(val, "AutoRotationEnabled", &m.AutoRotationEnabled) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &l.Name) + case "serverKeyName": + err = unpopulate(val, "ServerKeyName", &m.ServerKeyName) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &l.Properties) + case "serverKeyType": + err = unpopulate(val, "ServerKeyType", &m.ServerKeyType) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &l.Type) + 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionPolicyListResult. -func (l LongTermRetentionPolicyListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceExternalAdministrator. +func (m ManagedInstanceExternalAdministrator) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) + 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 LongTermRetentionPolicyListResult. -func (l *LongTermRetentionPolicyListResult) UnmarshalJSON(data []byte) error { +// 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", l, err) + 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", &l.NextLink) + case "administratorType": + err = unpopulate(val, "AdministratorType", &m.AdministratorType) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) + 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MaintenanceConfigurationCapability. -func (m MaintenanceConfigurationCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceFamilyCapability. +func (m ManagedInstanceFamilyCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "name", m.Name) populate(objectMap, "reason", m.Reason) + populate(objectMap, "sku", m.SKU) populate(objectMap, "status", m.Status) - populate(objectMap, "zoneRedundant", m.ZoneRedundant) + populate(objectMap, "supportedLicenseTypes", m.SupportedLicenseTypes) + populate(objectMap, "supportedVcoresValues", m.SupportedVcoresValues) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceConfigurationCapability. -func (m *MaintenanceConfigurationCapability) UnmarshalJSON(data []byte) error { +// 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) @@ -7775,11 +10236,17 @@ func (m *MaintenanceConfigurationCapability) UnmarshalJSON(data []byte) error { 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 "zoneRedundant": - err = unpopulate(val, "ZoneRedundant", &m.ZoneRedundant) + 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 { @@ -7789,18 +10256,19 @@ func (m *MaintenanceConfigurationCapability) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindowOptions. -func (m MaintenanceWindowOptions) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceKey. +func (m ManagedInstanceKey) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 MaintenanceWindowOptions. -func (m *MaintenanceWindowOptions) UnmarshalJSON(data []byte) error { +// 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) @@ -7811,6 +10279,9 @@ func (m *MaintenanceWindowOptions) UnmarshalJSON(data []byte) error { 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) @@ -7828,21 +10299,16 @@ func (m *MaintenanceWindowOptions) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindowOptionsProperties. -func (m MaintenanceWindowOptionsProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceKeyListResult. +func (m ManagedInstanceKeyListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceWindowOptionsProperties. -func (m *MaintenanceWindowOptionsProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -7850,26 +10316,11 @@ func (m *MaintenanceWindowOptionsProperties) UnmarshalJSON(data []byte) error { 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) + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) delete(rawMsg, key) - case "timeGranularityInMinutes": - err = unpopulate(val, "TimeGranularityInMinutes", &m.TimeGranularityInMinutes) + case "value": + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { @@ -7879,17 +10330,19 @@ func (m *MaintenanceWindowOptionsProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindowTimeRange. -func (m MaintenanceWindowTimeRange) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceKeyProperties. +func (m ManagedInstanceKeyProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dayOfWeek", m.DayOfWeek) - populate(objectMap, "duration", m.Duration) - populate(objectMap, "startTime", m.StartTime) + 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 MaintenanceWindowTimeRange. -func (m *MaintenanceWindowTimeRange) UnmarshalJSON(data []byte) error { +// 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) @@ -7897,53 +10350,20 @@ func (m *MaintenanceWindowTimeRange) UnmarshalJSON(data []byte) error { 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) + case "autoRotationEnabled": + err = unpopulate(val, "AutoRotationEnabled", &m.AutoRotationEnabled) 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]any) - 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) + case "creationDate": + err = unpopulateTimeRFC3339(val, "CreationDate", &m.CreationDate) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) + case "serverKeyType": + err = unpopulate(val, "ServerKeyType", &m.ServerKeyType) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &m.Thumbprint) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "uri": + err = unpopulate(val, "URI", &m.URI) delete(rawMsg, key) } if err != nil { @@ -7953,15 +10373,16 @@ func (m *MaintenanceWindows) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindowsProperties. -func (m MaintenanceWindowsProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceListResult. +func (m ManagedInstanceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "timeRanges", m.TimeRanges) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceWindowsProperties. -func (m *MaintenanceWindowsProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -7969,8 +10390,11 @@ func (m *MaintenanceWindowsProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "timeRanges": - err = unpopulate(val, "TimeRanges", &m.TimeRanges) + 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 { @@ -7980,8 +10404,8 @@ func (m *MaintenanceWindowsProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedBackupShortTermRetentionPolicy. -func (m ManagedBackupShortTermRetentionPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceLongTermRetentionBackup. +func (m ManagedInstanceLongTermRetentionBackup) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", m.ID) populate(objectMap, "name", m.Name) @@ -7990,8 +10414,8 @@ func (m ManagedBackupShortTermRetentionPolicy) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedBackupShortTermRetentionPolicy. -func (m *ManagedBackupShortTermRetentionPolicy) UnmarshalJSON(data []byte) error { +// 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) @@ -8019,16 +10443,16 @@ func (m *ManagedBackupShortTermRetentionPolicy) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedBackupShortTermRetentionPolicyListResult. -func (m ManagedBackupShortTermRetentionPolicyListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceLongTermRetentionBackupListResult. +func (m ManagedInstanceLongTermRetentionBackupListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -8050,15 +10474,21 @@ func (m *ManagedBackupShortTermRetentionPolicyListResult) UnmarshalJSON(data []b return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedBackupShortTermRetentionPolicyProperties. -func (m ManagedBackupShortTermRetentionPolicyProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceLongTermRetentionBackupProperties. +func (m ManagedInstanceLongTermRetentionBackupProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "retentionDays", m.RetentionDays) + 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 ManagedBackupShortTermRetentionPolicyProperties. -func (m *ManagedBackupShortTermRetentionPolicyProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -8066,8 +10496,26 @@ func (m *ManagedBackupShortTermRetentionPolicyProperties) UnmarshalJSON(data []b for key, val := range rawMsg { var err error switch key { - case "retentionDays": - err = unpopulate(val, "RetentionDays", &m.RetentionDays) + 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 { @@ -8077,20 +10525,18 @@ func (m *ManagedBackupShortTermRetentionPolicyProperties) UnmarshalJSON(data []b return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedDatabase. -func (m ManagedDatabase) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceLongTermRetentionPolicy. +func (m ManagedInstanceLongTermRetentionPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -8101,18 +10547,12 @@ func (m *ManagedDatabase) UnmarshalJSON(data []byte) error { 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) @@ -8124,16 +10564,16 @@ func (m *ManagedDatabase) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseListResult. -func (m ManagedDatabaseListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceLongTermRetentionPolicyListResult. +func (m ManagedInstanceLongTermRetentionPolicyListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -8145,161 +10585,7 @@ func (m *ManagedDatabaseListResult) UnmarshalJSON(data []byte) error { 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 ManagedDatabaseProperties. -func (m ManagedDatabaseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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]any) - 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) + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { @@ -8309,18 +10595,17 @@ func (m *ManagedDatabaseRestoreDetailsProperties) UnmarshalJSON(data []byte) err return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseRestoreDetailsResult. -func (m ManagedDatabaseRestoreDetailsResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceMaintenanceConfigurationCapability. +func (m ManagedInstanceMaintenanceConfigurationCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "type", m.Type) + populate(objectMap, "reason", m.Reason) + populate(objectMap, "status", m.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseRestoreDetailsResult. -func (m *ManagedDatabaseRestoreDetailsResult) UnmarshalJSON(data []byte) error { +// 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) @@ -8328,17 +10613,14 @@ func (m *ManagedDatabaseRestoreDetailsResult) UnmarshalJSON(data []byte) error { 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) + case "reason": + err = unpopulate(val, "Reason", &m.Reason) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "status": + err = unpopulate(val, "Status", &m.Status) delete(rawMsg, key) } if err != nil { @@ -8348,8 +10630,8 @@ func (m *ManagedDatabaseRestoreDetailsResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseSecurityAlertPolicy. -func (m ManagedDatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceOperation. +func (m ManagedInstanceOperation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", m.ID) populate(objectMap, "name", m.Name) @@ -8358,8 +10640,8 @@ func (m ManagedDatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseSecurityAlertPolicy. -func (m *ManagedDatabaseSecurityAlertPolicy) UnmarshalJSON(data []byte) error { +// 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) @@ -8387,16 +10669,16 @@ func (m *ManagedDatabaseSecurityAlertPolicy) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseSecurityAlertPolicyListResult. -func (m ManagedDatabaseSecurityAlertPolicyListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceOperationListResult. +func (m ManagedInstanceOperationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -8418,16 +10700,16 @@ func (m *ManagedDatabaseSecurityAlertPolicyListResult) UnmarshalJSON(data []byte return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseUpdate. -func (m ManagedDatabaseUpdate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceOperationParametersPair. +func (m ManagedInstanceOperationParametersPair) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "tags", m.Tags) + populate(objectMap, "currentParameters", m.CurrentParameters) + populate(objectMap, "requestedParameters", m.RequestedParameters) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseUpdate. -func (m *ManagedDatabaseUpdate) UnmarshalJSON(data []byte) error { +// 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) @@ -8435,11 +10717,11 @@ func (m *ManagedDatabaseUpdate) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &m.Properties) + case "currentParameters": + err = unpopulate(val, "CurrentParameters", &m.CurrentParameters) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &m.Tags) + case "requestedParameters": + err = unpopulate(val, "RequestedParameters", &m.RequestedParameters) delete(rawMsg, key) } if err != nil { @@ -8449,22 +10731,29 @@ func (m *ManagedDatabaseUpdate) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstance. -func (m ManagedInstance) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceOperationProperties. +func (m ManagedInstanceOperationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 ManagedInstance. -func (m *ManagedInstance) UnmarshalJSON(data []byte) error { +// 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) @@ -8472,29 +10761,50 @@ func (m *ManagedInstance) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &m.ID) + case "description": + err = unpopulate(val, "Description", &m.Description) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &m.Identity) + case "errorCode": + err = unpopulate(val, "ErrorCode", &m.ErrorCode) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &m.Location) + case "errorDescription": + err = unpopulate(val, "ErrorDescription", &m.ErrorDescription) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) + case "errorSeverity": + err = unpopulate(val, "ErrorSeverity", &m.ErrorSeverity) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) + case "estimatedCompletionTime": + err = unpopulateTimeRFC3339(val, "EstimatedCompletionTime", &m.EstimatedCompletionTime) delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &m.SKU) + case "isCancellable": + err = unpopulate(val, "IsCancellable", &m.IsCancellable) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &m.Tags) + case "isUserError": + err = unpopulate(val, "IsUserError", &m.IsUserError) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + 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 { @@ -8504,18 +10814,17 @@ func (m *ManagedInstance) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAdministrator. -func (m ManagedInstanceAdministrator) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceOperationSteps. +func (m ManagedInstanceOperationSteps) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "type", m.Type) + 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 ManagedInstanceAdministrator. -func (m *ManagedInstanceAdministrator) UnmarshalJSON(data []byte) error { +// 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) @@ -8523,17 +10832,14 @@ func (m *ManagedInstanceAdministrator) UnmarshalJSON(data []byte) error { 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) + case "currentStep": + err = unpopulate(val, "CurrentStep", &m.CurrentStep) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) + case "stepsList": + err = unpopulate(val, "StepsList", &m.StepsList) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "totalSteps": + err = unpopulate(val, "TotalSteps", &m.TotalSteps) delete(rawMsg, key) } if err != nil { @@ -8543,16 +10849,16 @@ func (m *ManagedInstanceAdministrator) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAdministratorListResult. -func (m ManagedInstanceAdministratorListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePairInfo. +func (m ManagedInstancePairInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) + populate(objectMap, "partnerManagedInstanceId", m.PartnerManagedInstanceID) + populate(objectMap, "primaryManagedInstanceId", m.PrimaryManagedInstanceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceAdministratorListResult. -func (m *ManagedInstanceAdministratorListResult) UnmarshalJSON(data []byte) error { +// 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) @@ -8560,11 +10866,11 @@ func (m *ManagedInstanceAdministratorListResult) UnmarshalJSON(data []byte) erro for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &m.NextLink) + case "partnerManagedInstanceId": + err = unpopulate(val, "PartnerManagedInstanceID", &m.PartnerManagedInstanceID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) + case "primaryManagedInstanceId": + err = unpopulate(val, "PrimaryManagedInstanceID", &m.PrimaryManagedInstanceID) delete(rawMsg, key) } if err != nil { @@ -8574,18 +10880,16 @@ func (m *ManagedInstanceAdministratorListResult) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAdministratorProperties. -func (m ManagedInstanceAdministratorProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePecProperty. +func (m ManagedInstancePecProperty) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "administratorType", m.AdministratorType) - populate(objectMap, "login", m.Login) - populate(objectMap, "sid", m.Sid) - populate(objectMap, "tenantId", m.TenantID) + populate(objectMap, "id", m.ID) + populate(objectMap, "properties", m.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceAdministratorProperties. -func (m *ManagedInstanceAdministratorProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -8593,17 +10897,11 @@ func (m *ManagedInstanceAdministratorProperties) UnmarshalJSON(data []byte) erro 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) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &m.TenantID) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) } if err != nil { @@ -8613,16 +10911,18 @@ func (m *ManagedInstanceAdministratorProperties) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAzureADOnlyAuthListResult. -func (m ManagedInstanceAzureADOnlyAuthListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateEndpointConnection. +func (m ManagedInstancePrivateEndpointConnection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) + 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 ManagedInstanceAzureADOnlyAuthListResult. -func (m *ManagedInstanceAzureADOnlyAuthListResult) UnmarshalJSON(data []byte) error { +// 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) @@ -8630,11 +10930,17 @@ func (m *ManagedInstanceAzureADOnlyAuthListResult) UnmarshalJSON(data []byte) er for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &m.NextLink) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) + 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 { @@ -8644,15 +10950,16 @@ func (m *ManagedInstanceAzureADOnlyAuthListResult) UnmarshalJSON(data []byte) er return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAzureADOnlyAuthProperties. -func (m ManagedInstanceAzureADOnlyAuthProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateEndpointConnectionListResult. +func (m ManagedInstancePrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "azureADOnlyAuthentication", m.AzureADOnlyAuthentication) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceAzureADOnlyAuthProperties. -func (m *ManagedInstanceAzureADOnlyAuthProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -8660,8 +10967,11 @@ func (m *ManagedInstanceAzureADOnlyAuthProperties) UnmarshalJSON(data []byte) er for key, val := range rawMsg { var err error switch key { - case "azureADOnlyAuthentication": - err = unpopulate(val, "AzureADOnlyAuthentication", &m.AzureADOnlyAuthentication) + 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 { @@ -8671,18 +10981,17 @@ func (m *ManagedInstanceAzureADOnlyAuthProperties) UnmarshalJSON(data []byte) er return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAzureADOnlyAuthentication. -func (m ManagedInstanceAzureADOnlyAuthentication) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateEndpointConnectionProperties. +func (m ManagedInstancePrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "type", m.Type) + 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 ManagedInstanceAzureADOnlyAuthentication. -func (m *ManagedInstanceAzureADOnlyAuthentication) UnmarshalJSON(data []byte) error { +// 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) @@ -8690,17 +10999,14 @@ func (m *ManagedInstanceAzureADOnlyAuthentication) UnmarshalJSON(data []byte) er 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) + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &m.PrivateEndpoint) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &m.PrivateLinkServiceConnectionState) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) delete(rawMsg, key) } if err != nil { @@ -8710,20 +11016,15 @@ func (m *ManagedInstanceAzureADOnlyAuthentication) UnmarshalJSON(data []byte) er return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceEditionCapability. -func (m ManagedInstanceEditionCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateEndpointProperty. +func (m ManagedInstancePrivateEndpointProperty) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "id", m.ID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceEditionCapability. -func (m *ManagedInstanceEditionCapability) UnmarshalJSON(data []byte) error { +// 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) @@ -8731,23 +11032,8 @@ func (m *ManagedInstanceEditionCapability) UnmarshalJSON(data []byte) error { 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) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) } if err != nil { @@ -8757,19 +11043,18 @@ func (m *ManagedInstanceEditionCapability) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceEncryptionProtector. -func (m ManagedInstanceEncryptionProtector) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateLink. +func (m ManagedInstancePrivateLink) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -8780,9 +11065,6 @@ func (m *ManagedInstanceEncryptionProtector) UnmarshalJSON(data []byte) error { 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) @@ -8800,16 +11082,16 @@ func (m *ManagedInstanceEncryptionProtector) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceEncryptionProtectorListResult. -func (m ManagedInstanceEncryptionProtectorListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateLinkListResult. +func (m ManagedInstancePrivateLinkListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -8831,19 +11113,16 @@ func (m *ManagedInstanceEncryptionProtectorListResult) UnmarshalJSON(data []byte return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceEncryptionProtectorProperties. -func (m ManagedInstanceEncryptionProtectorProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateLinkProperties. +func (m ManagedInstancePrivateLinkProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "groupId", m.GroupID) + populate(objectMap, "requiredMembers", m.RequiredMembers) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceEncryptionProtectorProperties. -func (m *ManagedInstanceEncryptionProtectorProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -8851,20 +11130,11 @@ func (m *ManagedInstanceEncryptionProtectorProperties) UnmarshalJSON(data []byte 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) + case "groupId": + err = unpopulate(val, "GroupID", &m.GroupID) delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &m.URI) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &m.RequiredMembers) delete(rawMsg, key) } if err != nil { @@ -8874,20 +11144,17 @@ func (m *ManagedInstanceEncryptionProtectorProperties) UnmarshalJSON(data []byte return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceExternalAdministrator. -func (m ManagedInstanceExternalAdministrator) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateLinkServiceConnectionStateProperty. +func (m ManagedInstancePrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 ManagedInstanceExternalAdministrator. -func (m *ManagedInstanceExternalAdministrator) UnmarshalJSON(data []byte) error { +// 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) @@ -8895,23 +11162,14 @@ func (m *ManagedInstanceExternalAdministrator) UnmarshalJSON(data []byte) error 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) + case "actionsRequired": + err = unpopulate(val, "ActionsRequired", &m.ActionsRequired) delete(rawMsg, key) - case "sid": - err = unpopulate(val, "Sid", &m.Sid) + case "description": + err = unpopulate(val, "Description", &m.Description) delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &m.TenantID) + case "status": + err = unpopulate(val, "Status", &m.Status) delete(rawMsg, key) } if err != nil { @@ -8921,20 +11179,43 @@ func (m *ManagedInstanceExternalAdministrator) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceFamilyCapability. -func (m ManagedInstanceFamilyCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceProperties. +func (m ManagedInstanceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 ManagedInstanceFamilyCapability. -func (m *ManagedInstanceFamilyCapability) UnmarshalJSON(data []byte) error { +// 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) @@ -8942,23 +11223,92 @@ func (m *ManagedInstanceFamilyCapability) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &m.Name) + 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 "reason": - err = unpopulate(val, "Reason", &m.Reason) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &m.PrivateEndpointConnections) delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &m.SKU) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) + case "proxyOverride": + err = unpopulate(val, "ProxyOverride", &m.ProxyOverride) delete(rawMsg, key) - case "supportedLicenseTypes": - err = unpopulate(val, "SupportedLicenseTypes", &m.SupportedLicenseTypes) + case "publicDataEndpointEnabled": + err = unpopulate(val, "PublicDataEndpointEnabled", &m.PublicDataEndpointEnabled) delete(rawMsg, key) - case "supportedVcoresValues": - err = unpopulate(val, "SupportedVcoresValues", &m.SupportedVcoresValues) + 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 { @@ -8968,19 +11318,18 @@ func (m *ManagedInstanceFamilyCapability) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceKey. -func (m ManagedInstanceKey) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceQuery. +func (m ManagedInstanceQuery) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -8991,9 +11340,6 @@ func (m *ManagedInstanceKey) UnmarshalJSON(data []byte) error { 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) @@ -9011,16 +11357,16 @@ func (m *ManagedInstanceKey) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceKeyListResult. -func (m ManagedInstanceKeyListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceQueryStatistics. +func (m ManagedInstanceQueryStatistics) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -9042,19 +11388,18 @@ func (m *ManagedInstanceKeyListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceKeyProperties. -func (m ManagedInstanceKeyProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceUpdate. +func (m ManagedInstanceUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 ManagedInstanceKeyProperties. -func (m *ManagedInstanceKeyProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -9062,20 +11407,17 @@ func (m *ManagedInstanceKeyProperties) UnmarshalJSON(data []byte) error { 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) + case "identity": + err = unpopulate(val, "Identity", &m.Identity) delete(rawMsg, key) - case "serverKeyType": - err = unpopulate(val, "ServerKeyType", &m.ServerKeyType) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &m.Thumbprint) + case "sku": + err = unpopulate(val, "SKU", &m.SKU) delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &m.URI) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) delete(rawMsg, key) } if err != nil { @@ -9085,16 +11427,23 @@ func (m *ManagedInstanceKeyProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceListResult. -func (m ManagedInstanceListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceVcoresCapability. +func (m ManagedInstanceVcoresCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", m.NextLink) + 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 ManagedInstanceListResult. -func (m *ManagedInstanceListResult) UnmarshalJSON(data []byte) error { +// 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) @@ -9102,8 +11451,29 @@ func (m *ManagedInstanceListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &m.NextLink) + 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) @@ -9116,8 +11486,51 @@ func (m *ManagedInstanceListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceLongTermRetentionBackup. -func (m ManagedInstanceLongTermRetentionBackup) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceVersionCapability. +func (m ManagedInstanceVersionCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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]any) populate(objectMap, "id", m.ID) populate(objectMap, "name", m.Name) @@ -9126,8 +11539,8 @@ func (m ManagedInstanceLongTermRetentionBackup) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceLongTermRetentionBackup. -func (m *ManagedInstanceLongTermRetentionBackup) UnmarshalJSON(data []byte) error { +// 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) @@ -9155,16 +11568,16 @@ func (m *ManagedInstanceLongTermRetentionBackup) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceLongTermRetentionBackupListResult. -func (m ManagedInstanceLongTermRetentionBackupListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceVulnerabilityAssessmentListResult. +func (m ManagedInstanceVulnerabilityAssessmentListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -9186,21 +11599,18 @@ func (m *ManagedInstanceLongTermRetentionBackupListResult) UnmarshalJSON(data [] return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceLongTermRetentionBackupProperties. -func (m ManagedInstanceLongTermRetentionBackupProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceVulnerabilityAssessmentProperties. +func (m ManagedInstanceVulnerabilityAssessmentProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 ManagedInstanceLongTermRetentionBackupProperties. -func (m *ManagedInstanceLongTermRetentionBackupProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -9208,26 +11618,17 @@ func (m *ManagedInstanceLongTermRetentionBackupProperties) UnmarshalJSON(data [] 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) + case "recurringScans": + err = unpopulate(val, "RecurringScans", &m.RecurringScans) delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &m.DatabaseName) + case "storageAccountAccessKey": + err = unpopulate(val, "StorageAccountAccessKey", &m.StorageAccountAccessKey) delete(rawMsg, key) - case "managedInstanceCreateTime": - err = unpopulateTimeRFC3339(val, "ManagedInstanceCreateTime", &m.ManagedInstanceCreateTime) + case "storageContainerPath": + err = unpopulate(val, "StorageContainerPath", &m.StorageContainerPath) delete(rawMsg, key) - case "managedInstanceName": - err = unpopulate(val, "ManagedInstanceName", &m.ManagedInstanceName) + case "storageContainerSasKey": + err = unpopulate(val, "StorageContainerSasKey", &m.StorageContainerSasKey) delete(rawMsg, key) } if err != nil { @@ -9237,8 +11638,8 @@ func (m *ManagedInstanceLongTermRetentionBackupProperties) UnmarshalJSON(data [] return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceLongTermRetentionPolicy. -func (m ManagedInstanceLongTermRetentionPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedLedgerDigestUploads. +func (m ManagedLedgerDigestUploads) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", m.ID) populate(objectMap, "name", m.Name) @@ -9247,8 +11648,8 @@ func (m ManagedInstanceLongTermRetentionPolicy) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceLongTermRetentionPolicy. -func (m *ManagedInstanceLongTermRetentionPolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedLedgerDigestUploads. +func (m *ManagedLedgerDigestUploads) UnmarshalJSON(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) @@ -9276,16 +11677,16 @@ func (m *ManagedInstanceLongTermRetentionPolicy) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceLongTermRetentionPolicyListResult. -func (m ManagedInstanceLongTermRetentionPolicyListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedLedgerDigestUploadsListResult. +func (m ManagedLedgerDigestUploadsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedLedgerDigestUploadsListResult. +func (m *ManagedLedgerDigestUploadsListResult) UnmarshalJSON(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) @@ -9307,17 +11708,16 @@ func (m *ManagedInstanceLongTermRetentionPolicyListResult) UnmarshalJSON(data [] return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceMaintenanceConfigurationCapability. -func (m ManagedInstanceMaintenanceConfigurationCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedLedgerDigestUploadsProperties. +func (m ManagedLedgerDigestUploadsProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", m.Name) - populate(objectMap, "reason", m.Reason) - populate(objectMap, "status", m.Status) + populate(objectMap, "digestStorageEndpoint", m.DigestStorageEndpoint) + populate(objectMap, "state", m.State) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceMaintenanceConfigurationCapability. -func (m *ManagedInstanceMaintenanceConfigurationCapability) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedLedgerDigestUploadsProperties. +func (m *ManagedLedgerDigestUploadsProperties) UnmarshalJSON(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) @@ -9325,14 +11725,11 @@ func (m *ManagedInstanceMaintenanceConfigurationCapability) UnmarshalJSON(data [ 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) + case "digestStorageEndpoint": + err = unpopulate(val, "DigestStorageEndpoint", &m.DigestStorageEndpoint) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) + case "state": + err = unpopulate(val, "State", &m.State) delete(rawMsg, key) } if err != nil { @@ -9342,8 +11739,8 @@ func (m *ManagedInstanceMaintenanceConfigurationCapability) UnmarshalJSON(data [ return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceOperation. -func (m ManagedInstanceOperation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedServerDNSAlias. +func (m ManagedServerDNSAlias) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", m.ID) populate(objectMap, "name", m.Name) @@ -9352,8 +11749,8 @@ func (m ManagedInstanceOperation) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceOperation. -func (m *ManagedInstanceOperation) UnmarshalJSON(data []byte) error { +// 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) @@ -9381,16 +11778,15 @@ func (m *ManagedInstanceOperation) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceOperationListResult. -func (m ManagedInstanceOperationListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedServerDNSAliasAcquisition. +func (m ManagedServerDNSAliasAcquisition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) + populate(objectMap, "oldManagedServerDnsAliasResourceId", m.OldManagedServerDNSAliasResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceOperationListResult. -func (m *ManagedInstanceOperationListResult) UnmarshalJSON(data []byte) error { +// 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) @@ -9398,11 +11794,8 @@ func (m *ManagedInstanceOperationListResult) UnmarshalJSON(data []byte) error { 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) + case "oldManagedServerDnsAliasResourceId": + err = unpopulate(val, "OldManagedServerDNSAliasResourceID", &m.OldManagedServerDNSAliasResourceID) delete(rawMsg, key) } if err != nil { @@ -9412,16 +11805,15 @@ func (m *ManagedInstanceOperationListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceOperationParametersPair. -func (m ManagedInstanceOperationParametersPair) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedServerDNSAliasCreation. +func (m ManagedServerDNSAliasCreation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "currentParameters", m.CurrentParameters) - populate(objectMap, "requestedParameters", m.RequestedParameters) + populate(objectMap, "createDnsRecord", m.CreateDNSRecord) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceOperationParametersPair. -func (m *ManagedInstanceOperationParametersPair) UnmarshalJSON(data []byte) error { +// 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) @@ -9429,11 +11821,8 @@ func (m *ManagedInstanceOperationParametersPair) UnmarshalJSON(data []byte) erro 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) + case "createDnsRecord": + err = unpopulate(val, "CreateDNSRecord", &m.CreateDNSRecord) delete(rawMsg, key) } if err != nil { @@ -9443,29 +11832,16 @@ func (m *ManagedInstanceOperationParametersPair) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceOperationProperties. -func (m ManagedInstanceOperationProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedServerDNSAliasListResult. +func (m ManagedServerDNSAliasListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceOperationProperties. -func (m *ManagedInstanceOperationProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -9473,50 +11849,11 @@ func (m *ManagedInstanceOperationProperties) UnmarshalJSON(data []byte) error { 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) + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) + case "value": + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { @@ -9526,17 +11863,16 @@ func (m *ManagedInstanceOperationProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceOperationSteps. -func (m ManagedInstanceOperationSteps) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedServerDNSAliasProperties. +func (m ManagedServerDNSAliasProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "currentStep", m.CurrentStep) - populate(objectMap, "stepsList", m.StepsList) - populate(objectMap, "totalSteps", m.TotalSteps) + populate(objectMap, "azureDnsRecord", m.AzureDNSRecord) + populate(objectMap, "publicAzureDnsRecord", m.PublicAzureDNSRecord) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceOperationSteps. -func (m *ManagedInstanceOperationSteps) UnmarshalJSON(data []byte) error { +// 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) @@ -9544,14 +11880,11 @@ func (m *ManagedInstanceOperationSteps) UnmarshalJSON(data []byte) error { 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) + case "azureDnsRecord": + err = unpopulate(val, "AzureDNSRecord", &m.AzureDNSRecord) delete(rawMsg, key) - case "totalSteps": - err = unpopulate(val, "TotalSteps", &m.TotalSteps) + case "publicAzureDnsRecord": + err = unpopulate(val, "PublicAzureDNSRecord", &m.PublicAzureDNSRecord) delete(rawMsg, key) } if err != nil { @@ -9561,16 +11894,19 @@ func (m *ManagedInstanceOperationSteps) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePairInfo. -func (m ManagedInstancePairInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedServerSecurityAlertPolicy. +func (m ManagedServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "partnerManagedInstanceId", m.PartnerManagedInstanceID) - populate(objectMap, "primaryManagedInstanceId", m.PrimaryManagedInstanceID) + 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 ManagedInstancePairInfo. -func (m *ManagedInstancePairInfo) UnmarshalJSON(data []byte) error { +// 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) @@ -9578,11 +11914,20 @@ func (m *ManagedInstancePairInfo) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "partnerManagedInstanceId": - err = unpopulate(val, "PartnerManagedInstanceID", &m.PartnerManagedInstanceID) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "primaryManagedInstanceId": - err = unpopulate(val, "PrimaryManagedInstanceID", &m.PrimaryManagedInstanceID) + 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 { @@ -9592,16 +11937,16 @@ func (m *ManagedInstancePairInfo) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePecProperty. -func (m ManagedInstancePecProperty) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedServerSecurityAlertPolicyListResult. +func (m ManagedServerSecurityAlertPolicyListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) - populate(objectMap, "properties", m.Properties) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstancePecProperty. -func (m *ManagedInstancePecProperty) UnmarshalJSON(data []byte) error { +// 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) @@ -9609,11 +11954,11 @@ func (m *ManagedInstancePecProperty) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &m.ID) + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) + case "value": + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { @@ -9623,8 +11968,8 @@ func (m *ManagedInstancePecProperty) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateEndpointConnection. -func (m ManagedInstancePrivateEndpointConnection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedTransparentDataEncryption. +func (m ManagedTransparentDataEncryption) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", m.ID) populate(objectMap, "name", m.Name) @@ -9633,8 +11978,8 @@ func (m ManagedInstancePrivateEndpointConnection) MarshalJSON() ([]byte, error) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstancePrivateEndpointConnection. -func (m *ManagedInstancePrivateEndpointConnection) UnmarshalJSON(data []byte) error { +// 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) @@ -9662,16 +12007,16 @@ func (m *ManagedInstancePrivateEndpointConnection) UnmarshalJSON(data []byte) er return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateEndpointConnectionListResult. -func (m ManagedInstancePrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedTransparentDataEncryptionListResult. +func (m ManagedTransparentDataEncryptionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -9693,50 +12038,15 @@ func (m *ManagedInstancePrivateEndpointConnectionListResult) UnmarshalJSON(data return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateEndpointConnectionProperties. -func (m ManagedInstancePrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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) { +// MarshalJSON implements the json.Marshaller interface for type ManagedTransparentDataEncryptionProperties. +func (m ManagedTransparentDataEncryptionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) + populate(objectMap, "state", m.State) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstancePrivateEndpointProperty. -func (m *ManagedInstancePrivateEndpointProperty) UnmarshalJSON(data []byte) error { +// 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) @@ -9744,8 +12054,8 @@ func (m *ManagedInstancePrivateEndpointProperty) UnmarshalJSON(data []byte) erro for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &m.ID) + case "state": + err = unpopulate(val, "State", &m.State) delete(rawMsg, key) } if err != nil { @@ -9755,18 +12065,16 @@ func (m *ManagedInstancePrivateEndpointProperty) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateLink. -func (m ManagedInstancePrivateLink) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MaxSizeCapability. +func (m MaxSizeCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "type", m.Type) + populate(objectMap, "limit", m.Limit) + populate(objectMap, "unit", m.Unit) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstancePrivateLink. -func (m *ManagedInstancePrivateLink) UnmarshalJSON(data []byte) error { +// 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) @@ -9774,17 +12082,11 @@ func (m *ManagedInstancePrivateLink) UnmarshalJSON(data []byte) error { 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) + case "limit": + err = unpopulate(val, "Limit", &m.Limit) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "unit": + err = unpopulate(val, "Unit", &m.Unit) delete(rawMsg, key) } if err != nil { @@ -9794,16 +12096,20 @@ func (m *ManagedInstancePrivateLink) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateLinkListResult. -func (m ManagedInstancePrivateLinkListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MaxSizeRangeCapability. +func (m MaxSizeRangeCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) + 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 ManagedInstancePrivateLinkListResult. -func (m *ManagedInstancePrivateLinkListResult) UnmarshalJSON(data []byte) error { +// 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) @@ -9811,11 +12117,23 @@ func (m *ManagedInstancePrivateLinkListResult) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &m.NextLink) + case "logSize": + err = unpopulate(val, "LogSize", &m.LogSize) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) + 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 { @@ -9825,16 +12143,20 @@ func (m *ManagedInstancePrivateLinkListResult) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateLinkProperties. -func (m ManagedInstancePrivateLinkProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Metric. +func (m Metric) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "groupId", m.GroupID) - populate(objectMap, "requiredMembers", m.RequiredMembers) + 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 ManagedInstancePrivateLinkProperties. -func (m *ManagedInstancePrivateLinkProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -9842,11 +12164,23 @@ func (m *ManagedInstancePrivateLinkProperties) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "groupId": - err = unpopulate(val, "GroupID", &m.GroupID) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &m.EndTime) delete(rawMsg, key) - case "requiredMembers": - err = unpopulate(val, "RequiredMembers", &m.RequiredMembers) + 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 { @@ -9856,17 +12190,16 @@ func (m *ManagedInstancePrivateLinkProperties) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateLinkServiceConnectionStateProperty. -func (m ManagedInstancePrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MetricAvailability. +func (m MetricAvailability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "actionsRequired", m.ActionsRequired) - populate(objectMap, "description", m.Description) - populate(objectMap, "status", m.Status) + populate(objectMap, "retention", m.Retention) + populate(objectMap, "timeGrain", m.TimeGrain) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstancePrivateLinkServiceConnectionStateProperty. -func (m *ManagedInstancePrivateLinkServiceConnectionStateProperty) UnmarshalJSON(data []byte) error { +// 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) @@ -9874,14 +12207,11 @@ func (m *ManagedInstancePrivateLinkServiceConnectionStateProperty) UnmarshalJSON 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) + case "retention": + err = unpopulate(val, "Retention", &m.Retention) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) + case "timeGrain": + err = unpopulate(val, "TimeGrain", &m.TimeGrain) delete(rawMsg, key) } if err != nil { @@ -9891,43 +12221,19 @@ func (m *ManagedInstancePrivateLinkServiceConnectionStateProperty) UnmarshalJSON return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceProperties. -func (m ManagedInstanceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MetricDefinition. +func (m MetricDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 ManagedInstanceProperties. -func (m *ManagedInstanceProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -9935,92 +12241,47 @@ func (m *ManagedInstanceProperties) UnmarshalJSON(data []byte) error { 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) + case "metricAvailabilities": + err = unpopulate(val, "MetricAvailabilities", &m.MetricAvailabilities) delete(rawMsg, key) - case "storageSizeInGB": - err = unpopulate(val, "StorageSizeInGB", &m.StorageSizeInGB) + case "name": + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) - case "subnetId": - err = unpopulate(val, "SubnetID", &m.SubnetID) + case "primaryAggregationType": + err = unpopulate(val, "PrimaryAggregationType", &m.PrimaryAggregationType) delete(rawMsg, key) - case "timezoneId": - err = unpopulate(val, "TimezoneID", &m.TimezoneID) + case "resourceUri": + err = unpopulate(val, "ResourceURI", &m.ResourceURI) delete(rawMsg, key) - case "vCores": - err = unpopulate(val, "VCores", &m.VCores) + case "unit": + err = unpopulate(val, "Unit", &m.Unit) delete(rawMsg, key) - case "zoneRedundant": - err = unpopulate(val, "ZoneRedundant", &m.ZoneRedundant) + } + 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]any) + 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 { @@ -10030,18 +12291,15 @@ func (m *ManagedInstanceProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceQuery. -func (m ManagedInstanceQuery) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MetricListResult. +func (m MetricListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "type", m.Type) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceQuery. -func (m *ManagedInstanceQuery) UnmarshalJSON(data []byte) error { +// 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) @@ -10049,17 +12307,8 @@ func (m *ManagedInstanceQuery) UnmarshalJSON(data []byte) error { 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) + case "value": + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { @@ -10069,16 +12318,16 @@ func (m *ManagedInstanceQuery) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceQueryStatistics. -func (m ManagedInstanceQueryStatistics) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MetricName. +func (m MetricName) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "localizedValue", m.LocalizedValue) 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 { +// 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) @@ -10086,8 +12335,8 @@ func (m *ManagedInstanceQueryStatistics) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &m.NextLink) + case "localizedValue": + err = unpopulate(val, "LocalizedValue", &m.LocalizedValue) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &m.Value) @@ -10100,18 +12349,20 @@ func (m *ManagedInstanceQueryStatistics) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceUpdate. -func (m ManagedInstanceUpdate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MetricValue. +func (m MetricValue) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "identity", m.Identity) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "sku", m.SKU) - populate(objectMap, "tags", m.Tags) + 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 ManagedInstanceUpdate. -func (m *ManagedInstanceUpdate) UnmarshalJSON(data []byte) error { +// 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) @@ -10119,17 +12370,23 @@ func (m *ManagedInstanceUpdate) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "identity": - err = unpopulate(val, "Identity", &m.Identity) + case "average": + err = unpopulate(val, "Average", &m.Average) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) + case "count": + err = unpopulate(val, "Count", &m.Count) delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &m.SKU) + case "maximum": + err = unpopulate(val, "Maximum", &m.Maximum) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &m.Tags) + 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 { @@ -10139,23 +12396,17 @@ func (m *ManagedInstanceUpdate) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceVcoresCapability. -func (m ManagedInstanceVcoresCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MinCapacityCapability. +func (m MinCapacityCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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 { +// 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) @@ -10163,30 +12414,12 @@ func (m *ManagedInstanceVcoresCapability) UnmarshalJSON(data []byte) error { 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) @@ -10198,1694 +12431,1888 @@ func (m *ManagedInstanceVcoresCapability) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceVersionCapability. -func (m ManagedInstanceVersionCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Name. +func (n Name) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "localizedValue", n.LocalizedValue) + populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceVersionCapability. -func (m *ManagedInstanceVersionCapability) UnmarshalJSON(data []byte) error { +// 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", m, err) + 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]any) + 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]any) + 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", &m.Name) + err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) - case "reason": - err = unpopulate(val, "Reason", &m.Reason) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) - case "supportedEditions": - err = unpopulate(val, "SupportedEditions", &m.SupportedEditions) + } + 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]any) + 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 "supportedInstancePoolEditions": - err = unpopulate(val, "SupportedInstancePoolEditions", &m.SupportedInstancePoolEditions) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceVulnerabilityAssessment. -func (m ManagedInstanceVulnerabilityAssessment) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationImpact. +func (o OperationImpact) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "type", m.Type) + 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 ManagedInstanceVulnerabilityAssessment. -func (m *ManagedInstanceVulnerabilityAssessment) UnmarshalJSON(data []byte) error { +// 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", m, err) + 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", &m.ID) + case "changeValueAbsolute": + err = unpopulate(val, "ChangeValueAbsolute", &o.ChangeValueAbsolute) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) + case "changeValueRelative": + err = unpopulate(val, "ChangeValueRelative", &o.ChangeValueRelative) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) + case "name": + err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "unit": + err = unpopulate(val, "Unit", &o.Unit) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceVulnerabilityAssessmentListResult. -func (m ManagedInstanceVulnerabilityAssessmentListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceVulnerabilityAssessmentListResult. -func (m *ManagedInstanceVulnerabilityAssessmentListResult) UnmarshalJSON(data []byte) error { +// 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", m, err) + 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", &m.NextLink) + err = unpopulate(val, "NextLink", &o.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &m.Value) + err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceVulnerabilityAssessmentProperties. -func (m ManagedInstanceVulnerabilityAssessmentProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpoint. +func (o OutboundEnvironmentEndpoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "recurringScans", m.RecurringScans) - populate(objectMap, "storageAccountAccessKey", m.StorageAccountAccessKey) - populate(objectMap, "storageContainerPath", m.StorageContainerPath) - populate(objectMap, "storageContainerSasKey", m.StorageContainerSasKey) + populate(objectMap, "category", o.Category) + populate(objectMap, "endpoints", o.Endpoints) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceVulnerabilityAssessmentProperties. -func (m *ManagedInstanceVulnerabilityAssessmentProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEnvironmentEndpoint. +func (o *OutboundEnvironmentEndpoint) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", o, 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) + case "category": + err = unpopulate(val, "Category", &o.Category) delete(rawMsg, key) - case "storageContainerSasKey": - err = unpopulate(val, "StorageContainerSasKey", &m.StorageContainerSasKey) + case "endpoints": + err = unpopulate(val, "Endpoints", &o.Endpoints) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedServerSecurityAlertPolicy. -func (m ManagedServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpointCollection. +func (o OutboundEnvironmentEndpointCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServerSecurityAlertPolicy. -func (m *ManagedServerSecurityAlertPolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEnvironmentEndpointCollection. +func (o *OutboundEnvironmentEndpointCollection) UnmarshalJSON(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) + 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", &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) + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "value": + err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedServerSecurityAlertPolicyListResult. -func (m ManagedServerSecurityAlertPolicyListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OutboundFirewallRule. +func (o OutboundFirewallRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) + 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 ManagedServerSecurityAlertPolicyListResult. -func (m *ManagedServerSecurityAlertPolicyListResult) UnmarshalJSON(data []byte) error { +// 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", m, err) + 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", &m.NextLink) + case "id": + err = unpopulate(val, "ID", &o.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) + 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedTransparentDataEncryption. -func (m ManagedTransparentDataEncryption) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OutboundFirewallRuleListResult. +func (o OutboundFirewallRuleListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "type", m.Type) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedTransparentDataEncryption. -func (m *ManagedTransparentDataEncryption) UnmarshalJSON(data []byte) error { +// 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", m, err) + 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", &m.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "value": + err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedTransparentDataEncryptionListResult. -func (m ManagedTransparentDataEncryptionListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OutboundFirewallRuleProperties. +func (o OutboundFirewallRuleProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) + populate(objectMap, "provisioningState", o.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedTransparentDataEncryptionListResult. -func (m *ManagedTransparentDataEncryptionListResult) UnmarshalJSON(data []byte) error { +// 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", m, err) + 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", &m.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &o.ProvisioningState) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedTransparentDataEncryptionProperties. -func (m ManagedTransparentDataEncryptionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerInfo. +func (p PartnerInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "state", m.State) + 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 ManagedTransparentDataEncryptionProperties. -func (m *ManagedTransparentDataEncryptionProperties) UnmarshalJSON(data []byte) error { +// 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "state": - err = unpopulate(val, "State", &m.State) + 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MaxSizeCapability. -func (m MaxSizeCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerRegionInfo. +func (p PartnerRegionInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "limit", m.Limit) - populate(objectMap, "unit", m.Unit) + populate(objectMap, "location", p.Location) + populate(objectMap, "replicationRole", p.ReplicationRole) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MaxSizeCapability. -func (m *MaxSizeCapability) UnmarshalJSON(data []byte) error { +// 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "limit": - err = unpopulate(val, "Limit", &m.Limit) + case "location": + err = unpopulate(val, "Location", &p.Location) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &m.Unit) + case "replicationRole": + err = unpopulate(val, "ReplicationRole", &p.ReplicationRole) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MaxSizeRangeCapability. -func (m MaxSizeRangeCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PerformanceLevelCapability. +func (p PerformanceLevelCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "unit", p.Unit) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MaxSizeRangeCapability. -func (m *MaxSizeRangeCapability) UnmarshalJSON(data []byte) error { +// 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, 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) + case "unit": + err = unpopulate(val, "Unit", &p.Unit) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Metric. -func (m Metric) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. +func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 Metric. -func (m *Metric) UnmarshalJSON(data []byte) error { +// 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, 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) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &m.StartTime) + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "timeGrain": - err = unpopulate(val, "TimeGrain", &m.TimeGrain) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &m.Unit) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MetricAvailability. -func (m MetricAvailability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. +func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "retention", m.Retention) - populate(objectMap, "timeGrain", m.TimeGrain) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MetricAvailability. -func (m *MetricAvailability) UnmarshalJSON(data []byte) error { +// 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "retention": - err = unpopulate(val, "Retention", &m.Retention) + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) - case "timeGrain": - err = unpopulate(val, "TimeGrain", &m.TimeGrain) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MetricDefinition. -func (m MetricDefinition) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. +func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "groupIds", p.GroupIDs) + 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 MetricDefinition. -func (m *MetricDefinition) UnmarshalJSON(data []byte) error { +// 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "metricAvailabilities": - err = unpopulate(val, "MetricAvailabilities", &m.MetricAvailabilities) + case "groupIds": + err = unpopulate(val, "GroupIDs", &p.GroupIDs) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "primaryAggregationType": - err = unpopulate(val, "PrimaryAggregationType", &m.PrimaryAggregationType) + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) delete(rawMsg, key) - case "resourceUri": - err = unpopulate(val, "ResourceURI", &m.ResourceURI) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &m.Unit) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MetricDefinitionListResult. -func (m MetricDefinitionListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionRequestStatus. +func (p PrivateEndpointConnectionRequestStatus) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", m.Value) + 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 MetricDefinitionListResult. -func (m *MetricDefinitionListResult) UnmarshalJSON(data []byte) error { +// 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &m.Value) + 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MetricListResult. -func (m MetricListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointProperty. +func (p PrivateEndpointProperty) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", m.Value) + populate(objectMap, "id", p.ID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MetricListResult. -func (m *MetricListResult) UnmarshalJSON(data []byte) error { +// 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &m.Value) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MetricName. -func (m MetricName) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. +func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "localizedValue", m.LocalizedValue) - populate(objectMap, "value", m.Value) + 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 MetricName. -func (m *MetricName) UnmarshalJSON(data []byte) error { +// 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "localizedValue": - err = unpopulate(val, "LocalizedValue", &m.LocalizedValue) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) + 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MetricValue. -func (m MetricValue) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. +func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MetricValue. -func (m *MetricValue) UnmarshalJSON(data []byte) error { +// 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, 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) + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) - case "total": - err = unpopulate(val, "Total", &m.Total) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MinCapacityCapability. -func (m MinCapacityCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "reason", m.Reason) - populate(objectMap, "status", m.Status) - populate(objectMap, "value", m.Value) + 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 MinCapacityCapability. -func (m *MinCapacityCapability) UnmarshalJSON(data []byte) error { +// 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "reason": - err = unpopulate(val, "Reason", &m.Reason) + case "groupId": + err = unpopulate(val, "GroupID", &p.GroupID) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Name. -func (n Name) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionStateProperty. +func (p PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "localizedValue", n.LocalizedValue) - populate(objectMap, "value", n.Value) + 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 Name. -func (n *Name) UnmarshalJSON(data []byte) error { +// 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", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "localizedValue": - err = unpopulate(val, "LocalizedValue", &n.LocalizedValue) + case "actionsRequired": + err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &n.Value) + 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", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkIsolationSettings. -func (n NetworkIsolationSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "sqlServerResourceId", n.SQLServerResourceID) - populate(objectMap, "storageAccountResourceId", n.StorageAccountResourceID) + 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 NetworkIsolationSettings. -func (n *NetworkIsolationSettings) UnmarshalJSON(data []byte) error { +// 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", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "sqlServerResourceId": - err = unpopulate(val, "SQLServerResourceID", &n.SQLServerResourceID) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "storageAccountResourceId": - err = unpopulate(val, "StorageAccountResourceID", &n.StorageAccountResourceID) + 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", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Operation. -func (o Operation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProxyResourceWithWritableName. +func (p ProxyResourceWithWritableName) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "display", o.Display) - populate(objectMap, "name", o.Name) - populate(objectMap, "origin", o.Origin) - populate(objectMap, "properties", o.Properties) + 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 Operation. -func (o *Operation) UnmarshalJSON(data []byte) error { +// 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "display": - err = unpopulate(val, "Display", &o.Display) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "origin": - err = unpopulate(val, "Origin", &o.Origin) + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &o.Properties) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. -func (o OperationDisplay) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type QueryCheck. +func (q QueryCheck) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", o.Description) - populate(objectMap, "operation", o.Operation) - populate(objectMap, "provider", o.Provider) - populate(objectMap, "resource", o.Resource) + populate(objectMap, "columnNames", q.ColumnNames) + populate(objectMap, "expectedResult", q.ExpectedResult) + populate(objectMap, "query", q.Query) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. -func (o *OperationDisplay) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryCheck. +func (q *QueryCheck) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", q, 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) + case "columnNames": + err = unpopulate(val, "ColumnNames", &q.ColumnNames) delete(rawMsg, key) - case "provider": - err = unpopulate(val, "Provider", &o.Provider) + case "expectedResult": + err = unpopulate(val, "ExpectedResult", &q.ExpectedResult) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &o.Resource) + case "query": + err = unpopulate(val, "Query", &q.Query) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationImpact. -func (o OperationImpact) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type QueryMetricInterval. +func (q QueryMetricInterval) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "changeValueAbsolute", o.ChangeValueAbsolute) - populate(objectMap, "changeValueRelative", o.ChangeValueRelative) - populate(objectMap, "name", o.Name) - populate(objectMap, "unit", o.Unit) + 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 OperationImpact. -func (o *OperationImpact) UnmarshalJSON(data []byte) error { +// 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { - case "changeValueAbsolute": - err = unpopulate(val, "ChangeValueAbsolute", &o.ChangeValueAbsolute) + case "executionCount": + err = unpopulate(val, "ExecutionCount", &q.ExecutionCount) delete(rawMsg, key) - case "changeValueRelative": - err = unpopulate(val, "ChangeValueRelative", &o.ChangeValueRelative) + case "intervalStartTime": + err = unpopulate(val, "IntervalStartTime", &q.IntervalStartTime) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) + case "intervalType": + err = unpopulate(val, "IntervalType", &q.IntervalType) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &o.Unit) + case "metrics": + err = unpopulate(val, "Metrics", &q.Metrics) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationListResult. -func (o OperationListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type QueryMetricProperties. +func (q QueryMetricProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) + 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 OperationListResult. -func (o *OperationListResult) UnmarshalJSON(data []byte) error { +// 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &o.NextLink) + 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", &o.Value) + err = unpopulate(val, "Value", &q.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OutboundFirewallRule. -func (o OutboundFirewallRule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type QueryProperties. +func (q QueryProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", o.ID) - populate(objectMap, "name", o.Name) - populate(objectMap, "properties", o.Properties) - populate(objectMap, "type", o.Type) + populate(objectMap, "queryText", q.QueryText) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundFirewallRule. -func (o *OutboundFirewallRule) UnmarshalJSON(data []byte) error { +// 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", 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) + 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OutboundFirewallRuleListResult. -func (o OutboundFirewallRuleListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type QueryStatistics. +func (q QueryStatistics) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) + 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 OutboundFirewallRuleListResult. -func (o *OutboundFirewallRuleListResult) UnmarshalJSON(data []byte) error { +// 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &o.NextLink) + case "id": + err = unpopulate(val, "ID", &q.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &o.Value) + 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OutboundFirewallRuleProperties. -func (o OutboundFirewallRuleProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type QueryStatisticsProperties. +func (q QueryStatisticsProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "provisioningState", o.ProvisioningState) + 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 OutboundFirewallRuleProperties. -func (o *OutboundFirewallRuleProperties) UnmarshalJSON(data []byte) error { +// 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &o.ProvisioningState) + 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PartnerInfo. -func (p PartnerInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ReadScaleCapability. +func (r ReadScaleCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "replicationRole", p.ReplicationRole) + 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 PartnerInfo. -func (p *PartnerInfo) UnmarshalJSON(data []byte) error { +// 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", p, err) + 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", &p.ID) + case "maxNumberOfReplicas": + err = unpopulate(val, "MaxNumberOfReplicas", &r.MaxNumberOfReplicas) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) + case "reason": + err = unpopulate(val, "Reason", &r.Reason) delete(rawMsg, key) - case "replicationRole": - err = unpopulate(val, "ReplicationRole", &p.ReplicationRole) + case "status": + err = unpopulate(val, "Status", &r.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PartnerRegionInfo. -func (p PartnerRegionInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecommendedAction. +func (r RecommendedAction) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "location", p.Location) - populate(objectMap, "replicationRole", p.ReplicationRole) + 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 PartnerRegionInfo. -func (p *PartnerRegionInfo) UnmarshalJSON(data []byte) error { +// 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", p, err) + 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", &p.Location) + err = unpopulate(val, "Location", &r.Location) delete(rawMsg, key) - case "replicationRole": - err = unpopulate(val, "ReplicationRole", &p.ReplicationRole) + 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PerformanceLevelCapability. -func (p PerformanceLevelCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecommendedActionErrorInfo. +func (r RecommendedActionErrorInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "unit", p.Unit) - populate(objectMap, "value", p.Value) + populate(objectMap, "errorCode", r.ErrorCode) + populate(objectMap, "isRetryable", r.IsRetryable) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PerformanceLevelCapability. -func (p *PerformanceLevelCapability) UnmarshalJSON(data []byte) error { +// 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "unit": - err = unpopulate(val, "Unit", &p.Unit) + case "errorCode": + err = unpopulate(val, "ErrorCode", &r.ErrorCode) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + case "isRetryable": + err = unpopulate(val, "IsRetryable", &r.IsRetryable) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. -func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecommendedActionImpactRecord. +func (r RecommendedActionImpactRecord) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) + 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 PrivateEndpointConnection. -func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { +// 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", p, err) + 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", &p.ID) + case "absoluteValue": + err = unpopulate(val, "AbsoluteValue", &r.AbsoluteValue) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) + case "changeValueAbsolute": + err = unpopulate(val, "ChangeValueAbsolute", &r.ChangeValueAbsolute) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) + case "changeValueRelative": + err = unpopulate(val, "ChangeValueRelative", &r.ChangeValueRelative) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. -func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecommendedActionImplementationInfo. +func (r RecommendedActionImplementationInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) + populate(objectMap, "method", r.Method) + populate(objectMap, "script", r.Script) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult. -func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { +// 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", p, err) + 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", &p.NextLink) + case "method": + err = unpopulate(val, "Method", &r.Method) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + case "script": + err = unpopulate(val, "Script", &r.Script) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. -func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecommendedActionMetricInfo. +func (r RecommendedActionMetricInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "privateEndpoint", p.PrivateEndpoint) - populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) - populate(objectMap, "provisioningState", p.ProvisioningState) + 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 PrivateEndpointConnectionProperties. -func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { +// 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "privateEndpoint": - err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) + 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 "privateLinkServiceConnectionState": - err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + case "unit": + err = unpopulate(val, "Unit", &r.Unit) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + case "value": + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionRequestStatus. -func (p PrivateEndpointConnectionRequestStatus) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecommendedActionProperties. +func (r RecommendedActionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "privateEndpointConnectionName", p.PrivateEndpointConnectionName) - populate(objectMap, "privateLinkServiceId", p.PrivateLinkServiceID) - populate(objectMap, "status", p.Status) + 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 PrivateEndpointConnectionRequestStatus. -func (p *PrivateEndpointConnectionRequestStatus) UnmarshalJSON(data []byte) error { +// 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "privateEndpointConnectionName": - err = unpopulate(val, "PrivateEndpointConnectionName", &p.PrivateEndpointConnectionName) + case "details": + err = unpopulate(val, "Details", &r.Details) delete(rawMsg, key) - case "privateLinkServiceId": - err = unpopulate(val, "PrivateLinkServiceID", &p.PrivateLinkServiceID) + case "errorDetails": + err = unpopulate(val, "ErrorDetails", &r.ErrorDetails) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &p.Status) + 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointProperty. -func (p PrivateEndpointProperty) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecommendedActionStateInfo. +func (r RecommendedActionStateInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) + 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 PrivateEndpointProperty. -func (p *PrivateEndpointProperty) UnmarshalJSON(data []byte) error { +// 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", p, err) + 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", &p.ID) + 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. -func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecommendedSensitivityLabelUpdate. +func (r RecommendedSensitivityLabelUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) + 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 PrivateLinkResource. -func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { +// 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", p, err) + 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", &p.ID) + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &p.Name) + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &p.Properties) + err = unpopulate(val, "Properties", &r.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &p.Type) + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. -func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecommendedSensitivityLabelUpdateList. +func (r RecommendedSensitivityLabelUpdateList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) + populate(objectMap, "operations", r.Operations) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult. -func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error { +// 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", p, err) + 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", &p.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + case "operations": + err = unpopulate(val, "Operations", &r.Operations) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. -func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecommendedSensitivityLabelUpdateProperties. +func (r RecommendedSensitivityLabelUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "groupId", p.GroupID) - populate(objectMap, "requiredMembers", p.RequiredMembers) - populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + 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 PrivateLinkResourceProperties. -func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { +// 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "groupId": - err = unpopulate(val, "GroupID", &p.GroupID) + case "column": + err = unpopulate(val, "Column", &r.Column) delete(rawMsg, key) - case "requiredMembers": - err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) + case "op": + err = unpopulate(val, "Op", &r.Op) delete(rawMsg, key) - case "requiredZoneNames": - err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) + 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionStateProperty. -func (p PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecoverableDatabase. +func (r RecoverableDatabase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "actionsRequired", p.ActionsRequired) - populate(objectMap, "description", p.Description) - populate(objectMap, "status", p.Status) + 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 PrivateLinkServiceConnectionStateProperty. -func (p *PrivateLinkServiceConnectionStateProperty) UnmarshalJSON(data []byte) error { +// 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "actionsRequired": - err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &p.Description) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &p.Status) + case "type": + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProxyResource. -func (p ProxyResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecoverableDatabaseListResult. +func (r RecoverableDatabaseListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "type", p.Type) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. -func (p *ProxyResource) UnmarshalJSON(data []byte) error { +// 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", p, err) + 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", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "value": + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProxyResourceWithWritableName. -func (p ProxyResourceWithWritableName) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecoverableDatabaseProperties. +func (r RecoverableDatabaseProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "type", p.Type) + populate(objectMap, "edition", r.Edition) + populate(objectMap, "elasticPoolName", r.ElasticPoolName) + populate(objectMap, "keys", r.Keys) + populateTimeRFC3339(objectMap, "lastAvailableBackupDate", r.LastAvailableBackupDate) + populate(objectMap, "serviceLevelObjective", r.ServiceLevelObjective) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResourceWithWritableName. -func (p *ProxyResourceWithWritableName) UnmarshalJSON(data []byte) error { +// 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", p, err) + 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", &p.ID) + case "edition": + err = unpopulate(val, "Edition", &r.Edition) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) + case "elasticPoolName": + err = unpopulate(val, "ElasticPoolName", &r.ElasticPoolName) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "keys": + err = unpopulate(val, "Keys", &r.Keys) + 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type QueryMetricInterval. -func (q QueryMetricInterval) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecoverableManagedDatabase. +func (r RecoverableManagedDatabase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "executionCount", q.ExecutionCount) - populate(objectMap, "intervalStartTime", q.IntervalStartTime) - populate(objectMap, "intervalType", q.IntervalType) - populate(objectMap, "metrics", q.Metrics) + 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 QueryMetricInterval. -func (q *QueryMetricInterval) UnmarshalJSON(data []byte) error { +// 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", q, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "executionCount": - err = unpopulate(val, "ExecutionCount", &q.ExecutionCount) + case "id": + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) - case "intervalStartTime": - err = unpopulate(val, "IntervalStartTime", &q.IntervalStartTime) + case "name": + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) - case "intervalType": - err = unpopulate(val, "IntervalType", &q.IntervalType) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) delete(rawMsg, key) - case "metrics": - err = unpopulate(val, "Metrics", &q.Metrics) + case "type": + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type QueryMetricProperties. -func (q QueryMetricProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecoverableManagedDatabaseListResult. +func (r RecoverableManagedDatabaseListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type QueryMetricProperties. -func (q *QueryMetricProperties) UnmarshalJSON(data []byte) error { +// 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", q, err) + return fmt.Errorf("unmarshalling type %T: %v", r, 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) + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &q.Value) + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type QueryProperties. -func (q QueryProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecoverableManagedDatabaseProperties. +func (r RecoverableManagedDatabaseProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "queryText", q.QueryText) + populate(objectMap, "lastAvailableBackupDate", r.LastAvailableBackupDate) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type QueryProperties. -func (q *QueryProperties) UnmarshalJSON(data []byte) error { +// 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", q, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "queryText": - err = unpopulate(val, "QueryText", &q.QueryText) + case "lastAvailableBackupDate": + err = unpopulate(val, "LastAvailableBackupDate", &r.LastAvailableBackupDate) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type QueryStatistics. -func (q QueryStatistics) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RefreshExternalGovernanceStatusOperationResult. +func (r RefreshExternalGovernanceStatusOperationResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", q.ID) - populate(objectMap, "name", q.Name) - populate(objectMap, "properties", q.Properties) - populate(objectMap, "type", q.Type) + 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 QueryStatistics. -func (q *QueryStatistics) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RefreshExternalGovernanceStatusOperationResult. +func (r *RefreshExternalGovernanceStatusOperationResult) UnmarshalJSON(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) + 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", &q.ID) + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &q.Name) + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &q.Properties) + err = unpopulate(val, "Properties", &r.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &q.Type) + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type QueryStatisticsProperties. -func (q QueryStatisticsProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RefreshExternalGovernanceStatusOperationResultProperties. +func (r RefreshExternalGovernanceStatusOperationResultProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "errorMessage", r.ErrorMessage) + populate(objectMap, "queuedTime", r.QueuedTime) + populate(objectMap, "requestId", r.RequestID) + populate(objectMap, "requestType", r.RequestType) + populate(objectMap, "serverName", r.ServerName) + populate(objectMap, "status", r.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type QueryStatisticsProperties. -func (q *QueryStatisticsProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RefreshExternalGovernanceStatusOperationResultProperties. +func (r *RefreshExternalGovernanceStatusOperationResultProperties) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "databaseName": - err = unpopulate(val, "DatabaseName", &q.DatabaseName) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &r.ErrorMessage) delete(rawMsg, key) - case "endTime": - err = unpopulate(val, "EndTime", &q.EndTime) + case "queuedTime": + err = unpopulate(val, "QueuedTime", &r.QueuedTime) delete(rawMsg, key) - case "intervals": - err = unpopulate(val, "Intervals", &q.Intervals) + case "requestId": + err = unpopulate(val, "RequestID", &r.RequestID) delete(rawMsg, key) - case "queryId": - err = unpopulate(val, "QueryID", &q.QueryID) + case "requestType": + err = unpopulate(val, "RequestType", &r.RequestType) delete(rawMsg, key) - case "startTime": - err = unpopulate(val, "StartTime", &q.StartTime) + case "serverName": + err = unpopulate(val, "ServerName", &r.ServerName) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &r.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ReadScaleCapability. -func (r ReadScaleCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Remediation. +func (r Remediation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "maxNumberOfReplicas", r.MaxNumberOfReplicas) - populate(objectMap, "reason", r.Reason) - populate(objectMap, "status", r.Status) + populate(objectMap, "automated", r.Automated) + populate(objectMap, "description", r.Description) + populate(objectMap, "portalLink", r.PortalLink) + populate(objectMap, "scripts", r.Scripts) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ReadScaleCapability. -func (r *ReadScaleCapability) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Remediation. +func (r *Remediation) UnmarshalJSON(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) @@ -11893,14 +14320,17 @@ func (r *ReadScaleCapability) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "maxNumberOfReplicas": - err = unpopulate(val, "MaxNumberOfReplicas", &r.MaxNumberOfReplicas) + case "automated": + err = unpopulate(val, "Automated", &r.Automated) delete(rawMsg, key) - case "reason": - err = unpopulate(val, "Reason", &r.Reason) + case "description": + err = unpopulate(val, "Description", &r.Description) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &r.Status) + case "portalLink": + err = unpopulate(val, "PortalLink", &r.PortalLink) + delete(rawMsg, key) + case "scripts": + err = unpopulate(val, "Scripts", &r.Scripts) delete(rawMsg, key) } if err != nil { @@ -11910,20 +14340,18 @@ func (r *ReadScaleCapability) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RecommendedAction. -func (r RecommendedAction) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ReplicationLink. +func (r ReplicationLink) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -11934,12 +14362,6 @@ func (r *RecommendedAction) UnmarshalJSON(data []byte) error { 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) @@ -11957,16 +14379,16 @@ func (r *RecommendedAction) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RecommendedActionErrorInfo. -func (r RecommendedActionErrorInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ReplicationLinkListResult. +func (r ReplicationLinkListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "errorCode", r.ErrorCode) - populate(objectMap, "isRetryable", r.IsRetryable) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionErrorInfo. -func (r *RecommendedActionErrorInfo) UnmarshalJSON(data []byte) error { +// 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) @@ -11974,11 +14396,11 @@ func (r *RecommendedActionErrorInfo) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "errorCode": - err = unpopulate(val, "ErrorCode", &r.ErrorCode) + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) delete(rawMsg, key) - case "isRetryable": - err = unpopulate(val, "IsRetryable", &r.IsRetryable) + case "value": + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { @@ -11988,19 +14410,25 @@ func (r *RecommendedActionErrorInfo) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RecommendedActionImpactRecord. -func (r RecommendedActionImpactRecord) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ReplicationLinkProperties. +func (r ReplicationLinkProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 RecommendedActionImpactRecord. -func (r *RecommendedActionImpactRecord) UnmarshalJSON(data []byte) error { +// 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) @@ -12008,20 +14436,38 @@ func (r *RecommendedActionImpactRecord) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "absoluteValue": - err = unpopulate(val, "AbsoluteValue", &r.AbsoluteValue) + case "isTerminationAllowed": + err = unpopulate(val, "IsTerminationAllowed", &r.IsTerminationAllowed) delete(rawMsg, key) - case "changeValueAbsolute": - err = unpopulate(val, "ChangeValueAbsolute", &r.ChangeValueAbsolute) + case "linkType": + err = unpopulate(val, "LinkType", &r.LinkType) delete(rawMsg, key) - case "changeValueRelative": - err = unpopulate(val, "ChangeValueRelative", &r.ChangeValueRelative) + case "partnerDatabase": + err = unpopulate(val, "PartnerDatabase", &r.PartnerDatabase) delete(rawMsg, key) - case "dimensionName": - err = unpopulate(val, "DimensionName", &r.DimensionName) + case "partnerLocation": + err = unpopulate(val, "PartnerLocation", &r.PartnerLocation) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &r.Unit) + 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 { @@ -12031,16 +14477,17 @@ func (r *RecommendedActionImpactRecord) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RecommendedActionImplementationInfo. -func (r RecommendedActionImplementationInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "method", r.Method) - populate(objectMap, "script", r.Script) + 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 RecommendedActionImplementationInfo. -func (r *RecommendedActionImplementationInfo) UnmarshalJSON(data []byte) error { +// 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) @@ -12048,11 +14495,14 @@ func (r *RecommendedActionImplementationInfo) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "method": - err = unpopulate(val, "Method", &r.Method) + case "id": + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) - case "script": - err = unpopulate(val, "Script", &r.Script) + 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 { @@ -12062,19 +14512,18 @@ func (r *RecommendedActionImplementationInfo) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RecommendedActionMetricInfo. -func (r RecommendedActionMetricInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceIdentity. +func (r ResourceIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 RecommendedActionMetricInfo. -func (r *RecommendedActionMetricInfo) UnmarshalJSON(data []byte) error { +// 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) @@ -12082,20 +14531,17 @@ func (r *RecommendedActionMetricInfo) UnmarshalJSON(data []byte) error { 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) + case "principalId": + err = unpopulate(val, "PrincipalID", &r.PrincipalID) delete(rawMsg, key) - case "timeGrain": - err = unpopulate(val, "TimeGrain", &r.TimeGrain) + case "tenantId": + err = unpopulate(val, "TenantID", &r.TenantID) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &r.Unit) + case "type": + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &r.UserAssignedIdentities) delete(rawMsg, key) } if err != nil { @@ -12105,112 +14551,24 @@ func (r *RecommendedActionMetricInfo) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RecommendedActionProperties. -func (r RecommendedActionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceMoveDefinition. +func (r ResourceMoveDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "id", r.ID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionProperties. -func (r *RecommendedActionProperties) UnmarshalJSON(data []byte) error { +// 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 "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) + 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 { @@ -12220,17 +14578,17 @@ func (r *RecommendedActionProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RecommendedActionStateInfo. -func (r RecommendedActionStateInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceWithWritableName. +func (r ResourceWithWritableName) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "actionInitiatedBy", r.ActionInitiatedBy) - populate(objectMap, "currentValue", r.CurrentValue) - populateTimeRFC3339(objectMap, "lastModified", r.LastModified) + 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 RecommendedActionStateInfo. -func (r *RecommendedActionStateInfo) UnmarshalJSON(data []byte) error { +// 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) @@ -12238,14 +14596,14 @@ func (r *RecommendedActionStateInfo) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "actionInitiatedBy": - err = unpopulate(val, "ActionInitiatedBy", &r.ActionInitiatedBy) + case "id": + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) - case "currentValue": - err = unpopulate(val, "CurrentValue", &r.CurrentValue) + case "name": + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) - case "lastModified": - err = unpopulateTimeRFC3339(val, "LastModified", &r.LastModified) + case "type": + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { @@ -12255,18 +14613,21 @@ func (r *RecommendedActionStateInfo) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RecommendedSensitivityLabelUpdate. -func (r RecommendedSensitivityLabelUpdate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableDroppedDatabase. +func (r RestorableDroppedDatabase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 RecommendedSensitivityLabelUpdate. -func (r *RecommendedSensitivityLabelUpdate) UnmarshalJSON(data []byte) error { +// 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) @@ -12277,12 +14638,21 @@ func (r *RecommendedSensitivityLabelUpdate) UnmarshalJSON(data []byte) error { 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) @@ -12294,15 +14664,16 @@ func (r *RecommendedSensitivityLabelUpdate) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RecommendedSensitivityLabelUpdateList. -func (r RecommendedSensitivityLabelUpdateList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableDroppedDatabaseListResult. +func (r RestorableDroppedDatabaseListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "operations", r.Operations) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedSensitivityLabelUpdateList. -func (r *RecommendedSensitivityLabelUpdateList) UnmarshalJSON(data []byte) error { +// 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) @@ -12310,8 +14681,11 @@ func (r *RecommendedSensitivityLabelUpdateList) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "operations": - err = unpopulate(val, "Operations", &r.Operations) + 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 { @@ -12321,18 +14695,21 @@ func (r *RecommendedSensitivityLabelUpdateList) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type RecommendedSensitivityLabelUpdateProperties. -func (r RecommendedSensitivityLabelUpdateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableDroppedDatabaseProperties. +func (r RestorableDroppedDatabaseProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "column", r.Column) - populate(objectMap, "op", r.Op) - populate(objectMap, "schema", r.Schema) - populate(objectMap, "table", r.Table) + 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, "keys", r.Keys) + populate(objectMap, "maxSizeBytes", r.MaxSizeBytes) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedSensitivityLabelUpdateProperties. -func (r *RecommendedSensitivityLabelUpdateProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -12340,17 +14717,26 @@ func (r *RecommendedSensitivityLabelUpdateProperties) UnmarshalJSON(data []byte) for key, val := range rawMsg { var err error switch key { - case "column": - err = unpopulate(val, "Column", &r.Column) + case "backupStorageRedundancy": + err = unpopulate(val, "BackupStorageRedundancy", &r.BackupStorageRedundancy) delete(rawMsg, key) - case "op": - err = unpopulate(val, "Op", &r.Op) + case "creationDate": + err = unpopulateTimeRFC3339(val, "CreationDate", &r.CreationDate) delete(rawMsg, key) - case "schema": - err = unpopulate(val, "Schema", &r.Schema) + case "databaseName": + err = unpopulate(val, "DatabaseName", &r.DatabaseName) delete(rawMsg, key) - case "table": - err = unpopulate(val, "Table", &r.Table) + case "deletionDate": + err = unpopulateTimeRFC3339(val, "DeletionDate", &r.DeletionDate) + delete(rawMsg, key) + case "earliestRestoreDate": + err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &r.EarliestRestoreDate) + delete(rawMsg, key) + case "keys": + err = unpopulate(val, "Keys", &r.Keys) + delete(rawMsg, key) + case "maxSizeBytes": + err = unpopulate(val, "MaxSizeBytes", &r.MaxSizeBytes) delete(rawMsg, key) } if err != nil { @@ -12360,18 +14746,20 @@ func (r *RecommendedSensitivityLabelUpdateProperties) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type RecoverableDatabase. -func (r RecoverableDatabase) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableDroppedManagedDatabase. +func (r RestorableDroppedManagedDatabase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 RecoverableDatabase. -func (r *RecoverableDatabase) UnmarshalJSON(data []byte) error { +// 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) @@ -12382,12 +14770,18 @@ func (r *RecoverableDatabase) UnmarshalJSON(data []byte) error { 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) @@ -12399,15 +14793,16 @@ func (r *RecoverableDatabase) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RecoverableDatabaseListResult. -func (r RecoverableDatabaseListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableDroppedManagedDatabaseListResult. +func (r RestorableDroppedManagedDatabaseListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "nextLink", r.NextLink) 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 { +// 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) @@ -12415,6 +14810,9 @@ func (r *RecoverableDatabaseListResult) UnmarshalJSON(data []byte) error { 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) @@ -12426,18 +14824,18 @@ func (r *RecoverableDatabaseListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RecoverableDatabaseProperties. -func (r RecoverableDatabaseProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableDroppedManagedDatabaseProperties. +func (r RestorableDroppedManagedDatabaseProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "edition", r.Edition) - populate(objectMap, "elasticPoolName", r.ElasticPoolName) - populateTimeRFC3339(objectMap, "lastAvailableBackupDate", r.LastAvailableBackupDate) - populate(objectMap, "serviceLevelObjective", r.ServiceLevelObjective) + 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 RecoverableDatabaseProperties. -func (r *RecoverableDatabaseProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -12445,17 +14843,17 @@ func (r *RecoverableDatabaseProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "edition": - err = unpopulate(val, "Edition", &r.Edition) + case "creationDate": + err = unpopulateTimeRFC3339(val, "CreationDate", &r.CreationDate) delete(rawMsg, key) - case "elasticPoolName": - err = unpopulate(val, "ElasticPoolName", &r.ElasticPoolName) + case "databaseName": + err = unpopulate(val, "DatabaseName", &r.DatabaseName) delete(rawMsg, key) - case "lastAvailableBackupDate": - err = unpopulateTimeRFC3339(val, "LastAvailableBackupDate", &r.LastAvailableBackupDate) + case "deletionDate": + err = unpopulateTimeRFC3339(val, "DeletionDate", &r.DeletionDate) delete(rawMsg, key) - case "serviceLevelObjective": - err = unpopulate(val, "ServiceLevelObjective", &r.ServiceLevelObjective) + case "earliestRestoreDate": + err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &r.EarliestRestoreDate) delete(rawMsg, key) } if err != nil { @@ -12465,18 +14863,19 @@ func (r *RecoverableDatabaseProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RecoverableManagedDatabase. -func (r RecoverableManagedDatabase) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorePoint. +func (r RestorePoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 RecoverableManagedDatabase. -func (r *RecoverableManagedDatabase) UnmarshalJSON(data []byte) error { +// 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) @@ -12487,6 +14886,9 @@ func (r *RecoverableManagedDatabase) UnmarshalJSON(data []byte) error { 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) @@ -12504,16 +14906,16 @@ func (r *RecoverableManagedDatabase) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RecoverableManagedDatabaseListResult. -func (r RecoverableManagedDatabaseListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorePointListResult. +func (r RestorePointListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -12535,45 +14937,18 @@ func (r *RecoverableManagedDatabaseListResult) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type RecoverableManagedDatabaseProperties. -func (r RecoverableManagedDatabaseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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) { +// MarshalJSON implements the json.Marshaller interface for type RestorePointProperties. +func (r RestorePointProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "type", r.Type) + 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 ReplicationLink. -func (r *ReplicationLink) UnmarshalJSON(data []byte) error { +// 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) @@ -12581,17 +14956,17 @@ func (r *ReplicationLink) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) + case "earliestRestoreDate": + err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &r.EarliestRestoreDate) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) + case "restorePointCreationDate": + err = unpopulateTimeRFC3339(val, "RestorePointCreationDate", &r.RestorePointCreationDate) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) + case "restorePointLabel": + err = unpopulate(val, "RestorePointLabel", &r.RestorePointLabel) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "restorePointType": + err = unpopulate(val, "RestorePointType", &r.RestorePointType) delete(rawMsg, key) } if err != nil { @@ -12601,612 +14976,667 @@ func (r *ReplicationLink) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ReplicationLinkListResult. -func (r ReplicationLinkListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SKU. +func (s SKU) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) + 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 ReplicationLinkListResult. -func (r *ReplicationLinkListResult) UnmarshalJSON(data []byte) error { +// 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", r, err) + 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", &r.NextLink) + case "capacity": + err = unpopulate(val, "Capacity", &s.Capacity) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) + 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ReplicationLinkProperties. -func (r ReplicationLinkProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScheduleItem. +func (s ScheduleItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "startDay", s.StartDay) + populate(objectMap, "startTime", s.StartTime) + populate(objectMap, "stopDay", s.StopDay) + populate(objectMap, "stopTime", s.StopTime) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationLinkProperties. -func (r *ReplicationLinkProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleItem. +func (s *ScheduleItem) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", s, 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) + case "startDay": + err = unpopulate(val, "StartDay", &s.StartDay) delete(rawMsg, key) - case "replicationState": - err = unpopulate(val, "ReplicationState", &r.ReplicationState) + case "startTime": + err = unpopulate(val, "StartTime", &s.StartTime) delete(rawMsg, key) - case "role": - err = unpopulate(val, "Role", &r.Role) + case "stopDay": + err = unpopulate(val, "StopDay", &s.StopDay) delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &r.StartTime) + case "stopTime": + err = unpopulate(val, "StopTime", &s.StopTime) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SecurityAlertPolicyProperties. +func (s SecurityAlertPolicyProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "type", r.Type) + 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 Resource. -func (r *Resource) UnmarshalJSON(data []byte) error { +// 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", r, err) + 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", &r.ID) + case "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &s.CreationTime) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) + case "disabledAlerts": + err = unpopulate(val, "DisabledAlerts", &s.DisabledAlerts) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceIdentity. -func (r ResourceIdentity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SecurityAlertsPolicyProperties. +func (s SecurityAlertsPolicyProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "principalId", r.PrincipalID) - populate(objectMap, "tenantId", r.TenantID) - populate(objectMap, "type", r.Type) - populate(objectMap, "userAssignedIdentities", r.UserAssignedIdentities) + 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 ResourceIdentity. -func (r *ResourceIdentity) UnmarshalJSON(data []byte) error { +// 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "principalId": - err = unpopulate(val, "PrincipalID", &r.PrincipalID) + case "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &s.CreationTime) delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &r.TenantID) + case "disabledAlerts": + err = unpopulate(val, "DisabledAlerts", &s.DisabledAlerts) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "emailAccountAdmins": + err = unpopulate(val, "EmailAccountAdmins", &s.EmailAccountAdmins) delete(rawMsg, key) - case "userAssignedIdentities": - err = unpopulate(val, "UserAssignedIdentities", &r.UserAssignedIdentities) + 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceMoveDefinition. -func (r ResourceMoveDefinition) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SecurityEvent. +func (s SecurityEvent) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) + 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 ResourceMoveDefinition. -func (r *ResourceMoveDefinition) UnmarshalJSON(data []byte) error { +// 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", r, err) + 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", &r.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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceWithWritableName. -func (r ResourceWithWritableName) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SecurityEventCollection. +func (s SecurityEventCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "type", r.Type) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceWithWritableName. -func (r *ResourceWithWritableName) UnmarshalJSON(data []byte) error { +// 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", r, err) + 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", &r.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableDroppedDatabase. -func (r RestorableDroppedDatabase) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SecurityEventProperties. +func (s SecurityEventProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 RestorableDroppedDatabase. -func (r *RestorableDroppedDatabase) UnmarshalJSON(data []byte) error { +// 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", r, err) + 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", &r.ID) + case "applicationName": + err = unpopulate(val, "ApplicationName", &s.ApplicationName) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) + case "clientIp": + err = unpopulate(val, "ClientIP", &s.ClientIP) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) + case "database": + err = unpopulate(val, "Database", &s.Database) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) + case "eventTime": + err = unpopulateTimeRFC3339(val, "EventTime", &s.EventTime) delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &r.SKU) + case "principalName": + err = unpopulate(val, "PrincipalName", &s.PrincipalName) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) + case "securityEventSqlInjectionAdditionalProperties": + err = unpopulate(val, "SecurityEventSQLInjectionAdditionalProperties", &s.SecurityEventSQLInjectionAdditionalProperties) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableDroppedDatabaseListResult. -func (r RestorableDroppedDatabaseListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SecurityEventSQLInjectionAdditionalProperties. +func (s SecurityEventSQLInjectionAdditionalProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) + 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 RestorableDroppedDatabaseListResult. -func (r *RestorableDroppedDatabaseListResult) UnmarshalJSON(data []byte) error { +// 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", r, err) + 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", &r.NextLink) + case "errorCode": + err = unpopulate(val, "ErrorCode", &s.ErrorCode) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) + 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableDroppedDatabaseProperties. -func (r RestorableDroppedDatabaseProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SecurityEventsFilterParameters. +func (s SecurityEventsFilterParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populateTimeRFC3339(objectMap, "eventTime", s.EventTime) + populate(objectMap, "showServerRecords", s.ShowServerRecords) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDroppedDatabaseProperties. -func (r *RestorableDroppedDatabaseProperties) UnmarshalJSON(data []byte) error { +// 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, 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) + case "eventTime": + err = unpopulateTimeRFC3339(val, "EventTime", &s.EventTime) delete(rawMsg, key) - case "maxSizeBytes": - err = unpopulate(val, "MaxSizeBytes", &r.MaxSizeBytes) + case "showServerRecords": + err = unpopulate(val, "ShowServerRecords", &s.ShowServerRecords) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableDroppedManagedDatabase. -func (r RestorableDroppedManagedDatabase) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SensitivityLabel. +func (s SensitivityLabel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 RestorableDroppedManagedDatabase. -func (r *RestorableDroppedManagedDatabase) UnmarshalJSON(data []byte) error { +// 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", r, err) + 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", &r.ID) + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) + case "managedBy": + err = unpopulate(val, "ManagedBy", &s.ManagedBy) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &r.Name) + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &r.Type) + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableDroppedManagedDatabaseListResult. -func (r RestorableDroppedManagedDatabaseListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SensitivityLabelListResult. +func (s SensitivityLabelListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDroppedManagedDatabaseListResult. -func (r *RestorableDroppedManagedDatabaseListResult) UnmarshalJSON(data []byte) error { +// 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", r, err) + 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", &r.NextLink) + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &r.Value) + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableDroppedManagedDatabaseProperties. -func (r RestorableDroppedManagedDatabaseProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SensitivityLabelProperties. +func (s SensitivityLabelProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateTimeRFC3339(objectMap, "creationDate", r.CreationDate) - populate(objectMap, "databaseName", r.DatabaseName) - populateTimeRFC3339(objectMap, "deletionDate", r.DeletionDate) - populateTimeRFC3339(objectMap, "earliestRestoreDate", r.EarliestRestoreDate) + 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 RestorableDroppedManagedDatabaseProperties. -func (r *RestorableDroppedManagedDatabaseProperties) UnmarshalJSON(data []byte) error { +// 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "creationDate": - err = unpopulateTimeRFC3339(val, "CreationDate", &r.CreationDate) + case "columnName": + err = unpopulate(val, "ColumnName", &s.ColumnName) delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &r.DatabaseName) + case "informationType": + err = unpopulate(val, "InformationType", &s.InformationType) delete(rawMsg, key) - case "deletionDate": - err = unpopulateTimeRFC3339(val, "DeletionDate", &r.DeletionDate) + case "informationTypeId": + err = unpopulate(val, "InformationTypeID", &s.InformationTypeID) delete(rawMsg, key) - case "earliestRestoreDate": - err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &r.EarliestRestoreDate) + 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorePoint. -func (r RestorePoint) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SensitivityLabelUpdate. +func (s SensitivityLabelUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 RestorePoint. -func (r *RestorePoint) UnmarshalJSON(data []byte) error { +// 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", r, err) + 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", &r.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &r.Name) + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &r.Properties) + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &r.Type) + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorePointListResult. -func (r RestorePointListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SensitivityLabelUpdateList. +func (s SensitivityLabelUpdateList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) + populate(objectMap, "operations", s.Operations) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointListResult. -func (r *RestorePointListResult) UnmarshalJSON(data []byte) error { +// 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", r, err) + 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", &r.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) + case "operations": + err = unpopulate(val, "Operations", &s.Operations) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorePointProperties. -func (r RestorePointProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SensitivityLabelUpdateProperties. +func (s SensitivityLabelUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateTimeRFC3339(objectMap, "earliestRestoreDate", r.EarliestRestoreDate) - populateTimeRFC3339(objectMap, "restorePointCreationDate", r.RestorePointCreationDate) - populate(objectMap, "restorePointLabel", r.RestorePointLabel) - populate(objectMap, "restorePointType", r.RestorePointType) + 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 RestorePointProperties. -func (r *RestorePointProperties) UnmarshalJSON(data []byte) error { +// 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "earliestRestoreDate": - err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &r.EarliestRestoreDate) + case "column": + err = unpopulate(val, "Column", &s.Column) delete(rawMsg, key) - case "restorePointCreationDate": - err = unpopulateTimeRFC3339(val, "RestorePointCreationDate", &r.RestorePointCreationDate) + case "op": + err = unpopulate(val, "Op", &s.Op) delete(rawMsg, key) - case "restorePointLabel": - err = unpopulate(val, "RestorePointLabel", &r.RestorePointLabel) + case "schema": + err = unpopulate(val, "Schema", &s.Schema) delete(rawMsg, key) - case "restorePointType": - err = unpopulate(val, "RestorePointType", &r.RestorePointType) + 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SKU. -func (s SKU) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Server. +func (s Server) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "capacity", s.Capacity) - populate(objectMap, "family", s.Family) + 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, "size", s.Size) - populate(objectMap, "tier", s.Tier) + 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 SKU. -func (s *SKU) UnmarshalJSON(data []byte) error { +// 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) @@ -13214,20 +15644,29 @@ func (s *SKU) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "capacity": - err = unpopulate(val, "Capacity", &s.Capacity) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "family": - err = unpopulate(val, "Family", &s.Family) + 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 "size": - err = unpopulate(val, "Size", &s.Size) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &s.Tier) + 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 { @@ -13237,22 +15676,19 @@ func (s *SKU) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SecurityAlertPolicyProperties. -func (s SecurityAlertPolicyProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerAdvancedThreatProtection. +func (s ServerAdvancedThreatProtection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 SecurityAlertPolicyProperties. -func (s *SecurityAlertPolicyProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -13260,29 +15696,20 @@ func (s *SecurityAlertPolicyProperties) UnmarshalJSON(data []byte) error { 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) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "retentionDays": - err = unpopulate(val, "RetentionDays", &s.RetentionDays) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &s.State) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) - case "storageAccountAccessKey": - err = unpopulate(val, "StorageAccountAccessKey", &s.StorageAccountAccessKey) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) delete(rawMsg, key) - case "storageEndpoint": - err = unpopulate(val, "StorageEndpoint", &s.StorageEndpoint) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { @@ -13292,22 +15719,18 @@ func (s *SecurityAlertPolicyProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SecurityAlertsPolicyProperties. -func (s SecurityAlertsPolicyProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerAutomaticTuning. +func (s ServerAutomaticTuning) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 SecurityAlertsPolicyProperties. -func (s *SecurityAlertsPolicyProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -13315,29 +15738,17 @@ func (s *SecurityAlertsPolicyProperties) UnmarshalJSON(data []byte) error { 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) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &s.State) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "storageAccountAccessKey": - err = unpopulate(val, "StorageAccountAccessKey", &s.StorageAccountAccessKey) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) - case "storageEndpoint": - err = unpopulate(val, "StorageEndpoint", &s.StorageEndpoint) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { @@ -13347,8 +15758,8 @@ func (s *SecurityAlertsPolicyProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SecurityEvent. -func (s SecurityEvent) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerAzureADAdministrator. +func (s ServerAzureADAdministrator) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) @@ -13357,8 +15768,8 @@ func (s SecurityEvent) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityEvent. -func (s *SecurityEvent) UnmarshalJSON(data []byte) error { +// 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) @@ -13386,16 +15797,18 @@ func (s *SecurityEvent) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SecurityEventCollection. -func (s SecurityEventCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerAzureADOnlyAuthentication. +func (s ServerAzureADOnlyAuthentication) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) + 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 SecurityEventCollection. -func (s *SecurityEventCollection) UnmarshalJSON(data []byte) error { +// 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) @@ -13403,11 +15816,17 @@ func (s *SecurityEventCollection) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + 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 { @@ -13417,23 +15836,18 @@ func (s *SecurityEventCollection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SecurityEventProperties. -func (s SecurityEventProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerBlobAuditingPolicy. +func (s ServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 SecurityEventProperties. -func (s *SecurityEventProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -13441,32 +15855,17 @@ func (s *SecurityEventProperties) UnmarshalJSON(data []byte) error { 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) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "securityEventType": - err = unpopulate(val, "SecurityEventType", &s.SecurityEventType) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "server": - err = unpopulate(val, "Server", &s.Server) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) - case "subscription": - err = unpopulate(val, "Subscription", &s.Subscription) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { @@ -13476,21 +15875,16 @@ func (s *SecurityEventProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SecurityEventSQLInjectionAdditionalProperties. -func (s SecurityEventSQLInjectionAdditionalProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerBlobAuditingPolicyListResult. +func (s ServerBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityEventSQLInjectionAdditionalProperties. -func (s *SecurityEventSQLInjectionAdditionalProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -13498,26 +15892,11 @@ func (s *SecurityEventSQLInjectionAdditionalProperties) UnmarshalJSON(data []byt 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) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "threatId": - err = unpopulate(val, "ThreatID", &s.ThreatID) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { @@ -13527,16 +15906,25 @@ func (s *SecurityEventSQLInjectionAdditionalProperties) UnmarshalJSON(data []byt return nil } -// MarshalJSON implements the json.Marshaller interface for type SecurityEventsFilterParameters. -func (s SecurityEventsFilterParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerBlobAuditingPolicyProperties. +func (s ServerBlobAuditingPolicyProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateTimeRFC3339(objectMap, "eventTime", s.EventTime) - populate(objectMap, "showServerRecords", s.ShowServerRecords) + 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 SecurityEventsFilterParameters. -func (s *SecurityEventsFilterParameters) UnmarshalJSON(data []byte) error { +// 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) @@ -13544,11 +15932,38 @@ func (s *SecurityEventsFilterParameters) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "eventTime": - err = unpopulateTimeRFC3339(val, "EventTime", &s.EventTime) + case "auditActionsAndGroups": + err = unpopulate(val, "AuditActionsAndGroups", &s.AuditActionsAndGroups) delete(rawMsg, key) - case "showServerRecords": - err = unpopulate(val, "ShowServerRecords", &s.ShowServerRecords) + 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 { @@ -13558,19 +15973,20 @@ func (s *SecurityEventsFilterParameters) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SensitivityLabel. -func (s SensitivityLabel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerCommunicationLink. +func (s ServerCommunicationLink) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", s.ID) - populate(objectMap, "managedBy", s.ManagedBy) + 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 SensitivityLabel. -func (s *SensitivityLabel) UnmarshalJSON(data []byte) error { +// 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) @@ -13581,8 +15997,11 @@ func (s *SensitivityLabel) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "managedBy": - err = unpopulate(val, "ManagedBy", &s.ManagedBy) + 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) @@ -13601,16 +16020,15 @@ func (s *SensitivityLabel) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SensitivityLabelListResult. -func (s SensitivityLabelListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerCommunicationLinkListResult. +func (s ServerCommunicationLinkListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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 { +// 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) @@ -13618,9 +16036,6 @@ func (s *SensitivityLabelListResult) UnmarshalJSON(data []byte) error { 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) @@ -13632,23 +16047,16 @@ func (s *SensitivityLabelListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SensitivityLabelProperties. -func (s SensitivityLabelProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerCommunicationLinkProperties. +func (s ServerCommunicationLinkProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "partnerServer", s.PartnerServer) + populate(objectMap, "state", s.State) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SensitivityLabelProperties. -func (s *SensitivityLabelProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -13656,32 +16064,11 @@ func (s *SensitivityLabelProperties) UnmarshalJSON(data []byte) error { 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) + case "partnerServer": + err = unpopulate(val, "PartnerServer", &s.PartnerServer) delete(rawMsg, key) - case "tableName": - err = unpopulate(val, "TableName", &s.TableName) + case "state": + err = unpopulate(val, "State", &s.State) delete(rawMsg, key) } if err != nil { @@ -13691,8 +16078,8 @@ func (s *SensitivityLabelProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SensitivityLabelUpdate. -func (s SensitivityLabelUpdate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerConfigurationOption. +func (s ServerConfigurationOption) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) @@ -13701,8 +16088,8 @@ func (s SensitivityLabelUpdate) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SensitivityLabelUpdate. -func (s *SensitivityLabelUpdate) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerConfigurationOption. +func (s *ServerConfigurationOption) UnmarshalJSON(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) @@ -13730,15 +16117,16 @@ func (s *SensitivityLabelUpdate) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SensitivityLabelUpdateList. -func (s SensitivityLabelUpdateList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerConfigurationOptionListResult. +func (s ServerConfigurationOptionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "operations", s.Operations) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SensitivityLabelUpdateList. -func (s *SensitivityLabelUpdateList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerConfigurationOptionListResult. +func (s *ServerConfigurationOptionListResult) UnmarshalJSON(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) @@ -13746,8 +16134,11 @@ func (s *SensitivityLabelUpdateList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "operations": - err = unpopulate(val, "Operations", &s.Operations) + 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 { @@ -13756,20 +16147,17 @@ func (s *SensitivityLabelUpdateList) UnmarshalJSON(data []byte) error { } return nil } - -// MarshalJSON implements the json.Marshaller interface for type SensitivityLabelUpdateProperties. -func (s SensitivityLabelUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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) + +// MarshalJSON implements the json.Marshaller interface for type ServerConfigurationOptionProperties. +func (s ServerConfigurationOptionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "serverConfigurationOptionValue", s.ServerConfigurationOptionValue) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SensitivityLabelUpdateProperties. -func (s *SensitivityLabelUpdateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerConfigurationOptionProperties. +func (s *ServerConfigurationOptionProperties) UnmarshalJSON(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) @@ -13777,20 +16165,11 @@ func (s *SensitivityLabelUpdateProperties) UnmarshalJSON(data []byte) error { 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) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) delete(rawMsg, key) - case "table": - err = unpopulate(val, "Table", &s.Table) + case "serverConfigurationOptionValue": + err = unpopulate(val, "ServerConfigurationOptionValue", &s.ServerConfigurationOptionValue) delete(rawMsg, key) } if err != nil { @@ -13800,22 +16179,20 @@ func (s *SensitivityLabelUpdateProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Server. -func (s Server) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerConnectionPolicy. +func (s ServerConnectionPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -13826,9 +16203,6 @@ func (s *Server) UnmarshalJSON(data []byte) error { 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) @@ -13841,9 +16215,6 @@ func (s *Server) UnmarshalJSON(data []byte) error { 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) @@ -13855,19 +16226,16 @@ func (s *Server) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerAdvancedThreatProtection. -func (s ServerAdvancedThreatProtection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerConnectionPolicyListResult. +func (s ServerConnectionPolicyListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerAdvancedThreatProtection. -func (s *ServerAdvancedThreatProtection) UnmarshalJSON(data []byte) error { +// 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) @@ -13875,20 +16243,11 @@ func (s *ServerAdvancedThreatProtection) UnmarshalJSON(data []byte) error { 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) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { @@ -13898,18 +16257,15 @@ func (s *ServerAdvancedThreatProtection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerAutomaticTuning. -func (s ServerAutomaticTuning) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerConnectionPolicyProperties. +func (s ServerConnectionPolicyProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) + populate(objectMap, "connectionType", s.ConnectionType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerAutomaticTuning. -func (s *ServerAutomaticTuning) UnmarshalJSON(data []byte) error { +// 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) @@ -13917,17 +16273,8 @@ func (s *ServerAutomaticTuning) UnmarshalJSON(data []byte) error { 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) + case "connectionType": + err = unpopulate(val, "ConnectionType", &s.ConnectionType) delete(rawMsg, key) } if err != nil { @@ -13937,8 +16284,8 @@ func (s *ServerAutomaticTuning) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerAzureADAdministrator. -func (s ServerAzureADAdministrator) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerDNSAlias. +func (s ServerDNSAlias) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) @@ -13947,8 +16294,8 @@ func (s ServerAzureADAdministrator) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerAzureADAdministrator. -func (s *ServerAzureADAdministrator) UnmarshalJSON(data []byte) error { +// 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) @@ -13976,18 +16323,15 @@ func (s *ServerAzureADAdministrator) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerAzureADOnlyAuthentication. -func (s ServerAzureADOnlyAuthentication) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerDNSAliasAcquisition. +func (s ServerDNSAliasAcquisition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) + populate(objectMap, "oldServerDnsAliasId", s.OldServerDNSAliasID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerAzureADOnlyAuthentication. -func (s *ServerAzureADOnlyAuthentication) UnmarshalJSON(data []byte) error { +// 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) @@ -13995,17 +16339,8 @@ func (s *ServerAzureADOnlyAuthentication) UnmarshalJSON(data []byte) error { 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) + case "oldServerDnsAliasId": + err = unpopulate(val, "OldServerDNSAliasID", &s.OldServerDNSAliasID) delete(rawMsg, key) } if err != nil { @@ -14015,18 +16350,16 @@ func (s *ServerAzureADOnlyAuthentication) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerBlobAuditingPolicy. -func (s ServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerDNSAliasListResult. +func (s ServerDNSAliasListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerBlobAuditingPolicy. -func (s *ServerBlobAuditingPolicy) UnmarshalJSON(data []byte) error { +// 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) @@ -14034,17 +16367,38 @@ func (s *ServerBlobAuditingPolicy) UnmarshalJSON(data []byte) error { 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) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + } + 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]any) + 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 { @@ -14054,16 +16408,16 @@ func (s *ServerBlobAuditingPolicy) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerBlobAuditingPolicyListResult. -func (s ServerBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerDevOpsAuditSettingsListResult. +func (s ServerDevOpsAuditSettingsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -14085,16 +16439,11 @@ func (s *ServerBlobAuditingPolicyListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerBlobAuditingPolicyProperties. -func (s ServerBlobAuditingPolicyProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerDevOpsAuditSettingsProperties. +func (s ServerDevOpsAuditSettingsProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) @@ -14102,8 +16451,8 @@ func (s ServerBlobAuditingPolicyProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerBlobAuditingPolicyProperties. -func (s *ServerBlobAuditingPolicyProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -14111,27 +16460,12 @@ func (s *ServerBlobAuditingPolicyProperties) UnmarshalJSON(data []byte) error { 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) @@ -14152,20 +16486,63 @@ func (s *ServerBlobAuditingPolicyProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerCommunicationLink. -func (s ServerCommunicationLink) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerDevOpsAuditingSettings. +func (s ServerDevOpsAuditingSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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]any) - 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) + 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 ServerCommunicationLink. -func (s *ServerCommunicationLink) UnmarshalJSON(data []byte) error { +// 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) @@ -14173,23 +16550,23 @@ func (s *ServerCommunicationLink) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) + case "administratorType": + err = unpopulate(val, "AdministratorType", &s.AdministratorType) delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &s.Kind) + case "azureADOnlyAuthentication": + err = unpopulate(val, "AzureADOnlyAuthentication", &s.AzureADOnlyAuthentication) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &s.Location) + case "login": + err = unpopulate(val, "Login", &s.Login) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) + case "principalType": + err = unpopulate(val, "PrincipalType", &s.PrincipalType) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "sid": + err = unpopulate(val, "Sid", &s.Sid) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + case "tenantId": + err = unpopulate(val, "TenantID", &s.TenantID) delete(rawMsg, key) } if err != nil { @@ -14199,15 +16576,16 @@ func (s *ServerCommunicationLink) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerCommunicationLinkListResult. -func (s ServerCommunicationLinkListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerFirewallRuleProperties. +func (s ServerFirewallRuleProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", s.Value) + populate(objectMap, "endIpAddress", s.EndIPAddress) + populate(objectMap, "startIpAddress", s.StartIPAddress) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerCommunicationLinkListResult. -func (s *ServerCommunicationLinkListResult) UnmarshalJSON(data []byte) error { +// 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) @@ -14215,8 +16593,11 @@ func (s *ServerCommunicationLinkListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &s.Value) + 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 { @@ -14226,16 +16607,15 @@ func (s *ServerCommunicationLinkListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerCommunicationLinkProperties. -func (s ServerCommunicationLinkProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerInfo. +func (s ServerInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "partnerServer", s.PartnerServer) - populate(objectMap, "state", s.State) + populate(objectMap, "serverId", s.ServerID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerCommunicationLinkProperties. -func (s *ServerCommunicationLinkProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -14243,11 +16623,8 @@ func (s *ServerCommunicationLinkProperties) UnmarshalJSON(data []byte) error { 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) + case "serverId": + err = unpopulate(val, "ServerID", &s.ServerID) delete(rawMsg, key) } if err != nil { @@ -14257,8 +16634,8 @@ func (s *ServerCommunicationLinkProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerConnectionPolicy. -func (s ServerConnectionPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerKey. +func (s ServerKey) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "kind", s.Kind) @@ -14269,8 +16646,8 @@ func (s ServerConnectionPolicy) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerConnectionPolicy. -func (s *ServerConnectionPolicy) UnmarshalJSON(data []byte) error { +// 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) @@ -14304,16 +16681,16 @@ func (s *ServerConnectionPolicy) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerConnectionPolicyListResult. -func (s ServerConnectionPolicyListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerKeyListResult. +func (s ServerKeyListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -14335,15 +16712,20 @@ func (s *ServerConnectionPolicyListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerConnectionPolicyProperties. -func (s ServerConnectionPolicyProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerKeyProperties. +func (s ServerKeyProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "connectionType", s.ConnectionType) + 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 ServerConnectionPolicyProperties. -func (s *ServerConnectionPolicyProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -14351,8 +16733,23 @@ func (s *ServerConnectionPolicyProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "connectionType": - err = unpopulate(val, "ConnectionType", &s.ConnectionType) + 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 { @@ -14362,18 +16759,16 @@ func (s *ServerConnectionPolicyProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerDNSAlias. -func (s ServerDNSAlias) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerListResult. +func (s ServerListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerDNSAlias. -func (s *ServerDNSAlias) UnmarshalJSON(data []byte) error { +// 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) @@ -14381,17 +16776,11 @@ func (s *ServerDNSAlias) UnmarshalJSON(data []byte) error { 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) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { @@ -14401,15 +16790,18 @@ func (s *ServerDNSAlias) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerDNSAliasAcquisition. -func (s ServerDNSAliasAcquisition) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerOperation. +func (s ServerOperation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "oldServerDnsAliasId", s.OldServerDNSAliasID) + 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 ServerDNSAliasAcquisition. -func (s *ServerDNSAliasAcquisition) UnmarshalJSON(data []byte) error { +// 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) @@ -14417,8 +16809,17 @@ func (s *ServerDNSAliasAcquisition) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "oldServerDnsAliasId": - err = unpopulate(val, "OldServerDNSAliasID", &s.OldServerDNSAliasID) + 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 { @@ -14428,16 +16829,16 @@ func (s *ServerDNSAliasAcquisition) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerDNSAliasListResult. -func (s ServerDNSAliasListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerOperationListResult. +func (s ServerOperationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -14459,15 +16860,27 @@ func (s *ServerDNSAliasListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerDNSAliasProperties. -func (s ServerDNSAliasProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerOperationProperties. +func (s ServerOperationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "azureDnsRecord", s.AzureDNSRecord) + 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 ServerDNSAliasProperties. -func (s *ServerDNSAliasProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -14475,8 +16888,44 @@ func (s *ServerDNSAliasProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "azureDnsRecord": - err = unpopulate(val, "AzureDNSRecord", &s.AzureDNSRecord) + 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 { @@ -14486,16 +16935,16 @@ func (s *ServerDNSAliasProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerDevOpsAuditSettingsListResult. -func (s ServerDevOpsAuditSettingsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerPrivateEndpointConnection. +func (s ServerPrivateEndpointConnection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) + populate(objectMap, "id", s.ID) + populate(objectMap, "properties", s.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerDevOpsAuditSettingsListResult. -func (s *ServerDevOpsAuditSettingsListResult) UnmarshalJSON(data []byte) error { +// 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) @@ -14503,11 +16952,11 @@ func (s *ServerDevOpsAuditSettingsListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) } if err != nil { @@ -14517,19 +16966,29 @@ func (s *ServerDevOpsAuditSettingsListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerDevOpsAuditSettingsProperties. -func (s ServerDevOpsAuditSettingsProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerProperties. +func (s ServerProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "isAzureMonitorTargetEnabled", s.IsAzureMonitorTargetEnabled) + populate(objectMap, "administratorLogin", s.AdministratorLogin) + populate(objectMap, "administratorLoginPassword", s.AdministratorLoginPassword) + populate(objectMap, "administrators", s.Administrators) + populate(objectMap, "externalGovernanceStatus", s.ExternalGovernanceStatus) + 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, "storageAccountAccessKey", s.StorageAccountAccessKey) - populate(objectMap, "storageAccountSubscriptionId", s.StorageAccountSubscriptionID) - populate(objectMap, "storageEndpoint", s.StorageEndpoint) + populate(objectMap, "version", s.Version) + populate(objectMap, "workspaceFeature", s.WorkspaceFeature) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerDevOpsAuditSettingsProperties. -func (s *ServerDevOpsAuditSettingsProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -14537,20 +16996,50 @@ func (s *ServerDevOpsAuditSettingsProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "isAzureMonitorTargetEnabled": - err = unpopulate(val, "IsAzureMonitorTargetEnabled", &s.IsAzureMonitorTargetEnabled) + 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 "externalGovernanceStatus": + err = unpopulate(val, "ExternalGovernanceStatus", &s.ExternalGovernanceStatus) + 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 "storageAccountAccessKey": - err = unpopulate(val, "StorageAccountAccessKey", &s.StorageAccountAccessKey) - delete(rawMsg, key) - case "storageAccountSubscriptionId": - err = unpopulate(val, "StorageAccountSubscriptionID", &s.StorageAccountSubscriptionID) + case "version": + err = unpopulate(val, "Version", &s.Version) delete(rawMsg, key) - case "storageEndpoint": - err = unpopulate(val, "StorageEndpoint", &s.StorageEndpoint) + case "workspaceFeature": + err = unpopulate(val, "WorkspaceFeature", &s.WorkspaceFeature) delete(rawMsg, key) } if err != nil { @@ -14560,8 +17049,8 @@ func (s *ServerDevOpsAuditSettingsProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerDevOpsAuditingSettings. -func (s ServerDevOpsAuditingSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerSecurityAlertPolicy. +func (s ServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) @@ -14571,8 +17060,8 @@ func (s ServerDevOpsAuditingSettings) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerDevOpsAuditingSettings. -func (s *ServerDevOpsAuditingSettings) UnmarshalJSON(data []byte) error { +// 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) @@ -14603,20 +17092,18 @@ func (s *ServerDevOpsAuditingSettings) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerExternalAdministrator. -func (s ServerExternalAdministrator) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerTrustCertificate. +func (s ServerTrustCertificate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 ServerExternalAdministrator. -func (s *ServerExternalAdministrator) UnmarshalJSON(data []byte) error { +// 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) @@ -14624,23 +17111,17 @@ func (s *ServerExternalAdministrator) UnmarshalJSON(data []byte) error { 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) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "principalType": - err = unpopulate(val, "PrincipalType", &s.PrincipalType) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "sid": - err = unpopulate(val, "Sid", &s.Sid) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &s.TenantID) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { @@ -14650,16 +17131,17 @@ func (s *ServerExternalAdministrator) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerFirewallRuleProperties. -func (s ServerFirewallRuleProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerTrustCertificateProperties. +func (s ServerTrustCertificateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "endIpAddress", s.EndIPAddress) - populate(objectMap, "startIpAddress", s.StartIPAddress) + 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 ServerFirewallRuleProperties. -func (s *ServerFirewallRuleProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -14667,11 +17149,14 @@ func (s *ServerFirewallRuleProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "endIpAddress": - err = unpopulate(val, "EndIPAddress", &s.EndIPAddress) + case "certificateName": + err = unpopulate(val, "CertificateName", &s.CertificateName) delete(rawMsg, key) - case "startIpAddress": - err = unpopulate(val, "StartIPAddress", &s.StartIPAddress) + 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 { @@ -14681,15 +17166,16 @@ func (s *ServerFirewallRuleProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerInfo. -func (s ServerInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerTrustCertificatesListResult. +func (s ServerTrustCertificatesListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "serverId", s.ServerID) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerInfo. -func (s *ServerInfo) UnmarshalJSON(data []byte) error { +// 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) @@ -14697,8 +17183,11 @@ func (s *ServerInfo) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "serverId": - err = unpopulate(val, "ServerID", &s.ServerID) + 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 { @@ -14708,20 +17197,18 @@ func (s *ServerInfo) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerKey. -func (s ServerKey) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerTrustGroup. +func (s ServerTrustGroup) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -14732,12 +17219,6 @@ func (s *ServerKey) UnmarshalJSON(data []byte) error { 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) @@ -14755,16 +17236,16 @@ func (s *ServerKey) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerKeyListResult. -func (s ServerKeyListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerTrustGroupListResult. +func (s ServerTrustGroupListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -14786,20 +17267,16 @@ func (s *ServerKeyListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerKeyProperties. -func (s ServerKeyProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerTrustGroupProperties. +func (s ServerTrustGroupProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "groupMembers", s.GroupMembers) + populate(objectMap, "trustScopes", s.TrustScopes) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerKeyProperties. -func (s *ServerKeyProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -14807,23 +17284,11 @@ func (s *ServerKeyProperties) UnmarshalJSON(data []byte) error { 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) + case "groupMembers": + err = unpopulate(val, "GroupMembers", &s.GroupMembers) delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &s.URI) + case "trustScopes": + err = unpopulate(val, "TrustScopes", &s.TrustScopes) delete(rawMsg, key) } if err != nil { @@ -14833,16 +17298,17 @@ func (s *ServerKeyProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerListResult. -func (s ServerListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerUpdate. +func (s ServerUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) + 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 ServerListResult. -func (s *ServerListResult) UnmarshalJSON(data []byte) error { +// 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) @@ -14850,11 +17316,14 @@ func (s *ServerListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) + case "identity": + err = unpopulate(val, "Identity", &s.Identity) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + 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 { @@ -14864,18 +17333,21 @@ func (s *ServerListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerOperation. -func (s ServerOperation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerUsage. +func (s ServerUsage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) + populate(objectMap, "currentValue", s.CurrentValue) + populate(objectMap, "displayName", s.DisplayName) + populate(objectMap, "limit", s.Limit) populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) + 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 ServerOperation. -func (s *ServerOperation) UnmarshalJSON(data []byte) error { +// 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) @@ -14883,17 +17355,26 @@ func (s *ServerOperation) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) + 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 "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "nextResetTime": + err = unpopulateTimeRFC3339(val, "NextResetTime", &s.NextResetTime) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + 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 { @@ -14903,16 +17384,15 @@ func (s *ServerOperation) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerOperationListResult. -func (s ServerOperationListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerUsageListResult. +func (s ServerUsageListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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 { +// 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) @@ -14920,9 +17400,6 @@ func (s *ServerOperationListResult) UnmarshalJSON(data []byte) error { 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) @@ -14934,27 +17411,19 @@ func (s *ServerOperationListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerOperationProperties. -func (s ServerOperationProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerVersionCapability. +func (s ServerVersionCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 ServerOperationProperties. -func (s *ServerOperationProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -14962,44 +17431,20 @@ func (s *ServerOperationProperties) UnmarshalJSON(data []byte) error { 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) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "percentComplete": - err = unpopulate(val, "PercentComplete", &s.PercentComplete) + case "reason": + err = unpopulate(val, "Reason", &s.Reason) delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &s.ServerName) + case "status": + err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &s.StartTime) + case "supportedEditions": + err = unpopulate(val, "SupportedEditions", &s.SupportedEditions) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &s.State) + case "supportedElasticPoolEditions": + err = unpopulate(val, "SupportedElasticPoolEditions", &s.SupportedElasticPoolEditions) delete(rawMsg, key) } if err != nil { @@ -15009,16 +17454,18 @@ func (s *ServerOperationProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerPrivateEndpointConnection. -func (s ServerPrivateEndpointConnection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerVulnerabilityAssessment. +func (s ServerVulnerabilityAssessment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 ServerPrivateEndpointConnection. -func (s *ServerPrivateEndpointConnection) UnmarshalJSON(data []byte) error { +// 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) @@ -15029,9 +17476,15 @@ func (s *ServerPrivateEndpointConnection) UnmarshalJSON(data []byte) error { 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) @@ -15040,28 +17493,16 @@ func (s *ServerPrivateEndpointConnection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerProperties. -func (s ServerProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerVulnerabilityAssessmentListResult. +func (s ServerVulnerabilityAssessmentListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerProperties. -func (s *ServerProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -15069,47 +17510,11 @@ func (s *ServerProperties) UnmarshalJSON(data []byte) error { 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) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "workspaceFeature": - err = unpopulate(val, "WorkspaceFeature", &s.WorkspaceFeature) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { @@ -15119,19 +17524,18 @@ func (s *ServerProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerSecurityAlertPolicy. -func (s ServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerVulnerabilityAssessmentProperties. +func (s ServerVulnerabilityAssessmentProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 ServerSecurityAlertPolicy. -func (s *ServerSecurityAlertPolicy) UnmarshalJSON(data []byte) error { +// 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) @@ -15139,20 +17543,17 @@ func (s *ServerSecurityAlertPolicy) UnmarshalJSON(data []byte) error { 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) + case "recurringScans": + err = unpopulate(val, "RecurringScans", &s.RecurringScans) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "storageAccountAccessKey": + err = unpopulate(val, "StorageAccountAccessKey", &s.StorageAccountAccessKey) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &s.SystemData) + case "storageContainerPath": + err = unpopulate(val, "StorageContainerPath", &s.StorageContainerPath) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + case "storageContainerSasKey": + err = unpopulate(val, "StorageContainerSasKey", &s.StorageContainerSasKey) delete(rawMsg, key) } if err != nil { @@ -15162,8 +17563,8 @@ func (s *ServerSecurityAlertPolicy) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerTrustCertificate. -func (s ServerTrustCertificate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServiceObjective. +func (s ServiceObjective) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) @@ -15171,9 +17572,9 @@ func (s ServerTrustCertificate) MarshalJSON() ([]byte, error) { 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 { + +// 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) @@ -15201,17 +17602,28 @@ func (s *ServerTrustCertificate) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerTrustCertificateProperties. -func (s ServerTrustCertificateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServiceObjectiveCapability. +func (s ServiceObjectiveCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "certificateName", s.CertificateName) - populate(objectMap, "publicBlob", s.PublicBlob) - populate(objectMap, "thumbprint", s.Thumbprint) + 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 ServerTrustCertificateProperties. -func (s *ServerTrustCertificateProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -15219,14 +17631,47 @@ func (s *ServerTrustCertificateProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "certificateName": - err = unpopulate(val, "CertificateName", &s.CertificateName) + case "computeModel": + err = unpopulate(val, "ComputeModel", &s.ComputeModel) delete(rawMsg, key) - case "publicBlob": - err = unpopulate(val, "PublicBlob", &s.PublicBlob) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &s.Thumbprint) + 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 { @@ -15236,16 +17681,15 @@ func (s *ServerTrustCertificateProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerTrustCertificatesListResult. -func (s ServerTrustCertificatesListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServiceObjectiveListResult. +func (s ServiceObjectiveListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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 { +// 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) @@ -15253,9 +17697,6 @@ func (s *ServerTrustCertificatesListResult) UnmarshalJSON(data []byte) error { 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) @@ -15267,18 +17708,19 @@ func (s *ServerTrustCertificatesListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerTrustGroup. -func (s ServerTrustGroup) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServiceObjectiveProperties. +func (s ServiceObjectiveProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) + 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 ServerTrustGroup. -func (s *ServerTrustGroup) UnmarshalJSON(data []byte) error { +// 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) @@ -15286,17 +17728,20 @@ func (s *ServerTrustGroup) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) + case "description": + err = unpopulate(val, "Description", &s.Description) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) + case "enabled": + err = unpopulate(val, "Enabled", &s.Enabled) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "isDefault": + err = unpopulate(val, "IsDefault", &s.IsDefault) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + 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 { @@ -15306,16 +17751,18 @@ func (s *ServerTrustGroup) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerTrustGroupListResult. -func (s ServerTrustGroupListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServicePrincipal. +func (s ServicePrincipal) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) + 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 ServerTrustGroupListResult. -func (s *ServerTrustGroupListResult) UnmarshalJSON(data []byte) error { +// 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) @@ -15323,11 +17770,17 @@ func (s *ServerTrustGroupListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) + case "clientId": + err = unpopulate(val, "ClientID", &s.ClientID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + 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 { @@ -15337,16 +17790,17 @@ func (s *ServerTrustGroupListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerTrustGroupProperties. -func (s ServerTrustGroupProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SloUsageMetric. +func (s SloUsageMetric) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "groupMembers", s.GroupMembers) - populate(objectMap, "trustScopes", s.TrustScopes) + 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 ServerTrustGroupProperties. -func (s *ServerTrustGroupProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -15354,11 +17808,14 @@ func (s *ServerTrustGroupProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "groupMembers": - err = unpopulate(val, "GroupMembers", &s.GroupMembers) + case "inRangeTimeRatio": + err = unpopulate(val, "InRangeTimeRatio", &s.InRangeTimeRatio) delete(rawMsg, key) - case "trustScopes": - err = unpopulate(val, "TrustScopes", &s.TrustScopes) + 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 { @@ -15368,17 +17825,19 @@ func (s *ServerTrustGroupProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerUpdate. -func (s ServerUpdate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StartStopManagedInstanceSchedule. +func (s StartStopManagedInstanceSchedule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "identity", s.Identity) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerUpdate. -func (s *ServerUpdate) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StartStopManagedInstanceSchedule. +func (s *StartStopManagedInstanceSchedule) UnmarshalJSON(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) @@ -15386,14 +17845,20 @@ func (s *ServerUpdate) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "identity": - err = unpopulate(val, "Identity", &s.Identity) + 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 "tags": - err = unpopulate(val, "Tags", &s.Tags) + 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 { @@ -15403,21 +17868,16 @@ func (s *ServerUpdate) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerUsage. -func (s ServerUsage) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StartStopManagedInstanceScheduleListResult. +func (s StartStopManagedInstanceScheduleListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerUsage. -func (s *ServerUsage) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StartStopManagedInstanceScheduleListResult. +func (s *StartStopManagedInstanceScheduleListResult) UnmarshalJSON(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) @@ -15425,26 +17885,11 @@ func (s *ServerUsage) UnmarshalJSON(data []byte) error { 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) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &s.Unit) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { @@ -15454,15 +17899,19 @@ func (s *ServerUsage) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerUsageListResult. -func (s ServerUsageListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StartStopManagedInstanceScheduleProperties. +func (s StartStopManagedInstanceScheduleProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", s.Value) + populate(objectMap, "description", s.Description) + populate(objectMap, "nextExecutionTime", s.NextExecutionTime) + populate(objectMap, "nextRunAction", s.NextRunAction) + populate(objectMap, "scheduleList", s.ScheduleList) + populate(objectMap, "timeZoneId", s.TimeZoneID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerUsageListResult. -func (s *ServerUsageListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StartStopManagedInstanceScheduleProperties. +func (s *StartStopManagedInstanceScheduleProperties) UnmarshalJSON(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) @@ -15470,8 +17919,20 @@ func (s *ServerUsageListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &s.Value) + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "nextExecutionTime": + err = unpopulate(val, "NextExecutionTime", &s.NextExecutionTime) + delete(rawMsg, key) + case "nextRunAction": + err = unpopulate(val, "NextRunAction", &s.NextRunAction) + delete(rawMsg, key) + case "scheduleList": + err = unpopulate(val, "ScheduleList", &s.ScheduleList) + delete(rawMsg, key) + case "timeZoneId": + err = unpopulate(val, "TimeZoneID", &s.TimeZoneID) delete(rawMsg, key) } if err != nil { @@ -15481,19 +17942,17 @@ func (s *ServerUsageListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerVersionCapability. -func (s ServerVersionCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StorageCapability. +func (s StorageCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "status", s.Status) + populate(objectMap, "storageAccountType", s.StorageAccountType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerVersionCapability. -func (s *ServerVersionCapability) UnmarshalJSON(data []byte) error { +// 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) @@ -15501,20 +17960,14 @@ func (s *ServerVersionCapability) UnmarshalJSON(data []byte) error { 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) + case "storageAccountType": + err = unpopulate(val, "StorageAccountType", &s.StorageAccountType) delete(rawMsg, key) } if err != nil { @@ -15524,8 +17977,8 @@ func (s *ServerVersionCapability) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerVulnerabilityAssessment. -func (s ServerVulnerabilityAssessment) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SubscriptionUsage. +func (s SubscriptionUsage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) @@ -15534,8 +17987,8 @@ func (s ServerVulnerabilityAssessment) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerVulnerabilityAssessment. -func (s *ServerVulnerabilityAssessment) UnmarshalJSON(data []byte) error { +// 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) @@ -15563,16 +18016,16 @@ func (s *ServerVulnerabilityAssessment) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerVulnerabilityAssessmentListResult. -func (s ServerVulnerabilityAssessmentListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SubscriptionUsageListResult. +func (s SubscriptionUsageListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -15594,18 +18047,18 @@ func (s *ServerVulnerabilityAssessmentListResult) UnmarshalJSON(data []byte) err return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerVulnerabilityAssessmentProperties. -func (s ServerVulnerabilityAssessmentProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SubscriptionUsageProperties. +func (s SubscriptionUsageProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "recurringScans", s.RecurringScans) - populate(objectMap, "storageAccountAccessKey", s.StorageAccountAccessKey) - populate(objectMap, "storageContainerPath", s.StorageContainerPath) - populate(objectMap, "storageContainerSasKey", s.StorageContainerSasKey) + 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 ServerVulnerabilityAssessmentProperties. -func (s *ServerVulnerabilityAssessmentProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -15613,17 +18066,17 @@ func (s *ServerVulnerabilityAssessmentProperties) UnmarshalJSON(data []byte) err for key, val := range rawMsg { var err error switch key { - case "recurringScans": - err = unpopulate(val, "RecurringScans", &s.RecurringScans) + case "currentValue": + err = unpopulate(val, "CurrentValue", &s.CurrentValue) delete(rawMsg, key) - case "storageAccountAccessKey": - err = unpopulate(val, "StorageAccountAccessKey", &s.StorageAccountAccessKey) + case "displayName": + err = unpopulate(val, "DisplayName", &s.DisplayName) delete(rawMsg, key) - case "storageContainerPath": - err = unpopulate(val, "StorageContainerPath", &s.StorageContainerPath) + case "limit": + err = unpopulate(val, "Limit", &s.Limit) delete(rawMsg, key) - case "storageContainerSasKey": - err = unpopulate(val, "StorageContainerSasKey", &s.StorageContainerSasKey) + case "unit": + err = unpopulate(val, "Unit", &s.Unit) delete(rawMsg, key) } if err != nil { @@ -15633,8 +18086,8 @@ func (s *ServerVulnerabilityAssessmentProperties) UnmarshalJSON(data []byte) err return nil } -// MarshalJSON implements the json.Marshaller interface for type ServiceObjective. -func (s ServiceObjective) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SynapseLinkWorkspace. +func (s SynapseLinkWorkspace) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) @@ -15643,8 +18096,8 @@ func (s ServiceObjective) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceObjective. -func (s *ServiceObjective) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SynapseLinkWorkspace. +func (s *SynapseLinkWorkspace) UnmarshalJSON(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) @@ -15672,28 +18125,16 @@ func (s *ServiceObjective) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServiceObjectiveCapability. -func (s ServiceObjectiveCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SynapseLinkWorkspaceInfoProperties. +func (s SynapseLinkWorkspaceInfoProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "linkConnectionName", s.LinkConnectionName) + populate(objectMap, "workspaceId", s.WorkspaceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceObjectiveCapability. -func (s *ServiceObjectiveCapability) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SynapseLinkWorkspaceInfoProperties. +func (s *SynapseLinkWorkspaceInfoProperties) UnmarshalJSON(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) @@ -15701,47 +18142,11 @@ func (s *ServiceObjectiveCapability) UnmarshalJSON(data []byte) error { 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) + case "linkConnectionName": + err = unpopulate(val, "LinkConnectionName", &s.LinkConnectionName) 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) + case "workspaceId": + err = unpopulate(val, "WorkspaceID", &s.WorkspaceID) delete(rawMsg, key) } if err != nil { @@ -15751,15 +18156,16 @@ func (s *ServiceObjectiveCapability) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServiceObjectiveListResult. -func (s ServiceObjectiveListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SynapseLinkWorkspaceListResult. +func (s SynapseLinkWorkspaceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) 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 { +// UnmarshalJSON implements the json.Unmarshaller interface for type SynapseLinkWorkspaceListResult. +func (s *SynapseLinkWorkspaceListResult) UnmarshalJSON(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) @@ -15767,6 +18173,9 @@ func (s *ServiceObjectiveListResult) UnmarshalJSON(data []byte) error { 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) @@ -15778,19 +18187,15 @@ func (s *ServiceObjectiveListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServiceObjectiveProperties. -func (s ServiceObjectiveProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SynapseLinkWorkspaceProperties. +func (s SynapseLinkWorkspaceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "workspaces", s.Workspaces) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceObjectiveProperties. -func (s *ServiceObjectiveProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SynapseLinkWorkspaceProperties. +func (s *SynapseLinkWorkspaceProperties) UnmarshalJSON(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) @@ -15798,20 +18203,8 @@ func (s *ServiceObjectiveProperties) UnmarshalJSON(data []byte) error { 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) + case "workspaces": + err = unpopulate(val, "Workspaces", &s.Workspaces) delete(rawMsg, key) } if err != nil { @@ -15821,18 +18214,18 @@ func (s *ServiceObjectiveProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServicePrincipal. -func (s ServicePrincipal) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SyncAgent. +func (s SyncAgent) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientId", s.ClientID) - populate(objectMap, "principalId", s.PrincipalID) - populate(objectMap, "tenantId", s.TenantID) + 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 ServicePrincipal. -func (s *ServicePrincipal) UnmarshalJSON(data []byte) error { +// 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) @@ -15840,14 +18233,14 @@ func (s *ServicePrincipal) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "clientId": - err = unpopulate(val, "ClientID", &s.ClientID) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "principalId": - err = unpopulate(val, "PrincipalID", &s.PrincipalID) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &s.TenantID) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &s.Type) @@ -15860,17 +18253,15 @@ func (s *ServicePrincipal) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SloUsageMetric. -func (s SloUsageMetric) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SyncAgentKeyProperties. +func (s SyncAgentKeyProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "inRangeTimeRatio", s.InRangeTimeRatio) - populate(objectMap, "serviceLevelObjective", s.ServiceLevelObjective) - populate(objectMap, "serviceLevelObjectiveId", s.ServiceLevelObjectiveID) + populate(objectMap, "syncAgentKey", s.SyncAgentKey) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SloUsageMetric. -func (s *SloUsageMetric) UnmarshalJSON(data []byte) error { +// 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) @@ -15878,14 +18269,8 @@ func (s *SloUsageMetric) UnmarshalJSON(data []byte) error { 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) + case "syncAgentKey": + err = unpopulate(val, "SyncAgentKey", &s.SyncAgentKey) delete(rawMsg, key) } if err != nil { @@ -15895,17 +18280,18 @@ func (s *SloUsageMetric) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type StorageCapability. -func (s StorageCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SyncAgentLinkedDatabase. +func (s SyncAgentLinkedDatabase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "reason", s.Reason) - populate(objectMap, "status", s.Status) - populate(objectMap, "storageAccountType", s.StorageAccountType) + 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 StorageCapability. -func (s *StorageCapability) UnmarshalJSON(data []byte) error { +// 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) @@ -15913,14 +18299,48 @@ func (s *StorageCapability) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "reason": - err = unpopulate(val, "Reason", &s.Reason) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &s.Status) + 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]any) + 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 "storageAccountType": - err = unpopulate(val, "StorageAccountType", &s.StorageAccountType) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { @@ -15930,18 +18350,20 @@ func (s *StorageCapability) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SubscriptionUsage. -func (s SubscriptionUsage) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SyncAgentLinkedDatabaseProperties. +func (s SyncAgentLinkedDatabaseProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) + 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 SubscriptionUsage. -func (s *SubscriptionUsage) UnmarshalJSON(data []byte) error { +// 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) @@ -15949,17 +18371,23 @@ func (s *SubscriptionUsage) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) + case "databaseId": + err = unpopulate(val, "DatabaseID", &s.DatabaseID) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) + case "databaseName": + err = unpopulate(val, "DatabaseName", &s.DatabaseName) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "databaseType": + err = unpopulate(val, "DatabaseType", &s.DatabaseType) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + 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 { @@ -15969,16 +18397,16 @@ func (s *SubscriptionUsage) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SubscriptionUsageListResult. -func (s SubscriptionUsageListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SyncAgentListResult. +func (s SyncAgentListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -16000,18 +18428,21 @@ func (s *SubscriptionUsageListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SubscriptionUsageProperties. -func (s SubscriptionUsageProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SyncAgentProperties. +func (s SyncAgentProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "currentValue", s.CurrentValue) - populate(objectMap, "displayName", s.DisplayName) - populate(objectMap, "limit", s.Limit) - populate(objectMap, "unit", s.Unit) + 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 SubscriptionUsageProperties. -func (s *SubscriptionUsageProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -16019,17 +18450,26 @@ func (s *SubscriptionUsageProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "currentValue": - err = unpopulate(val, "CurrentValue", &s.CurrentValue) + case "expiryTime": + err = unpopulateTimeRFC3339(val, "ExpiryTime", &s.ExpiryTime) delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &s.DisplayName) + case "isUpToDate": + err = unpopulate(val, "IsUpToDate", &s.IsUpToDate) delete(rawMsg, key) - case "limit": - err = unpopulate(val, "Limit", &s.Limit) + case "lastAliveTime": + err = unpopulateTimeRFC3339(val, "LastAliveTime", &s.LastAliveTime) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &s.Unit) + 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 { @@ -16039,18 +18479,16 @@ func (s *SubscriptionUsageProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncAgent. -func (s SyncAgent) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SyncDatabaseIDListResult. +func (s SyncDatabaseIDListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SyncAgent. -func (s *SyncAgent) UnmarshalJSON(data []byte) error { +// 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) @@ -16058,17 +18496,11 @@ func (s *SyncAgent) UnmarshalJSON(data []byte) error { 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) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { @@ -16078,15 +18510,15 @@ func (s *SyncAgent) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncAgentKeyProperties. -func (s SyncAgentKeyProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SyncDatabaseIDProperties. +func (s SyncDatabaseIDProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "syncAgentKey", s.SyncAgentKey) + populate(objectMap, "id", s.ID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SyncAgentKeyProperties. -func (s *SyncAgentKeyProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -16094,8 +18526,8 @@ func (s *SyncAgentKeyProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "syncAgentKey": - err = unpopulate(val, "SyncAgentKey", &s.SyncAgentKey) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) } if err != nil { @@ -16105,18 +18537,16 @@ func (s *SyncAgentKeyProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncAgentLinkedDatabase. -func (s SyncAgentLinkedDatabase) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SyncFullSchemaProperties. +func (s SyncFullSchemaProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) + populateTimeRFC3339(objectMap, "lastUpdateTime", s.LastUpdateTime) + populate(objectMap, "tables", s.Tables) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SyncAgentLinkedDatabase. -func (s *SyncAgentLinkedDatabase) UnmarshalJSON(data []byte) error { +// 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) @@ -16124,17 +18554,11 @@ func (s *SyncAgentLinkedDatabase) UnmarshalJSON(data []byte) error { 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) + case "lastUpdateTime": + err = unpopulateTimeRFC3339(val, "LastUpdateTime", &s.LastUpdateTime) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + case "tables": + err = unpopulate(val, "Tables", &s.Tables) delete(rawMsg, key) } if err != nil { @@ -16144,16 +18568,16 @@ func (s *SyncAgentLinkedDatabase) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncAgentLinkedDatabaseListResult. -func (s SyncAgentLinkedDatabaseListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SyncFullSchemaPropertiesListResult. +func (s SyncFullSchemaPropertiesListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -16175,20 +18599,19 @@ func (s *SyncAgentLinkedDatabaseListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncAgentLinkedDatabaseProperties. -func (s SyncAgentLinkedDatabaseProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SyncFullSchemaTable. +func (s SyncFullSchemaTable) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 SyncAgentLinkedDatabaseProperties. -func (s *SyncAgentLinkedDatabaseProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -16196,23 +18619,71 @@ func (s *SyncAgentLinkedDatabaseProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "databaseId": - err = unpopulate(val, "DatabaseID", &s.DatabaseID) + case "columns": + err = unpopulate(val, "Columns", &s.Columns) delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &s.DatabaseName) + case "errorId": + err = unpopulate(val, "ErrorID", &s.ErrorID) delete(rawMsg, key) - case "databaseType": - err = unpopulate(val, "DatabaseType", &s.DatabaseType) + 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]any) + 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 "description": - err = unpopulate(val, "Description", &s.Description) + case "hasError": + err = unpopulate(val, "HasError", &s.HasError) delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &s.ServerName) + case "isPrimaryKey": + err = unpopulate(val, "IsPrimaryKey", &s.IsPrimaryKey) delete(rawMsg, key) - case "userName": - err = unpopulate(val, "UserName", &s.UserName) + 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 { @@ -16222,16 +18693,19 @@ func (s *SyncAgentLinkedDatabaseProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncAgentListResult. -func (s SyncAgentListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SyncGroup. +func (s SyncGroup) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) + 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 SyncAgentListResult. -func (s *SyncAgentListResult) UnmarshalJSON(data []byte) error { +// 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) @@ -16239,11 +18713,20 @@ func (s *SyncAgentListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + 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 { @@ -16253,21 +18736,16 @@ func (s *SyncAgentListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncAgentProperties. -func (s SyncAgentProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SyncGroupListResult. +func (s SyncGroupListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SyncAgentProperties. -func (s *SyncAgentProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -16275,26 +18753,11 @@ func (s *SyncAgentProperties) UnmarshalJSON(data []byte) error { 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) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &s.Version) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { @@ -16304,16 +18767,16 @@ func (s *SyncAgentProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncDatabaseIDListResult. -func (s SyncDatabaseIDListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SyncGroupLogListResult. +func (s SyncGroupLogListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -16335,15 +18798,20 @@ func (s *SyncDatabaseIDListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncDatabaseIDProperties. -func (s SyncDatabaseIDProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SyncGroupLogProperties. +func (s SyncGroupLogProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) + 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 SyncDatabaseIDProperties. -func (s *SyncDatabaseIDProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -16351,8 +18819,23 @@ func (s *SyncDatabaseIDProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) + 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 { @@ -16362,16 +18845,26 @@ func (s *SyncDatabaseIDProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncFullSchemaProperties. -func (s SyncFullSchemaProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SyncGroupProperties. +func (s SyncGroupProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateTimeRFC3339(objectMap, "lastUpdateTime", s.LastUpdateTime) - populate(objectMap, "tables", s.Tables) + 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 SyncFullSchemaProperties. -func (s *SyncFullSchemaProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -16379,11 +18872,41 @@ func (s *SyncFullSchemaProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "lastUpdateTime": - err = unpopulateTimeRFC3339(val, "LastUpdateTime", &s.LastUpdateTime) + case "conflictLoggingRetentionInDays": + err = unpopulate(val, "ConflictLoggingRetentionInDays", &s.ConflictLoggingRetentionInDays) delete(rawMsg, key) - case "tables": - err = unpopulate(val, "Tables", &s.Tables) + 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 { @@ -16393,16 +18916,16 @@ func (s *SyncFullSchemaProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncFullSchemaPropertiesListResult. -func (s SyncFullSchemaPropertiesListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SyncGroupSchema. +func (s SyncGroupSchema) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) + populate(objectMap, "masterSyncMemberName", s.MasterSyncMemberName) + populate(objectMap, "tables", s.Tables) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SyncFullSchemaPropertiesListResult. -func (s *SyncFullSchemaPropertiesListResult) UnmarshalJSON(data []byte) error { +// 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) @@ -16410,11 +18933,11 @@ func (s *SyncFullSchemaPropertiesListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) + case "masterSyncMemberName": + err = unpopulate(val, "MasterSyncMemberName", &s.MasterSyncMemberName) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "tables": + err = unpopulate(val, "Tables", &s.Tables) delete(rawMsg, key) } if err != nil { @@ -16424,19 +18947,16 @@ func (s *SyncFullSchemaPropertiesListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncFullSchemaTable. -func (s SyncFullSchemaTable) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SyncGroupSchemaTable. +func (s SyncGroupSchemaTable) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -16447,15 +18967,6 @@ func (s *SyncFullSchemaTable) UnmarshalJSON(data []byte) error { 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) @@ -16467,45 +18978,29 @@ func (s *SyncFullSchemaTable) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncFullSchemaTableColumn. -func (s SyncFullSchemaTableColumn) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SyncGroupSchemaTableColumn. +func (s SyncGroupSchemaTableColumn) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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 "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) + switch key { + case "dataSize": + err = unpopulate(val, "DataSize", &s.DataSize) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) + case "dataType": + err = unpopulate(val, "DataType", &s.DataType) delete(rawMsg, key) case "quotedName": err = unpopulate(val, "QuotedName", &s.QuotedName) @@ -16518,19 +19013,18 @@ func (s *SyncFullSchemaTableColumn) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncGroup. -func (s SyncGroup) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SyncMember. +func (s SyncMember) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -16547,9 +19041,6 @@ func (s *SyncGroup) UnmarshalJSON(data []byte) error { 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) @@ -16561,16 +19052,16 @@ func (s *SyncGroup) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncGroupListResult. -func (s SyncGroupListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SyncMemberListResult. +func (s SyncMemberListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// 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) @@ -16592,16 +19083,26 @@ func (s *SyncGroupListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncGroupLogListResult. -func (s SyncGroupLogListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SyncMemberProperties. +func (s SyncMemberProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) + 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 SyncGroupLogListResult. -func (s *SyncGroupLogListResult) UnmarshalJSON(data []byte) error { +// 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) @@ -16609,11 +19110,41 @@ func (s *SyncGroupLogListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) + case "databaseName": + err = unpopulate(val, "DatabaseName", &s.DatabaseName) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + 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 { @@ -16623,20 +19154,20 @@ func (s *SyncGroupLogListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncGroupLogProperties. -func (s SyncGroupLogProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 SyncGroupLogProperties. -func (s *SyncGroupLogProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -16644,23 +19175,23 @@ func (s *SyncGroupLogProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "details": - err = unpopulate(val, "Details", &s.Details) + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) delete(rawMsg, key) - case "operationStatus": - err = unpopulate(val, "OperationStatus", &s.OperationStatus) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &s.Source) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) delete(rawMsg, key) - case "timestamp": - err = unpopulateTimeRFC3339(val, "Timestamp", &s.Timestamp) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) delete(rawMsg, key) - case "tracingId": - err = unpopulate(val, "TracingID", &s.TracingID) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) delete(rawMsg, key) } if err != nil { @@ -16670,979 +19201,957 @@ func (s *SyncGroupLogProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncGroupProperties. -func (s SyncGroupProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type TdeCertificate. +func (t TdeCertificate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 SyncGroupProperties. -func (s *SyncGroupProperties) UnmarshalJSON(data []byte) error { +// 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", t, 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) + case "id": + err = unpopulate(val, "ID", &t.ID) delete(rawMsg, key) - case "privateEndpointName": - err = unpopulate(val, "PrivateEndpointName", &s.PrivateEndpointName) + case "name": + err = unpopulate(val, "Name", &t.Name) delete(rawMsg, key) - case "schema": - err = unpopulate(val, "Schema", &s.Schema) + case "properties": + err = unpopulate(val, "Properties", &t.Properties) delete(rawMsg, key) - case "syncDatabaseId": - err = unpopulate(val, "SyncDatabaseID", &s.SyncDatabaseID) + case "type": + err = unpopulate(val, "Type", &t.Type) delete(rawMsg, key) - case "syncState": - err = unpopulate(val, "SyncState", &s.SyncState) + } + 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]any) + 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 "usePrivateLinkConnection": - err = unpopulate(val, "UsePrivateLinkConnection", &s.UsePrivateLinkConnection) + case "privateBlob": + err = unpopulate(val, "PrivateBlob", &t.PrivateBlob) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncGroupSchema. -func (s SyncGroupSchema) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type TimeZone. +func (t TimeZone) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "masterSyncMemberName", s.MasterSyncMemberName) - populate(objectMap, "tables", s.Tables) + 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 SyncGroupSchema. -func (s *SyncGroupSchema) UnmarshalJSON(data []byte) error { +// 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { - case "masterSyncMemberName": - err = unpopulate(val, "MasterSyncMemberName", &s.MasterSyncMemberName) + case "id": + err = unpopulate(val, "ID", &t.ID) delete(rawMsg, key) - case "tables": - err = unpopulate(val, "Tables", &s.Tables) + 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncGroupSchemaTable. -func (s SyncGroupSchemaTable) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type TimeZoneListResult. +func (t TimeZoneListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "columns", s.Columns) - populate(objectMap, "quotedName", s.QuotedName) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroupSchemaTable. -func (s *SyncGroupSchemaTable) UnmarshalJSON(data []byte) error { +// 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { - case "columns": - err = unpopulate(val, "Columns", &s.Columns) + case "nextLink": + err = unpopulate(val, "NextLink", &t.NextLink) delete(rawMsg, key) - case "quotedName": - err = unpopulate(val, "QuotedName", &s.QuotedName) + case "value": + err = unpopulate(val, "Value", &t.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncGroupSchemaTableColumn. -func (s SyncGroupSchemaTableColumn) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type TimeZoneProperties. +func (t TimeZoneProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dataSize", s.DataSize) - populate(objectMap, "dataType", s.DataType) - populate(objectMap, "quotedName", s.QuotedName) + populate(objectMap, "displayName", t.DisplayName) + populate(objectMap, "timeZoneId", t.TimeZoneID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroupSchemaTableColumn. -func (s *SyncGroupSchemaTableColumn) UnmarshalJSON(data []byte) error { +// 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", t, 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) + case "displayName": + err = unpopulate(val, "DisplayName", &t.DisplayName) delete(rawMsg, key) - case "quotedName": - err = unpopulate(val, "QuotedName", &s.QuotedName) + case "timeZoneId": + err = unpopulate(val, "TimeZoneID", &t.TimeZoneID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncMember. -func (s SyncMember) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type TopQueries. +func (t TopQueries) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) + 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 SyncMember. -func (s *SyncMember) UnmarshalJSON(data []byte) error { +// 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", s, err) + 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", &s.ID) + case "aggregationFunction": + err = unpopulate(val, "AggregationFunction", &t.AggregationFunction) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) + case "endTime": + err = unpopulate(val, "EndTime", &t.EndTime) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "intervalType": + err = unpopulate(val, "IntervalType", &t.IntervalType) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncMemberListResult. -func (s SyncMemberListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type TopQueriesListResult. +func (t TopQueriesListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SyncMemberListResult. -func (s *SyncMemberListResult) UnmarshalJSON(data []byte) error { +// 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", s, err) + 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", &s.NextLink) + err = unpopulate(val, "NextLink", &t.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &s.Value) + err = unpopulate(val, "Value", &t.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncMemberProperties. -func (s SyncMemberProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type TrackedResource. +func (t TrackedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 SyncMemberProperties. -func (s *SyncMemberProperties) UnmarshalJSON(data []byte) error { +// 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", t, 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) + case "id": + err = unpopulate(val, "ID", &t.ID) delete(rawMsg, key) - case "syncMemberAzureDatabaseResourceId": - err = unpopulate(val, "SyncMemberAzureDatabaseResourceID", &s.SyncMemberAzureDatabaseResourceID) + case "location": + err = unpopulate(val, "Location", &t.Location) delete(rawMsg, key) - case "syncState": - err = unpopulate(val, "SyncState", &s.SyncState) + case "name": + err = unpopulate(val, "Name", &t.Name) delete(rawMsg, key) - case "usePrivateLinkConnection": - err = unpopulate(val, "UsePrivateLinkConnection", &s.UsePrivateLinkConnection) + case "tags": + err = unpopulate(val, "Tags", &t.Tags) delete(rawMsg, key) - case "userName": - err = unpopulate(val, "UserName", &s.UserName) + case "type": + err = unpopulate(val, "Type", &t.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type TransparentDataEncryptionProperties. +func (t TransparentDataEncryptionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "state", t.State) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) UnmarshalJSON(data []byte) error { +// 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", t, 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) + case "state": + err = unpopulate(val, "State", &t.State) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TdeCertificate. -func (t TdeCertificate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type UpdateLongTermRetentionBackupParameters. +func (u UpdateLongTermRetentionBackupParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", t.ID) - populate(objectMap, "name", t.Name) - populate(objectMap, "properties", t.Properties) - populate(objectMap, "type", t.Type) + populate(objectMap, "properties", u.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TdeCertificate. -func (t *TdeCertificate) UnmarshalJSON(data []byte) error { +// 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", t, err) + 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", &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) + case "properties": + err = unpopulate(val, "Properties", &u.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", u, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TdeCertificateProperties. -func (t TdeCertificateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type UpdateLongTermRetentionBackupParametersProperties. +func (u UpdateLongTermRetentionBackupParametersProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "certPassword", t.CertPassword) - populate(objectMap, "privateBlob", t.PrivateBlob) + populate(objectMap, "requestedBackupStorageRedundancy", u.RequestedBackupStorageRedundancy) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TdeCertificateProperties. -func (t *TdeCertificateProperties) UnmarshalJSON(data []byte) error { +// 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", t, err) + return fmt.Errorf("unmarshalling type %T: %v", u, 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) + case "requestedBackupStorageRedundancy": + err = unpopulate(val, "RequestedBackupStorageRedundancy", &u.RequestedBackupStorageRedundancy) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", u, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TimeZone. -func (t TimeZone) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type UpdateVirtualClusterDNSServersOperation. +func (u UpdateVirtualClusterDNSServersOperation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", t.ID) - populate(objectMap, "name", t.Name) - populate(objectMap, "properties", t.Properties) - populate(objectMap, "type", t.Type) + 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 TimeZone. -func (t *TimeZone) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateVirtualClusterDNSServersOperation. +func (u *UpdateVirtualClusterDNSServersOperation) UnmarshalJSON(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) + 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", &t.ID) + err = unpopulate(val, "ID", &u.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &t.Name) + err = unpopulate(val, "Name", &u.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &t.Properties) + err = unpopulate(val, "Properties", &u.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &t.Type) + err = unpopulate(val, "Type", &u.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", u, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TimeZoneListResult. -func (t TimeZoneListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type UpsertManagedServerOperationParameters. +func (u UpsertManagedServerOperationParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", t.NextLink) - populate(objectMap, "value", t.Value) + 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 TimeZoneListResult. -func (t *TimeZoneListResult) UnmarshalJSON(data []byte) error { +// 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", t, err) + 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", &t.NextLink) + case "family": + err = unpopulate(val, "Family", &u.Family) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &t.Value) + 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", t, err) + return fmt.Errorf("unmarshalling type %T: %v", u, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TimeZoneProperties. -func (t TimeZoneProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type UpsertManagedServerOperationStep. +func (u UpsertManagedServerOperationStep) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "displayName", t.DisplayName) - populate(objectMap, "timeZoneId", t.TimeZoneID) + 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 TimeZoneProperties. -func (t *TimeZoneProperties) UnmarshalJSON(data []byte) error { +// 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", t, err) + return fmt.Errorf("unmarshalling type %T: %v", u, err) } for key, val := range rawMsg { var err error switch key { - case "displayName": - err = unpopulate(val, "DisplayName", &t.DisplayName) + case "name": + err = unpopulate(val, "Name", &u.Name) delete(rawMsg, key) - case "timeZoneId": - err = unpopulate(val, "TimeZoneID", &t.TimeZoneID) + 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", t, err) + return fmt.Errorf("unmarshalling type %T: %v", u, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TopQueries. -func (t TopQueries) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Usage. +func (u Usage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 TopQueries. -func (t *TopQueries) UnmarshalJSON(data []byte) error { +// 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", t, err) + return fmt.Errorf("unmarshalling type %T: %v", u, err) } for key, val := range rawMsg { var err error switch key { - case "aggregationFunction": - err = unpopulate(val, "AggregationFunction", &t.AggregationFunction) + case "currentValue": + err = unpopulate(val, "CurrentValue", &u.CurrentValue) delete(rawMsg, key) - case "endTime": - err = unpopulate(val, "EndTime", &t.EndTime) + case "id": + err = unpopulate(val, "ID", &u.ID) delete(rawMsg, key) - case "intervalType": - err = unpopulate(val, "IntervalType", &t.IntervalType) + case "limit": + err = unpopulate(val, "Limit", &u.Limit) delete(rawMsg, key) - case "numberOfQueries": - err = unpopulate(val, "NumberOfQueries", &t.NumberOfQueries) + case "name": + err = unpopulate(val, "Name", &u.Name) delete(rawMsg, key) - case "observationMetric": - err = unpopulate(val, "ObservationMetric", &t.ObservationMetric) + case "requestedLimit": + err = unpopulate(val, "RequestedLimit", &u.RequestedLimit) delete(rawMsg, key) - case "queries": - err = unpopulate(val, "Queries", &t.Queries) + case "type": + err = unpopulate(val, "Type", &u.Type) delete(rawMsg, key) - case "startTime": - err = unpopulate(val, "StartTime", &t.StartTime) + case "unit": + err = unpopulate(val, "Unit", &u.Unit) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", u, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TopQueriesListResult. -func (t TopQueriesListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type UsageListResult. +func (u UsageListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", t.NextLink) - populate(objectMap, "value", t.Value) + populate(objectMap, "nextLink", u.NextLink) + populate(objectMap, "value", u.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TopQueriesListResult. -func (t *TopQueriesListResult) UnmarshalJSON(data []byte) error { +// 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", t, err) + 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", &t.NextLink) + err = unpopulate(val, "NextLink", &u.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &t.Value) + err = unpopulate(val, "Value", &u.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", u, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type UserIdentity. +func (u UserIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "clientId", u.ClientID) + populate(objectMap, "principalId", u.PrincipalID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. -func (t *TrackedResource) UnmarshalJSON(data []byte) error { +// 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", t, err) + 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", &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) + case "clientId": + err = unpopulate(val, "ClientID", &u.ClientID) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &t.Type) + case "principalId": + err = unpopulate(val, "PrincipalID", &u.PrincipalID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", u, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TransparentDataEncryptionProperties. -func (t TransparentDataEncryptionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VaRule. +func (v VaRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "state", t.State) + populate(objectMap, "benchmarkReferences", v.BenchmarkReferences) + populate(objectMap, "category", v.Category) + populate(objectMap, "description", v.Description) + populate(objectMap, "queryCheck", v.QueryCheck) + populate(objectMap, "rationale", v.Rationale) + populate(objectMap, "ruleId", v.RuleID) + populate(objectMap, "ruleType", v.RuleType) + populate(objectMap, "severity", v.Severity) + populate(objectMap, "title", v.Title) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TransparentDataEncryptionProperties. -func (t *TransparentDataEncryptionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VaRule. +func (v *VaRule) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } for key, val := range rawMsg { var err error switch key { - case "state": - err = unpopulate(val, "State", &t.State) + case "benchmarkReferences": + err = unpopulate(val, "BenchmarkReferences", &v.BenchmarkReferences) + delete(rawMsg, key) + case "category": + err = unpopulate(val, "Category", &v.Category) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &v.Description) + delete(rawMsg, key) + case "queryCheck": + err = unpopulate(val, "QueryCheck", &v.QueryCheck) + delete(rawMsg, key) + case "rationale": + err = unpopulate(val, "Rationale", &v.Rationale) + delete(rawMsg, key) + case "ruleId": + err = unpopulate(val, "RuleID", &v.RuleID) + delete(rawMsg, key) + case "ruleType": + err = unpopulate(val, "RuleType", &v.RuleType) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &v.Severity) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &v.Title) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type UpdateLongTermRetentionBackupParameters. -func (u UpdateLongTermRetentionBackupParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VirtualCluster. +func (v VirtualCluster) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", u.Properties) + 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 UpdateLongTermRetentionBackupParameters. -func (u *UpdateLongTermRetentionBackupParameters) UnmarshalJSON(data []byte) error { +// 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", u, err) + 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", &u.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", u, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type UpdateLongTermRetentionBackupParametersProperties. -func (u UpdateLongTermRetentionBackupParametersProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VirtualClusterDNSServersProperties. +func (v VirtualClusterDNSServersProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "requestedBackupStorageRedundancy", u.RequestedBackupStorageRedundancy) + populate(objectMap, "status", v.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateLongTermRetentionBackupParametersProperties. -func (u *UpdateLongTermRetentionBackupParametersProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualClusterDNSServersProperties. +func (v *VirtualClusterDNSServersProperties) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } for key, val := range rawMsg { var err error switch key { - case "requestedBackupStorageRedundancy": - err = unpopulate(val, "RequestedBackupStorageRedundancy", &u.RequestedBackupStorageRedundancy) + case "status": + err = unpopulate(val, "Status", &v.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type UpdateManagedInstanceDNSServersOperation. -func (u UpdateManagedInstanceDNSServersOperation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VirtualClusterListResult. +func (v VirtualClusterListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", u.ID) - populate(objectMap, "name", u.Name) - populate(objectMap, "properties", u.Properties) - populate(objectMap, "type", u.Type) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateManagedInstanceDNSServersOperation. -func (u *UpdateManagedInstanceDNSServersOperation) UnmarshalJSON(data []byte) error { +// 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", u, err) + 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", &u.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &u.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &u.Properties) + case "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &u.Type) + case "value": + err = unpopulate(val, "Value", &v.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type UpsertManagedServerOperationParameters. -func (u UpsertManagedServerOperationParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VirtualClusterProperties. +func (v VirtualClusterProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "family", u.Family) - populate(objectMap, "storageSizeInGB", u.StorageSizeInGB) - populate(objectMap, "tier", u.Tier) - populate(objectMap, "vCores", u.VCores) + populate(objectMap, "childResources", v.ChildResources) + populate(objectMap, "subnetId", v.SubnetID) + populate(objectMap, "version", v.Version) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type UpsertManagedServerOperationParameters. -func (u *UpsertManagedServerOperationParameters) UnmarshalJSON(data []byte) error { +// 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", u, err) + return fmt.Errorf("unmarshalling type %T: %v", v, 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) + case "childResources": + err = unpopulate(val, "ChildResources", &v.ChildResources) delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &u.Tier) + case "subnetId": + err = unpopulate(val, "SubnetID", &v.SubnetID) delete(rawMsg, key) - case "vCores": - err = unpopulate(val, "VCores", &u.VCores) + case "version": + err = unpopulate(val, "Version", &v.Version) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type UpsertManagedServerOperationStep. -func (u UpsertManagedServerOperationStep) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VirtualClusterUpdate. +func (v VirtualClusterUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", u.Name) - populate(objectMap, "order", u.Order) - populate(objectMap, "status", u.Status) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "tags", v.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type UpsertManagedServerOperationStep. -func (u *UpsertManagedServerOperationStep) UnmarshalJSON(data []byte) error { +// 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", u, err) + return fmt.Errorf("unmarshalling type %T: %v", v, 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) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &u.Status) + case "tags": + err = unpopulate(val, "Tags", &v.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Usage. -func (u Usage) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRule. +func (v VirtualNetworkRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + 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 Usage. -func (u *Usage) UnmarshalJSON(data []byte) error { +// 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", u, err) + return fmt.Errorf("unmarshalling type %T: %v", v, 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) + err = unpopulate(val, "ID", &v.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &u.Name) + err = unpopulate(val, "Name", &v.Name) delete(rawMsg, key) - case "requestedLimit": - err = unpopulate(val, "RequestedLimit", &u.RequestedLimit) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &u.Type) - delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &u.Unit) + err = unpopulate(val, "Type", &v.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type UsageListResult. -func (u UsageListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRuleListResult. +func (v VirtualNetworkRuleListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", u.NextLink) - populate(objectMap, "value", u.Value) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type UsageListResult. -func (u *UsageListResult) UnmarshalJSON(data []byte) error { +// 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", u, err) + 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", &u.NextLink) + err = unpopulate(val, "NextLink", &v.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &u.Value) + err = unpopulate(val, "Value", &v.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type UserIdentity. -func (u UserIdentity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRuleProperties. +func (v VirtualNetworkRuleProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientId", u.ClientID) - populate(objectMap, "principalId", u.PrincipalID) + 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 UserIdentity. -func (u *UserIdentity) UnmarshalJSON(data []byte) error { +// 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", u, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } for key, val := range rawMsg { var err error switch key { - case "clientId": - err = unpopulate(val, "ClientID", &u.ClientID) + case "ignoreMissingVnetServiceEndpoint": + err = unpopulate(val, "IgnoreMissingVnetServiceEndpoint", &v.IgnoreMissingVnetServiceEndpoint) delete(rawMsg, key) - case "principalId": - err = unpopulate(val, "PrincipalID", &u.PrincipalID) + 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", u, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type VirtualCluster. -func (v VirtualCluster) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessment. +func (v VulnerabilityAssessment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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, "systemData", v.SystemData) 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 { +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessment. +func (v *VulnerabilityAssessment) UnmarshalJSON(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) @@ -17653,17 +20162,14 @@ func (v *VirtualCluster) UnmarshalJSON(data []byte) error { 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) + case "systemData": + err = unpopulate(val, "SystemData", &v.SystemData) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &v.Type) @@ -17676,16 +20182,16 @@ func (v *VirtualCluster) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type VirtualClusterListResult. -func (v VirtualClusterListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentListResult. +func (v VulnerabilityAssessmentListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentListResult. +func (v *VulnerabilityAssessmentListResult) UnmarshalJSON(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) @@ -17707,18 +20213,44 @@ func (v *VirtualClusterListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type VirtualClusterProperties. -func (v VirtualClusterProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentPolicyProperties. +func (v VulnerabilityAssessmentPolicyProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "childResources", v.ChildResources) - populate(objectMap, "family", v.Family) - populate(objectMap, "maintenanceConfigurationId", v.MaintenanceConfigurationID) - populate(objectMap, "subnetId", v.SubnetID) + populate(objectMap, "state", v.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentPolicyProperties. +func (v *VulnerabilityAssessmentPolicyProperties) UnmarshalJSON(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 "state": + err = unpopulate(val, "State", &v.State) + 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]any) + 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 VirtualClusterProperties. -func (v *VirtualClusterProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -17726,17 +20258,14 @@ func (v *VirtualClusterProperties) UnmarshalJSON(data []byte) error { 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) + case "emailSubscriptionAdmins": + err = unpopulate(val, "EmailSubscriptionAdmins", &v.EmailSubscriptionAdmins) delete(rawMsg, key) - case "maintenanceConfigurationId": - err = unpopulate(val, "MaintenanceConfigurationID", &v.MaintenanceConfigurationID) + case "emails": + err = unpopulate(val, "Emails", &v.Emails) delete(rawMsg, key) - case "subnetId": - err = unpopulate(val, "SubnetID", &v.SubnetID) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &v.IsEnabled) delete(rawMsg, key) } if err != nil { @@ -17746,16 +20275,16 @@ func (v *VirtualClusterProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type VirtualClusterUpdate. -func (v VirtualClusterUpdate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanError. +func (v VulnerabilityAssessmentScanError) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) + populate(objectMap, "code", v.Code) + populate(objectMap, "message", v.Message) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualClusterUpdate. -func (v *VirtualClusterUpdate) UnmarshalJSON(data []byte) error { +// 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) @@ -17763,11 +20292,11 @@ func (v *VirtualClusterUpdate) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &v.Properties) + case "code": + err = unpopulate(val, "Code", &v.Code) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) + case "message": + err = unpopulate(val, "Message", &v.Message) delete(rawMsg, key) } if err != nil { @@ -17777,18 +20306,16 @@ func (v *VirtualClusterUpdate) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRule. -func (v VirtualNetworkRule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanForSQLError. +func (v VulnerabilityAssessmentScanForSQLError) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "type", v.Type) + populate(objectMap, "code", v.Code) + populate(objectMap, "message", v.Message) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkRule. -func (v *VirtualNetworkRule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanForSQLError. +func (v *VulnerabilityAssessmentScanForSQLError) UnmarshalJSON(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) @@ -17796,17 +20323,11 @@ func (v *VirtualNetworkRule) UnmarshalJSON(data []byte) error { 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) + case "code": + err = unpopulate(val, "Code", &v.Code) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) + case "message": + err = unpopulate(val, "Message", &v.Message) delete(rawMsg, key) } if err != nil { @@ -17816,16 +20337,16 @@ func (v *VirtualNetworkRule) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRuleListResult. -func (v VirtualNetworkRuleListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanListResult. +func (v VulnerabilityAssessmentScanListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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 { +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanListResult. +func (v *VulnerabilityAssessmentScanListResult) UnmarshalJSON(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) @@ -17847,17 +20368,18 @@ func (v *VirtualNetworkRuleListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRuleProperties. -func (v VirtualNetworkRuleProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanRecord. +func (v VulnerabilityAssessmentScanRecord) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "ignoreMissingVnetServiceEndpoint", v.IgnoreMissingVnetServiceEndpoint) - populate(objectMap, "state", v.State) - populate(objectMap, "virtualNetworkSubnetId", v.VirtualNetworkSubnetID) + 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 VirtualNetworkRuleProperties. -func (v *VirtualNetworkRuleProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -17865,14 +20387,17 @@ func (v *VirtualNetworkRuleProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "ignoreMissingVnetServiceEndpoint": - err = unpopulate(val, "IgnoreMissingVnetServiceEndpoint", &v.IgnoreMissingVnetServiceEndpoint) + case "id": + err = unpopulate(val, "ID", &v.ID) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &v.State) + case "name": + err = unpopulate(val, "Name", &v.Name) delete(rawMsg, key) - case "virtualNetworkSubnetId": - err = unpopulate(val, "VirtualNetworkSubnetID", &v.VirtualNetworkSubnetID) + 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 { @@ -17882,17 +20407,19 @@ func (v *VirtualNetworkRuleProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentRecurringScansProperties. -func (v VulnerabilityAssessmentRecurringScansProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanRecordForSQL. +func (v VulnerabilityAssessmentScanRecordForSQL) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "emailSubscriptionAdmins", v.EmailSubscriptionAdmins) - populate(objectMap, "emails", v.Emails) - populate(objectMap, "isEnabled", v.IsEnabled) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "systemData", v.SystemData) + populate(objectMap, "type", v.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentRecurringScansProperties. -func (v *VulnerabilityAssessmentRecurringScansProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanRecordForSQL. +func (v *VulnerabilityAssessmentScanRecordForSQL) UnmarshalJSON(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) @@ -17900,14 +20427,20 @@ func (v *VulnerabilityAssessmentRecurringScansProperties) UnmarshalJSON(data []b for key, val := range rawMsg { var err error switch key { - case "emailSubscriptionAdmins": - err = unpopulate(val, "EmailSubscriptionAdmins", &v.EmailSubscriptionAdmins) + case "id": + err = unpopulate(val, "ID", &v.ID) delete(rawMsg, key) - case "emails": - err = unpopulate(val, "Emails", &v.Emails) + case "name": + err = unpopulate(val, "Name", &v.Name) delete(rawMsg, key) - case "isEnabled": - err = unpopulate(val, "IsEnabled", &v.IsEnabled) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &v.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) delete(rawMsg, key) } if err != nil { @@ -17917,16 +20450,16 @@ func (v *VulnerabilityAssessmentRecurringScansProperties) UnmarshalJSON(data []b return nil } -// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanError. -func (v VulnerabilityAssessmentScanError) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanRecordForSQLListResult. +func (v VulnerabilityAssessmentScanRecordForSQLListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "code", v.Code) - populate(objectMap, "message", v.Message) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanError. -func (v *VulnerabilityAssessmentScanError) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanRecordForSQLListResult. +func (v *VulnerabilityAssessmentScanRecordForSQLListResult) UnmarshalJSON(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) @@ -17934,11 +20467,11 @@ func (v *VulnerabilityAssessmentScanError) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "code": - err = unpopulate(val, "Code", &v.Code) + case "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &v.Message) + case "value": + err = unpopulate(val, "Value", &v.Value) delete(rawMsg, key) } if err != nil { @@ -17948,18 +20481,31 @@ func (v *VulnerabilityAssessmentScanError) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanRecord. -func (v VulnerabilityAssessmentScanRecord) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanRecordForSQLProperties. +func (v VulnerabilityAssessmentScanRecordForSQLProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "type", v.Type) + populate(objectMap, "database", v.Database) + populateTimeRFC3339(objectMap, "endTime", v.EndTime) + populate(objectMap, "errors", v.Errors) + populate(objectMap, "highSeverityFailedRulesCount", v.HighSeverityFailedRulesCount) + populate(objectMap, "isBaselineApplied", v.IsBaselineApplied) + populateTimeRFC3339(objectMap, "lastScanTime", v.LastScanTime) + populate(objectMap, "lowSeverityFailedRulesCount", v.LowSeverityFailedRulesCount) + populate(objectMap, "mediumSeverityFailedRulesCount", v.MediumSeverityFailedRulesCount) + populate(objectMap, "sqlVersion", v.SQLVersion) + populate(objectMap, "scanId", v.ScanID) + populate(objectMap, "server", v.Server) + populateTimeRFC3339(objectMap, "startTime", v.StartTime) + populate(objectMap, "state", v.State) + populate(objectMap, "totalFailedRulesCount", v.TotalFailedRulesCount) + populate(objectMap, "totalPassedRulesCount", v.TotalPassedRulesCount) + populate(objectMap, "totalRulesCount", v.TotalRulesCount) + populate(objectMap, "triggerType", v.TriggerType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanRecord. -func (v *VulnerabilityAssessmentScanRecord) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanRecordForSQLProperties. +func (v *VulnerabilityAssessmentScanRecordForSQLProperties) UnmarshalJSON(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) @@ -17967,17 +20513,56 @@ func (v *VulnerabilityAssessmentScanRecord) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &v.ID) + case "database": + err = unpopulate(val, "Database", &v.Database) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &v.EndTime) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) + case "errors": + err = unpopulate(val, "Errors", &v.Errors) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) + case "highSeverityFailedRulesCount": + err = unpopulate(val, "HighSeverityFailedRulesCount", &v.HighSeverityFailedRulesCount) + delete(rawMsg, key) + case "isBaselineApplied": + err = unpopulate(val, "IsBaselineApplied", &v.IsBaselineApplied) + delete(rawMsg, key) + case "lastScanTime": + err = unpopulateTimeRFC3339(val, "LastScanTime", &v.LastScanTime) + delete(rawMsg, key) + case "lowSeverityFailedRulesCount": + err = unpopulate(val, "LowSeverityFailedRulesCount", &v.LowSeverityFailedRulesCount) + delete(rawMsg, key) + case "mediumSeverityFailedRulesCount": + err = unpopulate(val, "MediumSeverityFailedRulesCount", &v.MediumSeverityFailedRulesCount) + delete(rawMsg, key) + case "sqlVersion": + err = unpopulate(val, "SQLVersion", &v.SQLVersion) + delete(rawMsg, key) + case "scanId": + err = unpopulate(val, "ScanID", &v.ScanID) + delete(rawMsg, key) + case "server": + err = unpopulate(val, "Server", &v.Server) + 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 "totalFailedRulesCount": + err = unpopulate(val, "TotalFailedRulesCount", &v.TotalFailedRulesCount) + delete(rawMsg, key) + case "totalPassedRulesCount": + err = unpopulate(val, "TotalPassedRulesCount", &v.TotalPassedRulesCount) + delete(rawMsg, key) + case "totalRulesCount": + err = unpopulate(val, "TotalRulesCount", &v.TotalRulesCount) + delete(rawMsg, key) + case "triggerType": + err = unpopulate(val, "TriggerType", &v.TriggerType) delete(rawMsg, key) } if err != nil { @@ -18073,6 +20658,104 @@ func (v *VulnerabilityAssessmentScanRecordProperties) UnmarshalJSON(data []byte) return nil } +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanResultProperties. +func (v VulnerabilityAssessmentScanResultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "baselineAdjustedResult", v.BaselineAdjustedResult) + populate(objectMap, "errorMessage", v.ErrorMessage) + populate(objectMap, "isTrimmed", v.IsTrimmed) + populate(objectMap, "queryResults", v.QueryResults) + populate(objectMap, "remediation", v.Remediation) + populate(objectMap, "ruleId", v.RuleID) + populate(objectMap, "ruleMetadata", v.RuleMetadata) + populate(objectMap, "status", v.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanResultProperties. +func (v *VulnerabilityAssessmentScanResultProperties) UnmarshalJSON(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 "baselineAdjustedResult": + err = unpopulate(val, "BaselineAdjustedResult", &v.BaselineAdjustedResult) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &v.ErrorMessage) + delete(rawMsg, key) + case "isTrimmed": + err = unpopulate(val, "IsTrimmed", &v.IsTrimmed) + delete(rawMsg, key) + case "queryResults": + err = unpopulate(val, "QueryResults", &v.QueryResults) + delete(rawMsg, key) + case "remediation": + err = unpopulate(val, "Remediation", &v.Remediation) + delete(rawMsg, key) + case "ruleId": + err = unpopulate(val, "RuleID", &v.RuleID) + delete(rawMsg, key) + case "ruleMetadata": + err = unpopulate(val, "RuleMetadata", &v.RuleMetadata) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &v.Status) + 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 VulnerabilityAssessmentScanResults. +func (v VulnerabilityAssessmentScanResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "systemData", v.SystemData) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanResults. +func (v *VulnerabilityAssessmentScanResults) UnmarshalJSON(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 "systemData": + err = unpopulate(val, "SystemData", &v.SystemData) + 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 WorkloadClassifier. func (w WorkloadClassifier) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/sql/armsql/operations_client.go b/sdk/resourcemanager/sql/armsql/operations_client.go index ed850b20b5f1..4a77e239fc18 100644 --- a/sdk/resourcemanager/sql/armsql/operations_client.go +++ b/sdk/resourcemanager/sql/armsql/operations_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // 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/options.go b/sdk/resourcemanager/sql/armsql/options.go new file mode 100644 index 000000000000..6856976468c2 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/options.go @@ -0,0 +1,3401 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import "time" + +// AgentClientCreateOrUpdateOptions contains the optional parameters for the AgentClient.CreateOrUpdate method. +type AgentClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// AgentClientGetOptions contains the optional parameters for the AgentClient.Get method. +type AgentClientGetOptions struct { + // placeholder for future optional parameters +} + +// BackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate +// method. +type BackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BackupShortTermRetentionPoliciesClientBeginUpdateOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.BeginUpdate +// method. +type BackupShortTermRetentionPoliciesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BackupShortTermRetentionPoliciesClientGetOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.Get +// method. +type BackupShortTermRetentionPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// BackupShortTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.NewListByDatabasePager +// method. +type BackupShortTermRetentionPoliciesClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// CapabilitiesClientListByLocationOptions contains the optional parameters for the CapabilitiesClient.ListByLocation method. +type CapabilitiesClientListByLocationOptions struct { + // If specified, restricts the response to only include the selected item. + Include *CapabilityGroup +} + +// DataMaskingPoliciesClientCreateOrUpdateOptions contains the optional parameters for the DataMaskingPoliciesClient.CreateOrUpdate +// method. +type DataMaskingPoliciesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// DataMaskingPoliciesClientGetOptions contains the optional parameters for the DataMaskingPoliciesClient.Get method. +type DataMaskingPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// DataMaskingRulesClientCreateOrUpdateOptions contains the optional parameters for the DataMaskingRulesClient.CreateOrUpdate +// method. +type DataMaskingRulesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// DataMaskingRulesClientListByDatabaseOptions contains the optional parameters for the DataMaskingRulesClient.NewListByDatabasePager +// method. +type DataMaskingRulesClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// DataWarehouseUserActivitiesClientGetOptions contains the optional parameters for the DataWarehouseUserActivitiesClient.Get +// method. +type DataWarehouseUserActivitiesClientGetOptions struct { + // placeholder for future optional parameters +} + +// DataWarehouseUserActivitiesClientListByDatabaseOptions contains the optional parameters for the DataWarehouseUserActivitiesClient.NewListByDatabasePager +// method. +type DataWarehouseUserActivitiesClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// DatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateOptions contains the optional parameters for the DatabaseAdvancedThreatProtectionSettingsClient.CreateOrUpdate +// method. +type DatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// DatabaseAdvancedThreatProtectionSettingsClientGetOptions contains the optional parameters for the DatabaseAdvancedThreatProtectionSettingsClient.Get +// method. +type DatabaseAdvancedThreatProtectionSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatabaseAdvancedThreatProtectionSettingsClientListByDatabaseOptions contains the optional parameters for the DatabaseAdvancedThreatProtectionSettingsClient.NewListByDatabasePager +// method. +type DatabaseAdvancedThreatProtectionSettingsClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// DatabaseAdvisorsClientGetOptions contains the optional parameters for the DatabaseAdvisorsClient.Get method. +type DatabaseAdvisorsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatabaseAdvisorsClientListByDatabaseOptions contains the optional parameters for the DatabaseAdvisorsClient.ListByDatabase +// method. +type DatabaseAdvisorsClientListByDatabaseOptions struct { + // The child resources to include in the response. + Expand *string +} + +// DatabaseAdvisorsClientUpdateOptions contains the optional parameters for the DatabaseAdvisorsClient.Update method. +type DatabaseAdvisorsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// DatabaseAutomaticTuningClientGetOptions contains the optional parameters for the DatabaseAutomaticTuningClient.Get method. +type DatabaseAutomaticTuningClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatabaseAutomaticTuningClientUpdateOptions contains the optional parameters for the DatabaseAutomaticTuningClient.Update +// method. +type DatabaseAutomaticTuningClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// DatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions contains the optional parameters for the DatabaseBlobAuditingPoliciesClient.CreateOrUpdate +// method. +type DatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// DatabaseBlobAuditingPoliciesClientGetOptions contains the optional parameters for the DatabaseBlobAuditingPoliciesClient.Get +// method. +type DatabaseBlobAuditingPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatabaseBlobAuditingPoliciesClientListByDatabaseOptions contains the optional parameters for the DatabaseBlobAuditingPoliciesClient.NewListByDatabasePager +// method. +type DatabaseBlobAuditingPoliciesClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// DatabaseColumnsClientGetOptions contains the optional parameters for the DatabaseColumnsClient.Get method. +type DatabaseColumnsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatabaseColumnsClientListByDatabaseOptions contains the optional parameters for the DatabaseColumnsClient.NewListByDatabasePager +// method. +type DatabaseColumnsClientListByDatabaseOptions struct { + Column []string + OrderBy []string + Schema []string + + // An opaque token that identifies a starting point in the collection. + Skiptoken *string + Table []string +} + +// DatabaseColumnsClientListByTableOptions contains the optional parameters for the DatabaseColumnsClient.NewListByTablePager +// method. +type DatabaseColumnsClientListByTableOptions struct { + // An OData filter expression that filters elements in the collection. + Filter *string +} + +// DatabaseEncryptionProtectorsClientBeginRevalidateOptions contains the optional parameters for the DatabaseEncryptionProtectorsClient.BeginRevalidate +// method. +type DatabaseEncryptionProtectorsClientBeginRevalidateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabaseEncryptionProtectorsClientBeginRevertOptions contains the optional parameters for the DatabaseEncryptionProtectorsClient.BeginRevert +// method. +type DatabaseEncryptionProtectorsClientBeginRevertOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabaseExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabaseExtensionsClient.BeginCreateOrUpdate +// method. +type DatabaseExtensionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabaseExtensionsClientGetOptions contains the optional parameters for the DatabaseExtensionsClient.Get method. +type DatabaseExtensionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatabaseExtensionsClientListByDatabaseOptions contains the optional parameters for the DatabaseExtensionsClient.NewListByDatabasePager +// method. +type DatabaseExtensionsClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// DatabaseOperationsClientCancelOptions contains the optional parameters for the DatabaseOperationsClient.Cancel method. +type DatabaseOperationsClientCancelOptions struct { + // placeholder for future optional parameters +} + +// DatabaseOperationsClientListByDatabaseOptions contains the optional parameters for the DatabaseOperationsClient.NewListByDatabasePager +// method. +type DatabaseOperationsClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// DatabaseRecommendedActionsClientGetOptions contains the optional parameters for the DatabaseRecommendedActionsClient.Get +// method. +type DatabaseRecommendedActionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatabaseRecommendedActionsClientListByDatabaseAdvisorOptions contains the optional parameters for the DatabaseRecommendedActionsClient.ListByDatabaseAdvisor +// method. +type DatabaseRecommendedActionsClientListByDatabaseAdvisorOptions struct { + // placeholder for future optional parameters +} + +// DatabaseRecommendedActionsClientUpdateOptions contains the optional parameters for the DatabaseRecommendedActionsClient.Update +// method. +type DatabaseRecommendedActionsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentBaselinesClient.CreateOrUpdate +// method. +type DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSQLVulnerabilityAssessmentBaselinesClientGetOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentBaselinesClient.Get +// method. +type DatabaseSQLVulnerabilityAssessmentBaselinesClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentOptions contains the optional parameters +// for the DatabaseSQLVulnerabilityAssessmentBaselinesClient.NewListBySQLVulnerabilityAssessmentPager method. +type DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSQLVulnerabilityAssessmentExecuteScanClientBeginExecuteOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentExecuteScanClient.BeginExecute +// method. +type DatabaseSQLVulnerabilityAssessmentExecuteScanClientBeginExecuteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate +// method. +type DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.Delete +// method. +type DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.Get +// method. +type DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.NewListByBaselinePager +// method. +type DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSQLVulnerabilityAssessmentScanResultClientGetOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentScanResultClient.Get +// method. +type DatabaseSQLVulnerabilityAssessmentScanResultClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentScanResultClient.NewListByScanPager +// method. +type DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSQLVulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentScansClient.Get +// method. +type DatabaseSQLVulnerabilityAssessmentScansClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsOptions contains the optional parameters +// for the DatabaseSQLVulnerabilityAssessmentScansClient.NewListBySQLVulnerabilityAssessmentsPager method. +type DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSQLVulnerabilityAssessmentsSettingsClientGetOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentsSettingsClient.Get +// method. +type DatabaseSQLVulnerabilityAssessmentsSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentsSettingsClient.NewListByDatabasePager +// method. +type DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSchemasClientGetOptions contains the optional parameters for the DatabaseSchemasClient.Get method. +type DatabaseSchemasClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSchemasClientListByDatabaseOptions contains the optional parameters for the DatabaseSchemasClient.NewListByDatabasePager +// method. +type DatabaseSchemasClientListByDatabaseOptions struct { + // An OData filter expression that filters elements in the collection. + Filter *string +} + +// DatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions contains the optional parameters for the DatabaseSecurityAlertPoliciesClient.CreateOrUpdate +// method. +type DatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSecurityAlertPoliciesClientGetOptions contains the optional parameters for the DatabaseSecurityAlertPoliciesClient.Get +// method. +type DatabaseSecurityAlertPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSecurityAlertPoliciesClientListByDatabaseOptions contains the optional parameters for the DatabaseSecurityAlertPoliciesClient.NewListByDatabasePager +// method. +type DatabaseSecurityAlertPoliciesClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// DatabaseTablesClientGetOptions contains the optional parameters for the DatabaseTablesClient.Get method. +type DatabaseTablesClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatabaseTablesClientListBySchemaOptions contains the optional parameters for the DatabaseTablesClient.NewListBySchemaPager +// method. +type DatabaseTablesClientListBySchemaOptions struct { + // An OData filter expression that filters elements in the collection. + Filter *string +} + +// DatabaseUsagesClientListByDatabaseOptions contains the optional parameters for the DatabaseUsagesClient.NewListByDatabasePager +// method. +type DatabaseUsagesClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate +// method. +type DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// DatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentRuleBaselinesClient.Delete +// method. +type DatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// DatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentRuleBaselinesClient.Get +// method. +type DatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.BeginInitiateScan +// method. +type DatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabaseVulnerabilityAssessmentScansClientExportOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.Export +// method. +type DatabaseVulnerabilityAssessmentScansClientExportOptions struct { + // placeholder for future optional parameters +} + +// DatabaseVulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.Get +// method. +type DatabaseVulnerabilityAssessmentScansClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.NewListByDatabasePager +// method. +type DatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// DatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.CreateOrUpdate +// method. +type DatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// DatabaseVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.Delete +// method. +type DatabaseVulnerabilityAssessmentsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// DatabaseVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.Get +// method. +type DatabaseVulnerabilityAssessmentsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatabaseVulnerabilityAssessmentsClientListByDatabaseOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.NewListByDatabasePager +// method. +type DatabaseVulnerabilityAssessmentsClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// DatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabasesClient.BeginCreateOrUpdate +// method. +type DatabasesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabasesClientBeginDeleteOptions contains the optional parameters for the DatabasesClient.BeginDelete method. +type DatabasesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabasesClientBeginExportOptions contains the optional parameters for the DatabasesClient.BeginExport method. +type DatabasesClientBeginExportOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabasesClientBeginFailoverOptions contains the optional parameters for the DatabasesClient.BeginFailover method. +type DatabasesClientBeginFailoverOptions struct { + // The type of replica to be failed over. + ReplicaType *ReplicaType + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabasesClientBeginImportOptions contains the optional parameters for the DatabasesClient.BeginImport method. +type DatabasesClientBeginImportOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabasesClientBeginPauseOptions contains the optional parameters for the DatabasesClient.BeginPause method. +type DatabasesClientBeginPauseOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabasesClientBeginResumeOptions contains the optional parameters for the DatabasesClient.BeginResume method. +type DatabasesClientBeginResumeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabasesClientBeginUpdateOptions contains the optional parameters for the DatabasesClient.BeginUpdate method. +type DatabasesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabasesClientBeginUpgradeDataWarehouseOptions contains the optional parameters for the DatabasesClient.BeginUpgradeDataWarehouse +// method. +type DatabasesClientBeginUpgradeDataWarehouseOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabasesClientGetOptions contains the optional parameters for the DatabasesClient.Get method. +type DatabasesClientGetOptions struct { + // The child resources to include in the response. + Expand *string + + // An OData filter expression that filters elements in the collection. + Filter *string +} + +// DatabasesClientListByElasticPoolOptions contains the optional parameters for the DatabasesClient.NewListByElasticPoolPager +// method. +type DatabasesClientListByElasticPoolOptions struct { + // placeholder for future optional parameters +} + +// DatabasesClientListByServerOptions contains the optional parameters for the DatabasesClient.NewListByServerPager method. +type DatabasesClientListByServerOptions struct { + SkipToken *string +} + +// DatabasesClientListInaccessibleByServerOptions contains the optional parameters for the DatabasesClient.NewListInaccessibleByServerPager +// method. +type DatabasesClientListInaccessibleByServerOptions struct { + // placeholder for future optional parameters +} + +// DatabasesClientListMetricDefinitionsOptions contains the optional parameters for the DatabasesClient.NewListMetricDefinitionsPager +// method. +type DatabasesClientListMetricDefinitionsOptions struct { + // placeholder for future optional parameters +} + +// DatabasesClientListMetricsOptions contains the optional parameters for the DatabasesClient.NewListMetricsPager method. +type DatabasesClientListMetricsOptions struct { + // placeholder for future optional parameters +} + +// DatabasesClientRenameOptions contains the optional parameters for the DatabasesClient.Rename method. +type DatabasesClientRenameOptions struct { + // placeholder for future optional parameters +} + +// DeletedServersClientBeginRecoverOptions contains the optional parameters for the DeletedServersClient.BeginRecover method. +type DeletedServersClientBeginRecoverOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DeletedServersClientGetOptions contains the optional parameters for the DeletedServersClient.Get method. +type DeletedServersClientGetOptions struct { + // placeholder for future optional parameters +} + +// DeletedServersClientListByLocationOptions contains the optional parameters for the DeletedServersClient.NewListByLocationPager +// method. +type DeletedServersClientListByLocationOptions struct { + // placeholder for future optional parameters +} + +// DeletedServersClientListOptions contains the optional parameters for the DeletedServersClient.NewListPager method. +type DeletedServersClientListOptions struct { + // placeholder for future optional parameters +} + +// DistributedAvailabilityGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.BeginCreateOrUpdate +// method. +type DistributedAvailabilityGroupsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DistributedAvailabilityGroupsClientBeginDeleteOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.BeginDelete +// method. +type DistributedAvailabilityGroupsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DistributedAvailabilityGroupsClientBeginUpdateOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.BeginUpdate +// method. +type DistributedAvailabilityGroupsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DistributedAvailabilityGroupsClientGetOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.Get +// method. +type DistributedAvailabilityGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DistributedAvailabilityGroupsClientListByInstanceOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.NewListByInstancePager +// method. +type DistributedAvailabilityGroupsClientListByInstanceOptions struct { + // placeholder for future optional parameters +} + +// ElasticPoolActivitiesClientListByElasticPoolOptions contains the optional parameters for the ElasticPoolActivitiesClient.NewListByElasticPoolPager +// method. +type ElasticPoolActivitiesClientListByElasticPoolOptions struct { + // placeholder for future optional parameters +} + +// ElasticPoolDatabaseActivitiesClientListByElasticPoolOptions contains the optional parameters for the ElasticPoolDatabaseActivitiesClient.NewListByElasticPoolPager +// method. +type ElasticPoolDatabaseActivitiesClientListByElasticPoolOptions struct { + // placeholder for future optional parameters +} + +// ElasticPoolOperationsClientCancelOptions contains the optional parameters for the ElasticPoolOperationsClient.Cancel method. +type ElasticPoolOperationsClientCancelOptions struct { + // placeholder for future optional parameters +} + +// ElasticPoolOperationsClientListByElasticPoolOptions contains the optional parameters for the ElasticPoolOperationsClient.NewListByElasticPoolPager +// method. +type ElasticPoolOperationsClientListByElasticPoolOptions struct { + // placeholder for future optional parameters +} + +// ElasticPoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the ElasticPoolsClient.BeginCreateOrUpdate +// method. +type ElasticPoolsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ElasticPoolsClientBeginDeleteOptions contains the optional parameters for the ElasticPoolsClient.BeginDelete method. +type ElasticPoolsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ElasticPoolsClientBeginFailoverOptions contains the optional parameters for the ElasticPoolsClient.BeginFailover method. +type ElasticPoolsClientBeginFailoverOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ElasticPoolsClientBeginUpdateOptions contains the optional parameters for the ElasticPoolsClient.BeginUpdate method. +type ElasticPoolsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ElasticPoolsClientGetOptions contains the optional parameters for the ElasticPoolsClient.Get method. +type ElasticPoolsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ElasticPoolsClientListByServerOptions contains the optional parameters for the ElasticPoolsClient.NewListByServerPager +// method. +type ElasticPoolsClientListByServerOptions struct { + // The number of elements in the collection to skip. + Skip *int64 +} + +// ElasticPoolsClientListMetricDefinitionsOptions contains the optional parameters for the ElasticPoolsClient.NewListMetricDefinitionsPager +// method. +type ElasticPoolsClientListMetricDefinitionsOptions struct { + // placeholder for future optional parameters +} + +// ElasticPoolsClientListMetricsOptions contains the optional parameters for the ElasticPoolsClient.NewListMetricsPager method. +type ElasticPoolsClientListMetricsOptions struct { + // placeholder for future optional parameters +} + +// EncryptionProtectorsClientBeginCreateOrUpdateOptions contains the optional parameters for the EncryptionProtectorsClient.BeginCreateOrUpdate +// method. +type EncryptionProtectorsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// EncryptionProtectorsClientBeginRevalidateOptions contains the optional parameters for the EncryptionProtectorsClient.BeginRevalidate +// method. +type EncryptionProtectorsClientBeginRevalidateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// EncryptionProtectorsClientGetOptions contains the optional parameters for the EncryptionProtectorsClient.Get method. +type EncryptionProtectorsClientGetOptions struct { + // placeholder for future optional parameters +} + +// EncryptionProtectorsClientListByServerOptions contains the optional parameters for the EncryptionProtectorsClient.NewListByServerPager +// method. +type EncryptionProtectorsClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// EndpointCertificatesClientGetOptions contains the optional parameters for the EndpointCertificatesClient.Get method. +type EndpointCertificatesClientGetOptions struct { + // placeholder for future optional parameters +} + +// EndpointCertificatesClientListByInstanceOptions contains the optional parameters for the EndpointCertificatesClient.NewListByInstancePager +// method. +type EndpointCertificatesClientListByInstanceOptions struct { + // placeholder for future optional parameters +} + +// ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ExtendedDatabaseBlobAuditingPoliciesClient.CreateOrUpdate +// method. +type ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ExtendedDatabaseBlobAuditingPoliciesClientGetOptions contains the optional parameters for the ExtendedDatabaseBlobAuditingPoliciesClient.Get +// method. +type ExtendedDatabaseBlobAuditingPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseOptions contains the optional parameters for the ExtendedDatabaseBlobAuditingPoliciesClient.NewListByDatabasePager +// method. +type ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// ExtendedServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ExtendedServerBlobAuditingPoliciesClient.BeginCreateOrUpdate +// method. +type ExtendedServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExtendedServerBlobAuditingPoliciesClientGetOptions contains the optional parameters for the ExtendedServerBlobAuditingPoliciesClient.Get +// method. +type ExtendedServerBlobAuditingPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ExtendedServerBlobAuditingPoliciesClientListByServerOptions contains the optional parameters for the ExtendedServerBlobAuditingPoliciesClient.NewListByServerPager +// method. +type ExtendedServerBlobAuditingPoliciesClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// FailoverGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the FailoverGroupsClient.BeginCreateOrUpdate +// method. +type FailoverGroupsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FailoverGroupsClientBeginDeleteOptions contains the optional parameters for the FailoverGroupsClient.BeginDelete method. +type FailoverGroupsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FailoverGroupsClientBeginFailoverOptions contains the optional parameters for the FailoverGroupsClient.BeginFailover method. +type FailoverGroupsClientBeginFailoverOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FailoverGroupsClientBeginForceFailoverAllowDataLossOptions contains the optional parameters for the FailoverGroupsClient.BeginForceFailoverAllowDataLoss +// method. +type FailoverGroupsClientBeginForceFailoverAllowDataLossOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FailoverGroupsClientBeginTryPlannedBeforeForcedFailoverOptions contains the optional parameters for the FailoverGroupsClient.BeginTryPlannedBeforeForcedFailover +// method. +type FailoverGroupsClientBeginTryPlannedBeforeForcedFailoverOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FailoverGroupsClientBeginUpdateOptions contains the optional parameters for the FailoverGroupsClient.BeginUpdate method. +type FailoverGroupsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FailoverGroupsClientGetOptions contains the optional parameters for the FailoverGroupsClient.Get method. +type FailoverGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// FailoverGroupsClientListByServerOptions contains the optional parameters for the FailoverGroupsClient.NewListByServerPager +// method. +type FailoverGroupsClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// FirewallRulesClientCreateOrUpdateOptions contains the optional parameters for the FirewallRulesClient.CreateOrUpdate method. +type FirewallRulesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// FirewallRulesClientDeleteOptions contains the optional parameters for the FirewallRulesClient.Delete method. +type FirewallRulesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// FirewallRulesClientGetOptions contains the optional parameters for the FirewallRulesClient.Get method. +type FirewallRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// FirewallRulesClientListByServerOptions contains the optional parameters for the FirewallRulesClient.NewListByServerPager +// method. +type FirewallRulesClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// FirewallRulesClientReplaceOptions contains the optional parameters for the FirewallRulesClient.Replace method. +type FirewallRulesClientReplaceOptions struct { + // placeholder for future optional parameters +} + +// GeoBackupPoliciesClientCreateOrUpdateOptions contains the optional parameters for the GeoBackupPoliciesClient.CreateOrUpdate +// method. +type GeoBackupPoliciesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// GeoBackupPoliciesClientGetOptions contains the optional parameters for the GeoBackupPoliciesClient.Get method. +type GeoBackupPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// GeoBackupPoliciesClientListByDatabaseOptions contains the optional parameters for the GeoBackupPoliciesClient.NewListByDatabasePager +// method. +type GeoBackupPoliciesClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// IPv6FirewallRulesClientCreateOrUpdateOptions contains the optional parameters for the IPv6FirewallRulesClient.CreateOrUpdate +// method. +type IPv6FirewallRulesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// IPv6FirewallRulesClientDeleteOptions contains the optional parameters for the IPv6FirewallRulesClient.Delete method. +type IPv6FirewallRulesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// IPv6FirewallRulesClientGetOptions contains the optional parameters for the IPv6FirewallRulesClient.Get method. +type IPv6FirewallRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// IPv6FirewallRulesClientListByServerOptions contains the optional parameters for the IPv6FirewallRulesClient.NewListByServerPager +// method. +type IPv6FirewallRulesClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// InstanceFailoverGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the InstanceFailoverGroupsClient.BeginCreateOrUpdate +// method. +type InstanceFailoverGroupsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InstanceFailoverGroupsClientBeginDeleteOptions contains the optional parameters for the InstanceFailoverGroupsClient.BeginDelete +// method. +type InstanceFailoverGroupsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InstanceFailoverGroupsClientBeginFailoverOptions contains the optional parameters for the InstanceFailoverGroupsClient.BeginFailover +// method. +type InstanceFailoverGroupsClientBeginFailoverOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InstanceFailoverGroupsClientBeginForceFailoverAllowDataLossOptions contains the optional parameters for the InstanceFailoverGroupsClient.BeginForceFailoverAllowDataLoss +// method. +type InstanceFailoverGroupsClientBeginForceFailoverAllowDataLossOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InstanceFailoverGroupsClientGetOptions contains the optional parameters for the InstanceFailoverGroupsClient.Get method. +type InstanceFailoverGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// InstanceFailoverGroupsClientListByLocationOptions contains the optional parameters for the InstanceFailoverGroupsClient.NewListByLocationPager +// method. +type InstanceFailoverGroupsClientListByLocationOptions struct { + // placeholder for future optional parameters +} + +// InstancePoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the InstancePoolsClient.BeginCreateOrUpdate +// method. +type InstancePoolsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InstancePoolsClientBeginDeleteOptions contains the optional parameters for the InstancePoolsClient.BeginDelete method. +type InstancePoolsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InstancePoolsClientBeginUpdateOptions contains the optional parameters for the InstancePoolsClient.BeginUpdate method. +type InstancePoolsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InstancePoolsClientGetOptions contains the optional parameters for the InstancePoolsClient.Get method. +type InstancePoolsClientGetOptions struct { + // placeholder for future optional parameters +} + +// InstancePoolsClientListByResourceGroupOptions contains the optional parameters for the InstancePoolsClient.NewListByResourceGroupPager +// method. +type InstancePoolsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// InstancePoolsClientListOptions contains the optional parameters for the InstancePoolsClient.NewListPager method. +type InstancePoolsClientListOptions struct { + // placeholder for future optional parameters +} + +// JobAgentsClientBeginCreateOrUpdateOptions contains the optional parameters for the JobAgentsClient.BeginCreateOrUpdate +// method. +type JobAgentsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// JobAgentsClientBeginDeleteOptions contains the optional parameters for the JobAgentsClient.BeginDelete method. +type JobAgentsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// JobAgentsClientBeginUpdateOptions contains the optional parameters for the JobAgentsClient.BeginUpdate method. +type JobAgentsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// JobAgentsClientGetOptions contains the optional parameters for the JobAgentsClient.Get method. +type JobAgentsClientGetOptions struct { + // placeholder for future optional parameters +} + +// JobAgentsClientListByServerOptions contains the optional parameters for the JobAgentsClient.NewListByServerPager method. +type JobAgentsClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// JobCredentialsClientCreateOrUpdateOptions contains the optional parameters for the JobCredentialsClient.CreateOrUpdate +// method. +type JobCredentialsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// JobCredentialsClientDeleteOptions contains the optional parameters for the JobCredentialsClient.Delete method. +type JobCredentialsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// JobCredentialsClientGetOptions contains the optional parameters for the JobCredentialsClient.Get method. +type JobCredentialsClientGetOptions struct { + // placeholder for future optional parameters +} + +// JobCredentialsClientListByAgentOptions contains the optional parameters for the JobCredentialsClient.NewListByAgentPager +// method. +type JobCredentialsClientListByAgentOptions struct { + // placeholder for future optional parameters +} + +// JobExecutionsClientBeginCreateOptions contains the optional parameters for the JobExecutionsClient.BeginCreate method. +type JobExecutionsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// JobExecutionsClientBeginCreateOrUpdateOptions contains the optional parameters for the JobExecutionsClient.BeginCreateOrUpdate +// method. +type JobExecutionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// JobExecutionsClientCancelOptions contains the optional parameters for the JobExecutionsClient.Cancel method. +type JobExecutionsClientCancelOptions struct { + // placeholder for future optional parameters +} + +// JobExecutionsClientGetOptions contains the optional parameters for the JobExecutionsClient.Get method. +type JobExecutionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// JobExecutionsClientListByAgentOptions contains the optional parameters for the JobExecutionsClient.NewListByAgentPager +// method. +type JobExecutionsClientListByAgentOptions struct { + // If specified, only job executions created before the specified time are included. + CreateTimeMax *time.Time + + // If specified, only job executions created at or after the specified time are included. + CreateTimeMin *time.Time + + // If specified, only job executions completed before the specified time are included. + EndTimeMax *time.Time + + // If specified, only job executions completed at or after the specified time are included. + EndTimeMin *time.Time + + // If specified, only active or only completed job executions are included. + IsActive *bool + + // The number of elements in the collection to skip. + Skip *int32 + + // The number of elements to return from the collection. + Top *int32 +} + +// JobExecutionsClientListByJobOptions contains the optional parameters for the JobExecutionsClient.NewListByJobPager method. +type JobExecutionsClientListByJobOptions struct { + // If specified, only job executions created before the specified time are included. + CreateTimeMax *time.Time + + // If specified, only job executions created at or after the specified time are included. + CreateTimeMin *time.Time + + // If specified, only job executions completed before the specified time are included. + EndTimeMax *time.Time + + // If specified, only job executions completed at or after the specified time are included. + EndTimeMin *time.Time + + // If specified, only active or only completed job executions are included. + IsActive *bool + + // The number of elements in the collection to skip. + Skip *int32 + + // The number of elements to return from the collection. + Top *int32 +} + +// JobStepExecutionsClientGetOptions contains the optional parameters for the JobStepExecutionsClient.Get method. +type JobStepExecutionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// JobStepExecutionsClientListByJobExecutionOptions contains the optional parameters for the JobStepExecutionsClient.NewListByJobExecutionPager +// method. +type JobStepExecutionsClientListByJobExecutionOptions struct { + // If specified, only job executions created before the specified time are included. + CreateTimeMax *time.Time + + // If specified, only job executions created at or after the specified time are included. + CreateTimeMin *time.Time + + // If specified, only job executions completed before the specified time are included. + EndTimeMax *time.Time + + // If specified, only job executions completed at or after the specified time are included. + EndTimeMin *time.Time + + // If specified, only active or only completed job executions are included. + IsActive *bool + + // The number of elements in the collection to skip. + Skip *int32 + + // The number of elements to return from the collection. + Top *int32 +} + +// JobStepsClientCreateOrUpdateOptions contains the optional parameters for the JobStepsClient.CreateOrUpdate method. +type JobStepsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// JobStepsClientDeleteOptions contains the optional parameters for the JobStepsClient.Delete method. +type JobStepsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// JobStepsClientGetByVersionOptions contains the optional parameters for the JobStepsClient.GetByVersion method. +type JobStepsClientGetByVersionOptions struct { + // placeholder for future optional parameters +} + +// JobStepsClientGetOptions contains the optional parameters for the JobStepsClient.Get method. +type JobStepsClientGetOptions struct { + // placeholder for future optional parameters +} + +// JobStepsClientListByJobOptions contains the optional parameters for the JobStepsClient.NewListByJobPager method. +type JobStepsClientListByJobOptions struct { + // placeholder for future optional parameters +} + +// JobStepsClientListByVersionOptions contains the optional parameters for the JobStepsClient.NewListByVersionPager method. +type JobStepsClientListByVersionOptions struct { + // placeholder for future optional parameters +} + +// JobTargetExecutionsClientGetOptions contains the optional parameters for the JobTargetExecutionsClient.Get method. +type JobTargetExecutionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// JobTargetExecutionsClientListByJobExecutionOptions contains the optional parameters for the JobTargetExecutionsClient.NewListByJobExecutionPager +// method. +type JobTargetExecutionsClientListByJobExecutionOptions struct { + // If specified, only job executions created before the specified time are included. + CreateTimeMax *time.Time + + // If specified, only job executions created at or after the specified time are included. + CreateTimeMin *time.Time + + // If specified, only job executions completed before the specified time are included. + EndTimeMax *time.Time + + // If specified, only job executions completed at or after the specified time are included. + EndTimeMin *time.Time + + // If specified, only active or only completed job executions are included. + IsActive *bool + + // The number of elements in the collection to skip. + Skip *int32 + + // The number of elements to return from the collection. + Top *int32 +} + +// JobTargetExecutionsClientListByStepOptions contains the optional parameters for the JobTargetExecutionsClient.NewListByStepPager +// method. +type JobTargetExecutionsClientListByStepOptions struct { + // If specified, only job executions created before the specified time are included. + CreateTimeMax *time.Time + + // If specified, only job executions created at or after the specified time are included. + CreateTimeMin *time.Time + + // If specified, only job executions completed before the specified time are included. + EndTimeMax *time.Time + + // If specified, only job executions completed at or after the specified time are included. + EndTimeMin *time.Time + + // If specified, only active or only completed job executions are included. + IsActive *bool + + // The number of elements in the collection to skip. + Skip *int32 + + // The number of elements to return from the collection. + Top *int32 +} + +// JobTargetGroupsClientCreateOrUpdateOptions contains the optional parameters for the JobTargetGroupsClient.CreateOrUpdate +// method. +type JobTargetGroupsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// JobTargetGroupsClientDeleteOptions contains the optional parameters for the JobTargetGroupsClient.Delete method. +type JobTargetGroupsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// JobTargetGroupsClientGetOptions contains the optional parameters for the JobTargetGroupsClient.Get method. +type JobTargetGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// JobTargetGroupsClientListByAgentOptions contains the optional parameters for the JobTargetGroupsClient.NewListByAgentPager +// method. +type JobTargetGroupsClientListByAgentOptions struct { + // placeholder for future optional parameters +} + +// JobVersionsClientGetOptions contains the optional parameters for the JobVersionsClient.Get method. +type JobVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// JobVersionsClientListByJobOptions contains the optional parameters for the JobVersionsClient.NewListByJobPager method. +type JobVersionsClientListByJobOptions struct { + // placeholder for future optional parameters +} + +// JobsClientCreateOrUpdateOptions contains the optional parameters for the JobsClient.CreateOrUpdate method. +type JobsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// JobsClientDeleteOptions contains the optional parameters for the JobsClient.Delete method. +type JobsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// JobsClientGetOptions contains the optional parameters for the JobsClient.Get method. +type JobsClientGetOptions struct { + // placeholder for future optional parameters +} + +// JobsClientListByAgentOptions contains the optional parameters for the JobsClient.NewListByAgentPager method. +type JobsClientListByAgentOptions struct { + // placeholder for future optional parameters +} + +// LedgerDigestUploadsClientBeginCreateOrUpdateOptions contains the optional parameters for the LedgerDigestUploadsClient.BeginCreateOrUpdate +// method. +type LedgerDigestUploadsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LedgerDigestUploadsClientBeginDisableOptions contains the optional parameters for the LedgerDigestUploadsClient.BeginDisable +// method. +type LedgerDigestUploadsClientBeginDisableOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LedgerDigestUploadsClientGetOptions contains the optional parameters for the LedgerDigestUploadsClient.Get method. +type LedgerDigestUploadsClientGetOptions struct { + // placeholder for future optional parameters +} + +// LedgerDigestUploadsClientListByDatabaseOptions contains the optional parameters for the LedgerDigestUploadsClient.NewListByDatabasePager +// method. +type LedgerDigestUploadsClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// LongTermRetentionBackupsClientBeginCopyByResourceGroupOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginCopyByResourceGroup +// method. +type LongTermRetentionBackupsClientBeginCopyByResourceGroupOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LongTermRetentionBackupsClientBeginCopyOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginCopy +// method. +type LongTermRetentionBackupsClientBeginCopyOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LongTermRetentionBackupsClientBeginDeleteByResourceGroupOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginDeleteByResourceGroup +// method. +type LongTermRetentionBackupsClientBeginDeleteByResourceGroupOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LongTermRetentionBackupsClientBeginDeleteOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginDelete +// method. +type LongTermRetentionBackupsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LongTermRetentionBackupsClientBeginUpdateByResourceGroupOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginUpdateByResourceGroup +// method. +type LongTermRetentionBackupsClientBeginUpdateByResourceGroupOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LongTermRetentionBackupsClientBeginUpdateOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginUpdate +// method. +type LongTermRetentionBackupsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LongTermRetentionBackupsClientGetByResourceGroupOptions contains the optional parameters for the LongTermRetentionBackupsClient.GetByResourceGroup +// method. +type LongTermRetentionBackupsClientGetByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// LongTermRetentionBackupsClientGetOptions contains the optional parameters for the LongTermRetentionBackupsClient.Get method. +type LongTermRetentionBackupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// LongTermRetentionBackupsClientListByDatabaseOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByDatabasePager +// method. +type LongTermRetentionBackupsClientListByDatabaseOptions struct { + // Whether to query against just live databases, just deleted databases, or all databases. + DatabaseState *DatabaseState + + // Whether or not to only get the latest backup for each database. + OnlyLatestPerDatabase *bool +} + +// LongTermRetentionBackupsClientListByLocationOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByLocationPager +// method. +type LongTermRetentionBackupsClientListByLocationOptions struct { + // Whether to query against just live databases, just deleted databases, or all databases. + DatabaseState *DatabaseState + + // Whether or not to only get the latest backup for each database. + OnlyLatestPerDatabase *bool +} + +// LongTermRetentionBackupsClientListByResourceGroupDatabaseOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByResourceGroupDatabasePager +// method. +type LongTermRetentionBackupsClientListByResourceGroupDatabaseOptions struct { + // Whether to query against just live databases, just deleted databases, or all databases. + DatabaseState *DatabaseState + + // Whether or not to only get the latest backup for each database. + OnlyLatestPerDatabase *bool +} + +// LongTermRetentionBackupsClientListByResourceGroupLocationOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByResourceGroupLocationPager +// method. +type LongTermRetentionBackupsClientListByResourceGroupLocationOptions struct { + // Whether to query against just live databases, just deleted databases, or all databases. + DatabaseState *DatabaseState + + // Whether or not to only get the latest backup for each database. + OnlyLatestPerDatabase *bool +} + +// LongTermRetentionBackupsClientListByResourceGroupServerOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByResourceGroupServerPager +// method. +type LongTermRetentionBackupsClientListByResourceGroupServerOptions struct { + // Whether to query against just live databases, just deleted databases, or all databases. + DatabaseState *DatabaseState + + // Whether or not to only get the latest backup for each database. + OnlyLatestPerDatabase *bool +} + +// LongTermRetentionBackupsClientListByServerOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByServerPager +// method. +type LongTermRetentionBackupsClientListByServerOptions struct { + // Whether to query against just live databases, just deleted databases, or all databases. + DatabaseState *DatabaseState + + // Whether or not to only get the latest backup for each database. + OnlyLatestPerDatabase *bool +} + +// LongTermRetentionManagedInstanceBackupsClientBeginDeleteByResourceGroupOptions contains the optional parameters for the +// LongTermRetentionManagedInstanceBackupsClient.BeginDeleteByResourceGroup method. +type LongTermRetentionManagedInstanceBackupsClientBeginDeleteByResourceGroupOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LongTermRetentionManagedInstanceBackupsClientBeginDeleteOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.BeginDelete +// method. +type LongTermRetentionManagedInstanceBackupsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.GetByResourceGroup +// method. +type LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// LongTermRetentionManagedInstanceBackupsClientGetOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.Get +// method. +type LongTermRetentionManagedInstanceBackupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// LongTermRetentionManagedInstanceBackupsClientListByDatabaseOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.NewListByDatabasePager +// method. +type LongTermRetentionManagedInstanceBackupsClientListByDatabaseOptions struct { + // Whether to query against just live databases, just deleted databases, or all databases. + DatabaseState *DatabaseState + + // Whether or not to only get the latest backup for each database. + OnlyLatestPerDatabase *bool +} + +// LongTermRetentionManagedInstanceBackupsClientListByInstanceOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.NewListByInstancePager +// method. +type LongTermRetentionManagedInstanceBackupsClientListByInstanceOptions struct { + // Whether to query against just live databases, just deleted databases, or all databases. + DatabaseState *DatabaseState + + // Whether or not to only get the latest backup for each database. + OnlyLatestPerDatabase *bool +} + +// LongTermRetentionManagedInstanceBackupsClientListByLocationOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.NewListByLocationPager +// method. +type LongTermRetentionManagedInstanceBackupsClientListByLocationOptions struct { + // Whether to query against just live databases, just deleted databases, or all databases. + DatabaseState *DatabaseState + + // Whether or not to only get the latest backup for each database. + OnlyLatestPerDatabase *bool +} + +// LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseOptions contains the optional parameters for the +// LongTermRetentionManagedInstanceBackupsClient.NewListByResourceGroupDatabasePager method. +type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseOptions struct { + // Whether to query against just live databases, just deleted databases, or all databases. + DatabaseState *DatabaseState + + // Whether or not to only get the latest backup for each database. + OnlyLatestPerDatabase *bool +} + +// LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceOptions contains the optional parameters for the +// LongTermRetentionManagedInstanceBackupsClient.NewListByResourceGroupInstancePager method. +type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceOptions struct { + // Whether to query against just live databases, just deleted databases, or all databases. + DatabaseState *DatabaseState + + // Whether or not to only get the latest backup for each database. + OnlyLatestPerDatabase *bool +} + +// LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationOptions contains the optional parameters for the +// LongTermRetentionManagedInstanceBackupsClient.NewListByResourceGroupLocationPager method. +type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationOptions struct { + // Whether to query against just live databases, just deleted databases, or all databases. + DatabaseState *DatabaseState + + // Whether or not to only get the latest backup for each database. + OnlyLatestPerDatabase *bool +} + +// LongTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the LongTermRetentionPoliciesClient.BeginCreateOrUpdate +// method. +type LongTermRetentionPoliciesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LongTermRetentionPoliciesClientGetOptions contains the optional parameters for the LongTermRetentionPoliciesClient.Get +// method. +type LongTermRetentionPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// LongTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the LongTermRetentionPoliciesClient.NewListByDatabasePager +// method. +type LongTermRetentionPoliciesClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// MaintenanceWindowOptionsClientGetOptions contains the optional parameters for the MaintenanceWindowOptionsClient.Get method. +type MaintenanceWindowOptionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// MaintenanceWindowsClientCreateOrUpdateOptions contains the optional parameters for the MaintenanceWindowsClient.CreateOrUpdate +// method. +type MaintenanceWindowsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// MaintenanceWindowsClientGetOptions contains the optional parameters for the MaintenanceWindowsClient.Get method. +type MaintenanceWindowsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedBackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate +// method. +type ManagedBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedBackupShortTermRetentionPoliciesClientBeginUpdateOptions contains the optional parameters for the ManagedBackupShortTermRetentionPoliciesClient.BeginUpdate +// method. +type ManagedBackupShortTermRetentionPoliciesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedBackupShortTermRetentionPoliciesClientGetOptions contains the optional parameters for the ManagedBackupShortTermRetentionPoliciesClient.Get +// method. +type ManagedBackupShortTermRetentionPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedBackupShortTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the ManagedBackupShortTermRetentionPoliciesClient.NewListByDatabasePager +// method. +type ManagedBackupShortTermRetentionPoliciesClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// 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.NewListByDatabasePager +// 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 +} + +// ManagedDatabaseColumnsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseColumnsClient.NewListByDatabasePager +// method. +type ManagedDatabaseColumnsClientListByDatabaseOptions struct { + Column []string + OrderBy []string + Schema []string + + // An opaque token that identifies a starting point in the collection. + Skiptoken *string + Table []string +} + +// ManagedDatabaseColumnsClientListByTableOptions contains the optional parameters for the ManagedDatabaseColumnsClient.NewListByTablePager +// method. +type ManagedDatabaseColumnsClientListByTableOptions struct { + // An OData filter expression that filters elements in the collection. + Filter *string +} + +// ManagedDatabaseMoveOperationsClientGetOptions contains the optional parameters for the ManagedDatabaseMoveOperationsClient.Get +// method. +type ManagedDatabaseMoveOperationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseMoveOperationsClientListByLocationOptions contains the optional parameters for the ManagedDatabaseMoveOperationsClient.NewListByLocationPager +// method. +type ManagedDatabaseMoveOperationsClientListByLocationOptions struct { + // An OData filter expression that filters elements in the collection. + Filter *string + + // Whether or not to only get the latest operation for each database. Has higher priority than $filter. + OnlyLatestPerDatabase *bool +} + +// ManagedDatabaseQueriesClientGetOptions contains the optional parameters for the ManagedDatabaseQueriesClient.Get method. +type ManagedDatabaseQueriesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseQueriesClientListByQueryOptions contains the optional parameters for the ManagedDatabaseQueriesClient.NewListByQueryPager +// method. +type ManagedDatabaseQueriesClientListByQueryOptions struct { + // End time for observed period. + EndTime *string + + // The time step to be used to summarize the metric values. + Interval *QueryTimeGrainType + + // Start time for observed period. + StartTime *string +} + +// ManagedDatabaseRecommendedSensitivityLabelsClientUpdateOptions contains the optional parameters for the ManagedDatabaseRecommendedSensitivityLabelsClient.Update +// method. +type ManagedDatabaseRecommendedSensitivityLabelsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseRestoreDetailsClientGetOptions contains the optional parameters for the ManagedDatabaseRestoreDetailsClient.Get +// method. +type ManagedDatabaseRestoreDetailsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseSchemasClientGetOptions contains the optional parameters for the ManagedDatabaseSchemasClient.Get method. +type ManagedDatabaseSchemasClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseSchemasClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSchemasClient.NewListByDatabasePager +// method. +type ManagedDatabaseSchemasClientListByDatabaseOptions struct { + // An OData filter expression that filters elements in the collection. + Filter *string +} + +// ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseSecurityAlertPoliciesClient.CreateOrUpdate +// method. +type ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ManagedDatabaseSecurityAlertPoliciesClient.Get +// method. +type ManagedDatabaseSecurityAlertPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSecurityAlertPoliciesClient.NewListByDatabasePager +// method. +type ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseSecurityEventsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSecurityEventsClient.NewListByDatabasePager +// method. +type ManagedDatabaseSecurityEventsClientListByDatabaseOptions struct { + // An OData filter expression that filters elements in the collection. + Filter *string + + // The number of elements in the collection to skip. + Skip *int32 + + // An opaque token that identifies a starting point in the collection. + Skiptoken *string + + // The number of elements to return from the collection. + Top *int32 +} + +// ManagedDatabaseSensitivityLabelsClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.CreateOrUpdate +// method. +type ManagedDatabaseSensitivityLabelsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseSensitivityLabelsClientDeleteOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.Delete +// method. +type ManagedDatabaseSensitivityLabelsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseSensitivityLabelsClientDisableRecommendationOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.DisableRecommendation +// method. +type ManagedDatabaseSensitivityLabelsClientDisableRecommendationOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseSensitivityLabelsClientEnableRecommendationOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.EnableRecommendation +// method. +type ManagedDatabaseSensitivityLabelsClientEnableRecommendationOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseSensitivityLabelsClientGetOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.Get +// method. +type ManagedDatabaseSensitivityLabelsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.NewListCurrentByDatabasePager +// method. +type ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseOptions struct { + Count *bool + + // An OData filter expression that filters elements in the collection. + Filter *string + SkipToken *string +} + +// ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.NewListRecommendedByDatabasePager +// method. +type ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseOptions struct { + // An OData filter expression that filters elements in the collection. + Filter *string + + // Specifies whether to include disabled recommendations or not. + IncludeDisabledRecommendations *bool + SkipToken *string +} + +// ManagedDatabaseSensitivityLabelsClientUpdateOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.Update +// method. +type ManagedDatabaseSensitivityLabelsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseTablesClientGetOptions contains the optional parameters for the ManagedDatabaseTablesClient.Get method. +type ManagedDatabaseTablesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseTablesClientListBySchemaOptions contains the optional parameters for the ManagedDatabaseTablesClient.NewListBySchemaPager +// method. +type ManagedDatabaseTablesClientListBySchemaOptions struct { + // An OData filter expression that filters elements in the collection. + Filter *string +} + +// ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseTransparentDataEncryptionClient.CreateOrUpdate +// method. +type ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseTransparentDataEncryptionClientGetOptions contains the optional parameters for the ManagedDatabaseTransparentDataEncryptionClient.Get +// method. +type ManagedDatabaseTransparentDataEncryptionClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseTransparentDataEncryptionClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseTransparentDataEncryptionClient.NewListByDatabasePager +// method. +type ManagedDatabaseTransparentDataEncryptionClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions contains the optional parameters for the +// ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate method. +type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.Delete +// method. +type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.Get +// method. +type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentScansClient.BeginInitiateScan +// method. +type ManagedDatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedDatabaseVulnerabilityAssessmentScansClientExportOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentScansClient.Export +// method. +type ManagedDatabaseVulnerabilityAssessmentScansClientExportOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseVulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentScansClient.Get +// method. +type ManagedDatabaseVulnerabilityAssessmentScansClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentScansClient.NewListByDatabasePager +// method. +type ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.CreateOrUpdate +// method. +type ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.Delete +// method. +type ManagedDatabaseVulnerabilityAssessmentsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.Get +// method. +type ManagedDatabaseVulnerabilityAssessmentsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.NewListByDatabasePager +// method. +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 { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedDatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedDatabasesClient.BeginCreateOrUpdate +// method. +type ManagedDatabasesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedDatabasesClientBeginDeleteOptions contains the optional parameters for the ManagedDatabasesClient.BeginDelete method. +type ManagedDatabasesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + 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. + ResumeToken string +} + +// ManagedDatabasesClientGetOptions contains the optional parameters for the ManagedDatabasesClient.Get method. +type ManagedDatabasesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabasesClientListByInstanceOptions contains the optional parameters for the ManagedDatabasesClient.NewListByInstancePager +// method. +type ManagedDatabasesClientListByInstanceOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabasesClientListInaccessibleByInstanceOptions contains the optional parameters for the ManagedDatabasesClient.NewListInaccessibleByInstancePager +// method. +type ManagedDatabasesClientListInaccessibleByInstanceOptions struct { + // placeholder for future optional parameters +} + +// ManagedInstanceAdministratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.BeginCreateOrUpdate +// method. +type ManagedInstanceAdministratorsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedInstanceAdministratorsClientBeginDeleteOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.BeginDelete +// method. +type ManagedInstanceAdministratorsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedInstanceAdministratorsClientGetOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.Get +// method. +type ManagedInstanceAdministratorsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedInstanceAdministratorsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.NewListByInstancePager +// method. +type ManagedInstanceAdministratorsClientListByInstanceOptions struct { + // placeholder for future optional parameters +} + +// 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.NewListByInstancePager +// method. +type ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceOptions struct { + // placeholder for future optional parameters +} + +// ManagedInstanceAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceAzureADOnlyAuthenticationsClient.BeginCreateOrUpdate +// method. +type ManagedInstanceAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedInstanceAzureADOnlyAuthenticationsClientBeginDeleteOptions contains the optional parameters for the ManagedInstanceAzureADOnlyAuthenticationsClient.BeginDelete +// method. +type ManagedInstanceAzureADOnlyAuthenticationsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedInstanceAzureADOnlyAuthenticationsClientGetOptions contains the optional parameters for the ManagedInstanceAzureADOnlyAuthenticationsClient.Get +// method. +type ManagedInstanceAzureADOnlyAuthenticationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceAzureADOnlyAuthenticationsClient.NewListByInstancePager +// method. +type ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceOptions struct { + // placeholder for future optional parameters +} + +// 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.NewListByManagedInstancePager +// method. +type ManagedInstanceDtcsClientListByManagedInstanceOptions struct { + // placeholder for future optional parameters +} + +// ManagedInstanceEncryptionProtectorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceEncryptionProtectorsClient.BeginCreateOrUpdate +// method. +type ManagedInstanceEncryptionProtectorsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedInstanceEncryptionProtectorsClientBeginRevalidateOptions contains the optional parameters for the ManagedInstanceEncryptionProtectorsClient.BeginRevalidate +// method. +type ManagedInstanceEncryptionProtectorsClientBeginRevalidateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedInstanceEncryptionProtectorsClientGetOptions contains the optional parameters for the ManagedInstanceEncryptionProtectorsClient.Get +// method. +type ManagedInstanceEncryptionProtectorsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedInstanceEncryptionProtectorsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceEncryptionProtectorsClient.NewListByInstancePager +// method. +type ManagedInstanceEncryptionProtectorsClientListByInstanceOptions struct { + // placeholder for future optional parameters +} + +// ManagedInstanceKeysClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceKeysClient.BeginCreateOrUpdate +// method. +type ManagedInstanceKeysClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedInstanceKeysClientBeginDeleteOptions contains the optional parameters for the ManagedInstanceKeysClient.BeginDelete +// method. +type ManagedInstanceKeysClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedInstanceKeysClientGetOptions contains the optional parameters for the ManagedInstanceKeysClient.Get method. +type ManagedInstanceKeysClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedInstanceKeysClientListByInstanceOptions contains the optional parameters for the ManagedInstanceKeysClient.NewListByInstancePager +// method. +type ManagedInstanceKeysClientListByInstanceOptions struct { + // An OData filter expression that filters elements in the collection. + Filter *string +} + +// ManagedInstanceLongTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceLongTermRetentionPoliciesClient.BeginCreateOrUpdate +// method. +type ManagedInstanceLongTermRetentionPoliciesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedInstanceLongTermRetentionPoliciesClientGetOptions contains the optional parameters for the ManagedInstanceLongTermRetentionPoliciesClient.Get +// method. +type ManagedInstanceLongTermRetentionPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the ManagedInstanceLongTermRetentionPoliciesClient.NewListByDatabasePager +// method. +type ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// ManagedInstanceOperationsClientCancelOptions contains the optional parameters for the ManagedInstanceOperationsClient.Cancel +// method. +type ManagedInstanceOperationsClientCancelOptions struct { + // placeholder for future optional parameters +} + +// ManagedInstanceOperationsClientGetOptions contains the optional parameters for the ManagedInstanceOperationsClient.Get +// method. +type ManagedInstanceOperationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedInstanceOperationsClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstanceOperationsClient.NewListByManagedInstancePager +// method. +type ManagedInstanceOperationsClientListByManagedInstanceOptions struct { + // placeholder for future optional parameters +} + +// ManagedInstancePrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstancePrivateEndpointConnectionsClient.BeginCreateOrUpdate +// method. +type ManagedInstancePrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedInstancePrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the ManagedInstancePrivateEndpointConnectionsClient.BeginDelete +// method. +type ManagedInstancePrivateEndpointConnectionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedInstancePrivateEndpointConnectionsClientGetOptions contains the optional parameters for the ManagedInstancePrivateEndpointConnectionsClient.Get +// method. +type ManagedInstancePrivateEndpointConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstancePrivateEndpointConnectionsClient.NewListByManagedInstancePager +// method. +type ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceOptions struct { + // placeholder for future optional parameters +} + +// ManagedInstancePrivateLinkResourcesClientGetOptions contains the optional parameters for the ManagedInstancePrivateLinkResourcesClient.Get +// method. +type ManagedInstancePrivateLinkResourcesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedInstancePrivateLinkResourcesClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstancePrivateLinkResourcesClient.NewListByManagedInstancePager +// method. +type ManagedInstancePrivateLinkResourcesClientListByManagedInstanceOptions struct { + // placeholder for future optional parameters +} + +// ManagedInstanceTdeCertificatesClientBeginCreateOptions contains the optional parameters for the ManagedInstanceTdeCertificatesClient.BeginCreate +// method. +type ManagedInstanceTdeCertificatesClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.CreateOrUpdate +// method. +type ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ManagedInstanceVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.Delete +// method. +type ManagedInstanceVulnerabilityAssessmentsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ManagedInstanceVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.Get +// method. +type ManagedInstanceVulnerabilityAssessmentsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedInstanceVulnerabilityAssessmentsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.NewListByInstancePager +// method. +type ManagedInstanceVulnerabilityAssessmentsClientListByInstanceOptions struct { + // placeholder for future optional parameters +} + +// ManagedInstancesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstancesClient.BeginCreateOrUpdate +// method. +type ManagedInstancesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedInstancesClientBeginDeleteOptions contains the optional parameters for the ManagedInstancesClient.BeginDelete method. +type ManagedInstancesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedInstancesClientBeginFailoverOptions contains the optional parameters for the ManagedInstancesClient.BeginFailover +// method. +type ManagedInstancesClientBeginFailoverOptions struct { + // The type of replica to be failed over. + ReplicaType *ReplicaType + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedInstancesClientBeginStartOptions contains the optional parameters for the ManagedInstancesClient.BeginStart method. +type ManagedInstancesClientBeginStartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedInstancesClientBeginStopOptions contains the optional parameters for the ManagedInstancesClient.BeginStop method. +type ManagedInstancesClientBeginStopOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedInstancesClientBeginUpdateOptions contains the optional parameters for the ManagedInstancesClient.BeginUpdate method. +type ManagedInstancesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedInstancesClientGetOptions contains the optional parameters for the ManagedInstancesClient.Get method. +type ManagedInstancesClientGetOptions struct { + // The child resources to include in the response. + Expand *string +} + +// ManagedInstancesClientListByInstancePoolOptions contains the optional parameters for the ManagedInstancesClient.NewListByInstancePoolPager +// method. +type ManagedInstancesClientListByInstancePoolOptions struct { + // The child resources to include in the response. + Expand *string +} + +// ManagedInstancesClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstancesClient.NewListByManagedInstancePager +// method. +type ManagedInstancesClientListByManagedInstanceOptions struct { + // Aggregation function to be used, default value is 'sum' + AggregationFunction *AggregationFunctionType + + // Comma separated list of databases to be included into search. All DB's are included if this parameter is not specified. + Databases *string + + // End time for observed period. + EndTime *string + + // The time step to be used to summarize the metric values. Default value is PT1H + Interval *QueryTimeGrainType + + // How many 'top queries' to return. Default is 5. + NumberOfQueries *int32 + + // Metric to be used for ranking top queries. Default is 'cpu' + ObservationMetric *MetricType + + // Start time for observed period. + StartTime *string +} + +// ManagedInstancesClientListByResourceGroupOptions contains the optional parameters for the ManagedInstancesClient.NewListByResourceGroupPager +// method. +type ManagedInstancesClientListByResourceGroupOptions struct { + // The child resources to include in the response. + Expand *string +} + +// ManagedInstancesClientListOptions contains the optional parameters for the ManagedInstancesClient.NewListPager method. +type ManagedInstancesClientListOptions struct { + // The child resources to include in the response. + Expand *string +} + +// ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceOptions contains the optional parameters for the +// ManagedInstancesClient.NewListOutboundNetworkDependenciesByManagedInstancePager method. +type ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceOptions struct { + // placeholder for future optional parameters +} + +// ManagedLedgerDigestUploadsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedLedgerDigestUploadsClient.BeginCreateOrUpdate +// method. +type ManagedLedgerDigestUploadsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedLedgerDigestUploadsClientBeginDisableOptions contains the optional parameters for the ManagedLedgerDigestUploadsClient.BeginDisable +// method. +type ManagedLedgerDigestUploadsClientBeginDisableOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedLedgerDigestUploadsClientGetOptions contains the optional parameters for the ManagedLedgerDigestUploadsClient.Get +// method. +type ManagedLedgerDigestUploadsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedLedgerDigestUploadsClientListByDatabaseOptions contains the optional parameters for the ManagedLedgerDigestUploadsClient.NewListByDatabasePager +// method. +type ManagedLedgerDigestUploadsClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional +// parameters for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate method. +type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginUpdateOptions contains the optional parameters +// for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.BeginUpdate method. +type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetOptions contains the optional parameters for the +// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.Get method. +type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseOptions contains the +// optional parameters for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.NewListByRestorableDroppedDatabasePager +// method. +type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseOptions struct { + // placeholder for future optional parameters +} + +// 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.NewListByManagedInstancePager +// method. +type ManagedServerDNSAliasesClientListByManagedInstanceOptions struct { + // placeholder for future optional parameters +} + +// ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedServerSecurityAlertPoliciesClient.BeginCreateOrUpdate +// method. +type ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedServerSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ManagedServerSecurityAlertPoliciesClient.Get +// method. +type ManagedServerSecurityAlertPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedServerSecurityAlertPoliciesClientListByInstanceOptions contains the optional parameters for the ManagedServerSecurityAlertPoliciesClient.NewListByInstancePager +// method. +type ManagedServerSecurityAlertPoliciesClientListByInstanceOptions struct { + // placeholder for future optional parameters +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// OutboundFirewallRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the OutboundFirewallRulesClient.BeginCreateOrUpdate +// method. +type OutboundFirewallRulesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// OutboundFirewallRulesClientBeginDeleteOptions contains the optional parameters for the OutboundFirewallRulesClient.BeginDelete +// method. +type OutboundFirewallRulesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// OutboundFirewallRulesClientGetOptions contains the optional parameters for the OutboundFirewallRulesClient.Get method. +type OutboundFirewallRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// OutboundFirewallRulesClientListByServerOptions contains the optional parameters for the OutboundFirewallRulesClient.NewListByServerPager +// method. +type OutboundFirewallRulesClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate +// method. +type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete +// method. +type PrivateEndpointConnectionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get +// method. +type PrivateEndpointConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientListByServerOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByServerPager +// method. +type PrivateEndpointConnectionsClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get method. +type PrivateLinkResourcesClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkResourcesClientListByServerOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByServerPager +// method. +type PrivateLinkResourcesClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// RecommendedSensitivityLabelsClientUpdateOptions contains the optional parameters for the RecommendedSensitivityLabelsClient.Update +// method. +type RecommendedSensitivityLabelsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// RecoverableDatabasesClientGetOptions contains the optional parameters for the RecoverableDatabasesClient.Get method. +type RecoverableDatabasesClientGetOptions struct { + // The child resources to include in the response. + Expand *string + + // An OData filter expression that filters elements in the collection. + Filter *string +} + +// RecoverableDatabasesClientListByServerOptions contains the optional parameters for the RecoverableDatabasesClient.NewListByServerPager +// method. +type RecoverableDatabasesClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// RecoverableManagedDatabasesClientGetOptions contains the optional parameters for the RecoverableManagedDatabasesClient.Get +// method. +type RecoverableManagedDatabasesClientGetOptions struct { + // placeholder for future optional parameters +} + +// RecoverableManagedDatabasesClientListByInstanceOptions contains the optional parameters for the RecoverableManagedDatabasesClient.NewListByInstancePager +// method. +type RecoverableManagedDatabasesClientListByInstanceOptions struct { + // placeholder for future optional parameters +} + +// 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 { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationLinksClientBeginFailoverOptions contains the optional parameters for the ReplicationLinksClient.BeginFailover +// method. +type ReplicationLinksClientBeginFailoverOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationLinksClientGetOptions contains the optional parameters for the ReplicationLinksClient.Get method. +type ReplicationLinksClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicationLinksClientListByDatabaseOptions contains the optional parameters for the ReplicationLinksClient.NewListByDatabasePager +// method. +type ReplicationLinksClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// ReplicationLinksClientListByServerOptions contains the optional parameters for the ReplicationLinksClient.NewListByServerPager +// method. +type ReplicationLinksClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// RestorableDroppedDatabasesClientGetOptions contains the optional parameters for the RestorableDroppedDatabasesClient.Get +// method. +type RestorableDroppedDatabasesClientGetOptions struct { + // The child resources to include in the response. + Expand *string + + // An OData filter expression that filters elements in the collection. + Filter *string +} + +// RestorableDroppedDatabasesClientListByServerOptions contains the optional parameters for the RestorableDroppedDatabasesClient.NewListByServerPager +// method. +type RestorableDroppedDatabasesClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// RestorableDroppedManagedDatabasesClientGetOptions contains the optional parameters for the RestorableDroppedManagedDatabasesClient.Get +// method. +type RestorableDroppedManagedDatabasesClientGetOptions struct { + // placeholder for future optional parameters +} + +// RestorableDroppedManagedDatabasesClientListByInstanceOptions contains the optional parameters for the RestorableDroppedManagedDatabasesClient.NewListByInstancePager +// method. +type RestorableDroppedManagedDatabasesClientListByInstanceOptions struct { + // placeholder for future optional parameters +} + +// RestorePointsClientBeginCreateOptions contains the optional parameters for the RestorePointsClient.BeginCreate method. +type RestorePointsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RestorePointsClientDeleteOptions contains the optional parameters for the RestorePointsClient.Delete method. +type RestorePointsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// RestorePointsClientGetOptions contains the optional parameters for the RestorePointsClient.Get method. +type RestorePointsClientGetOptions struct { + // placeholder for future optional parameters +} + +// RestorePointsClientListByDatabaseOptions contains the optional parameters for the RestorePointsClient.NewListByDatabasePager +// method. +type RestorePointsClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// SensitivityLabelsClientCreateOrUpdateOptions contains the optional parameters for the SensitivityLabelsClient.CreateOrUpdate +// method. +type SensitivityLabelsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// SensitivityLabelsClientDeleteOptions contains the optional parameters for the SensitivityLabelsClient.Delete method. +type SensitivityLabelsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// SensitivityLabelsClientDisableRecommendationOptions contains the optional parameters for the SensitivityLabelsClient.DisableRecommendation +// method. +type SensitivityLabelsClientDisableRecommendationOptions struct { + // placeholder for future optional parameters +} + +// SensitivityLabelsClientEnableRecommendationOptions contains the optional parameters for the SensitivityLabelsClient.EnableRecommendation +// method. +type SensitivityLabelsClientEnableRecommendationOptions struct { + // placeholder for future optional parameters +} + +// SensitivityLabelsClientGetOptions contains the optional parameters for the SensitivityLabelsClient.Get method. +type SensitivityLabelsClientGetOptions struct { + // placeholder for future optional parameters +} + +// SensitivityLabelsClientListCurrentByDatabaseOptions contains the optional parameters for the SensitivityLabelsClient.NewListCurrentByDatabasePager +// method. +type SensitivityLabelsClientListCurrentByDatabaseOptions struct { + Count *bool + + // An OData filter expression that filters elements in the collection. + Filter *string + SkipToken *string +} + +// SensitivityLabelsClientListRecommendedByDatabaseOptions contains the optional parameters for the SensitivityLabelsClient.NewListRecommendedByDatabasePager +// method. +type SensitivityLabelsClientListRecommendedByDatabaseOptions struct { + // An OData filter expression that filters elements in the collection. + Filter *string + + // Specifies whether to include disabled recommendations or not. + IncludeDisabledRecommendations *bool + SkipToken *string +} + +// SensitivityLabelsClientUpdateOptions contains the optional parameters for the SensitivityLabelsClient.Update method. +type SensitivityLabelsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// ServerAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerAdvancedThreatProtectionSettingsClient.BeginCreateOrUpdate +// method. +type ServerAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerAdvancedThreatProtectionSettingsClientGetOptions contains the optional parameters for the ServerAdvancedThreatProtectionSettingsClient.Get +// method. +type ServerAdvancedThreatProtectionSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServerAdvancedThreatProtectionSettingsClientListByServerOptions contains the optional parameters for the ServerAdvancedThreatProtectionSettingsClient.NewListByServerPager +// method. +type ServerAdvancedThreatProtectionSettingsClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// ServerAdvisorsClientGetOptions contains the optional parameters for the ServerAdvisorsClient.Get method. +type ServerAdvisorsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServerAdvisorsClientListByServerOptions contains the optional parameters for the ServerAdvisorsClient.ListByServer method. +type ServerAdvisorsClientListByServerOptions struct { + // The child resources to include in the response. + Expand *string +} + +// ServerAdvisorsClientUpdateOptions contains the optional parameters for the ServerAdvisorsClient.Update method. +type ServerAdvisorsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// ServerAutomaticTuningClientGetOptions contains the optional parameters for the ServerAutomaticTuningClient.Get method. +type ServerAutomaticTuningClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServerAutomaticTuningClientUpdateOptions contains the optional parameters for the ServerAutomaticTuningClient.Update method. +type ServerAutomaticTuningClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// ServerAzureADAdministratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerAzureADAdministratorsClient.BeginCreateOrUpdate +// method. +type ServerAzureADAdministratorsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerAzureADAdministratorsClientBeginDeleteOptions contains the optional parameters for the ServerAzureADAdministratorsClient.BeginDelete +// method. +type ServerAzureADAdministratorsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerAzureADAdministratorsClientGetOptions contains the optional parameters for the ServerAzureADAdministratorsClient.Get +// method. +type ServerAzureADAdministratorsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServerAzureADAdministratorsClientListByServerOptions contains the optional parameters for the ServerAzureADAdministratorsClient.NewListByServerPager +// method. +type ServerAzureADAdministratorsClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// ServerAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.BeginCreateOrUpdate +// method. +type ServerAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerAzureADOnlyAuthenticationsClientBeginDeleteOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.BeginDelete +// method. +type ServerAzureADOnlyAuthenticationsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerAzureADOnlyAuthenticationsClientGetOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.Get +// method. +type ServerAzureADOnlyAuthenticationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServerAzureADOnlyAuthenticationsClientListByServerOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.NewListByServerPager +// method. +type ServerAzureADOnlyAuthenticationsClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// ServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerBlobAuditingPoliciesClient.BeginCreateOrUpdate +// method. +type ServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerBlobAuditingPoliciesClientGetOptions contains the optional parameters for the ServerBlobAuditingPoliciesClient.Get +// method. +type ServerBlobAuditingPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServerBlobAuditingPoliciesClientListByServerOptions contains the optional parameters for the ServerBlobAuditingPoliciesClient.NewListByServerPager +// method. +type ServerBlobAuditingPoliciesClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// ServerCommunicationLinksClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerCommunicationLinksClient.BeginCreateOrUpdate +// method. +type ServerCommunicationLinksClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerCommunicationLinksClientDeleteOptions contains the optional parameters for the ServerCommunicationLinksClient.Delete +// method. +type ServerCommunicationLinksClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ServerCommunicationLinksClientGetOptions contains the optional parameters for the ServerCommunicationLinksClient.Get method. +type ServerCommunicationLinksClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServerCommunicationLinksClientListByServerOptions contains the optional parameters for the ServerCommunicationLinksClient.NewListByServerPager +// method. +type ServerCommunicationLinksClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// ServerConfigurationOptionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerConfigurationOptionsClient.BeginCreateOrUpdate +// method. +type ServerConfigurationOptionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerConfigurationOptionsClientGetOptions contains the optional parameters for the ServerConfigurationOptionsClient.Get +// method. +type ServerConfigurationOptionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServerConfigurationOptionsClientListByManagedInstanceOptions contains the optional parameters for the ServerConfigurationOptionsClient.NewListByManagedInstancePager +// method. +type ServerConfigurationOptionsClientListByManagedInstanceOptions struct { + // placeholder for future optional parameters +} + +// ServerConnectionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerConnectionPoliciesClient.BeginCreateOrUpdate +// method. +type ServerConnectionPoliciesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerConnectionPoliciesClientGetOptions contains the optional parameters for the ServerConnectionPoliciesClient.Get method. +type ServerConnectionPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServerConnectionPoliciesClientListByServerOptions contains the optional parameters for the ServerConnectionPoliciesClient.NewListByServerPager +// method. +type ServerConnectionPoliciesClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// ServerDNSAliasesClientBeginAcquireOptions contains the optional parameters for the ServerDNSAliasesClient.BeginAcquire +// method. +type ServerDNSAliasesClientBeginAcquireOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerDNSAliasesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerDNSAliasesClient.BeginCreateOrUpdate +// method. +type ServerDNSAliasesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerDNSAliasesClientBeginDeleteOptions contains the optional parameters for the ServerDNSAliasesClient.BeginDelete method. +type ServerDNSAliasesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerDNSAliasesClientGetOptions contains the optional parameters for the ServerDNSAliasesClient.Get method. +type ServerDNSAliasesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServerDNSAliasesClientListByServerOptions contains the optional parameters for the ServerDNSAliasesClient.NewListByServerPager +// method. +type ServerDNSAliasesClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerDevOpsAuditSettingsClient.BeginCreateOrUpdate +// method. +type ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerDevOpsAuditSettingsClientGetOptions contains the optional parameters for the ServerDevOpsAuditSettingsClient.Get +// method. +type ServerDevOpsAuditSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServerDevOpsAuditSettingsClientListByServerOptions contains the optional parameters for the ServerDevOpsAuditSettingsClient.NewListByServerPager +// method. +type ServerDevOpsAuditSettingsClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// ServerKeysClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerKeysClient.BeginCreateOrUpdate +// method. +type ServerKeysClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerKeysClientBeginDeleteOptions contains the optional parameters for the ServerKeysClient.BeginDelete method. +type ServerKeysClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerKeysClientGetOptions contains the optional parameters for the ServerKeysClient.Get method. +type ServerKeysClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServerKeysClientListByServerOptions contains the optional parameters for the ServerKeysClient.NewListByServerPager method. +type ServerKeysClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// ServerOperationsClientListByServerOptions contains the optional parameters for the ServerOperationsClient.NewListByServerPager +// method. +type ServerOperationsClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate +// method. +type ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.Get +// method. +type ServerSecurityAlertPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServerSecurityAlertPoliciesClientListByServerOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.NewListByServerPager +// method. +type ServerSecurityAlertPoliciesClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// ServerTrustCertificatesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerTrustCertificatesClient.BeginCreateOrUpdate +// method. +type ServerTrustCertificatesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerTrustCertificatesClientBeginDeleteOptions contains the optional parameters for the ServerTrustCertificatesClient.BeginDelete +// method. +type ServerTrustCertificatesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerTrustCertificatesClientGetOptions contains the optional parameters for the ServerTrustCertificatesClient.Get method. +type ServerTrustCertificatesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServerTrustCertificatesClientListByInstanceOptions contains the optional parameters for the ServerTrustCertificatesClient.NewListByInstancePager +// method. +type ServerTrustCertificatesClientListByInstanceOptions struct { + // placeholder for future optional parameters +} + +// ServerTrustGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerTrustGroupsClient.BeginCreateOrUpdate +// method. +type ServerTrustGroupsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerTrustGroupsClientBeginDeleteOptions contains the optional parameters for the ServerTrustGroupsClient.BeginDelete +// method. +type ServerTrustGroupsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerTrustGroupsClientGetOptions contains the optional parameters for the ServerTrustGroupsClient.Get method. +type ServerTrustGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServerTrustGroupsClientListByInstanceOptions contains the optional parameters for the ServerTrustGroupsClient.NewListByInstancePager +// method. +type ServerTrustGroupsClientListByInstanceOptions struct { + // placeholder for future optional parameters +} + +// ServerTrustGroupsClientListByLocationOptions contains the optional parameters for the ServerTrustGroupsClient.NewListByLocationPager +// method. +type ServerTrustGroupsClientListByLocationOptions struct { + // placeholder for future optional parameters +} + +// ServerUsagesClientListByServerOptions contains the optional parameters for the ServerUsagesClient.NewListByServerPager +// method. +type ServerUsagesClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// ServerVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.CreateOrUpdate +// method. +type ServerVulnerabilityAssessmentsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ServerVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.Delete +// method. +type ServerVulnerabilityAssessmentsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ServerVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.Get +// method. +type ServerVulnerabilityAssessmentsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServerVulnerabilityAssessmentsClientListByServerOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.NewListByServerPager +// method. +type ServerVulnerabilityAssessmentsClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// ServersClientBeginCreateOrUpdateOptions contains the optional parameters for the ServersClient.BeginCreateOrUpdate method. +type ServersClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServersClientBeginDeleteOptions contains the optional parameters for the ServersClient.BeginDelete method. +type ServersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServersClientBeginImportDatabaseOptions contains the optional parameters for the ServersClient.BeginImportDatabase method. +type ServersClientBeginImportDatabaseOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServersClientBeginRefreshStatusOptions contains the optional parameters for the ServersClient.BeginRefreshStatus method. +type ServersClientBeginRefreshStatusOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServersClientBeginUpdateOptions contains the optional parameters for the ServersClient.BeginUpdate method. +type ServersClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServersClientCheckNameAvailabilityOptions contains the optional parameters for the ServersClient.CheckNameAvailability +// method. +type ServersClientCheckNameAvailabilityOptions struct { + // placeholder for future optional parameters +} + +// ServersClientGetOptions contains the optional parameters for the ServersClient.Get method. +type ServersClientGetOptions struct { + // The child resources to include in the response. + Expand *string +} + +// ServersClientListByResourceGroupOptions contains the optional parameters for the ServersClient.NewListByResourceGroupPager +// method. +type ServersClientListByResourceGroupOptions struct { + // The child resources to include in the response. + Expand *string +} + +// ServersClientListOptions contains the optional parameters for the ServersClient.NewListPager method. +type ServersClientListOptions struct { + // The child resources to include in the response. + Expand *string +} + +// ServiceObjectivesClientGetOptions contains the optional parameters for the ServiceObjectivesClient.Get method. +type ServiceObjectivesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServiceObjectivesClientListByServerOptions contains the optional parameters for the ServiceObjectivesClient.NewListByServerPager +// method. +type ServiceObjectivesClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// StartStopManagedInstanceSchedulesClientCreateOrUpdateOptions contains the optional parameters for the StartStopManagedInstanceSchedulesClient.CreateOrUpdate +// method. +type StartStopManagedInstanceSchedulesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// StartStopManagedInstanceSchedulesClientDeleteOptions contains the optional parameters for the StartStopManagedInstanceSchedulesClient.Delete +// method. +type StartStopManagedInstanceSchedulesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// StartStopManagedInstanceSchedulesClientGetOptions contains the optional parameters for the StartStopManagedInstanceSchedulesClient.Get +// method. +type StartStopManagedInstanceSchedulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// StartStopManagedInstanceSchedulesClientListByInstanceOptions contains the optional parameters for the StartStopManagedInstanceSchedulesClient.NewListByInstancePager +// method. +type StartStopManagedInstanceSchedulesClientListByInstanceOptions struct { + // placeholder for future optional parameters +} + +// SubscriptionUsagesClientGetOptions contains the optional parameters for the SubscriptionUsagesClient.Get method. +type SubscriptionUsagesClientGetOptions struct { + // placeholder for future optional parameters +} + +// SubscriptionUsagesClientListByLocationOptions contains the optional parameters for the SubscriptionUsagesClient.NewListByLocationPager +// method. +type SubscriptionUsagesClientListByLocationOptions struct { + // placeholder for future optional parameters +} + +// SynapseLinkWorkspacesClientListByDatabaseOptions contains the optional parameters for the SynapseLinkWorkspacesClient.NewListByDatabasePager +// method. +type SynapseLinkWorkspacesClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// SyncAgentsClientBeginCreateOrUpdateOptions contains the optional parameters for the SyncAgentsClient.BeginCreateOrUpdate +// method. +type SyncAgentsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SyncAgentsClientBeginDeleteOptions contains the optional parameters for the SyncAgentsClient.BeginDelete method. +type SyncAgentsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SyncAgentsClientGenerateKeyOptions contains the optional parameters for the SyncAgentsClient.GenerateKey method. +type SyncAgentsClientGenerateKeyOptions struct { + // placeholder for future optional parameters +} + +// SyncAgentsClientGetOptions contains the optional parameters for the SyncAgentsClient.Get method. +type SyncAgentsClientGetOptions struct { + // placeholder for future optional parameters +} + +// SyncAgentsClientListByServerOptions contains the optional parameters for the SyncAgentsClient.NewListByServerPager method. +type SyncAgentsClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// SyncAgentsClientListLinkedDatabasesOptions contains the optional parameters for the SyncAgentsClient.NewListLinkedDatabasesPager +// method. +type SyncAgentsClientListLinkedDatabasesOptions struct { + // placeholder for future optional parameters +} + +// SyncGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the SyncGroupsClient.BeginCreateOrUpdate +// method. +type SyncGroupsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SyncGroupsClientBeginDeleteOptions contains the optional parameters for the SyncGroupsClient.BeginDelete method. +type SyncGroupsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SyncGroupsClientBeginRefreshHubSchemaOptions contains the optional parameters for the SyncGroupsClient.BeginRefreshHubSchema +// method. +type SyncGroupsClientBeginRefreshHubSchemaOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SyncGroupsClientBeginUpdateOptions contains the optional parameters for the SyncGroupsClient.BeginUpdate method. +type SyncGroupsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SyncGroupsClientCancelSyncOptions contains the optional parameters for the SyncGroupsClient.CancelSync method. +type SyncGroupsClientCancelSyncOptions struct { + // placeholder for future optional parameters +} + +// SyncGroupsClientGetOptions contains the optional parameters for the SyncGroupsClient.Get method. +type SyncGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// SyncGroupsClientListByDatabaseOptions contains the optional parameters for the SyncGroupsClient.NewListByDatabasePager +// method. +type SyncGroupsClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// SyncGroupsClientListHubSchemasOptions contains the optional parameters for the SyncGroupsClient.NewListHubSchemasPager +// method. +type SyncGroupsClientListHubSchemasOptions struct { + // placeholder for future optional parameters +} + +// SyncGroupsClientListLogsOptions contains the optional parameters for the SyncGroupsClient.NewListLogsPager method. +type SyncGroupsClientListLogsOptions struct { + // The continuation token for this operation. + ContinuationToken *string +} + +// SyncGroupsClientListSyncDatabaseIDsOptions contains the optional parameters for the SyncGroupsClient.NewListSyncDatabaseIDsPager +// method. +type SyncGroupsClientListSyncDatabaseIDsOptions struct { + // placeholder for future optional parameters +} + +// SyncGroupsClientTriggerSyncOptions contains the optional parameters for the SyncGroupsClient.TriggerSync method. +type SyncGroupsClientTriggerSyncOptions struct { + // placeholder for future optional parameters +} + +// SyncMembersClientBeginCreateOrUpdateOptions contains the optional parameters for the SyncMembersClient.BeginCreateOrUpdate +// method. +type SyncMembersClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SyncMembersClientBeginDeleteOptions contains the optional parameters for the SyncMembersClient.BeginDelete method. +type SyncMembersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SyncMembersClientBeginRefreshMemberSchemaOptions contains the optional parameters for the SyncMembersClient.BeginRefreshMemberSchema +// method. +type SyncMembersClientBeginRefreshMemberSchemaOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SyncMembersClientBeginUpdateOptions contains the optional parameters for the SyncMembersClient.BeginUpdate method. +type SyncMembersClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SyncMembersClientGetOptions contains the optional parameters for the SyncMembersClient.Get method. +type SyncMembersClientGetOptions struct { + // placeholder for future optional parameters +} + +// SyncMembersClientListBySyncGroupOptions contains the optional parameters for the SyncMembersClient.NewListBySyncGroupPager +// method. +type SyncMembersClientListBySyncGroupOptions struct { + // placeholder for future optional parameters +} + +// SyncMembersClientListMemberSchemasOptions contains the optional parameters for the SyncMembersClient.NewListMemberSchemasPager +// method. +type SyncMembersClientListMemberSchemasOptions struct { + // placeholder for future optional parameters +} + +// TdeCertificatesClientBeginCreateOptions contains the optional parameters for the TdeCertificatesClient.BeginCreate method. +type TdeCertificatesClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// TimeZonesClientGetOptions contains the optional parameters for the TimeZonesClient.Get method. +type TimeZonesClientGetOptions struct { + // placeholder for future optional parameters +} + +// TimeZonesClientListByLocationOptions contains the optional parameters for the TimeZonesClient.NewListByLocationPager method. +type TimeZonesClientListByLocationOptions struct { + // placeholder for future optional parameters +} + +// TransparentDataEncryptionsClientBeginCreateOrUpdateOptions contains the optional parameters for the TransparentDataEncryptionsClient.BeginCreateOrUpdate +// method. +type TransparentDataEncryptionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// TransparentDataEncryptionsClientGetOptions contains the optional parameters for the TransparentDataEncryptionsClient.Get +// method. +type TransparentDataEncryptionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// TransparentDataEncryptionsClientListByDatabaseOptions contains the optional parameters for the TransparentDataEncryptionsClient.NewListByDatabasePager +// method. +type TransparentDataEncryptionsClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// UsagesClientListByInstancePoolOptions contains the optional parameters for the UsagesClient.NewListByInstancePoolPager +// method. +type UsagesClientListByInstancePoolOptions struct { + // Optional request parameter to include managed instance usages within the instance pool. + ExpandChildren *bool +} + +// VirtualClustersClientBeginDeleteOptions contains the optional parameters for the VirtualClustersClient.BeginDelete method. +type VirtualClustersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualClustersClientBeginUpdateDNSServersOptions contains the optional parameters for the VirtualClustersClient.BeginUpdateDNSServers +// method. +type VirtualClustersClientBeginUpdateDNSServersOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualClustersClientBeginUpdateOptions contains the optional parameters for the VirtualClustersClient.BeginUpdate method. +type VirtualClustersClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualClustersClientGetOptions contains the optional parameters for the VirtualClustersClient.Get method. +type VirtualClustersClientGetOptions struct { + // placeholder for future optional parameters +} + +// VirtualClustersClientListByResourceGroupOptions contains the optional parameters for the VirtualClustersClient.NewListByResourceGroupPager +// method. +type VirtualClustersClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// VirtualClustersClientListOptions contains the optional parameters for the VirtualClustersClient.NewListPager method. +type VirtualClustersClientListOptions struct { + // placeholder for future optional parameters +} + +// VirtualNetworkRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginCreateOrUpdate +// method. +type VirtualNetworkRulesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkRulesClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginDelete +// method. +type VirtualNetworkRulesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkRulesClientGetOptions contains the optional parameters for the VirtualNetworkRulesClient.Get method. +type VirtualNetworkRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// VirtualNetworkRulesClientListByServerOptions contains the optional parameters for the VirtualNetworkRulesClient.NewListByServerPager +// method. +type VirtualNetworkRulesClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentBaselineClientGetOptions contains the optional parameters for the VulnerabilityAssessmentBaselineClient.Get +// method. +type VulnerabilityAssessmentBaselineClientGetOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentOptions contains the optional parameters for the VulnerabilityAssessmentBaselineClient.NewListBySQLVulnerabilityAssessmentPager +// method. +type VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentBaselinesClientCreateOrUpdateOptions contains the optional parameters for the VulnerabilityAssessmentBaselinesClient.CreateOrUpdate +// method. +type VulnerabilityAssessmentBaselinesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentExecuteScanClientBeginExecuteOptions contains the optional parameters for the VulnerabilityAssessmentExecuteScanClient.BeginExecute +// method. +type VulnerabilityAssessmentExecuteScanClientBeginExecuteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateOptions contains the optional parameters for the VulnerabilityAssessmentRuleBaselineClient.CreateOrUpdate +// method. +type VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentRuleBaselineClientGetOptions contains the optional parameters for the VulnerabilityAssessmentRuleBaselineClient.Get +// method. +type VulnerabilityAssessmentRuleBaselineClientGetOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentRuleBaselineClientListByBaselineOptions contains the optional parameters for the VulnerabilityAssessmentRuleBaselineClient.NewListByBaselinePager +// method. +type VulnerabilityAssessmentRuleBaselineClientListByBaselineOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentRuleBaselinesClientDeleteOptions contains the optional parameters for the VulnerabilityAssessmentRuleBaselinesClient.Delete +// method. +type VulnerabilityAssessmentRuleBaselinesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentScanResultClientGetOptions contains the optional parameters for the VulnerabilityAssessmentScanResultClient.Get +// method. +type VulnerabilityAssessmentScanResultClientGetOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentScanResultClientListByScanOptions contains the optional parameters for the VulnerabilityAssessmentScanResultClient.NewListByScanPager +// method. +type VulnerabilityAssessmentScanResultClientListByScanOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the VulnerabilityAssessmentScansClient.Get +// method. +type VulnerabilityAssessmentScansClientGetOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsOptions contains the optional parameters for the VulnerabilityAssessmentScansClient.NewListBySQLVulnerabilityAssessmentsPager +// method. +type VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the VulnerabilityAssessmentsClient.Delete +// method. +type VulnerabilityAssessmentsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentsSettingsClientCreateOrUpdateOptions contains the optional parameters for the VulnerabilityAssessmentsSettingsClient.CreateOrUpdate +// method. +type VulnerabilityAssessmentsSettingsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentsSettingsClientGetOptions contains the optional parameters for the VulnerabilityAssessmentsSettingsClient.Get +// method. +type VulnerabilityAssessmentsSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentsSettingsClientListByServerOptions contains the optional parameters for the VulnerabilityAssessmentsSettingsClient.NewListByServerPager +// method. +type VulnerabilityAssessmentsSettingsClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// WorkloadClassifiersClientBeginCreateOrUpdateOptions contains the optional parameters for the WorkloadClassifiersClient.BeginCreateOrUpdate +// method. +type WorkloadClassifiersClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WorkloadClassifiersClientBeginDeleteOptions contains the optional parameters for the WorkloadClassifiersClient.BeginDelete +// method. +type WorkloadClassifiersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WorkloadClassifiersClientGetOptions contains the optional parameters for the WorkloadClassifiersClient.Get method. +type WorkloadClassifiersClientGetOptions struct { + // placeholder for future optional parameters +} + +// WorkloadClassifiersClientListByWorkloadGroupOptions contains the optional parameters for the WorkloadClassifiersClient.NewListByWorkloadGroupPager +// method. +type WorkloadClassifiersClientListByWorkloadGroupOptions struct { + // placeholder for future optional parameters +} + +// WorkloadGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the WorkloadGroupsClient.BeginCreateOrUpdate +// method. +type WorkloadGroupsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WorkloadGroupsClientBeginDeleteOptions contains the optional parameters for the WorkloadGroupsClient.BeginDelete method. +type WorkloadGroupsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WorkloadGroupsClientGetOptions contains the optional parameters for the WorkloadGroupsClient.Get method. +type WorkloadGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// WorkloadGroupsClientListByDatabaseOptions contains the optional parameters for the WorkloadGroupsClient.NewListByDatabasePager +// method. +type WorkloadGroupsClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/sql/armsql/outboundfirewallrules_client.go b/sdk/resourcemanager/sql/armsql/outboundfirewallrules_client.go index 72828e56ecb4..467f3a163d93 100644 --- a/sdk/resourcemanager/sql/armsql/outboundfirewallrules_client.go +++ b/sdk/resourcemanager/sql/armsql/outboundfirewallrules_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -59,7 +58,8 @@ func (client *OutboundFirewallRulesClient) BeginCreateOrUpdate(ctx context.Conte if err != nil { return nil, err } - return runtime.NewPoller[OutboundFirewallRulesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[OutboundFirewallRulesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[OutboundFirewallRulesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,18 +70,20 @@ func (client *OutboundFirewallRulesClient) BeginCreateOrUpdate(ctx context.Conte // // Generated from API version 2021-02-01-preview func (client *OutboundFirewallRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, outboundRuleFqdn string, parameters OutboundFirewallRule, options *OutboundFirewallRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, outboundRuleFqdn, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -111,7 +113,10 @@ func (client *OutboundFirewallRulesClient) createOrUpdateCreateRequest(ctx conte reqQP.Set("api-version", "2021-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a outbound firewall rule with a given name. @@ -129,7 +134,8 @@ func (client *OutboundFirewallRulesClient) BeginDelete(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller[OutboundFirewallRulesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[OutboundFirewallRulesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[OutboundFirewallRulesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -140,18 +146,20 @@ func (client *OutboundFirewallRulesClient) BeginDelete(ctx context.Context, reso // // Generated from API version 2021-02-01-preview func (client *OutboundFirewallRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, outboundRuleFqdn string, options *OutboundFirewallRulesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, outboundRuleFqdn, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -193,18 +201,21 @@ func (client *OutboundFirewallRulesClient) deleteCreateRequest(ctx context.Conte // - options - OutboundFirewallRulesClientGetOptions contains the optional parameters for the OutboundFirewallRulesClient.Get // method. func (client *OutboundFirewallRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, outboundRuleFqdn string, options *OutboundFirewallRulesClientGetOptions) (OutboundFirewallRulesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, outboundRuleFqdn, options) if err != nil { return OutboundFirewallRulesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return OutboundFirewallRulesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OutboundFirewallRulesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return OutboundFirewallRulesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/outboundfirewallrules_client_example_test.go b/sdk/resourcemanager/sql/armsql/outboundfirewallrules_client_example_test.go index 6d1f4e1d9aaf..850c96fe2d42 100644 --- a/sdk/resourcemanager/sql/armsql/outboundfirewallrules_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/outboundfirewallrules_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -45,7 +45,7 @@ func ExampleOutboundFirewallRulesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -77,7 +77,7 @@ func ExampleOutboundFirewallRulesClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -98,7 +98,7 @@ func ExampleOutboundFirewallRulesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/privateendpointconnections_client.go b/sdk/resourcemanager/sql/armsql/privateendpointconnections_client.go index 7273c297734c..58a77d3e8bbe 100644 --- a/sdk/resourcemanager/sql/armsql/privateendpointconnections_client.go +++ b/sdk/resourcemanager/sql/armsql/privateendpointconnections_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -47,7 +46,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Approve or reject a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-08-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. @@ -59,7 +58,8 @@ func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context. if err != nil { return nil, err } - return runtime.NewPoller[PrivateEndpointConnectionsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[PrivateEndpointConnectionsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[PrivateEndpointConnectionsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -68,20 +68,22 @@ func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context. // CreateOrUpdate - Approve or reject a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-08-01-preview func (client *PrivateEndpointConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, privateEndpointConnectionName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -108,16 +110,19 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-08-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. @@ -129,7 +134,8 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[PrivateEndpointConnectionsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[PrivateEndpointConnectionsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[PrivateEndpointConnectionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -138,20 +144,22 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-08-01-preview func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, privateEndpointConnectionName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -178,7 +186,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -186,7 +194,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Gets a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-08-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. @@ -194,18 +202,21 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // - options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get // method. func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, privateEndpointConnectionName, options) if err != nil { return PrivateEndpointConnectionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateEndpointConnectionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateEndpointConnectionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -232,7 +243,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,7 +260,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListByServerPager - Gets all private endpoint connections on a server. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-08-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. @@ -303,7 +314,7 @@ func (client *PrivateEndpointConnectionsClient) listByServerCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-08-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/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/sql/armsql/privateendpointconnections_client_example_test.go index 996072745da9..b3918c578e5a 100644 --- a/sdk/resourcemanager/sql/armsql/privateendpointconnections_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/privateendpointconnections_client_example_test.go @@ -15,10 +15,70 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-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() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByServerPager("Default", "test-svr", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.PrivateEndpointConnectionListResult = armsql.PrivateEndpointConnectionListResult{ + // Value: []*armsql.PrivateEndpointConnection{ + // { + // Name: to.Ptr("private-endpoint-connection-name"), + // Type: to.Ptr("Microsoft.Sql/servers/privateEndpointConnections"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name-2"), + // Properties: &armsql.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armsql.PrivateEndpointProperty{ + // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), + // }, + // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ + // Description: to.Ptr("Auto-approved"), + // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), + // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), + // }, + // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), + // }, + // }, + // { + // Name: to.Ptr("private-endpoint-connection-name-2"), + // Type: to.Ptr("Microsoft.Sql/servers/privateEndpointConnections"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name-2"), + // Properties: &armsql.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armsql.PrivateEndpointProperty{ + // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name-2"), + // }, + // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ + // Description: to.Ptr("Auto-approved"), + // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), + // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), + // }, + // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PrivateEndpointConnectionGet.json func ExamplePrivateEndpointConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -54,7 +114,7 @@ func ExamplePrivateEndpointConnectionsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PrivateEndpointConnectionUpdate.json func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -101,7 +161,7 @@ func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PrivateEndpointConnectionDelete.json func ExamplePrivateEndpointConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -121,63 +181,3 @@ func ExamplePrivateEndpointConnectionsClient_BeginDelete() { log.Fatalf("failed to pull the result: %v", err) } } - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/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() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByServerPager("Default", "test-svr", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateEndpointConnectionListResult = armsql.PrivateEndpointConnectionListResult{ - // Value: []*armsql.PrivateEndpointConnection{ - // { - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.Sql/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name-2"), - // Properties: &armsql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }, - // { - // Name: to.Ptr("private-endpoint-connection-name-2"), - // Type: to.Ptr("Microsoft.Sql/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name-2"), - // Properties: &armsql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name-2"), - // }, - // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/privatelinkresources_client.go b/sdk/resourcemanager/sql/armsql/privatelinkresources_client.go index 5f188202479f..0d7c2e60b07b 100644 --- a/sdk/resourcemanager/sql/armsql/privatelinkresources_client.go +++ b/sdk/resourcemanager/sql/armsql/privatelinkresources_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -55,18 +54,21 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // - options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get // method. func (client *PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, serverName string, groupName string, options *PrivateLinkResourcesClientGetOptions) (PrivateLinkResourcesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, groupName, options) if err != nil { return PrivateLinkResourcesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateLinkResourcesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateLinkResourcesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateLinkResourcesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/privatelinkresources_client_example_test.go b/sdk/resourcemanager/sql/armsql/privatelinkresources_client_example_test.go index 9a9cbdf0478a..c463756321c9 100644 --- a/sdk/resourcemanager/sql/armsql/privatelinkresources_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/privatelinkresources_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateLinkResourcesList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -55,7 +55,7 @@ func ExamplePrivateLinkResourcesClient_NewListByServerPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateLinkResourcesGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/recommendedsensitivitylabels_client.go b/sdk/resourcemanager/sql/armsql/recommendedsensitivitylabels_client.go index 3fc74b9745a3..f68d0c02fd23 100644 --- a/sdk/resourcemanager/sql/armsql/recommendedsensitivitylabels_client.go +++ b/sdk/resourcemanager/sql/armsql/recommendedsensitivitylabels_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -55,16 +54,18 @@ func NewRecommendedSensitivityLabelsClient(subscriptionID string, credential azc // - options - RecommendedSensitivityLabelsClientUpdateOptions contains the optional parameters for the RecommendedSensitivityLabelsClient.Update // method. func (client *RecommendedSensitivityLabelsClient) Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters RecommendedSensitivityLabelUpdateList, options *RecommendedSensitivityLabelsClientUpdateOptions) (RecommendedSensitivityLabelsClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { return RecommendedSensitivityLabelsClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RecommendedSensitivityLabelsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RecommendedSensitivityLabelsClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RecommendedSensitivityLabelsClientUpdateResponse{}, err } return RecommendedSensitivityLabelsClientUpdateResponse{}, nil } @@ -95,5 +96,8 @@ func (client *RecommendedSensitivityLabelsClient) updateCreateRequest(ctx contex reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/recommendedsensitivitylabels_client_example_test.go b/sdk/resourcemanager/sql/armsql/recommendedsensitivitylabels_client_example_test.go index a0c43549445b..4a5573326ac5 100644 --- a/sdk/resourcemanager/sql/armsql/recommendedsensitivitylabels_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/recommendedsensitivitylabels_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsRecommendedUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/recoverabledatabases_client.go b/sdk/resourcemanager/sql/armsql/recoverabledatabases_client.go index c9d7c4d41d87..c5fe69e8d732 100644 --- a/sdk/resourcemanager/sql/armsql/recoverabledatabases_client.go +++ b/sdk/resourcemanager/sql/armsql/recoverabledatabases_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -44,38 +43,37 @@ func NewRecoverableDatabasesClient(subscriptionID string, credential azcore.Toke return client, nil } -// Get - Gets a recoverable database, which is a resource representing a database's geo backup +// Get - Gets a recoverable database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2014-04-01 +// Generated from API version 2022-08-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 +// - databaseName - The name of the database. // - options - RecoverableDatabasesClientGetOptions contains the optional parameters for the RecoverableDatabasesClient.Get // method. func (client *RecoverableDatabasesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *RecoverableDatabasesClientGetOptions) (RecoverableDatabasesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { return RecoverableDatabasesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RecoverableDatabasesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RecoverableDatabasesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RecoverableDatabasesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. func (client *RecoverableDatabasesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *RecoverableDatabasesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases/{databaseName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -88,12 +86,22 @@ func (client *RecoverableDatabasesClient) getCreateRequest(ctx context.Context, 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.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -108,9 +116,9 @@ func (client *RecoverableDatabasesClient) getHandleResponse(resp *http.Response) return result, nil } -// NewListByServerPager - Gets a list of recoverable databases +// NewListByServerPager - Gets a list of recoverable databases. // -// Generated from API version 2014-04-01 +// Generated from API version 2022-08-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. @@ -119,10 +127,16 @@ func (client *RecoverableDatabasesClient) getHandleResponse(resp *http.Response) func (client *RecoverableDatabasesClient) NewListByServerPager(resourceGroupName string, serverName string, options *RecoverableDatabasesClientListByServerOptions) *runtime.Pager[RecoverableDatabasesClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[RecoverableDatabasesClientListByServerResponse]{ More: func(page RecoverableDatabasesClientListByServerResponse) bool { - return false + return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *RecoverableDatabasesClientListByServerResponse) (RecoverableDatabasesClientListByServerResponse, error) { - req, err := client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) + var req *policy.Request + var err error + if page == nil { + req, err = client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } if err != nil { return RecoverableDatabasesClientListByServerResponse{}, err } @@ -141,10 +155,6 @@ func (client *RecoverableDatabasesClient) NewListByServerPager(resourceGroupName // listByServerCreateRequest creates the ListByServer request. func (client *RecoverableDatabasesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *RecoverableDatabasesClientListByServerOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -153,12 +163,16 @@ func (client *RecoverableDatabasesClient) listByServerCreateRequest(ctx context. return nil, errors.New("parameter serverName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + 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.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") + reqQP.Set("api-version", "2022-08-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/recoverabledatabases_client_example_test.go b/sdk/resourcemanager/sql/armsql/recoverabledatabases_client_example_test.go index 43afa4d9c7e6..6277a7e699fa 100644 --- a/sdk/resourcemanager/sql/armsql/recoverabledatabases_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/recoverabledatabases_client_example_test.go @@ -13,41 +13,12 @@ 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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/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() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRecoverableDatabasesClient().Get(ctx, "recoverabledatabasetest-6852", "recoverabledatabasetest-2080", "recoverabledatabasetest-9187", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecoverableDatabase = armsql.RecoverableDatabase{ - // Name: to.Ptr("recoverabledatabasetest-9187"), - // Type: to.Ptr("Microsoft.Sql/servers/recoverabledatabases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/recoverabledatabasetest-6852/providers/Microsoft.Sql/servers/recoverabledatabasetest-2080/recoverabledatabases/recoverabledatabasetest-9187"), - // Properties: &armsql.RecoverableDatabaseProperties{ - // Edition: to.Ptr("Basic"), - // LastAvailableBackupDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T01:06:29.78Z"); return t}()), - // ServiceLevelObjective: to.Ptr("Basic"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/RecoverableDatabaseList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/RecoverableDatabaseList.json func ExampleRecoverableDatabasesClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -73,8 +44,8 @@ func ExampleRecoverableDatabasesClient_NewListByServerPager() { // Value: []*armsql.RecoverableDatabase{ // { // Name: to.Ptr("recoverabledatabasetest-1235"), - // Type: to.Ptr("Microsoft.Sql/servers/recoverabledatabases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/recoverabledatabasetest-1234/providers/Microsoft.Sql/servers/recoverabledatabasetest-7177/recoverabledatabases/recoverabledatabasetest-1235"), + // Type: to.Ptr("Microsoft.Sql/servers/recoverableDatabases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/recoverabledatabasetest-1234/providers/Microsoft.Sql/servers/recoverabledatabasetest-7177/recoverableDatabases/recoverabledatabasetest-1235"), // Properties: &armsql.RecoverableDatabaseProperties{ // Edition: to.Ptr("Standard"), // LastAvailableBackupDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T01:06:29.78Z"); return t}()), @@ -83,8 +54,8 @@ func ExampleRecoverableDatabasesClient_NewListByServerPager() { // }, // { // Name: to.Ptr("recoverabledatabasetest-9231"), - // Type: to.Ptr("Microsoft.Sql/servers/recoverabledatabases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/recoverabledatabasetest-1234/providers/Microsoft.Sql/servers/recoverabledatabasetest-7177/recoverabledatabases/recoverabledatabasetest-9231"), + // Type: to.Ptr("Microsoft.Sql/servers/recoverableDatabases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/recoverabledatabasetest-1234/providers/Microsoft.Sql/servers/recoverabledatabasetest-7177/recoverableDatabases/recoverabledatabasetest-9231"), // Properties: &armsql.RecoverableDatabaseProperties{ // Edition: to.Ptr("Premium"), // LastAvailableBackupDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T03:20:31.78Z"); return t}()), @@ -104,3 +75,73 @@ func ExampleRecoverableDatabasesClient_NewListByServerPager() { // } } } + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/RecoverableDatabaseGet.json +func ExampleRecoverableDatabasesClient_Get_getARecoverableDatabase() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewRecoverableDatabasesClient().Get(ctx, "recoverabledatabasetest-6852", "recoverabledatabasetest-2080", "recoverabledatabasetest-9187", &armsql.RecoverableDatabasesClientGetOptions{Expand: nil, + Filter: nil, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.RecoverableDatabase = armsql.RecoverableDatabase{ + // Name: to.Ptr("recoverabledatabasetest-9187"), + // Type: to.Ptr("Microsoft.Sql/servers/recoverableDatabases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/recoverabledatabasetest-6852/providers/Microsoft.Sql/servers/recoverabledatabasetest-2080/recoverableDatabases/recoverabledatabasetest-9187"), + // Properties: &armsql.RecoverableDatabaseProperties{ + // Edition: to.Ptr("Basic"), + // LastAvailableBackupDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T01:06:29.78Z"); return t}()), + // ServiceLevelObjective: to.Ptr("Basic"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/RecoverableDatabaseGetWithExpandEqualsKeys.json +func ExampleRecoverableDatabasesClient_Get_getsARecoverableDatabaseWithExpandEqualsKeys() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewRecoverableDatabasesClient().Get(ctx, "recoverabledatabasetest-6852", "recoverabledatabasetest-2080", "recoverabledatabasetest-9187", &armsql.RecoverableDatabasesClientGetOptions{Expand: to.Ptr("keys"), + Filter: nil, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.RecoverableDatabase = armsql.RecoverableDatabase{ + // Name: to.Ptr("recoverabledatabasetest-9187"), + // Type: to.Ptr("Microsoft.Sql/servers/recoverableDatabases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/recoverabledatabasetest-6852/providers/Microsoft.Sql/servers/recoverabledatabasetest-2080/recoverableDatabases/recoverabledatabasetest-9187"), + // Properties: &armsql.RecoverableDatabaseProperties{ + // Edition: to.Ptr("Basic"), + // Keys: map[string]*armsql.DatabaseKey{ + // "https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion": &armsql.DatabaseKey{ + // }, + // "https://your-key-vault-name.vault.azure.net/yourKey2/yourKey2Version": &armsql.DatabaseKey{ + // }, + // }, + // LastAvailableBackupDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T01:06:29.78Z"); return t}()), + // ServiceLevelObjective: to.Ptr("Basic"), + // }, + // } +} diff --git a/sdk/resourcemanager/sql/armsql/recoverablemanageddatabases_client.go b/sdk/resourcemanager/sql/armsql/recoverablemanageddatabases_client.go index 5dc1a6867846..30dca34514c3 100644 --- a/sdk/resourcemanager/sql/armsql/recoverablemanageddatabases_client.go +++ b/sdk/resourcemanager/sql/armsql/recoverablemanageddatabases_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -54,18 +53,21 @@ func NewRecoverableManagedDatabasesClient(subscriptionID string, credential azco // - options - RecoverableManagedDatabasesClientGetOptions contains the optional parameters for the RecoverableManagedDatabasesClient.Get // method. func (client *RecoverableManagedDatabasesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, recoverableDatabaseName string, options *RecoverableManagedDatabasesClientGetOptions) (RecoverableManagedDatabasesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, recoverableDatabaseName, options) if err != nil { return RecoverableManagedDatabasesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RecoverableManagedDatabasesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RecoverableManagedDatabasesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RecoverableManagedDatabasesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/recoverablemanageddatabases_client_example_test.go b/sdk/resourcemanager/sql/armsql/recoverablemanageddatabases_client_example_test.go index 28e21010fbf4..720a823cdcc0 100644 --- a/sdk/resourcemanager/sql/armsql/recoverablemanageddatabases_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/recoverablemanageddatabases_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListRecoverableManagedDatabasesByServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -61,7 +61,7 @@ func ExampleRecoverableManagedDatabasesClient_NewListByInstancePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetRecoverableManagedDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/replicationlinks_client.go b/sdk/resourcemanager/sql/armsql/replicationlinks_client.go index 87e24cf4408c..1d3fcd6a5643 100644 --- a/sdk/resourcemanager/sql/armsql/replicationlinks_client.go +++ b/sdk/resourcemanager/sql/armsql/replicationlinks_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -44,32 +43,52 @@ 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 + } + poller, err := runtime.NewPoller[ReplicationLinksClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ReplicationLinksClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), 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) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, linkID, options) if err != nil { - return ReplicationLinksClientDeleteResponse{}, err + return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().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(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return ReplicationLinksClientDeleteResponse{}, nil + return httpResp, 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") @@ -96,7 +115,7 @@ 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 } @@ -104,7 +123,7 @@ func (client *ReplicationLinksClient) deleteCreateRequest(ctx context.Context, r // 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. @@ -118,7 +137,8 @@ func (client *ReplicationLinksClient) BeginFailover(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller[ReplicationLinksClientFailoverResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationLinksClientFailoverResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationLinksClientFailoverResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -127,20 +147,22 @@ 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) { + var err error req, err := client.failoverCreateRequest(ctx, resourceGroupName, serverName, databaseName, linkID, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // failoverCreateRequest creates the Failover request. @@ -171,7 +193,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 @@ -180,7 +202,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. @@ -194,7 +216,8 @@ func (client *ReplicationLinksClient) BeginFailoverAllowDataLoss(ctx context.Con if err != nil { return nil, err } - return runtime.NewPoller[ReplicationLinksClientFailoverAllowDataLossResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationLinksClientFailoverAllowDataLossResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationLinksClientFailoverAllowDataLossResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -203,20 +226,22 @@ 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) { + var err error req, err := client.failoverAllowDataLossCreateRequest(ctx, resourceGroupName, serverName, databaseName, linkID, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // failoverAllowDataLossCreateRequest creates the FailoverAllowDataLoss request. @@ -247,7 +272,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 @@ -256,7 +281,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. @@ -264,18 +289,21 @@ func (client *ReplicationLinksClient) failoverAllowDataLossCreateRequest(ctx con // - linkID - The name of the replication link. // - options - ReplicationLinksClientGetOptions contains the optional parameters for the ReplicationLinksClient.Get method. func (client *ReplicationLinksClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *ReplicationLinksClientGetOptions) (ReplicationLinksClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, linkID, options) if err != nil { return ReplicationLinksClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationLinksClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationLinksClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationLinksClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -306,7 +334,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 @@ -323,7 +351,7 @@ func (client *ReplicationLinksClient) getHandleResponse(resp *http.Response) (Re // NewListByDatabasePager - Gets a list of replication links on database. // -// 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. @@ -382,7 +410,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 @@ -399,7 +427,7 @@ func (client *ReplicationLinksClient) listByDatabaseHandleResponse(resp *http.Re // NewListByServerPager - Gets a list of replication links. // -// 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. @@ -453,7 +481,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/replicationlinks_client_example_test.go b/sdk/resourcemanager/sql/armsql/replicationlinks_client_example_test.go index 5af2b579e485..3374f0ad8700 100644 --- a/sdk/resourcemanager/sql/armsql/replicationlinks_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/replicationlinks_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ReplicationLinkListByDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkListByDatabase.json func ExampleReplicationLinksClient_NewListByDatabasePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -79,7 +79,7 @@ func ExampleReplicationLinksClient_NewListByDatabasePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ReplicationLinkGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkGet.json func ExampleReplicationLinksClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -116,8 +116,8 @@ func ExampleReplicationLinksClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ReplicationLinkDelete.json -func ExampleReplicationLinksClient_Delete() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkDelete.json +func ExampleReplicationLinksClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -127,13 +127,17 @@ func ExampleReplicationLinksClient_Delete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = clientFactory.NewReplicationLinksClient().Delete(ctx, "Default", "sourcesvr", "gamma-db", "4891ca10-ebd0-47d7-9182-c722651780fb", nil) + poller, err := clientFactory.NewReplicationLinksClient().BeginDelete(ctx, "Default", "sourcesvr", "gamma-db", "4891ca10-ebd0-47d7-9182-c722651780fb", 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/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ReplicationLinkFailover.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkFailover.json func ExampleReplicationLinksClient_BeginFailover() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -174,7 +178,7 @@ func ExampleReplicationLinksClient_BeginFailover() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ReplicationLinkFailoverAllowDataLoss.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkFailoverAllowDataLoss.json func ExampleReplicationLinksClient_BeginFailoverAllowDataLoss() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -215,7 +219,7 @@ func ExampleReplicationLinksClient_BeginFailoverAllowDataLoss() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ReplicationLinkListByServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkListByServer.json func ExampleReplicationLinksClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/sql/armsql/response_types.go b/sdk/resourcemanager/sql/armsql/response_types.go index b48e7f63e374..091b5ae7f5c7 100644 --- a/sdk/resourcemanager/sql/armsql/response_types.go +++ b/sdk/resourcemanager/sql/armsql/response_types.go @@ -3,94 +3,110 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql // AgentClientCreateOrUpdateResponse contains the response from method AgentClient.CreateOrUpdate. type AgentClientCreateOrUpdateResponse struct { + // A recoverable managed database resource. AgentConfiguration } // AgentClientGetResponse contains the response from method AgentClient.Get. type AgentClientGetResponse struct { + // A recoverable managed database resource. AgentConfiguration } // BackupShortTermRetentionPoliciesClientCreateOrUpdateResponse contains the response from method BackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate. type BackupShortTermRetentionPoliciesClientCreateOrUpdateResponse struct { + // A short term retention policy. BackupShortTermRetentionPolicy } // BackupShortTermRetentionPoliciesClientGetResponse contains the response from method BackupShortTermRetentionPoliciesClient.Get. type BackupShortTermRetentionPoliciesClientGetResponse struct { + // A short term retention policy. BackupShortTermRetentionPolicy } // BackupShortTermRetentionPoliciesClientListByDatabaseResponse contains the response from method BackupShortTermRetentionPoliciesClient.NewListByDatabasePager. type BackupShortTermRetentionPoliciesClientListByDatabaseResponse struct { + // A list of short term retention policies. BackupShortTermRetentionPolicyListResult } // BackupShortTermRetentionPoliciesClientUpdateResponse contains the response from method BackupShortTermRetentionPoliciesClient.BeginUpdate. type BackupShortTermRetentionPoliciesClientUpdateResponse struct { + // A short term retention policy. BackupShortTermRetentionPolicy } // CapabilitiesClientListByLocationResponse contains the response from method CapabilitiesClient.ListByLocation. type CapabilitiesClientListByLocationResponse struct { + // The location capability. LocationCapabilities } // DataMaskingPoliciesClientCreateOrUpdateResponse contains the response from method DataMaskingPoliciesClient.CreateOrUpdate. type DataMaskingPoliciesClientCreateOrUpdateResponse struct { + // Represents a database data masking policy. DataMaskingPolicy } // DataMaskingPoliciesClientGetResponse contains the response from method DataMaskingPoliciesClient.Get. type DataMaskingPoliciesClientGetResponse struct { + // Represents a database data masking policy. DataMaskingPolicy } // DataMaskingRulesClientCreateOrUpdateResponse contains the response from method DataMaskingRulesClient.CreateOrUpdate. type DataMaskingRulesClientCreateOrUpdateResponse struct { + // Represents a database data masking rule. DataMaskingRule } // DataMaskingRulesClientListByDatabaseResponse contains the response from method DataMaskingRulesClient.NewListByDatabasePager. type DataMaskingRulesClientListByDatabaseResponse struct { + // The response to a list data masking rules request. DataMaskingRuleListResult } // DataWarehouseUserActivitiesClientGetResponse contains the response from method DataWarehouseUserActivitiesClient.Get. type DataWarehouseUserActivitiesClientGetResponse struct { + // User activities of a data warehouse DataWarehouseUserActivities } // DataWarehouseUserActivitiesClientListByDatabaseResponse contains the response from method DataWarehouseUserActivitiesClient.NewListByDatabasePager. type DataWarehouseUserActivitiesClientListByDatabaseResponse struct { + // User activities of a data warehouse DataWarehouseUserActivitiesListResult } // DatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse contains the response from method DatabaseAdvancedThreatProtectionSettingsClient.CreateOrUpdate. type DatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse struct { + // A database Advanced Threat Protection. DatabaseAdvancedThreatProtection } // DatabaseAdvancedThreatProtectionSettingsClientGetResponse contains the response from method DatabaseAdvancedThreatProtectionSettingsClient.Get. type DatabaseAdvancedThreatProtectionSettingsClientGetResponse struct { + // A database Advanced Threat Protection. DatabaseAdvancedThreatProtection } // DatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse contains the response from method DatabaseAdvancedThreatProtectionSettingsClient.NewListByDatabasePager. type DatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse struct { + // A list of the database's Advanced Threat Protection configurations. DatabaseAdvancedThreatProtectionListResult } // DatabaseAdvisorsClientGetResponse contains the response from method DatabaseAdvisorsClient.Get. type DatabaseAdvisorsClientGetResponse struct { + // Database, Server or Elastic Pool Advisor. Advisor } @@ -102,51 +118,71 @@ type DatabaseAdvisorsClientListByDatabaseResponse struct { // DatabaseAdvisorsClientUpdateResponse contains the response from method DatabaseAdvisorsClient.Update. type DatabaseAdvisorsClientUpdateResponse struct { + // Database, Server or Elastic Pool Advisor. Advisor } // DatabaseAutomaticTuningClientGetResponse contains the response from method DatabaseAutomaticTuningClient.Get. type DatabaseAutomaticTuningClientGetResponse struct { + // Database-level Automatic Tuning. DatabaseAutomaticTuning } // DatabaseAutomaticTuningClientUpdateResponse contains the response from method DatabaseAutomaticTuningClient.Update. type DatabaseAutomaticTuningClientUpdateResponse struct { + // Database-level Automatic Tuning. DatabaseAutomaticTuning } // DatabaseBlobAuditingPoliciesClientCreateOrUpdateResponse contains the response from method DatabaseBlobAuditingPoliciesClient.CreateOrUpdate. type DatabaseBlobAuditingPoliciesClientCreateOrUpdateResponse struct { + // A database blob auditing policy. DatabaseBlobAuditingPolicy } // DatabaseBlobAuditingPoliciesClientGetResponse contains the response from method DatabaseBlobAuditingPoliciesClient.Get. type DatabaseBlobAuditingPoliciesClientGetResponse struct { + // A database blob auditing policy. DatabaseBlobAuditingPolicy } // DatabaseBlobAuditingPoliciesClientListByDatabaseResponse contains the response from method DatabaseBlobAuditingPoliciesClient.NewListByDatabasePager. type DatabaseBlobAuditingPoliciesClientListByDatabaseResponse struct { + // A list of database auditing settings. DatabaseBlobAuditingPolicyListResult } // DatabaseColumnsClientGetResponse contains the response from method DatabaseColumnsClient.Get. type DatabaseColumnsClientGetResponse struct { + // A database column resource. DatabaseColumn } // DatabaseColumnsClientListByDatabaseResponse contains the response from method DatabaseColumnsClient.NewListByDatabasePager. type DatabaseColumnsClientListByDatabaseResponse struct { + // A list of database columns. DatabaseColumnListResult } // DatabaseColumnsClientListByTableResponse contains the response from method DatabaseColumnsClient.NewListByTablePager. type DatabaseColumnsClientListByTableResponse struct { + // A list of database columns. DatabaseColumnListResult } +// DatabaseEncryptionProtectorsClientRevalidateResponse contains the response from method DatabaseEncryptionProtectorsClient.BeginRevalidate. +type DatabaseEncryptionProtectorsClientRevalidateResponse struct { + // placeholder for future response values +} + +// DatabaseEncryptionProtectorsClientRevertResponse contains the response from method DatabaseEncryptionProtectorsClient.BeginRevert. +type DatabaseEncryptionProtectorsClientRevertResponse struct { + // placeholder for future response values +} + // DatabaseExtensionsClientCreateOrUpdateResponse contains the response from method DatabaseExtensionsClient.BeginCreateOrUpdate. type DatabaseExtensionsClientCreateOrUpdateResponse struct { + // An Extension operation result resource. ImportExportExtensionsOperationResult } @@ -157,6 +193,7 @@ type DatabaseExtensionsClientGetResponse struct { // DatabaseExtensionsClientListByDatabaseResponse contains the response from method DatabaseExtensionsClient.NewListByDatabasePager. type DatabaseExtensionsClientListByDatabaseResponse struct { + // Import export operation extensions list. ImportExportExtensionsOperationListResult } @@ -167,11 +204,13 @@ type DatabaseOperationsClientCancelResponse struct { // DatabaseOperationsClientListByDatabaseResponse contains the response from method DatabaseOperationsClient.NewListByDatabasePager. type DatabaseOperationsClientListByDatabaseResponse struct { + // The response to a list database operations request DatabaseOperationListResult } // DatabaseRecommendedActionsClientGetResponse contains the response from method DatabaseRecommendedActionsClient.Get. type DatabaseRecommendedActionsClientGetResponse struct { + // Database, Server or Elastic Pool Recommended Action. RecommendedAction } @@ -183,51 +222,144 @@ type DatabaseRecommendedActionsClientListByDatabaseAdvisorResponse struct { // DatabaseRecommendedActionsClientUpdateResponse contains the response from method DatabaseRecommendedActionsClient.Update. type DatabaseRecommendedActionsClientUpdateResponse struct { + // Database, Server or Elastic Pool Recommended Action. RecommendedAction } +// DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse contains the response from method DatabaseSQLVulnerabilityAssessmentBaselinesClient.CreateOrUpdate. +type DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse struct { + // A database sql vulnerability assessment baseline set. + DatabaseSQLVulnerabilityAssessmentBaselineSet +} + +// DatabaseSQLVulnerabilityAssessmentBaselinesClientGetResponse contains the response from method DatabaseSQLVulnerabilityAssessmentBaselinesClient.Get. +type DatabaseSQLVulnerabilityAssessmentBaselinesClientGetResponse struct { + // A database sql vulnerability assessment baseline set. + DatabaseSQLVulnerabilityAssessmentBaselineSet +} + +// DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse contains the response from method +// DatabaseSQLVulnerabilityAssessmentBaselinesClient.NewListBySQLVulnerabilityAssessmentPager. +type DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse struct { + // A list of SQL Vulnerability Assessments baseline set. + DatabaseSQLVulnerabilityAssessmentBaselineSetListResult +} + +// DatabaseSQLVulnerabilityAssessmentExecuteScanClientExecuteResponse contains the response from method DatabaseSQLVulnerabilityAssessmentExecuteScanClient.BeginExecute. +type DatabaseSQLVulnerabilityAssessmentExecuteScanClientExecuteResponse struct { + // placeholder for future response values +} + +// DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse contains the response from method DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate. +type DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse struct { + // A database sql vulnerability assessment rule baseline. + DatabaseSQLVulnerabilityAssessmentRuleBaseline +} + +// DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteResponse contains the response from method DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.Delete. +type DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteResponse struct { + // placeholder for future response values +} + +// DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetResponse contains the response from method DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.Get. +type DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetResponse struct { + // A database sql vulnerability assessment rule baseline. + DatabaseSQLVulnerabilityAssessmentRuleBaseline +} + +// DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse contains the response from method DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.NewListByBaselinePager. +type DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse struct { + // A list of SQL Vulnerability Assessments rule baseline. + DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult +} + +// DatabaseSQLVulnerabilityAssessmentScanResultClientGetResponse contains the response from method DatabaseSQLVulnerabilityAssessmentScanResultClient.Get. +type DatabaseSQLVulnerabilityAssessmentScanResultClientGetResponse struct { + VulnerabilityAssessmentScanResults +} + +// DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse contains the response from method DatabaseSQLVulnerabilityAssessmentScanResultClient.NewListByScanPager. +type DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse struct { + // A list of vulnerability assessment scan results. + VulnerabilityAssessmentScanListResult +} + +// DatabaseSQLVulnerabilityAssessmentScansClientGetResponse contains the response from method DatabaseSQLVulnerabilityAssessmentScansClient.Get. +type DatabaseSQLVulnerabilityAssessmentScansClientGetResponse struct { + // A vulnerability assessment scan record. + VulnerabilityAssessmentScanRecordForSQL +} + +// DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse contains the response from method +// DatabaseSQLVulnerabilityAssessmentScansClient.NewListBySQLVulnerabilityAssessmentsPager. +type DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse struct { + // A list of vulnerability assessment scan records. + VulnerabilityAssessmentScanRecordForSQLListResult +} + +// DatabaseSQLVulnerabilityAssessmentsSettingsClientGetResponse contains the response from method DatabaseSQLVulnerabilityAssessmentsSettingsClient.Get. +type DatabaseSQLVulnerabilityAssessmentsSettingsClientGetResponse struct { + // A SQL Vulnerability Assessment. + VulnerabilityAssessment +} + +// DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse contains the response from method DatabaseSQLVulnerabilityAssessmentsSettingsClient.NewListByDatabasePager. +type DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse struct { + // A list of SQL Vulnerability Assessments. + VulnerabilityAssessmentListResult +} + // DatabaseSchemasClientGetResponse contains the response from method DatabaseSchemasClient.Get. type DatabaseSchemasClientGetResponse struct { + // A database schema resource. DatabaseSchema } // DatabaseSchemasClientListByDatabaseResponse contains the response from method DatabaseSchemasClient.NewListByDatabasePager. type DatabaseSchemasClientListByDatabaseResponse struct { + // A list of database schemas. DatabaseSchemaListResult } // DatabaseSecurityAlertPoliciesClientCreateOrUpdateResponse contains the response from method DatabaseSecurityAlertPoliciesClient.CreateOrUpdate. type DatabaseSecurityAlertPoliciesClientCreateOrUpdateResponse struct { + // A database security alert policy. DatabaseSecurityAlertPolicy } // DatabaseSecurityAlertPoliciesClientGetResponse contains the response from method DatabaseSecurityAlertPoliciesClient.Get. type DatabaseSecurityAlertPoliciesClientGetResponse struct { + // A database security alert policy. DatabaseSecurityAlertPolicy } // DatabaseSecurityAlertPoliciesClientListByDatabaseResponse contains the response from method DatabaseSecurityAlertPoliciesClient.NewListByDatabasePager. type DatabaseSecurityAlertPoliciesClientListByDatabaseResponse struct { + // A list of the database's security alert policies. DatabaseSecurityAlertListResult } // DatabaseTablesClientGetResponse contains the response from method DatabaseTablesClient.Get. type DatabaseTablesClientGetResponse struct { + // A database table resource. DatabaseTable } // DatabaseTablesClientListBySchemaResponse contains the response from method DatabaseTablesClient.NewListBySchemaPager. type DatabaseTablesClientListBySchemaResponse struct { + // A list of database tables. DatabaseTableListResult } // DatabaseUsagesClientListByDatabaseResponse contains the response from method DatabaseUsagesClient.NewListByDatabasePager. type DatabaseUsagesClientListByDatabaseResponse struct { + // A list of database usage metrics. DatabaseUsageListResult } // DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse contains the response from method DatabaseVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate. type DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse struct { + // A database vulnerability assessment rule baseline. DatabaseVulnerabilityAssessmentRuleBaseline } @@ -238,16 +370,19 @@ type DatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteResponse struct { // DatabaseVulnerabilityAssessmentRuleBaselinesClientGetResponse contains the response from method DatabaseVulnerabilityAssessmentRuleBaselinesClient.Get. type DatabaseVulnerabilityAssessmentRuleBaselinesClientGetResponse struct { + // A database vulnerability assessment rule baseline. DatabaseVulnerabilityAssessmentRuleBaseline } // DatabaseVulnerabilityAssessmentScansClientExportResponse contains the response from method DatabaseVulnerabilityAssessmentScansClient.Export. type DatabaseVulnerabilityAssessmentScansClientExportResponse struct { + // A database Vulnerability Assessment scan export resource. DatabaseVulnerabilityAssessmentScansExport } // DatabaseVulnerabilityAssessmentScansClientGetResponse contains the response from method DatabaseVulnerabilityAssessmentScansClient.Get. type DatabaseVulnerabilityAssessmentScansClientGetResponse struct { + // A vulnerability assessment scan record. VulnerabilityAssessmentScanRecord } @@ -258,11 +393,13 @@ type DatabaseVulnerabilityAssessmentScansClientInitiateScanResponse struct { // DatabaseVulnerabilityAssessmentScansClientListByDatabaseResponse contains the response from method DatabaseVulnerabilityAssessmentScansClient.NewListByDatabasePager. type DatabaseVulnerabilityAssessmentScansClientListByDatabaseResponse struct { + // A list of vulnerability assessment scan records. VulnerabilityAssessmentScanRecordListResult } // DatabaseVulnerabilityAssessmentsClientCreateOrUpdateResponse contains the response from method DatabaseVulnerabilityAssessmentsClient.CreateOrUpdate. type DatabaseVulnerabilityAssessmentsClientCreateOrUpdateResponse struct { + // A database vulnerability assessment. DatabaseVulnerabilityAssessment } @@ -273,16 +410,19 @@ type DatabaseVulnerabilityAssessmentsClientDeleteResponse struct { // DatabaseVulnerabilityAssessmentsClientGetResponse contains the response from method DatabaseVulnerabilityAssessmentsClient.Get. type DatabaseVulnerabilityAssessmentsClientGetResponse struct { + // A database vulnerability assessment. DatabaseVulnerabilityAssessment } // DatabaseVulnerabilityAssessmentsClientListByDatabaseResponse contains the response from method DatabaseVulnerabilityAssessmentsClient.NewListByDatabasePager. type DatabaseVulnerabilityAssessmentsClientListByDatabaseResponse struct { + // A list of the database's vulnerability assessments. DatabaseVulnerabilityAssessmentListResult } // DatabasesClientCreateOrUpdateResponse contains the response from method DatabasesClient.BeginCreateOrUpdate. type DatabasesClientCreateOrUpdateResponse struct { + // A database resource. Database } @@ -293,6 +433,7 @@ type DatabasesClientDeleteResponse struct { // DatabasesClientExportResponse contains the response from method DatabasesClient.BeginExport. type DatabasesClientExportResponse struct { + // An ImportExport operation result resource. ImportExportOperationResult } @@ -303,41 +444,49 @@ type DatabasesClientFailoverResponse struct { // DatabasesClientGetResponse contains the response from method DatabasesClient.Get. type DatabasesClientGetResponse struct { + // A database resource. Database } // DatabasesClientImportResponse contains the response from method DatabasesClient.BeginImport. type DatabasesClientImportResponse struct { + // An ImportExport operation result resource. ImportExportOperationResult } // DatabasesClientListByElasticPoolResponse contains the response from method DatabasesClient.NewListByElasticPoolPager. type DatabasesClientListByElasticPoolResponse struct { + // A list of databases. DatabaseListResult } // DatabasesClientListByServerResponse contains the response from method DatabasesClient.NewListByServerPager. type DatabasesClientListByServerResponse struct { + // A list of databases. DatabaseListResult } // DatabasesClientListInaccessibleByServerResponse contains the response from method DatabasesClient.NewListInaccessibleByServerPager. type DatabasesClientListInaccessibleByServerResponse struct { + // A list of databases. DatabaseListResult } // DatabasesClientListMetricDefinitionsResponse contains the response from method DatabasesClient.NewListMetricDefinitionsPager. type DatabasesClientListMetricDefinitionsResponse struct { + // The response to a list database metric definitions request. MetricDefinitionListResult } // DatabasesClientListMetricsResponse contains the response from method DatabasesClient.NewListMetricsPager. type DatabasesClientListMetricsResponse struct { + // The response to a list database metrics request. MetricListResult } // DatabasesClientPauseResponse contains the response from method DatabasesClient.BeginPause. type DatabasesClientPauseResponse struct { + // A database resource. Database } @@ -348,11 +497,13 @@ type DatabasesClientRenameResponse struct { // DatabasesClientResumeResponse contains the response from method DatabasesClient.BeginResume. type DatabasesClientResumeResponse struct { + // A database resource. Database } // DatabasesClientUpdateResponse contains the response from method DatabasesClient.BeginUpdate. type DatabasesClientUpdateResponse struct { + // A database resource. Database } @@ -363,26 +514,31 @@ type DatabasesClientUpgradeDataWarehouseResponse struct { // DeletedServersClientGetResponse contains the response from method DeletedServersClient.Get. type DeletedServersClientGetResponse struct { + // A deleted server. DeletedServer } // DeletedServersClientListByLocationResponse contains the response from method DeletedServersClient.NewListByLocationPager. type DeletedServersClientListByLocationResponse struct { + // A list of deleted servers. DeletedServerListResult } // DeletedServersClientListResponse contains the response from method DeletedServersClient.NewListPager. type DeletedServersClientListResponse struct { + // A list of deleted servers. DeletedServerListResult } // DeletedServersClientRecoverResponse contains the response from method DeletedServersClient.BeginRecover. type DeletedServersClientRecoverResponse struct { + // A deleted server. DeletedServer } // DistributedAvailabilityGroupsClientCreateOrUpdateResponse contains the response from method DistributedAvailabilityGroupsClient.BeginCreateOrUpdate. type DistributedAvailabilityGroupsClientCreateOrUpdateResponse struct { + // Distributed availability group between box and Sql Managed Instance. DistributedAvailabilityGroup } @@ -393,26 +549,31 @@ type DistributedAvailabilityGroupsClientDeleteResponse struct { // DistributedAvailabilityGroupsClientGetResponse contains the response from method DistributedAvailabilityGroupsClient.Get. type DistributedAvailabilityGroupsClientGetResponse struct { + // Distributed availability group between box and Sql Managed Instance. DistributedAvailabilityGroup } // DistributedAvailabilityGroupsClientListByInstanceResponse contains the response from method DistributedAvailabilityGroupsClient.NewListByInstancePager. type DistributedAvailabilityGroupsClientListByInstanceResponse struct { + // A list of distributed availability groups in instance. DistributedAvailabilityGroupsListResult } // DistributedAvailabilityGroupsClientUpdateResponse contains the response from method DistributedAvailabilityGroupsClient.BeginUpdate. type DistributedAvailabilityGroupsClientUpdateResponse struct { + // Distributed availability group between box and Sql Managed Instance. DistributedAvailabilityGroup } // ElasticPoolActivitiesClientListByElasticPoolResponse contains the response from method ElasticPoolActivitiesClient.NewListByElasticPoolPager. type ElasticPoolActivitiesClientListByElasticPoolResponse struct { + // Represents the response to a list elastic pool activity request. ElasticPoolActivityListResult } // ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse contains the response from method ElasticPoolDatabaseActivitiesClient.NewListByElasticPoolPager. type ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse struct { + // Represents the response to a list elastic pool database activity request. ElasticPoolDatabaseActivityListResult } @@ -423,11 +584,13 @@ type ElasticPoolOperationsClientCancelResponse struct { // ElasticPoolOperationsClientListByElasticPoolResponse contains the response from method ElasticPoolOperationsClient.NewListByElasticPoolPager. type ElasticPoolOperationsClientListByElasticPoolResponse struct { + // The response to a list elastic pool operations request ElasticPoolOperationListResult } // ElasticPoolsClientCreateOrUpdateResponse contains the response from method ElasticPoolsClient.BeginCreateOrUpdate. type ElasticPoolsClientCreateOrUpdateResponse struct { + // An elastic pool. ElasticPool } @@ -443,41 +606,49 @@ type ElasticPoolsClientFailoverResponse struct { // ElasticPoolsClientGetResponse contains the response from method ElasticPoolsClient.Get. type ElasticPoolsClientGetResponse struct { + // An elastic pool. ElasticPool } // ElasticPoolsClientListByServerResponse contains the response from method ElasticPoolsClient.NewListByServerPager. type ElasticPoolsClientListByServerResponse struct { + // The result of an elastic pool list request. ElasticPoolListResult } // ElasticPoolsClientListMetricDefinitionsResponse contains the response from method ElasticPoolsClient.NewListMetricDefinitionsPager. type ElasticPoolsClientListMetricDefinitionsResponse struct { + // The response to a list database metric definitions request. MetricDefinitionListResult } // ElasticPoolsClientListMetricsResponse contains the response from method ElasticPoolsClient.NewListMetricsPager. type ElasticPoolsClientListMetricsResponse struct { + // The response to a list database metrics request. MetricListResult } // ElasticPoolsClientUpdateResponse contains the response from method ElasticPoolsClient.BeginUpdate. type ElasticPoolsClientUpdateResponse struct { + // An elastic pool. ElasticPool } // EncryptionProtectorsClientCreateOrUpdateResponse contains the response from method EncryptionProtectorsClient.BeginCreateOrUpdate. type EncryptionProtectorsClientCreateOrUpdateResponse struct { + // The server encryption protector. EncryptionProtector } // EncryptionProtectorsClientGetResponse contains the response from method EncryptionProtectorsClient.Get. type EncryptionProtectorsClientGetResponse struct { + // The server encryption protector. EncryptionProtector } // EncryptionProtectorsClientListByServerResponse contains the response from method EncryptionProtectorsClient.NewListByServerPager. type EncryptionProtectorsClientListByServerResponse struct { + // A list of server encryption protectors. EncryptionProtectorListResult } @@ -488,46 +659,55 @@ type EncryptionProtectorsClientRevalidateResponse struct { // EndpointCertificatesClientGetResponse contains the response from method EndpointCertificatesClient.Get. type EndpointCertificatesClientGetResponse struct { + // Certificate used on an endpoint on the Managed Instance. EndpointCertificate } // EndpointCertificatesClientListByInstanceResponse contains the response from method EndpointCertificatesClient.NewListByInstancePager. type EndpointCertificatesClientListByInstanceResponse struct { + // A list of endpoint certificates on the target instance. EndpointCertificateListResult } // ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateResponse contains the response from method ExtendedDatabaseBlobAuditingPoliciesClient.CreateOrUpdate. type ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateResponse struct { + // An extended database blob auditing policy. ExtendedDatabaseBlobAuditingPolicy } // ExtendedDatabaseBlobAuditingPoliciesClientGetResponse contains the response from method ExtendedDatabaseBlobAuditingPoliciesClient.Get. type ExtendedDatabaseBlobAuditingPoliciesClientGetResponse struct { + // An extended database blob auditing policy. ExtendedDatabaseBlobAuditingPolicy } // ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseResponse contains the response from method ExtendedDatabaseBlobAuditingPoliciesClient.NewListByDatabasePager. type ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseResponse struct { + // A list of database extended auditing settings. ExtendedDatabaseBlobAuditingPolicyListResult } // ExtendedServerBlobAuditingPoliciesClientCreateOrUpdateResponse contains the response from method ExtendedServerBlobAuditingPoliciesClient.BeginCreateOrUpdate. type ExtendedServerBlobAuditingPoliciesClientCreateOrUpdateResponse struct { + // An extended server blob auditing policy. ExtendedServerBlobAuditingPolicy } // ExtendedServerBlobAuditingPoliciesClientGetResponse contains the response from method ExtendedServerBlobAuditingPoliciesClient.Get. type ExtendedServerBlobAuditingPoliciesClientGetResponse struct { + // An extended server blob auditing policy. ExtendedServerBlobAuditingPolicy } // ExtendedServerBlobAuditingPoliciesClientListByServerResponse contains the response from method ExtendedServerBlobAuditingPoliciesClient.NewListByServerPager. type ExtendedServerBlobAuditingPoliciesClientListByServerResponse struct { + // A list of server extended auditing settings. ExtendedServerBlobAuditingPolicyListResult } // FailoverGroupsClientCreateOrUpdateResponse contains the response from method FailoverGroupsClient.BeginCreateOrUpdate. type FailoverGroupsClientCreateOrUpdateResponse struct { + // A failover group. FailoverGroup } @@ -538,31 +718,43 @@ type FailoverGroupsClientDeleteResponse struct { // FailoverGroupsClientFailoverResponse contains the response from method FailoverGroupsClient.BeginFailover. type FailoverGroupsClientFailoverResponse struct { + // A failover group. FailoverGroup } // FailoverGroupsClientForceFailoverAllowDataLossResponse contains the response from method FailoverGroupsClient.BeginForceFailoverAllowDataLoss. type FailoverGroupsClientForceFailoverAllowDataLossResponse struct { + // A failover group. FailoverGroup } // FailoverGroupsClientGetResponse contains the response from method FailoverGroupsClient.Get. type FailoverGroupsClientGetResponse struct { + // A failover group. FailoverGroup } // FailoverGroupsClientListByServerResponse contains the response from method FailoverGroupsClient.NewListByServerPager. type FailoverGroupsClientListByServerResponse struct { + // A list of failover groups. FailoverGroupListResult } +// FailoverGroupsClientTryPlannedBeforeForcedFailoverResponse contains the response from method FailoverGroupsClient.BeginTryPlannedBeforeForcedFailover. +type FailoverGroupsClientTryPlannedBeforeForcedFailoverResponse struct { + // A failover group. + FailoverGroup +} + // FailoverGroupsClientUpdateResponse contains the response from method FailoverGroupsClient.BeginUpdate. type FailoverGroupsClientUpdateResponse struct { + // A failover group. FailoverGroup } // FirewallRulesClientCreateOrUpdateResponse contains the response from method FirewallRulesClient.CreateOrUpdate. type FirewallRulesClientCreateOrUpdateResponse struct { + // A server firewall rule. FirewallRule } @@ -573,36 +765,43 @@ type FirewallRulesClientDeleteResponse struct { // FirewallRulesClientGetResponse contains the response from method FirewallRulesClient.Get. type FirewallRulesClientGetResponse struct { + // A server firewall rule. FirewallRule } // FirewallRulesClientListByServerResponse contains the response from method FirewallRulesClient.NewListByServerPager. type FirewallRulesClientListByServerResponse struct { + // The response to a list firewall rules request FirewallRuleListResult } // FirewallRulesClientReplaceResponse contains the response from method FirewallRulesClient.Replace. type FirewallRulesClientReplaceResponse struct { + // A server firewall rule. FirewallRule } // GeoBackupPoliciesClientCreateOrUpdateResponse contains the response from method GeoBackupPoliciesClient.CreateOrUpdate. type GeoBackupPoliciesClientCreateOrUpdateResponse struct { + // A database geo backup policy. GeoBackupPolicy } // GeoBackupPoliciesClientGetResponse contains the response from method GeoBackupPoliciesClient.Get. type GeoBackupPoliciesClientGetResponse struct { + // A database geo backup policy. GeoBackupPolicy } // GeoBackupPoliciesClientListByDatabaseResponse contains the response from method GeoBackupPoliciesClient.NewListByDatabasePager. type GeoBackupPoliciesClientListByDatabaseResponse struct { + // The response to a list geo backup policies request. GeoBackupPolicyListResult } // IPv6FirewallRulesClientCreateOrUpdateResponse contains the response from method IPv6FirewallRulesClient.CreateOrUpdate. type IPv6FirewallRulesClientCreateOrUpdateResponse struct { + // An IPv6 server firewall rule. IPv6FirewallRule } @@ -613,16 +812,19 @@ type IPv6FirewallRulesClientDeleteResponse struct { // IPv6FirewallRulesClientGetResponse contains the response from method IPv6FirewallRulesClient.Get. type IPv6FirewallRulesClientGetResponse struct { + // An IPv6 server firewall rule. IPv6FirewallRule } // IPv6FirewallRulesClientListByServerResponse contains the response from method IPv6FirewallRulesClient.NewListByServerPager. type IPv6FirewallRulesClientListByServerResponse struct { + // The response to a list IPv6 firewall rules request IPv6FirewallRuleListResult } // InstanceFailoverGroupsClientCreateOrUpdateResponse contains the response from method InstanceFailoverGroupsClient.BeginCreateOrUpdate. type InstanceFailoverGroupsClientCreateOrUpdateResponse struct { + // An instance failover group. InstanceFailoverGroup } @@ -633,26 +835,31 @@ type InstanceFailoverGroupsClientDeleteResponse struct { // InstanceFailoverGroupsClientFailoverResponse contains the response from method InstanceFailoverGroupsClient.BeginFailover. type InstanceFailoverGroupsClientFailoverResponse struct { + // An instance failover group. InstanceFailoverGroup } // InstanceFailoverGroupsClientForceFailoverAllowDataLossResponse contains the response from method InstanceFailoverGroupsClient.BeginForceFailoverAllowDataLoss. type InstanceFailoverGroupsClientForceFailoverAllowDataLossResponse struct { + // An instance failover group. InstanceFailoverGroup } // InstanceFailoverGroupsClientGetResponse contains the response from method InstanceFailoverGroupsClient.Get. type InstanceFailoverGroupsClientGetResponse struct { + // An instance failover group. InstanceFailoverGroup } // InstanceFailoverGroupsClientListByLocationResponse contains the response from method InstanceFailoverGroupsClient.NewListByLocationPager. type InstanceFailoverGroupsClientListByLocationResponse struct { + // A list of instance failover groups. InstanceFailoverGroupListResult } // InstancePoolsClientCreateOrUpdateResponse contains the response from method InstancePoolsClient.BeginCreateOrUpdate. type InstancePoolsClientCreateOrUpdateResponse struct { + // An Azure SQL instance pool. InstancePool } @@ -663,26 +870,31 @@ type InstancePoolsClientDeleteResponse struct { // InstancePoolsClientGetResponse contains the response from method InstancePoolsClient.Get. type InstancePoolsClientGetResponse struct { + // An Azure SQL instance pool. InstancePool } // InstancePoolsClientListByResourceGroupResponse contains the response from method InstancePoolsClient.NewListByResourceGroupPager. type InstancePoolsClientListByResourceGroupResponse struct { + // A list of Azure SQL instance pools. InstancePoolListResult } // InstancePoolsClientListResponse contains the response from method InstancePoolsClient.NewListPager. type InstancePoolsClientListResponse struct { + // A list of Azure SQL instance pools. InstancePoolListResult } // InstancePoolsClientUpdateResponse contains the response from method InstancePoolsClient.BeginUpdate. type InstancePoolsClientUpdateResponse struct { + // An Azure SQL instance pool. InstancePool } // JobAgentsClientCreateOrUpdateResponse contains the response from method JobAgentsClient.BeginCreateOrUpdate. type JobAgentsClientCreateOrUpdateResponse struct { + // An Azure SQL job agent. JobAgent } @@ -693,21 +905,25 @@ type JobAgentsClientDeleteResponse struct { // JobAgentsClientGetResponse contains the response from method JobAgentsClient.Get. type JobAgentsClientGetResponse struct { + // An Azure SQL job agent. JobAgent } // JobAgentsClientListByServerResponse contains the response from method JobAgentsClient.NewListByServerPager. type JobAgentsClientListByServerResponse struct { + // A list of Azure SQL job agents. JobAgentListResult } // JobAgentsClientUpdateResponse contains the response from method JobAgentsClient.BeginUpdate. type JobAgentsClientUpdateResponse struct { + // An Azure SQL job agent. JobAgent } // JobCredentialsClientCreateOrUpdateResponse contains the response from method JobCredentialsClient.CreateOrUpdate. type JobCredentialsClientCreateOrUpdateResponse struct { + // A stored credential that can be used by a job to connect to target databases. JobCredential } @@ -718,11 +934,13 @@ type JobCredentialsClientDeleteResponse struct { // JobCredentialsClientGetResponse contains the response from method JobCredentialsClient.Get. type JobCredentialsClientGetResponse struct { + // A stored credential that can be used by a job to connect to target databases. JobCredential } // JobCredentialsClientListByAgentResponse contains the response from method JobCredentialsClient.NewListByAgentPager. type JobCredentialsClientListByAgentResponse struct { + // A list of job credentials. JobCredentialListResult } @@ -733,41 +951,49 @@ type JobExecutionsClientCancelResponse struct { // JobExecutionsClientCreateOrUpdateResponse contains the response from method JobExecutionsClient.BeginCreateOrUpdate. type JobExecutionsClientCreateOrUpdateResponse struct { + // An execution of a job JobExecution } // JobExecutionsClientCreateResponse contains the response from method JobExecutionsClient.BeginCreate. type JobExecutionsClientCreateResponse struct { + // An execution of a job JobExecution } // JobExecutionsClientGetResponse contains the response from method JobExecutionsClient.Get. type JobExecutionsClientGetResponse struct { + // An execution of a job JobExecution } // JobExecutionsClientListByAgentResponse contains the response from method JobExecutionsClient.NewListByAgentPager. type JobExecutionsClientListByAgentResponse struct { + // A list of job executions. JobExecutionListResult } // JobExecutionsClientListByJobResponse contains the response from method JobExecutionsClient.NewListByJobPager. type JobExecutionsClientListByJobResponse struct { + // A list of job executions. JobExecutionListResult } // JobStepExecutionsClientGetResponse contains the response from method JobStepExecutionsClient.Get. type JobStepExecutionsClientGetResponse struct { + // An execution of a job JobExecution } // JobStepExecutionsClientListByJobExecutionResponse contains the response from method JobStepExecutionsClient.NewListByJobExecutionPager. type JobStepExecutionsClientListByJobExecutionResponse struct { + // A list of job executions. JobExecutionListResult } // JobStepsClientCreateOrUpdateResponse contains the response from method JobStepsClient.CreateOrUpdate. type JobStepsClientCreateOrUpdateResponse struct { + // A job step. JobStep } @@ -778,41 +1004,49 @@ type JobStepsClientDeleteResponse struct { // JobStepsClientGetByVersionResponse contains the response from method JobStepsClient.GetByVersion. type JobStepsClientGetByVersionResponse struct { + // A job step. JobStep } // JobStepsClientGetResponse contains the response from method JobStepsClient.Get. type JobStepsClientGetResponse struct { + // A job step. JobStep } // JobStepsClientListByJobResponse contains the response from method JobStepsClient.NewListByJobPager. type JobStepsClientListByJobResponse struct { + // A list of job steps. JobStepListResult } // JobStepsClientListByVersionResponse contains the response from method JobStepsClient.NewListByVersionPager. type JobStepsClientListByVersionResponse struct { + // A list of job steps. JobStepListResult } // JobTargetExecutionsClientGetResponse contains the response from method JobTargetExecutionsClient.Get. type JobTargetExecutionsClientGetResponse struct { + // An execution of a job JobExecution } // JobTargetExecutionsClientListByJobExecutionResponse contains the response from method JobTargetExecutionsClient.NewListByJobExecutionPager. type JobTargetExecutionsClientListByJobExecutionResponse struct { + // A list of job executions. JobExecutionListResult } // JobTargetExecutionsClientListByStepResponse contains the response from method JobTargetExecutionsClient.NewListByStepPager. type JobTargetExecutionsClientListByStepResponse struct { + // A list of job executions. JobExecutionListResult } // JobTargetGroupsClientCreateOrUpdateResponse contains the response from method JobTargetGroupsClient.CreateOrUpdate. type JobTargetGroupsClientCreateOrUpdateResponse struct { + // A group of job targets. JobTargetGroup } @@ -823,26 +1057,31 @@ type JobTargetGroupsClientDeleteResponse struct { // JobTargetGroupsClientGetResponse contains the response from method JobTargetGroupsClient.Get. type JobTargetGroupsClientGetResponse struct { + // A group of job targets. JobTargetGroup } // JobTargetGroupsClientListByAgentResponse contains the response from method JobTargetGroupsClient.NewListByAgentPager. type JobTargetGroupsClientListByAgentResponse struct { + // A list of target groups. JobTargetGroupListResult } // JobVersionsClientGetResponse contains the response from method JobVersionsClient.Get. type JobVersionsClientGetResponse struct { + // A job version. JobVersion } // JobVersionsClientListByJobResponse contains the response from method JobVersionsClient.NewListByJobPager. type JobVersionsClientListByJobResponse struct { + // A list of job versions. JobVersionListResult } // JobsClientCreateOrUpdateResponse contains the response from method JobsClient.CreateOrUpdate. type JobsClientCreateOrUpdateResponse struct { + // A job. Job } @@ -853,41 +1092,49 @@ type JobsClientDeleteResponse struct { // JobsClientGetResponse contains the response from method JobsClient.Get. type JobsClientGetResponse struct { + // A job. Job } // JobsClientListByAgentResponse contains the response from method JobsClient.NewListByAgentPager. type JobsClientListByAgentResponse struct { + // A list of jobs. JobListResult } // LedgerDigestUploadsClientCreateOrUpdateResponse contains the response from method LedgerDigestUploadsClient.BeginCreateOrUpdate. type LedgerDigestUploadsClientCreateOrUpdateResponse struct { + // Azure SQL Database ledger digest upload settings. LedgerDigestUploads } // LedgerDigestUploadsClientDisableResponse contains the response from method LedgerDigestUploadsClient.BeginDisable. type LedgerDigestUploadsClientDisableResponse struct { + // Azure SQL Database ledger digest upload settings. LedgerDigestUploads } // LedgerDigestUploadsClientGetResponse contains the response from method LedgerDigestUploadsClient.Get. type LedgerDigestUploadsClientGetResponse struct { + // Azure SQL Database ledger digest upload settings. LedgerDigestUploads } // LedgerDigestUploadsClientListByDatabaseResponse contains the response from method LedgerDigestUploadsClient.NewListByDatabasePager. type LedgerDigestUploadsClientListByDatabaseResponse struct { + // A list of ledger digest upload settings. LedgerDigestUploadsListResult } // LongTermRetentionBackupsClientCopyByResourceGroupResponse contains the response from method LongTermRetentionBackupsClient.BeginCopyByResourceGroup. type LongTermRetentionBackupsClientCopyByResourceGroupResponse struct { + // A LongTermRetentionBackup operation result resource. LongTermRetentionBackupOperationResult } // LongTermRetentionBackupsClientCopyResponse contains the response from method LongTermRetentionBackupsClient.BeginCopy. type LongTermRetentionBackupsClientCopyResponse struct { + // A LongTermRetentionBackup operation result resource. LongTermRetentionBackupOperationResult } @@ -903,51 +1150,61 @@ type LongTermRetentionBackupsClientDeleteResponse struct { // LongTermRetentionBackupsClientGetByResourceGroupResponse contains the response from method LongTermRetentionBackupsClient.GetByResourceGroup. type LongTermRetentionBackupsClientGetByResourceGroupResponse struct { + // A long term retention backup. LongTermRetentionBackup } // LongTermRetentionBackupsClientGetResponse contains the response from method LongTermRetentionBackupsClient.Get. type LongTermRetentionBackupsClientGetResponse struct { + // A long term retention backup. LongTermRetentionBackup } // LongTermRetentionBackupsClientListByDatabaseResponse contains the response from method LongTermRetentionBackupsClient.NewListByDatabasePager. type LongTermRetentionBackupsClientListByDatabaseResponse struct { + // A list of long term retention backups. LongTermRetentionBackupListResult } // LongTermRetentionBackupsClientListByLocationResponse contains the response from method LongTermRetentionBackupsClient.NewListByLocationPager. type LongTermRetentionBackupsClientListByLocationResponse struct { + // A list of long term retention backups. LongTermRetentionBackupListResult } // LongTermRetentionBackupsClientListByResourceGroupDatabaseResponse contains the response from method LongTermRetentionBackupsClient.NewListByResourceGroupDatabasePager. type LongTermRetentionBackupsClientListByResourceGroupDatabaseResponse struct { + // A list of long term retention backups. LongTermRetentionBackupListResult } // LongTermRetentionBackupsClientListByResourceGroupLocationResponse contains the response from method LongTermRetentionBackupsClient.NewListByResourceGroupLocationPager. type LongTermRetentionBackupsClientListByResourceGroupLocationResponse struct { + // A list of long term retention backups. LongTermRetentionBackupListResult } // LongTermRetentionBackupsClientListByResourceGroupServerResponse contains the response from method LongTermRetentionBackupsClient.NewListByResourceGroupServerPager. type LongTermRetentionBackupsClientListByResourceGroupServerResponse struct { + // A list of long term retention backups. LongTermRetentionBackupListResult } // LongTermRetentionBackupsClientListByServerResponse contains the response from method LongTermRetentionBackupsClient.NewListByServerPager. type LongTermRetentionBackupsClientListByServerResponse struct { + // A list of long term retention backups. LongTermRetentionBackupListResult } // LongTermRetentionBackupsClientUpdateByResourceGroupResponse contains the response from method LongTermRetentionBackupsClient.BeginUpdateByResourceGroup. type LongTermRetentionBackupsClientUpdateByResourceGroupResponse struct { + // A LongTermRetentionBackup operation result resource. LongTermRetentionBackupOperationResult } // LongTermRetentionBackupsClientUpdateResponse contains the response from method LongTermRetentionBackupsClient.BeginUpdate. type LongTermRetentionBackupsClientUpdateResponse struct { + // A LongTermRetentionBackup operation result resource. LongTermRetentionBackupOperationResult } @@ -963,61 +1220,73 @@ type LongTermRetentionManagedInstanceBackupsClientDeleteResponse struct { // LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.GetByResourceGroup. type LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupResponse struct { + // A long term retention backup for a managed database. ManagedInstanceLongTermRetentionBackup } // LongTermRetentionManagedInstanceBackupsClientGetResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.Get. type LongTermRetentionManagedInstanceBackupsClientGetResponse struct { + // A long term retention backup for a managed database. ManagedInstanceLongTermRetentionBackup } // LongTermRetentionManagedInstanceBackupsClientListByDatabaseResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.NewListByDatabasePager. type LongTermRetentionManagedInstanceBackupsClientListByDatabaseResponse struct { + // A list of long term retention backups for managed database(s). ManagedInstanceLongTermRetentionBackupListResult } // LongTermRetentionManagedInstanceBackupsClientListByInstanceResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.NewListByInstancePager. type LongTermRetentionManagedInstanceBackupsClientListByInstanceResponse struct { + // A list of long term retention backups for managed database(s). ManagedInstanceLongTermRetentionBackupListResult } // LongTermRetentionManagedInstanceBackupsClientListByLocationResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.NewListByLocationPager. type LongTermRetentionManagedInstanceBackupsClientListByLocationResponse struct { + // A list of long term retention backups for managed database(s). ManagedInstanceLongTermRetentionBackupListResult } // LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.NewListByResourceGroupDatabasePager. type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseResponse struct { + // A list of long term retention backups for managed database(s). ManagedInstanceLongTermRetentionBackupListResult } // LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.NewListByResourceGroupInstancePager. type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceResponse struct { + // A list of long term retention backups for managed database(s). ManagedInstanceLongTermRetentionBackupListResult } // LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.NewListByResourceGroupLocationPager. type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationResponse struct { + // A list of long term retention backups for managed database(s). ManagedInstanceLongTermRetentionBackupListResult } // LongTermRetentionPoliciesClientCreateOrUpdateResponse contains the response from method LongTermRetentionPoliciesClient.BeginCreateOrUpdate. type LongTermRetentionPoliciesClientCreateOrUpdateResponse struct { + // A long term retention policy. LongTermRetentionPolicy } // LongTermRetentionPoliciesClientGetResponse contains the response from method LongTermRetentionPoliciesClient.Get. type LongTermRetentionPoliciesClientGetResponse struct { + // A long term retention policy. LongTermRetentionPolicy } // LongTermRetentionPoliciesClientListByDatabaseResponse contains the response from method LongTermRetentionPoliciesClient.NewListByDatabasePager. type LongTermRetentionPoliciesClientListByDatabaseResponse struct { + // A list of long term retention policies. LongTermRetentionPolicyListResult } // MaintenanceWindowOptionsClientGetResponse contains the response from method MaintenanceWindowOptionsClient.Get. type MaintenanceWindowOptionsClientGetResponse struct { + // Maintenance window options. MaintenanceWindowOptions } @@ -1028,51 +1297,91 @@ type MaintenanceWindowsClientCreateOrUpdateResponse struct { // MaintenanceWindowsClientGetResponse contains the response from method MaintenanceWindowsClient.Get. type MaintenanceWindowsClientGetResponse struct { + // Maintenance windows. MaintenanceWindows } // ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdateResponse contains the response from method ManagedBackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate. type ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdateResponse struct { + // A short term retention policy. ManagedBackupShortTermRetentionPolicy } // ManagedBackupShortTermRetentionPoliciesClientGetResponse contains the response from method ManagedBackupShortTermRetentionPoliciesClient.Get. type ManagedBackupShortTermRetentionPoliciesClientGetResponse struct { + // A short term retention policy. ManagedBackupShortTermRetentionPolicy } // ManagedBackupShortTermRetentionPoliciesClientListByDatabaseResponse contains the response from method ManagedBackupShortTermRetentionPoliciesClient.NewListByDatabasePager. type ManagedBackupShortTermRetentionPoliciesClientListByDatabaseResponse struct { + // A list of short term retention policies. ManagedBackupShortTermRetentionPolicyListResult } // ManagedBackupShortTermRetentionPoliciesClientUpdateResponse contains the response from method ManagedBackupShortTermRetentionPoliciesClient.BeginUpdate. type ManagedBackupShortTermRetentionPoliciesClientUpdateResponse struct { + // A short term retention policy. ManagedBackupShortTermRetentionPolicy } +// ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse contains the response from method ManagedDatabaseAdvancedThreatProtectionSettingsClient.CreateOrUpdate. +type ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse struct { + // A managed database Advanced Threat Protection. + ManagedDatabaseAdvancedThreatProtection +} + +// ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse contains the response from method ManagedDatabaseAdvancedThreatProtectionSettingsClient.Get. +type ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse struct { + // A managed database Advanced Threat Protection. + ManagedDatabaseAdvancedThreatProtection +} + +// ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse contains the response from method ManagedDatabaseAdvancedThreatProtectionSettingsClient.NewListByDatabasePager. +type ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse struct { + // A list of the managed database's Advanced Threat Protection settings. + ManagedDatabaseAdvancedThreatProtectionListResult +} + // ManagedDatabaseColumnsClientGetResponse contains the response from method ManagedDatabaseColumnsClient.Get. type ManagedDatabaseColumnsClientGetResponse struct { + // A database column resource. DatabaseColumn } // ManagedDatabaseColumnsClientListByDatabaseResponse contains the response from method ManagedDatabaseColumnsClient.NewListByDatabasePager. type ManagedDatabaseColumnsClientListByDatabaseResponse struct { + // A list of database columns. DatabaseColumnListResult } // ManagedDatabaseColumnsClientListByTableResponse contains the response from method ManagedDatabaseColumnsClient.NewListByTablePager. type ManagedDatabaseColumnsClientListByTableResponse struct { + // A list of database columns. DatabaseColumnListResult } +// ManagedDatabaseMoveOperationsClientGetResponse contains the response from method ManagedDatabaseMoveOperationsClient.Get. +type ManagedDatabaseMoveOperationsClientGetResponse struct { + // A managed database move operation. + ManagedDatabaseMoveOperationResult +} + +// ManagedDatabaseMoveOperationsClientListByLocationResponse contains the response from method ManagedDatabaseMoveOperationsClient.NewListByLocationPager. +type ManagedDatabaseMoveOperationsClientListByLocationResponse struct { + // List of managed database move operations. + ManagedDatabaseMoveOperationListResult +} + // ManagedDatabaseQueriesClientGetResponse contains the response from method ManagedDatabaseQueriesClient.Get. type ManagedDatabaseQueriesClientGetResponse struct { + // Database query. ManagedInstanceQuery } // ManagedDatabaseQueriesClientListByQueryResponse contains the response from method ManagedDatabaseQueriesClient.NewListByQueryPager. type ManagedDatabaseQueriesClientListByQueryResponse struct { + // Execution statistics for one particular query ManagedInstanceQueryStatistics } @@ -1083,41 +1392,49 @@ type ManagedDatabaseRecommendedSensitivityLabelsClientUpdateResponse struct { // ManagedDatabaseRestoreDetailsClientGetResponse contains the response from method ManagedDatabaseRestoreDetailsClient.Get. type ManagedDatabaseRestoreDetailsClientGetResponse struct { + // A managed database restore details. ManagedDatabaseRestoreDetailsResult } // ManagedDatabaseSchemasClientGetResponse contains the response from method ManagedDatabaseSchemasClient.Get. type ManagedDatabaseSchemasClientGetResponse struct { + // A database schema resource. DatabaseSchema } // ManagedDatabaseSchemasClientListByDatabaseResponse contains the response from method ManagedDatabaseSchemasClient.NewListByDatabasePager. type ManagedDatabaseSchemasClientListByDatabaseResponse struct { + // A list of database schemas. DatabaseSchemaListResult } // ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateResponse contains the response from method ManagedDatabaseSecurityAlertPoliciesClient.CreateOrUpdate. type ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateResponse struct { + // A managed database security alert policy. ManagedDatabaseSecurityAlertPolicy } // ManagedDatabaseSecurityAlertPoliciesClientGetResponse contains the response from method ManagedDatabaseSecurityAlertPoliciesClient.Get. type ManagedDatabaseSecurityAlertPoliciesClientGetResponse struct { + // A managed database security alert policy. ManagedDatabaseSecurityAlertPolicy } // ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseResponse contains the response from method ManagedDatabaseSecurityAlertPoliciesClient.NewListByDatabasePager. type ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseResponse struct { + // A list of the managed database's security alert policies. ManagedDatabaseSecurityAlertPolicyListResult } // ManagedDatabaseSecurityEventsClientListByDatabaseResponse contains the response from method ManagedDatabaseSecurityEventsClient.NewListByDatabasePager. type ManagedDatabaseSecurityEventsClientListByDatabaseResponse struct { + // A list of security events. SecurityEventCollection } // ManagedDatabaseSensitivityLabelsClientCreateOrUpdateResponse contains the response from method ManagedDatabaseSensitivityLabelsClient.CreateOrUpdate. type ManagedDatabaseSensitivityLabelsClientCreateOrUpdateResponse struct { + // A sensitivity label. SensitivityLabel } @@ -1138,16 +1455,19 @@ type ManagedDatabaseSensitivityLabelsClientEnableRecommendationResponse struct { // ManagedDatabaseSensitivityLabelsClientGetResponse contains the response from method ManagedDatabaseSensitivityLabelsClient.Get. type ManagedDatabaseSensitivityLabelsClientGetResponse struct { + // A sensitivity label. SensitivityLabel } // ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseResponse contains the response from method ManagedDatabaseSensitivityLabelsClient.NewListCurrentByDatabasePager. type ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseResponse struct { + // A list of sensitivity labels. SensitivityLabelListResult } // ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseResponse contains the response from method ManagedDatabaseSensitivityLabelsClient.NewListRecommendedByDatabasePager. type ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseResponse struct { + // A list of sensitivity labels. SensitivityLabelListResult } @@ -1158,31 +1478,37 @@ type ManagedDatabaseSensitivityLabelsClientUpdateResponse struct { // ManagedDatabaseTablesClientGetResponse contains the response from method ManagedDatabaseTablesClient.Get. type ManagedDatabaseTablesClientGetResponse struct { + // A database table resource. DatabaseTable } // ManagedDatabaseTablesClientListBySchemaResponse contains the response from method ManagedDatabaseTablesClient.NewListBySchemaPager. type ManagedDatabaseTablesClientListBySchemaResponse struct { + // A list of database tables. DatabaseTableListResult } // ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateResponse contains the response from method ManagedDatabaseTransparentDataEncryptionClient.CreateOrUpdate. type ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateResponse struct { + // A managed database transparent data encryption state. ManagedTransparentDataEncryption } // ManagedDatabaseTransparentDataEncryptionClientGetResponse contains the response from method ManagedDatabaseTransparentDataEncryptionClient.Get. type ManagedDatabaseTransparentDataEncryptionClientGetResponse struct { + // A managed database transparent data encryption state. ManagedTransparentDataEncryption } // ManagedDatabaseTransparentDataEncryptionClientListByDatabaseResponse contains the response from method ManagedDatabaseTransparentDataEncryptionClient.NewListByDatabasePager. type ManagedDatabaseTransparentDataEncryptionClientListByDatabaseResponse struct { + // A list of managed transparent data encryptions ManagedTransparentDataEncryptionListResult } // ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate. type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse struct { + // A database vulnerability assessment rule baseline. DatabaseVulnerabilityAssessmentRuleBaseline } @@ -1193,16 +1519,19 @@ type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteResponse str // ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.Get. type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetResponse struct { + // A database vulnerability assessment rule baseline. DatabaseVulnerabilityAssessmentRuleBaseline } // ManagedDatabaseVulnerabilityAssessmentScansClientExportResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentScansClient.Export. type ManagedDatabaseVulnerabilityAssessmentScansClientExportResponse struct { + // A database Vulnerability Assessment scan export resource. DatabaseVulnerabilityAssessmentScansExport } // ManagedDatabaseVulnerabilityAssessmentScansClientGetResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentScansClient.Get. type ManagedDatabaseVulnerabilityAssessmentScansClientGetResponse struct { + // A vulnerability assessment scan record. VulnerabilityAssessmentScanRecord } @@ -1213,11 +1542,13 @@ type ManagedDatabaseVulnerabilityAssessmentScansClientInitiateScanResponse struc // ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentScansClient.NewListByDatabasePager. type ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseResponse struct { + // A list of vulnerability assessment scan records. VulnerabilityAssessmentScanRecordListResult } // ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentsClient.CreateOrUpdate. type ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateResponse struct { + // A database vulnerability assessment. DatabaseVulnerabilityAssessment } @@ -1228,14 +1559,26 @@ type ManagedDatabaseVulnerabilityAssessmentsClientDeleteResponse struct { // ManagedDatabaseVulnerabilityAssessmentsClientGetResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentsClient.Get. type ManagedDatabaseVulnerabilityAssessmentsClientGetResponse struct { + // A database vulnerability assessment. DatabaseVulnerabilityAssessment } // ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentsClient.NewListByDatabasePager. type ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseResponse struct { + // A list of the database's vulnerability assessments. DatabaseVulnerabilityAssessmentListResult } +// ManagedDatabasesClientCancelMoveResponse contains the response from method ManagedDatabasesClient.BeginCancelMove. +type ManagedDatabasesClientCancelMoveResponse struct { + // placeholder for future response values +} + +// ManagedDatabasesClientCompleteMoveResponse contains the response from method ManagedDatabasesClient.BeginCompleteMove. +type ManagedDatabasesClientCompleteMoveResponse struct { + // placeholder for future response values +} + // ManagedDatabasesClientCompleteRestoreResponse contains the response from method ManagedDatabasesClient.BeginCompleteRestore. type ManagedDatabasesClientCompleteRestoreResponse struct { // placeholder for future response values @@ -1243,6 +1586,7 @@ type ManagedDatabasesClientCompleteRestoreResponse struct { // ManagedDatabasesClientCreateOrUpdateResponse contains the response from method ManagedDatabasesClient.BeginCreateOrUpdate. type ManagedDatabasesClientCreateOrUpdateResponse struct { + // A managed database resource. ManagedDatabase } @@ -1253,26 +1597,36 @@ type ManagedDatabasesClientDeleteResponse struct { // ManagedDatabasesClientGetResponse contains the response from method ManagedDatabasesClient.Get. type ManagedDatabasesClientGetResponse struct { + // A managed database resource. ManagedDatabase } // ManagedDatabasesClientListByInstanceResponse contains the response from method ManagedDatabasesClient.NewListByInstancePager. type ManagedDatabasesClientListByInstanceResponse struct { + // A list of managed databases. ManagedDatabaseListResult } // ManagedDatabasesClientListInaccessibleByInstanceResponse contains the response from method ManagedDatabasesClient.NewListInaccessibleByInstancePager. type ManagedDatabasesClientListInaccessibleByInstanceResponse struct { + // A list of managed databases. ManagedDatabaseListResult } +// ManagedDatabasesClientStartMoveResponse contains the response from method ManagedDatabasesClient.BeginStartMove. +type ManagedDatabasesClientStartMoveResponse struct { + // placeholder for future response values +} + // ManagedDatabasesClientUpdateResponse contains the response from method ManagedDatabasesClient.BeginUpdate. type ManagedDatabasesClientUpdateResponse struct { + // A managed database resource. ManagedDatabase } // ManagedInstanceAdministratorsClientCreateOrUpdateResponse contains the response from method ManagedInstanceAdministratorsClient.BeginCreateOrUpdate. type ManagedInstanceAdministratorsClientCreateOrUpdateResponse struct { + // An Azure SQL managed instance administrator. ManagedInstanceAdministrator } @@ -1283,16 +1637,37 @@ type ManagedInstanceAdministratorsClientDeleteResponse struct { // ManagedInstanceAdministratorsClientGetResponse contains the response from method ManagedInstanceAdministratorsClient.Get. type ManagedInstanceAdministratorsClientGetResponse struct { + // An Azure SQL managed instance administrator. ManagedInstanceAdministrator } // ManagedInstanceAdministratorsClientListByInstanceResponse contains the response from method ManagedInstanceAdministratorsClient.NewListByInstancePager. type ManagedInstanceAdministratorsClientListByInstanceResponse struct { + // A list of managed instance administrators. ManagedInstanceAdministratorListResult } +// ManagedInstanceAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse contains the response from method ManagedInstanceAdvancedThreatProtectionSettingsClient.BeginCreateOrUpdate. +type ManagedInstanceAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse struct { + // A managed instance Advanced Threat Protection. + ManagedInstanceAdvancedThreatProtection +} + +// ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse contains the response from method ManagedInstanceAdvancedThreatProtectionSettingsClient.Get. +type ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse struct { + // A managed instance Advanced Threat Protection. + ManagedInstanceAdvancedThreatProtection +} + +// ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse contains the response from method ManagedInstanceAdvancedThreatProtectionSettingsClient.NewListByInstancePager. +type ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse struct { + // A list of the managed instance's Advanced Threat Protection settings. + ManagedInstanceAdvancedThreatProtectionListResult +} + // ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdateResponse contains the response from method ManagedInstanceAzureADOnlyAuthenticationsClient.BeginCreateOrUpdate. type ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdateResponse struct { + // Azure Active Directory only authentication. ManagedInstanceAzureADOnlyAuthentication } @@ -1303,26 +1678,49 @@ type ManagedInstanceAzureADOnlyAuthenticationsClientDeleteResponse struct { // ManagedInstanceAzureADOnlyAuthenticationsClientGetResponse contains the response from method ManagedInstanceAzureADOnlyAuthenticationsClient.Get. type ManagedInstanceAzureADOnlyAuthenticationsClientGetResponse struct { + // Azure Active Directory only authentication. ManagedInstanceAzureADOnlyAuthentication } // ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceResponse contains the response from method ManagedInstanceAzureADOnlyAuthenticationsClient.NewListByInstancePager. type ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceResponse struct { + // A list of active directory only authentications. ManagedInstanceAzureADOnlyAuthListResult } +// ManagedInstanceDtcsClientCreateOrUpdateResponse contains the response from method ManagedInstanceDtcsClient.BeginCreateOrUpdate. +type ManagedInstanceDtcsClientCreateOrUpdateResponse struct { + // SQL Managed Instance DTC + ManagedInstanceDtc +} + +// ManagedInstanceDtcsClientGetResponse contains the response from method ManagedInstanceDtcsClient.Get. +type ManagedInstanceDtcsClientGetResponse struct { + // SQL Managed Instance DTC + ManagedInstanceDtc +} + +// ManagedInstanceDtcsClientListByManagedInstanceResponse contains the response from method ManagedInstanceDtcsClient.NewListByManagedInstancePager. +type ManagedInstanceDtcsClientListByManagedInstanceResponse struct { + // A list of managed instance's DTCs. + ManagedInstanceDtcListResult +} + // ManagedInstanceEncryptionProtectorsClientCreateOrUpdateResponse contains the response from method ManagedInstanceEncryptionProtectorsClient.BeginCreateOrUpdate. type ManagedInstanceEncryptionProtectorsClientCreateOrUpdateResponse struct { + // The managed instance encryption protector. ManagedInstanceEncryptionProtector } // ManagedInstanceEncryptionProtectorsClientGetResponse contains the response from method ManagedInstanceEncryptionProtectorsClient.Get. type ManagedInstanceEncryptionProtectorsClientGetResponse struct { + // The managed instance encryption protector. ManagedInstanceEncryptionProtector } // ManagedInstanceEncryptionProtectorsClientListByInstanceResponse contains the response from method ManagedInstanceEncryptionProtectorsClient.NewListByInstancePager. type ManagedInstanceEncryptionProtectorsClientListByInstanceResponse struct { + // A list of managed instance encryption protectors. ManagedInstanceEncryptionProtectorListResult } @@ -1333,6 +1731,7 @@ type ManagedInstanceEncryptionProtectorsClientRevalidateResponse struct { // ManagedInstanceKeysClientCreateOrUpdateResponse contains the response from method ManagedInstanceKeysClient.BeginCreateOrUpdate. type ManagedInstanceKeysClientCreateOrUpdateResponse struct { + // A managed instance key. ManagedInstanceKey } @@ -1343,26 +1742,31 @@ type ManagedInstanceKeysClientDeleteResponse struct { // ManagedInstanceKeysClientGetResponse contains the response from method ManagedInstanceKeysClient.Get. type ManagedInstanceKeysClientGetResponse struct { + // A managed instance key. ManagedInstanceKey } // ManagedInstanceKeysClientListByInstanceResponse contains the response from method ManagedInstanceKeysClient.NewListByInstancePager. type ManagedInstanceKeysClientListByInstanceResponse struct { + // A list of managed instance keys. ManagedInstanceKeyListResult } // ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdateResponse contains the response from method ManagedInstanceLongTermRetentionPoliciesClient.BeginCreateOrUpdate. type ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdateResponse struct { + // A long term retention policy. ManagedInstanceLongTermRetentionPolicy } // ManagedInstanceLongTermRetentionPoliciesClientGetResponse contains the response from method ManagedInstanceLongTermRetentionPoliciesClient.Get. type ManagedInstanceLongTermRetentionPoliciesClientGetResponse struct { + // A long term retention policy. ManagedInstanceLongTermRetentionPolicy } // ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseResponse contains the response from method ManagedInstanceLongTermRetentionPoliciesClient.NewListByDatabasePager. type ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseResponse struct { + // A list of long term retention policies. ManagedInstanceLongTermRetentionPolicyListResult } @@ -1373,16 +1777,19 @@ type ManagedInstanceOperationsClientCancelResponse struct { // ManagedInstanceOperationsClientGetResponse contains the response from method ManagedInstanceOperationsClient.Get. type ManagedInstanceOperationsClientGetResponse struct { + // A managed instance operation. ManagedInstanceOperation } // ManagedInstanceOperationsClientListByManagedInstanceResponse contains the response from method ManagedInstanceOperationsClient.NewListByManagedInstancePager. type ManagedInstanceOperationsClientListByManagedInstanceResponse struct { + // The response to a list managed instance operations request ManagedInstanceOperationListResult } // ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method ManagedInstancePrivateEndpointConnectionsClient.BeginCreateOrUpdate. type ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdateResponse struct { + // A private endpoint connection ManagedInstancePrivateEndpointConnection } @@ -1393,21 +1800,25 @@ type ManagedInstancePrivateEndpointConnectionsClientDeleteResponse struct { // ManagedInstancePrivateEndpointConnectionsClientGetResponse contains the response from method ManagedInstancePrivateEndpointConnectionsClient.Get. type ManagedInstancePrivateEndpointConnectionsClientGetResponse struct { + // A private endpoint connection ManagedInstancePrivateEndpointConnection } // ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceResponse contains the response from method ManagedInstancePrivateEndpointConnectionsClient.NewListByManagedInstancePager. type ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceResponse struct { + // A list of private endpoint connections. ManagedInstancePrivateEndpointConnectionListResult } // ManagedInstancePrivateLinkResourcesClientGetResponse contains the response from method ManagedInstancePrivateLinkResourcesClient.Get. type ManagedInstancePrivateLinkResourcesClientGetResponse struct { + // A private link resource ManagedInstancePrivateLink } // ManagedInstancePrivateLinkResourcesClientListByManagedInstanceResponse contains the response from method ManagedInstancePrivateLinkResourcesClient.NewListByManagedInstancePager. type ManagedInstancePrivateLinkResourcesClientListByManagedInstanceResponse struct { + // A list of private link resources ManagedInstancePrivateLinkListResult } @@ -1418,6 +1829,7 @@ type ManagedInstanceTdeCertificatesClientCreateResponse struct { // ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateResponse contains the response from method ManagedInstanceVulnerabilityAssessmentsClient.CreateOrUpdate. type ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateResponse struct { + // A managed instance vulnerability assessment. ManagedInstanceVulnerabilityAssessment } @@ -1428,16 +1840,19 @@ type ManagedInstanceVulnerabilityAssessmentsClientDeleteResponse struct { // ManagedInstanceVulnerabilityAssessmentsClientGetResponse contains the response from method ManagedInstanceVulnerabilityAssessmentsClient.Get. type ManagedInstanceVulnerabilityAssessmentsClientGetResponse struct { + // A managed instance vulnerability assessment. ManagedInstanceVulnerabilityAssessment } // ManagedInstanceVulnerabilityAssessmentsClientListByInstanceResponse contains the response from method ManagedInstanceVulnerabilityAssessmentsClient.NewListByInstancePager. type ManagedInstanceVulnerabilityAssessmentsClientListByInstanceResponse struct { + // A list of the ManagedInstance's vulnerability assessments. ManagedInstanceVulnerabilityAssessmentListResult } // ManagedInstancesClientCreateOrUpdateResponse contains the response from method ManagedInstancesClient.BeginCreateOrUpdate. type ManagedInstancesClientCreateOrUpdateResponse struct { + // An Azure SQL managed instance. ManagedInstance } @@ -1453,79 +1868,163 @@ type ManagedInstancesClientFailoverResponse struct { // ManagedInstancesClientGetResponse contains the response from method ManagedInstancesClient.Get. type ManagedInstancesClientGetResponse struct { + // An Azure SQL managed instance. ManagedInstance } // ManagedInstancesClientListByInstancePoolResponse contains the response from method ManagedInstancesClient.NewListByInstancePoolPager. type ManagedInstancesClientListByInstancePoolResponse struct { + // A list of managed instances. ManagedInstanceListResult } // ManagedInstancesClientListByManagedInstanceResponse contains the response from method ManagedInstancesClient.NewListByManagedInstancePager. type ManagedInstancesClientListByManagedInstanceResponse struct { + // A list of top resource consuming queries on managed instance TopQueriesListResult } // ManagedInstancesClientListByResourceGroupResponse contains the response from method ManagedInstancesClient.NewListByResourceGroupPager. type ManagedInstancesClientListByResourceGroupResponse struct { + // A list of managed instances. ManagedInstanceListResult } +// ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse contains the response from method ManagedInstancesClient.NewListOutboundNetworkDependenciesByManagedInstancePager. +type ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse struct { + // A collection of endpoints that the managed instance service requires outbound network access to. + OutboundEnvironmentEndpointCollection +} + // ManagedInstancesClientListResponse contains the response from method ManagedInstancesClient.NewListPager. type ManagedInstancesClientListResponse struct { + // A list of managed instances. ManagedInstanceListResult } +// ManagedInstancesClientStartResponse contains the response from method ManagedInstancesClient.BeginStart. +type ManagedInstancesClientStartResponse struct { + // placeholder for future response values +} + +// ManagedInstancesClientStopResponse contains the response from method ManagedInstancesClient.BeginStop. +type ManagedInstancesClientStopResponse struct { + // placeholder for future response values +} + // ManagedInstancesClientUpdateResponse contains the response from method ManagedInstancesClient.BeginUpdate. type ManagedInstancesClientUpdateResponse struct { + // An Azure SQL managed instance. ManagedInstance } +// ManagedLedgerDigestUploadsClientCreateOrUpdateResponse contains the response from method ManagedLedgerDigestUploadsClient.BeginCreateOrUpdate. +type ManagedLedgerDigestUploadsClientCreateOrUpdateResponse struct { + // Azure SQL Database ledger digest upload settings. + ManagedLedgerDigestUploads +} + +// ManagedLedgerDigestUploadsClientDisableResponse contains the response from method ManagedLedgerDigestUploadsClient.BeginDisable. +type ManagedLedgerDigestUploadsClientDisableResponse struct { + // Azure SQL Database ledger digest upload settings. + ManagedLedgerDigestUploads +} + +// ManagedLedgerDigestUploadsClientGetResponse contains the response from method ManagedLedgerDigestUploadsClient.Get. +type ManagedLedgerDigestUploadsClientGetResponse struct { + // Azure SQL Database ledger digest upload settings. + ManagedLedgerDigestUploads +} + +// ManagedLedgerDigestUploadsClientListByDatabaseResponse contains the response from method ManagedLedgerDigestUploadsClient.NewListByDatabasePager. +type ManagedLedgerDigestUploadsClientListByDatabaseResponse struct { + // A list of ledger digest upload settings. + ManagedLedgerDigestUploadsListResult +} + // ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdateResponse contains the response from // method ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate. type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdateResponse struct { + // A short term retention policy. ManagedBackupShortTermRetentionPolicy } // ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetResponse contains the response from method ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.Get. type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetResponse struct { + // A short term retention policy. ManagedBackupShortTermRetentionPolicy } // ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseResponse contains // the response from method ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.NewListByRestorableDroppedDatabasePager. type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseResponse struct { + // A list of short term retention policies. ManagedBackupShortTermRetentionPolicyListResult } // ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdateResponse contains the response from method // ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.BeginUpdate. type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdateResponse struct { + // A short term retention policy. ManagedBackupShortTermRetentionPolicy } +// ManagedServerDNSAliasesClientAcquireResponse contains the response from method ManagedServerDNSAliasesClient.BeginAcquire. +type ManagedServerDNSAliasesClientAcquireResponse struct { + // A managed server DNS alias. + ManagedServerDNSAlias +} + +// ManagedServerDNSAliasesClientCreateOrUpdateResponse contains the response from method ManagedServerDNSAliasesClient.BeginCreateOrUpdate. +type ManagedServerDNSAliasesClientCreateOrUpdateResponse struct { + // A managed server DNS alias. + ManagedServerDNSAlias +} + +// ManagedServerDNSAliasesClientDeleteResponse contains the response from method ManagedServerDNSAliasesClient.BeginDelete. +type ManagedServerDNSAliasesClientDeleteResponse struct { + // placeholder for future response values +} + +// ManagedServerDNSAliasesClientGetResponse contains the response from method ManagedServerDNSAliasesClient.Get. +type ManagedServerDNSAliasesClientGetResponse struct { + // A managed server DNS alias. + ManagedServerDNSAlias +} + +// ManagedServerDNSAliasesClientListByManagedInstanceResponse contains the response from method ManagedServerDNSAliasesClient.NewListByManagedInstancePager. +type ManagedServerDNSAliasesClientListByManagedInstanceResponse struct { + // A list of managed server DNS aliases. + ManagedServerDNSAliasListResult +} + // ManagedServerSecurityAlertPoliciesClientCreateOrUpdateResponse contains the response from method ManagedServerSecurityAlertPoliciesClient.BeginCreateOrUpdate. type ManagedServerSecurityAlertPoliciesClientCreateOrUpdateResponse struct { + // A managed server security alert policy. ManagedServerSecurityAlertPolicy } // ManagedServerSecurityAlertPoliciesClientGetResponse contains the response from method ManagedServerSecurityAlertPoliciesClient.Get. type ManagedServerSecurityAlertPoliciesClientGetResponse struct { + // A managed server security alert policy. ManagedServerSecurityAlertPolicy } // ManagedServerSecurityAlertPoliciesClientListByInstanceResponse contains the response from method ManagedServerSecurityAlertPoliciesClient.NewListByInstancePager. type ManagedServerSecurityAlertPoliciesClientListByInstanceResponse struct { + // A list of the managed Server's security alert policies. ManagedServerSecurityAlertPolicyListResult } // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // Result of the request to list SQL operations. OperationListResult } // OutboundFirewallRulesClientCreateOrUpdateResponse contains the response from method OutboundFirewallRulesClient.BeginCreateOrUpdate. type OutboundFirewallRulesClientCreateOrUpdateResponse struct { + // An Azure SQL DB Server Outbound Firewall Rule. OutboundFirewallRule } @@ -1536,16 +2035,19 @@ type OutboundFirewallRulesClientDeleteResponse struct { // OutboundFirewallRulesClientGetResponse contains the response from method OutboundFirewallRulesClient.Get. type OutboundFirewallRulesClientGetResponse struct { + // An Azure SQL DB Server Outbound Firewall Rule. OutboundFirewallRule } // OutboundFirewallRulesClientListByServerResponse contains the response from method OutboundFirewallRulesClient.NewListByServerPager. type OutboundFirewallRulesClientListByServerResponse struct { + // A list of outbound rules. OutboundFirewallRuleListResult } // PrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionsClient.BeginCreateOrUpdate. type PrivateEndpointConnectionsClientCreateOrUpdateResponse struct { + // A private endpoint connection PrivateEndpointConnection } @@ -1556,21 +2058,25 @@ type PrivateEndpointConnectionsClientDeleteResponse struct { // PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get. type PrivateEndpointConnectionsClientGetResponse struct { + // A private endpoint connection PrivateEndpointConnection } // PrivateEndpointConnectionsClientListByServerResponse contains the response from method PrivateEndpointConnectionsClient.NewListByServerPager. type PrivateEndpointConnectionsClientListByServerResponse struct { + // A list of private endpoint connections. PrivateEndpointConnectionListResult } // PrivateLinkResourcesClientGetResponse contains the response from method PrivateLinkResourcesClient.Get. type PrivateLinkResourcesClientGetResponse struct { + // A private link resource PrivateLinkResource } // PrivateLinkResourcesClientListByServerResponse contains the response from method PrivateLinkResourcesClient.NewListByServerPager. type PrivateLinkResourcesClientListByServerResponse struct { + // A list of private link resources PrivateLinkResourceListResult } @@ -1581,76 +2087,90 @@ type RecommendedSensitivityLabelsClientUpdateResponse struct { // RecoverableDatabasesClientGetResponse contains the response from method RecoverableDatabasesClient.Get. type RecoverableDatabasesClientGetResponse struct { + // A recoverable database resource. RecoverableDatabase } // RecoverableDatabasesClientListByServerResponse contains the response from method RecoverableDatabasesClient.NewListByServerPager. type RecoverableDatabasesClientListByServerResponse struct { + // A list of recoverable databases. RecoverableDatabaseListResult } // RecoverableManagedDatabasesClientGetResponse contains the response from method RecoverableManagedDatabasesClient.Get. type RecoverableManagedDatabasesClientGetResponse struct { + // A recoverable managed database resource. RecoverableManagedDatabase } // RecoverableManagedDatabasesClientListByInstanceResponse contains the response from method RecoverableManagedDatabasesClient.NewListByInstancePager. type RecoverableManagedDatabasesClientListByInstanceResponse struct { + // A list of recoverable managed databases. RecoverableManagedDatabaseListResult } -// ReplicationLinksClientDeleteResponse contains the response from method ReplicationLinksClient.Delete. +// ReplicationLinksClientDeleteResponse contains the response from method ReplicationLinksClient.BeginDelete. type ReplicationLinksClientDeleteResponse struct { // placeholder for future response values } // ReplicationLinksClientFailoverAllowDataLossResponse contains the response from method ReplicationLinksClient.BeginFailoverAllowDataLoss. type ReplicationLinksClientFailoverAllowDataLossResponse struct { + // A replication link. ReplicationLink } // ReplicationLinksClientFailoverResponse contains the response from method ReplicationLinksClient.BeginFailover. type ReplicationLinksClientFailoverResponse struct { + // A replication link. ReplicationLink } // ReplicationLinksClientGetResponse contains the response from method ReplicationLinksClient.Get. type ReplicationLinksClientGetResponse struct { + // A replication link. ReplicationLink } // ReplicationLinksClientListByDatabaseResponse contains the response from method ReplicationLinksClient.NewListByDatabasePager. type ReplicationLinksClientListByDatabaseResponse struct { + // A list of replication links. ReplicationLinkListResult } // ReplicationLinksClientListByServerResponse contains the response from method ReplicationLinksClient.NewListByServerPager. type ReplicationLinksClientListByServerResponse struct { + // A list of replication links. ReplicationLinkListResult } // RestorableDroppedDatabasesClientGetResponse contains the response from method RestorableDroppedDatabasesClient.Get. type RestorableDroppedDatabasesClientGetResponse struct { + // A restorable dropped database resource. RestorableDroppedDatabase } // RestorableDroppedDatabasesClientListByServerResponse contains the response from method RestorableDroppedDatabasesClient.NewListByServerPager. type RestorableDroppedDatabasesClientListByServerResponse struct { + // A list of restorable dropped databases. RestorableDroppedDatabaseListResult } // RestorableDroppedManagedDatabasesClientGetResponse contains the response from method RestorableDroppedManagedDatabasesClient.Get. type RestorableDroppedManagedDatabasesClientGetResponse struct { + // A restorable dropped managed database resource. RestorableDroppedManagedDatabase } // RestorableDroppedManagedDatabasesClientListByInstanceResponse contains the response from method RestorableDroppedManagedDatabasesClient.NewListByInstancePager. type RestorableDroppedManagedDatabasesClientListByInstanceResponse struct { + // A list of restorable dropped managed databases. RestorableDroppedManagedDatabaseListResult } // RestorePointsClientCreateResponse contains the response from method RestorePointsClient.BeginCreate. type RestorePointsClientCreateResponse struct { + // Database restore points. RestorePoint } @@ -1661,16 +2181,19 @@ type RestorePointsClientDeleteResponse struct { // RestorePointsClientGetResponse contains the response from method RestorePointsClient.Get. type RestorePointsClientGetResponse struct { + // Database restore points. RestorePoint } // RestorePointsClientListByDatabaseResponse contains the response from method RestorePointsClient.NewListByDatabasePager. type RestorePointsClientListByDatabaseResponse struct { + // A list of long term retention backups. RestorePointListResult } // SensitivityLabelsClientCreateOrUpdateResponse contains the response from method SensitivityLabelsClient.CreateOrUpdate. type SensitivityLabelsClientCreateOrUpdateResponse struct { + // A sensitivity label. SensitivityLabel } @@ -1691,16 +2214,19 @@ type SensitivityLabelsClientEnableRecommendationResponse struct { // SensitivityLabelsClientGetResponse contains the response from method SensitivityLabelsClient.Get. type SensitivityLabelsClientGetResponse struct { + // A sensitivity label. SensitivityLabel } // SensitivityLabelsClientListCurrentByDatabaseResponse contains the response from method SensitivityLabelsClient.NewListCurrentByDatabasePager. type SensitivityLabelsClientListCurrentByDatabaseResponse struct { + // A list of sensitivity labels. SensitivityLabelListResult } // SensitivityLabelsClientListRecommendedByDatabaseResponse contains the response from method SensitivityLabelsClient.NewListRecommendedByDatabasePager. type SensitivityLabelsClientListRecommendedByDatabaseResponse struct { + // A list of sensitivity labels. SensitivityLabelListResult } @@ -1711,21 +2237,25 @@ type SensitivityLabelsClientUpdateResponse struct { // ServerAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse contains the response from method ServerAdvancedThreatProtectionSettingsClient.BeginCreateOrUpdate. type ServerAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse struct { + // A server Advanced Threat Protection. ServerAdvancedThreatProtection } // ServerAdvancedThreatProtectionSettingsClientGetResponse contains the response from method ServerAdvancedThreatProtectionSettingsClient.Get. type ServerAdvancedThreatProtectionSettingsClientGetResponse struct { + // A server Advanced Threat Protection. ServerAdvancedThreatProtection } // ServerAdvancedThreatProtectionSettingsClientListByServerResponse contains the response from method ServerAdvancedThreatProtectionSettingsClient.NewListByServerPager. type ServerAdvancedThreatProtectionSettingsClientListByServerResponse struct { + // A list of the server's Advanced Threat Protection configurations. LogicalServerAdvancedThreatProtectionListResult } // ServerAdvisorsClientGetResponse contains the response from method ServerAdvisorsClient.Get. type ServerAdvisorsClientGetResponse struct { + // Database, Server or Elastic Pool Advisor. Advisor } @@ -1737,21 +2267,25 @@ type ServerAdvisorsClientListByServerResponse struct { // ServerAdvisorsClientUpdateResponse contains the response from method ServerAdvisorsClient.Update. type ServerAdvisorsClientUpdateResponse struct { + // Database, Server or Elastic Pool Advisor. Advisor } // ServerAutomaticTuningClientGetResponse contains the response from method ServerAutomaticTuningClient.Get. type ServerAutomaticTuningClientGetResponse struct { + // Server-level Automatic Tuning. ServerAutomaticTuning } // ServerAutomaticTuningClientUpdateResponse contains the response from method ServerAutomaticTuningClient.Update. type ServerAutomaticTuningClientUpdateResponse struct { + // Server-level Automatic Tuning. ServerAutomaticTuning } // ServerAzureADAdministratorsClientCreateOrUpdateResponse contains the response from method ServerAzureADAdministratorsClient.BeginCreateOrUpdate. type ServerAzureADAdministratorsClientCreateOrUpdateResponse struct { + // Azure Active Directory administrator. ServerAzureADAdministrator } @@ -1762,16 +2296,19 @@ type ServerAzureADAdministratorsClientDeleteResponse struct { // ServerAzureADAdministratorsClientGetResponse contains the response from method ServerAzureADAdministratorsClient.Get. type ServerAzureADAdministratorsClientGetResponse struct { + // Azure Active Directory administrator. ServerAzureADAdministrator } // ServerAzureADAdministratorsClientListByServerResponse contains the response from method ServerAzureADAdministratorsClient.NewListByServerPager. type ServerAzureADAdministratorsClientListByServerResponse struct { + // A list of active directory administrators. AdministratorListResult } // ServerAzureADOnlyAuthenticationsClientCreateOrUpdateResponse contains the response from method ServerAzureADOnlyAuthenticationsClient.BeginCreateOrUpdate. type ServerAzureADOnlyAuthenticationsClientCreateOrUpdateResponse struct { + // Azure Active Directory only authentication. ServerAzureADOnlyAuthentication } @@ -1782,31 +2319,37 @@ type ServerAzureADOnlyAuthenticationsClientDeleteResponse struct { // ServerAzureADOnlyAuthenticationsClientGetResponse contains the response from method ServerAzureADOnlyAuthenticationsClient.Get. type ServerAzureADOnlyAuthenticationsClientGetResponse struct { + // Azure Active Directory only authentication. ServerAzureADOnlyAuthentication } // ServerAzureADOnlyAuthenticationsClientListByServerResponse contains the response from method ServerAzureADOnlyAuthenticationsClient.NewListByServerPager. type ServerAzureADOnlyAuthenticationsClientListByServerResponse struct { + // A list of active directory only authentications. AzureADOnlyAuthListResult } // ServerBlobAuditingPoliciesClientCreateOrUpdateResponse contains the response from method ServerBlobAuditingPoliciesClient.BeginCreateOrUpdate. type ServerBlobAuditingPoliciesClientCreateOrUpdateResponse struct { + // A server blob auditing policy. ServerBlobAuditingPolicy } // ServerBlobAuditingPoliciesClientGetResponse contains the response from method ServerBlobAuditingPoliciesClient.Get. type ServerBlobAuditingPoliciesClientGetResponse struct { + // A server blob auditing policy. ServerBlobAuditingPolicy } // ServerBlobAuditingPoliciesClientListByServerResponse contains the response from method ServerBlobAuditingPoliciesClient.NewListByServerPager. type ServerBlobAuditingPoliciesClientListByServerResponse struct { + // A list of server auditing settings. ServerBlobAuditingPolicyListResult } // ServerCommunicationLinksClientCreateOrUpdateResponse contains the response from method ServerCommunicationLinksClient.BeginCreateOrUpdate. type ServerCommunicationLinksClientCreateOrUpdateResponse struct { + // Server communication link. ServerCommunicationLink } @@ -1817,36 +2360,61 @@ type ServerCommunicationLinksClientDeleteResponse struct { // ServerCommunicationLinksClientGetResponse contains the response from method ServerCommunicationLinksClient.Get. type ServerCommunicationLinksClientGetResponse struct { + // Server communication link. ServerCommunicationLink } // ServerCommunicationLinksClientListByServerResponse contains the response from method ServerCommunicationLinksClient.NewListByServerPager. type ServerCommunicationLinksClientListByServerResponse struct { + // A list of server communication links. ServerCommunicationLinkListResult } +// ServerConfigurationOptionsClientCreateOrUpdateResponse contains the response from method ServerConfigurationOptionsClient.BeginCreateOrUpdate. +type ServerConfigurationOptionsClientCreateOrUpdateResponse struct { + // A server configuration option + ServerConfigurationOption +} + +// ServerConfigurationOptionsClientGetResponse contains the response from method ServerConfigurationOptionsClient.Get. +type ServerConfigurationOptionsClientGetResponse struct { + // A server configuration option + ServerConfigurationOption +} + +// ServerConfigurationOptionsClientListByManagedInstanceResponse contains the response from method ServerConfigurationOptionsClient.NewListByManagedInstancePager. +type ServerConfigurationOptionsClientListByManagedInstanceResponse struct { + // A list of server configuration options. + ServerConfigurationOptionListResult +} + // ServerConnectionPoliciesClientCreateOrUpdateResponse contains the response from method ServerConnectionPoliciesClient.BeginCreateOrUpdate. type ServerConnectionPoliciesClientCreateOrUpdateResponse struct { + // A server connection policy ServerConnectionPolicy } // ServerConnectionPoliciesClientGetResponse contains the response from method ServerConnectionPoliciesClient.Get. type ServerConnectionPoliciesClientGetResponse struct { + // A server connection policy ServerConnectionPolicy } // ServerConnectionPoliciesClientListByServerResponse contains the response from method ServerConnectionPoliciesClient.NewListByServerPager. type ServerConnectionPoliciesClientListByServerResponse struct { + // A list of server connection policy objects. ServerConnectionPolicyListResult } // ServerDNSAliasesClientAcquireResponse contains the response from method ServerDNSAliasesClient.BeginAcquire. type ServerDNSAliasesClientAcquireResponse struct { + // A server DNS alias. ServerDNSAlias } // ServerDNSAliasesClientCreateOrUpdateResponse contains the response from method ServerDNSAliasesClient.BeginCreateOrUpdate. type ServerDNSAliasesClientCreateOrUpdateResponse struct { + // A server DNS alias. ServerDNSAlias } @@ -1857,31 +2425,37 @@ type ServerDNSAliasesClientDeleteResponse struct { // ServerDNSAliasesClientGetResponse contains the response from method ServerDNSAliasesClient.Get. type ServerDNSAliasesClientGetResponse struct { + // A server DNS alias. ServerDNSAlias } // ServerDNSAliasesClientListByServerResponse contains the response from method ServerDNSAliasesClient.NewListByServerPager. type ServerDNSAliasesClientListByServerResponse struct { + // A list of server DNS aliases. ServerDNSAliasListResult } // ServerDevOpsAuditSettingsClientCreateOrUpdateResponse contains the response from method ServerDevOpsAuditSettingsClient.BeginCreateOrUpdate. type ServerDevOpsAuditSettingsClientCreateOrUpdateResponse struct { + // A server DevOps auditing settings. ServerDevOpsAuditingSettings } // ServerDevOpsAuditSettingsClientGetResponse contains the response from method ServerDevOpsAuditSettingsClient.Get. type ServerDevOpsAuditSettingsClientGetResponse struct { + // A server DevOps auditing settings. ServerDevOpsAuditingSettings } // ServerDevOpsAuditSettingsClientListByServerResponse contains the response from method ServerDevOpsAuditSettingsClient.NewListByServerPager. type ServerDevOpsAuditSettingsClientListByServerResponse struct { + // A list of server DevOps audit settings. ServerDevOpsAuditSettingsListResult } // ServerKeysClientCreateOrUpdateResponse contains the response from method ServerKeysClient.BeginCreateOrUpdate. type ServerKeysClientCreateOrUpdateResponse struct { + // A server key. ServerKey } @@ -1892,36 +2466,43 @@ type ServerKeysClientDeleteResponse struct { // ServerKeysClientGetResponse contains the response from method ServerKeysClient.Get. type ServerKeysClientGetResponse struct { + // A server key. ServerKey } // ServerKeysClientListByServerResponse contains the response from method ServerKeysClient.NewListByServerPager. type ServerKeysClientListByServerResponse struct { + // A list of server keys. ServerKeyListResult } // ServerOperationsClientListByServerResponse contains the response from method ServerOperationsClient.NewListByServerPager. type ServerOperationsClientListByServerResponse struct { + // The response to a list server operations request ServerOperationListResult } // ServerSecurityAlertPoliciesClientCreateOrUpdateResponse contains the response from method ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate. type ServerSecurityAlertPoliciesClientCreateOrUpdateResponse struct { + // A server security alert policy. ServerSecurityAlertPolicy } // ServerSecurityAlertPoliciesClientGetResponse contains the response from method ServerSecurityAlertPoliciesClient.Get. type ServerSecurityAlertPoliciesClientGetResponse struct { + // A server security alert policy. ServerSecurityAlertPolicy } // ServerSecurityAlertPoliciesClientListByServerResponse contains the response from method ServerSecurityAlertPoliciesClient.NewListByServerPager. type ServerSecurityAlertPoliciesClientListByServerResponse struct { + // A list of the server's security alert policies. LogicalServerSecurityAlertPolicyListResult } // ServerTrustCertificatesClientCreateOrUpdateResponse contains the response from method ServerTrustCertificatesClient.BeginCreateOrUpdate. type ServerTrustCertificatesClientCreateOrUpdateResponse struct { + // Server trust certificate imported from box to enable connection between box and Sql Managed Instance. ServerTrustCertificate } @@ -1932,16 +2513,19 @@ type ServerTrustCertificatesClientDeleteResponse struct { // ServerTrustCertificatesClientGetResponse contains the response from method ServerTrustCertificatesClient.Get. type ServerTrustCertificatesClientGetResponse struct { + // Server trust certificate imported from box to enable connection between box and Sql Managed Instance. ServerTrustCertificate } // ServerTrustCertificatesClientListByInstanceResponse contains the response from method ServerTrustCertificatesClient.NewListByInstancePager. type ServerTrustCertificatesClientListByInstanceResponse struct { + // A list of server trust certificates in instance. ServerTrustCertificatesListResult } // ServerTrustGroupsClientCreateOrUpdateResponse contains the response from method ServerTrustGroupsClient.BeginCreateOrUpdate. type ServerTrustGroupsClientCreateOrUpdateResponse struct { + // A server trust group. ServerTrustGroup } @@ -1952,26 +2536,31 @@ type ServerTrustGroupsClientDeleteResponse struct { // ServerTrustGroupsClientGetResponse contains the response from method ServerTrustGroupsClient.Get. type ServerTrustGroupsClientGetResponse struct { + // A server trust group. ServerTrustGroup } // ServerTrustGroupsClientListByInstanceResponse contains the response from method ServerTrustGroupsClient.NewListByInstancePager. type ServerTrustGroupsClientListByInstanceResponse struct { + // A list of server trust groups. ServerTrustGroupListResult } // ServerTrustGroupsClientListByLocationResponse contains the response from method ServerTrustGroupsClient.NewListByLocationPager. type ServerTrustGroupsClientListByLocationResponse struct { + // A list of server trust groups. ServerTrustGroupListResult } // ServerUsagesClientListByServerResponse contains the response from method ServerUsagesClient.NewListByServerPager. type ServerUsagesClientListByServerResponse struct { + // Represents the response to a list server metrics request. ServerUsageListResult } // ServerVulnerabilityAssessmentsClientCreateOrUpdateResponse contains the response from method ServerVulnerabilityAssessmentsClient.CreateOrUpdate. type ServerVulnerabilityAssessmentsClientCreateOrUpdateResponse struct { + // A server vulnerability assessment. ServerVulnerabilityAssessment } @@ -1982,21 +2571,25 @@ type ServerVulnerabilityAssessmentsClientDeleteResponse struct { // ServerVulnerabilityAssessmentsClientGetResponse contains the response from method ServerVulnerabilityAssessmentsClient.Get. type ServerVulnerabilityAssessmentsClientGetResponse struct { + // A server vulnerability assessment. ServerVulnerabilityAssessment } // ServerVulnerabilityAssessmentsClientListByServerResponse contains the response from method ServerVulnerabilityAssessmentsClient.NewListByServerPager. type ServerVulnerabilityAssessmentsClientListByServerResponse struct { + // A list of the server's vulnerability assessments. ServerVulnerabilityAssessmentListResult } // ServersClientCheckNameAvailabilityResponse contains the response from method ServersClient.CheckNameAvailability. type ServersClientCheckNameAvailabilityResponse struct { + // The result of a name availability check. CheckNameAvailabilityResponse } // ServersClientCreateOrUpdateResponse contains the response from method ServersClient.BeginCreateOrUpdate. type ServersClientCreateOrUpdateResponse struct { + // An Azure SQL Database server. Server } @@ -2007,51 +2600,96 @@ type ServersClientDeleteResponse struct { // ServersClientGetResponse contains the response from method ServersClient.Get. type ServersClientGetResponse struct { + // An Azure SQL Database server. Server } // ServersClientImportDatabaseResponse contains the response from method ServersClient.BeginImportDatabase. type ServersClientImportDatabaseResponse struct { + // An ImportExport operation result resource. ImportExportOperationResult } // ServersClientListByResourceGroupResponse contains the response from method ServersClient.NewListByResourceGroupPager. type ServersClientListByResourceGroupResponse struct { + // A list of servers. ServerListResult } // ServersClientListResponse contains the response from method ServersClient.NewListPager. type ServersClientListResponse struct { + // A list of servers. ServerListResult } +// ServersClientRefreshStatusResponse contains the response from method ServersClient.BeginRefreshStatus. +type ServersClientRefreshStatusResponse struct { + // An RefreshExternalGovernanceStatus operation result resource. + RefreshExternalGovernanceStatusOperationResult +} + // ServersClientUpdateResponse contains the response from method ServersClient.BeginUpdate. type ServersClientUpdateResponse struct { + // An Azure SQL Database server. Server } // ServiceObjectivesClientGetResponse contains the response from method ServiceObjectivesClient.Get. type ServiceObjectivesClientGetResponse struct { + // Represents a database service objective. ServiceObjective } // ServiceObjectivesClientListByServerResponse contains the response from method ServiceObjectivesClient.NewListByServerPager. type ServiceObjectivesClientListByServerResponse struct { + // Represents the response to a get database service objectives request. ServiceObjectiveListResult } +// StartStopManagedInstanceSchedulesClientCreateOrUpdateResponse contains the response from method StartStopManagedInstanceSchedulesClient.CreateOrUpdate. +type StartStopManagedInstanceSchedulesClientCreateOrUpdateResponse struct { + // Managed instance's Start/Stop schedule. + StartStopManagedInstanceSchedule +} + +// StartStopManagedInstanceSchedulesClientDeleteResponse contains the response from method StartStopManagedInstanceSchedulesClient.Delete. +type StartStopManagedInstanceSchedulesClientDeleteResponse struct { + // placeholder for future response values +} + +// StartStopManagedInstanceSchedulesClientGetResponse contains the response from method StartStopManagedInstanceSchedulesClient.Get. +type StartStopManagedInstanceSchedulesClientGetResponse struct { + // Managed instance's Start/Stop schedule. + StartStopManagedInstanceSchedule +} + +// StartStopManagedInstanceSchedulesClientListByInstanceResponse contains the response from method StartStopManagedInstanceSchedulesClient.NewListByInstancePager. +type StartStopManagedInstanceSchedulesClientListByInstanceResponse struct { + // Managed instance's Start/Stop schedule list result. + StartStopManagedInstanceScheduleListResult +} + // SubscriptionUsagesClientGetResponse contains the response from method SubscriptionUsagesClient.Get. type SubscriptionUsagesClientGetResponse struct { + // Usage Metric of a Subscription in a Location. SubscriptionUsage } // SubscriptionUsagesClientListByLocationResponse contains the response from method SubscriptionUsagesClient.NewListByLocationPager. type SubscriptionUsagesClientListByLocationResponse struct { + // A list of subscription usage metrics in a location. SubscriptionUsageListResult } +// SynapseLinkWorkspacesClientListByDatabaseResponse contains the response from method SynapseLinkWorkspacesClient.NewListByDatabasePager. +type SynapseLinkWorkspacesClientListByDatabaseResponse struct { + // A list of synapselink workspaces + SynapseLinkWorkspaceListResult +} + // SyncAgentsClientCreateOrUpdateResponse contains the response from method SyncAgentsClient.BeginCreateOrUpdate. type SyncAgentsClientCreateOrUpdateResponse struct { + // An Azure SQL Database sync agent. SyncAgent } @@ -2062,21 +2700,25 @@ type SyncAgentsClientDeleteResponse struct { // SyncAgentsClientGenerateKeyResponse contains the response from method SyncAgentsClient.GenerateKey. type SyncAgentsClientGenerateKeyResponse struct { + // Properties of an Azure SQL Database sync agent key. SyncAgentKeyProperties } // SyncAgentsClientGetResponse contains the response from method SyncAgentsClient.Get. type SyncAgentsClientGetResponse struct { + // An Azure SQL Database sync agent. SyncAgent } // SyncAgentsClientListByServerResponse contains the response from method SyncAgentsClient.NewListByServerPager. type SyncAgentsClientListByServerResponse struct { + // A list of sync agents. SyncAgentListResult } // SyncAgentsClientListLinkedDatabasesResponse contains the response from method SyncAgentsClient.NewListLinkedDatabasesPager. type SyncAgentsClientListLinkedDatabasesResponse struct { + // A list of sync agent linked databases. SyncAgentLinkedDatabaseListResult } @@ -2087,6 +2729,7 @@ type SyncGroupsClientCancelSyncResponse struct { // SyncGroupsClientCreateOrUpdateResponse contains the response from method SyncGroupsClient.BeginCreateOrUpdate. type SyncGroupsClientCreateOrUpdateResponse struct { + // An Azure SQL Database sync group. SyncGroup } @@ -2097,26 +2740,31 @@ type SyncGroupsClientDeleteResponse struct { // SyncGroupsClientGetResponse contains the response from method SyncGroupsClient.Get. type SyncGroupsClientGetResponse struct { + // An Azure SQL Database sync group. SyncGroup } // SyncGroupsClientListByDatabaseResponse contains the response from method SyncGroupsClient.NewListByDatabasePager. type SyncGroupsClientListByDatabaseResponse struct { + // A list of sync groups. SyncGroupListResult } // SyncGroupsClientListHubSchemasResponse contains the response from method SyncGroupsClient.NewListHubSchemasPager. type SyncGroupsClientListHubSchemasResponse struct { + // A list of sync schema properties. SyncFullSchemaPropertiesListResult } // SyncGroupsClientListLogsResponse contains the response from method SyncGroupsClient.NewListLogsPager. type SyncGroupsClientListLogsResponse struct { + // A list of sync group log properties. SyncGroupLogListResult } // SyncGroupsClientListSyncDatabaseIDsResponse contains the response from method SyncGroupsClient.NewListSyncDatabaseIDsPager. type SyncGroupsClientListSyncDatabaseIDsResponse struct { + // A list of sync database ID properties. SyncDatabaseIDListResult } @@ -2132,11 +2780,13 @@ type SyncGroupsClientTriggerSyncResponse struct { // SyncGroupsClientUpdateResponse contains the response from method SyncGroupsClient.BeginUpdate. type SyncGroupsClientUpdateResponse struct { + // An Azure SQL Database sync group. SyncGroup } // SyncMembersClientCreateOrUpdateResponse contains the response from method SyncMembersClient.BeginCreateOrUpdate. type SyncMembersClientCreateOrUpdateResponse struct { + // An Azure SQL Database sync member. SyncMember } @@ -2147,16 +2797,19 @@ type SyncMembersClientDeleteResponse struct { // SyncMembersClientGetResponse contains the response from method SyncMembersClient.Get. type SyncMembersClientGetResponse struct { + // An Azure SQL Database sync member. SyncMember } // SyncMembersClientListBySyncGroupResponse contains the response from method SyncMembersClient.NewListBySyncGroupPager. type SyncMembersClientListBySyncGroupResponse struct { + // A list of Azure SQL Database sync members. SyncMemberListResult } // SyncMembersClientListMemberSchemasResponse contains the response from method SyncMembersClient.NewListMemberSchemasPager. type SyncMembersClientListMemberSchemasResponse struct { + // A list of sync schema properties. SyncFullSchemaPropertiesListResult } @@ -2167,6 +2820,7 @@ type SyncMembersClientRefreshMemberSchemaResponse struct { // SyncMembersClientUpdateResponse contains the response from method SyncMembersClient.BeginUpdate. type SyncMembersClientUpdateResponse struct { + // An Azure SQL Database sync member. SyncMember } @@ -2177,31 +2831,37 @@ type TdeCertificatesClientCreateResponse struct { // TimeZonesClientGetResponse contains the response from method TimeZonesClient.Get. type TimeZonesClientGetResponse struct { + // Time Zone. TimeZone } // TimeZonesClientListByLocationResponse contains the response from method TimeZonesClient.NewListByLocationPager. type TimeZonesClientListByLocationResponse struct { + // A list of time zones. TimeZoneListResult } -// TransparentDataEncryptionsClientCreateOrUpdateResponse contains the response from method TransparentDataEncryptionsClient.CreateOrUpdate. +// TransparentDataEncryptionsClientCreateOrUpdateResponse contains the response from method TransparentDataEncryptionsClient.BeginCreateOrUpdate. type TransparentDataEncryptionsClientCreateOrUpdateResponse struct { + // A logical database transparent data encryption state. LogicalDatabaseTransparentDataEncryption } // TransparentDataEncryptionsClientGetResponse contains the response from method TransparentDataEncryptionsClient.Get. type TransparentDataEncryptionsClientGetResponse struct { + // A logical database transparent data encryption state. LogicalDatabaseTransparentDataEncryption } // TransparentDataEncryptionsClientListByDatabaseResponse contains the response from method TransparentDataEncryptionsClient.NewListByDatabasePager. type TransparentDataEncryptionsClientListByDatabaseResponse struct { + // A list of transparent data encryptions LogicalDatabaseTransparentDataEncryptionListResult } // UsagesClientListByInstancePoolResponse contains the response from method UsagesClient.NewListByInstancePoolPager. type UsagesClientListByInstancePoolResponse struct { + // A list of usages. UsageListResult } @@ -2212,31 +2872,37 @@ type VirtualClustersClientDeleteResponse struct { // VirtualClustersClientGetResponse contains the response from method VirtualClustersClient.Get. type VirtualClustersClientGetResponse struct { + // An Azure SQL virtual cluster. VirtualCluster } // VirtualClustersClientListByResourceGroupResponse contains the response from method VirtualClustersClient.NewListByResourceGroupPager. type VirtualClustersClientListByResourceGroupResponse struct { + // A list of virtual clusters. VirtualClusterListResult } // VirtualClustersClientListResponse contains the response from method VirtualClustersClient.NewListPager. type VirtualClustersClientListResponse struct { + // A list of virtual clusters. VirtualClusterListResult } -// VirtualClustersClientUpdateDNSServersResponse contains the response from method VirtualClustersClient.UpdateDNSServers. +// VirtualClustersClientUpdateDNSServersResponse contains the response from method VirtualClustersClient.BeginUpdateDNSServers. type VirtualClustersClientUpdateDNSServersResponse struct { - UpdateManagedInstanceDNSServersOperation + // A refresh DNS servers operation. + UpdateVirtualClusterDNSServersOperation } // VirtualClustersClientUpdateResponse contains the response from method VirtualClustersClient.BeginUpdate. type VirtualClustersClientUpdateResponse struct { + // An Azure SQL virtual cluster. VirtualCluster } // VirtualNetworkRulesClientCreateOrUpdateResponse contains the response from method VirtualNetworkRulesClient.BeginCreateOrUpdate. type VirtualNetworkRulesClientCreateOrUpdateResponse struct { + // A virtual network rule. VirtualNetworkRule } @@ -2247,16 +2913,111 @@ type VirtualNetworkRulesClientDeleteResponse struct { // VirtualNetworkRulesClientGetResponse contains the response from method VirtualNetworkRulesClient.Get. type VirtualNetworkRulesClientGetResponse struct { + // A virtual network rule. VirtualNetworkRule } // VirtualNetworkRulesClientListByServerResponse contains the response from method VirtualNetworkRulesClient.NewListByServerPager. type VirtualNetworkRulesClientListByServerResponse struct { + // A list of virtual network rules. VirtualNetworkRuleListResult } +// VulnerabilityAssessmentBaselineClientGetResponse contains the response from method VulnerabilityAssessmentBaselineClient.Get. +type VulnerabilityAssessmentBaselineClientGetResponse struct { + // A database sql vulnerability assessment baseline set. + DatabaseSQLVulnerabilityAssessmentBaselineSet +} + +// VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse contains the response from method VulnerabilityAssessmentBaselineClient.NewListBySQLVulnerabilityAssessmentPager. +type VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse struct { + // A list of SQL Vulnerability Assessments baseline set. + DatabaseSQLVulnerabilityAssessmentBaselineSetListResult +} + +// VulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse contains the response from method VulnerabilityAssessmentBaselinesClient.CreateOrUpdate. +type VulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse struct { + // A database sql vulnerability assessment baseline set. + DatabaseSQLVulnerabilityAssessmentBaselineSet +} + +// VulnerabilityAssessmentExecuteScanClientExecuteResponse contains the response from method VulnerabilityAssessmentExecuteScanClient.BeginExecute. +type VulnerabilityAssessmentExecuteScanClientExecuteResponse struct { + // placeholder for future response values +} + +// VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateResponse contains the response from method VulnerabilityAssessmentRuleBaselineClient.CreateOrUpdate. +type VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateResponse struct { + // A database sql vulnerability assessment rule baseline. + DatabaseSQLVulnerabilityAssessmentRuleBaseline +} + +// VulnerabilityAssessmentRuleBaselineClientGetResponse contains the response from method VulnerabilityAssessmentRuleBaselineClient.Get. +type VulnerabilityAssessmentRuleBaselineClientGetResponse struct { + // A database sql vulnerability assessment rule baseline. + DatabaseSQLVulnerabilityAssessmentRuleBaseline +} + +// VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse contains the response from method VulnerabilityAssessmentRuleBaselineClient.NewListByBaselinePager. +type VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse struct { + // A list of SQL Vulnerability Assessments rule baseline. + DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult +} + +// VulnerabilityAssessmentRuleBaselinesClientDeleteResponse contains the response from method VulnerabilityAssessmentRuleBaselinesClient.Delete. +type VulnerabilityAssessmentRuleBaselinesClientDeleteResponse struct { + // placeholder for future response values +} + +// VulnerabilityAssessmentScanResultClientGetResponse contains the response from method VulnerabilityAssessmentScanResultClient.Get. +type VulnerabilityAssessmentScanResultClientGetResponse struct { + VulnerabilityAssessmentScanResults +} + +// VulnerabilityAssessmentScanResultClientListByScanResponse contains the response from method VulnerabilityAssessmentScanResultClient.NewListByScanPager. +type VulnerabilityAssessmentScanResultClientListByScanResponse struct { + // A list of vulnerability assessment scan results. + VulnerabilityAssessmentScanListResult +} + +// VulnerabilityAssessmentScansClientGetResponse contains the response from method VulnerabilityAssessmentScansClient.Get. +type VulnerabilityAssessmentScansClientGetResponse struct { + // A vulnerability assessment scan record. + VulnerabilityAssessmentScanRecordForSQL +} + +// VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse contains the response from method VulnerabilityAssessmentScansClient.NewListBySQLVulnerabilityAssessmentsPager. +type VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse struct { + // A list of vulnerability assessment scan records. + VulnerabilityAssessmentScanRecordForSQLListResult +} + +// VulnerabilityAssessmentsClientDeleteResponse contains the response from method VulnerabilityAssessmentsClient.Delete. +type VulnerabilityAssessmentsClientDeleteResponse struct { + // placeholder for future response values +} + +// VulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse contains the response from method VulnerabilityAssessmentsSettingsClient.CreateOrUpdate. +type VulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse struct { + // A SQL Vulnerability Assessment. + VulnerabilityAssessment +} + +// VulnerabilityAssessmentsSettingsClientGetResponse contains the response from method VulnerabilityAssessmentsSettingsClient.Get. +type VulnerabilityAssessmentsSettingsClientGetResponse struct { + // A SQL Vulnerability Assessment. + VulnerabilityAssessment +} + +// VulnerabilityAssessmentsSettingsClientListByServerResponse contains the response from method VulnerabilityAssessmentsSettingsClient.NewListByServerPager. +type VulnerabilityAssessmentsSettingsClientListByServerResponse struct { + // A list of SQL Vulnerability Assessments. + VulnerabilityAssessmentListResult +} + // WorkloadClassifiersClientCreateOrUpdateResponse contains the response from method WorkloadClassifiersClient.BeginCreateOrUpdate. type WorkloadClassifiersClientCreateOrUpdateResponse struct { + // Workload classifier operations for a data warehouse WorkloadClassifier } @@ -2267,16 +3028,19 @@ type WorkloadClassifiersClientDeleteResponse struct { // WorkloadClassifiersClientGetResponse contains the response from method WorkloadClassifiersClient.Get. type WorkloadClassifiersClientGetResponse struct { + // Workload classifier operations for a data warehouse WorkloadClassifier } // WorkloadClassifiersClientListByWorkloadGroupResponse contains the response from method WorkloadClassifiersClient.NewListByWorkloadGroupPager. type WorkloadClassifiersClientListByWorkloadGroupResponse struct { + // A list of workload classifiers for a workload group. WorkloadClassifierListResult } // WorkloadGroupsClientCreateOrUpdateResponse contains the response from method WorkloadGroupsClient.BeginCreateOrUpdate. type WorkloadGroupsClientCreateOrUpdateResponse struct { + // Workload group operations for a data warehouse WorkloadGroup } @@ -2287,10 +3051,12 @@ type WorkloadGroupsClientDeleteResponse struct { // WorkloadGroupsClientGetResponse contains the response from method WorkloadGroupsClient.Get. type WorkloadGroupsClientGetResponse struct { + // Workload group operations for a data warehouse WorkloadGroup } // WorkloadGroupsClientListByDatabaseResponse contains the response from method WorkloadGroupsClient.NewListByDatabasePager. type WorkloadGroupsClientListByDatabaseResponse struct { + // A list of workload groups. WorkloadGroupListResult } diff --git a/sdk/resourcemanager/sql/armsql/restorabledroppeddatabases_client.go b/sdk/resourcemanager/sql/armsql/restorabledroppeddatabases_client.go index 19105276389e..ef665e206cbe 100644 --- a/sdk/resourcemanager/sql/armsql/restorabledroppeddatabases_client.go +++ b/sdk/resourcemanager/sql/armsql/restorabledroppeddatabases_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -47,25 +46,28 @@ func NewRestorableDroppedDatabasesClient(subscriptionID string, credential azcor // Get - Gets a restorable dropped database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-08-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. // - options - RestorableDroppedDatabasesClientGetOptions contains the optional parameters for the RestorableDroppedDatabasesClient.Get // method. func (client *RestorableDroppedDatabasesClient) Get(ctx context.Context, resourceGroupName string, serverName string, restorableDroppedDatabaseID string, options *RestorableDroppedDatabasesClientGetOptions) (RestorableDroppedDatabasesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, restorableDroppedDatabaseID, options) if err != nil { return RestorableDroppedDatabasesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RestorableDroppedDatabasesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RestorableDroppedDatabasesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RestorableDroppedDatabasesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -92,7 +94,13 @@ func (client *RestorableDroppedDatabasesClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -109,7 +117,7 @@ func (client *RestorableDroppedDatabasesClient) getHandleResponse(resp *http.Res // NewListByServerPager - Gets a list of restorable dropped databases. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2022-08-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. @@ -163,7 +171,7 @@ func (client *RestorableDroppedDatabasesClient) listByServerCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-08-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/restorabledroppeddatabases_client_example_test.go b/sdk/resourcemanager/sql/armsql/restorabledroppeddatabases_client_example_test.go index 991544125dd2..9b2e228ba808 100644 --- a/sdk/resourcemanager/sql/armsql/restorabledroppeddatabases_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/restorabledroppeddatabases_client_example_test.go @@ -13,11 +13,12 @@ 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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ListRestorableDroppedDatabasesByServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ListRestorableDroppedDatabasesByServer.json func ExampleRestorableDroppedDatabasesClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -79,8 +80,8 @@ func ExampleRestorableDroppedDatabasesClient_NewListByServerPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/GetRestorableDroppedDatabase.json -func ExampleRestorableDroppedDatabasesClient_Get() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetRestorableDroppedDatabaseWithExpandEqualsKeys.json +func ExampleRestorableDroppedDatabasesClient_Get_getsARestorableDroppedDatabaseWithExpandEqualsKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -90,7 +91,54 @@ func ExampleRestorableDroppedDatabasesClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewRestorableDroppedDatabasesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb,131403269876900000", nil) + res, err := clientFactory.NewRestorableDroppedDatabasesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb,131403269876900000", &armsql.RestorableDroppedDatabasesClientGetOptions{Expand: to.Ptr("keys"), + Filter: nil, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.RestorableDroppedDatabase = armsql.RestorableDroppedDatabase{ + // Name: to.Ptr("testdb,131403269876900000"), + // Type: to.Ptr("Microsoft.Sql/servers/restorableDroppedDatabases"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/restorableDroppedDatabases/testdb"), + // Location: to.Ptr("southeastasia"), + // Properties: &armsql.RestorableDroppedDatabaseProperties{ + // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-07T04:41:33.937Z"); return t}()), + // DatabaseName: to.Ptr("testdb"), + // DeletionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-27T02:49:47.69Z"); return t}()), + // Keys: map[string]*armsql.DatabaseKey{ + // "https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion": &armsql.DatabaseKey{ + // }, + // "https://your-key-vault-name.vault.azure.net/yourKey2/yourKey2Version": &armsql.DatabaseKey{ + // }, + // }, + // MaxSizeBytes: to.Ptr[int64](268435456000), + // }, + // SKU: &armsql.SKU{ + // Name: to.Ptr("BC_Gen4_2"), + // Tier: to.Ptr("BusinessCritical"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetRestorableDroppedDatabase.json +func ExampleRestorableDroppedDatabasesClient_Get_getsARestorableDroppedDatabase() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewRestorableDroppedDatabasesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb,131403269876900000", &armsql.RestorableDroppedDatabasesClientGetOptions{Expand: nil, + Filter: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/sql/armsql/restorabledroppedmanageddatabases_client.go b/sdk/resourcemanager/sql/armsql/restorabledroppedmanageddatabases_client.go index df0f50431792..04d17e91154e 100644 --- a/sdk/resourcemanager/sql/armsql/restorabledroppedmanageddatabases_client.go +++ b/sdk/resourcemanager/sql/armsql/restorabledroppedmanageddatabases_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -54,18 +53,21 @@ func NewRestorableDroppedManagedDatabasesClient(subscriptionID string, credentia // - options - RestorableDroppedManagedDatabasesClientGetOptions contains the optional parameters for the RestorableDroppedManagedDatabasesClient.Get // method. func (client *RestorableDroppedManagedDatabasesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string, options *RestorableDroppedManagedDatabasesClientGetOptions) (RestorableDroppedManagedDatabasesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, restorableDroppedDatabaseID, options) if err != nil { return RestorableDroppedManagedDatabasesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RestorableDroppedManagedDatabasesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RestorableDroppedManagedDatabasesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RestorableDroppedManagedDatabasesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/restorabledroppedmanageddatabases_client_example_test.go b/sdk/resourcemanager/sql/armsql/restorabledroppedmanageddatabases_client_example_test.go index 37066f55ec61..c0c6fcba7330 100644 --- a/sdk/resourcemanager/sql/armsql/restorabledroppedmanageddatabases_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/restorabledroppedmanageddatabases_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/RestorableDroppedManagedDatabaseListByManagedInstance.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -67,7 +67,7 @@ func ExampleRestorableDroppedManagedDatabasesClient_NewListByInstancePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/GetRestorableDroppedManagedDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/restorepoints_client.go b/sdk/resourcemanager/sql/armsql/restorepoints_client.go index 6f494b6677a1..289728de0900 100644 --- a/sdk/resourcemanager/sql/armsql/restorepoints_client.go +++ b/sdk/resourcemanager/sql/armsql/restorepoints_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -61,7 +60,8 @@ func (client *RestorePointsClient) BeginCreate(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller[RestorePointsClientCreateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[RestorePointsClientCreateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[RestorePointsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *RestorePointsClient) BeginCreate(ctx context.Context, resourceGrou // // Generated from API version 2020-11-01-preview func (client *RestorePointsClient) create(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters CreateDatabaseRestorePointDefinition, options *RestorePointsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -113,7 +115,10 @@ func (client *RestorePointsClient) createCreateRequest(ctx context.Context, reso reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Delete - Deletes a restore point. @@ -127,16 +132,18 @@ func (client *RestorePointsClient) createCreateRequest(ctx context.Context, reso // - restorePointName - The name of the restore point. // - options - RestorePointsClientDeleteOptions contains the optional parameters for the RestorePointsClient.Delete method. func (client *RestorePointsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, restorePointName string, options *RestorePointsClientDeleteOptions) (RestorePointsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, restorePointName, options) if err != nil { return RestorePointsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RestorePointsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RestorePointsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RestorePointsClientDeleteResponse{}, err } return RestorePointsClientDeleteResponse{}, nil } @@ -185,18 +192,21 @@ func (client *RestorePointsClient) deleteCreateRequest(ctx context.Context, reso // - restorePointName - The name of the restore point. // - options - RestorePointsClientGetOptions contains the optional parameters for the RestorePointsClient.Get method. func (client *RestorePointsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, restorePointName string, options *RestorePointsClientGetOptions) (RestorePointsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, restorePointName, options) if err != nil { return RestorePointsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RestorePointsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RestorePointsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RestorePointsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/restorepoints_client_example_test.go b/sdk/resourcemanager/sql/armsql/restorepoints_client_example_test.go index dfb45e8886c5..1f19e7418cb5 100644 --- a/sdk/resourcemanager/sql/armsql/restorepoints_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/restorepoints_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsListByDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsListByDatabase.json func ExampleRestorePointsClient_NewListByDatabasePager_listDatabaseRestorePoints() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -56,7 +56,7 @@ func ExampleRestorePointsClient_NewListByDatabasePager_listDatabaseRestorePoints } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DataWarehouseRestorePointsListByDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DataWarehouseRestorePointsListByDatabase.json func ExampleRestorePointsClient_NewListByDatabasePager_listDatawarehouseDatabaseRestorePoints() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -116,7 +116,7 @@ func ExampleRestorePointsClient_NewListByDatabasePager_listDatawarehouseDatabase } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsPost.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -153,7 +153,7 @@ func ExampleRestorePointsClient_BeginCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsGet.json func ExampleRestorePointsClient_Get_getsADatabaseRestorePoint() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -183,7 +183,7 @@ func ExampleRestorePointsClient_Get_getsADatabaseRestorePoint() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DataWarehouseRestorePointsGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DataWarehouseRestorePointsGet.json func ExampleRestorePointsClient_Get_getsADatawarehouseDatabaseRestorePoint() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -214,7 +214,7 @@ func ExampleRestorePointsClient_Get_getsADatawarehouseDatabaseRestorePoint() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/sensitivitylabels_client.go b/sdk/resourcemanager/sql/armsql/sensitivitylabels_client.go index 70e1381c4a1e..64e863f5b020 100644 --- a/sdk/resourcemanager/sql/armsql/sensitivitylabels_client.go +++ b/sdk/resourcemanager/sql/armsql/sensitivitylabels_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -60,18 +59,21 @@ func NewSensitivityLabelsClient(subscriptionID string, credential azcore.TokenCr // - options - SensitivityLabelsClientCreateOrUpdateOptions contains the optional parameters for the SensitivityLabelsClient.CreateOrUpdate // method. func (client *SensitivityLabelsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, parameters SensitivityLabel, options *SensitivityLabelsClientCreateOrUpdateOptions) (SensitivityLabelsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, parameters, options) if err != nil { return SensitivityLabelsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SensitivityLabelsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return SensitivityLabelsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return SensitivityLabelsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -114,7 +116,10 @@ func (client *SensitivityLabelsClient) createOrUpdateCreateRequest(ctx context.C reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -140,16 +145,18 @@ func (client *SensitivityLabelsClient) createOrUpdateHandleResponse(resp *http.R // - options - SensitivityLabelsClientDeleteOptions contains the optional parameters for the SensitivityLabelsClient.Delete // method. func (client *SensitivityLabelsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, options *SensitivityLabelsClientDeleteOptions) (SensitivityLabelsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, options) if err != nil { return SensitivityLabelsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SensitivityLabelsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SensitivityLabelsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SensitivityLabelsClientDeleteResponse{}, err } return SensitivityLabelsClientDeleteResponse{}, nil } @@ -210,16 +217,18 @@ func (client *SensitivityLabelsClient) deleteCreateRequest(ctx context.Context, // - options - SensitivityLabelsClientDisableRecommendationOptions contains the optional parameters for the SensitivityLabelsClient.DisableRecommendation // method. func (client *SensitivityLabelsClient) DisableRecommendation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, options *SensitivityLabelsClientDisableRecommendationOptions) (SensitivityLabelsClientDisableRecommendationResponse, error) { + var err error req, err := client.disableRecommendationCreateRequest(ctx, resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, options) if err != nil { return SensitivityLabelsClientDisableRecommendationResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SensitivityLabelsClientDisableRecommendationResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SensitivityLabelsClientDisableRecommendationResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SensitivityLabelsClientDisableRecommendationResponse{}, err } return SensitivityLabelsClientDisableRecommendationResponse{}, nil } @@ -281,16 +290,18 @@ func (client *SensitivityLabelsClient) disableRecommendationCreateRequest(ctx co // - options - SensitivityLabelsClientEnableRecommendationOptions contains the optional parameters for the SensitivityLabelsClient.EnableRecommendation // method. func (client *SensitivityLabelsClient) EnableRecommendation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, options *SensitivityLabelsClientEnableRecommendationOptions) (SensitivityLabelsClientEnableRecommendationResponse, error) { + var err error req, err := client.enableRecommendationCreateRequest(ctx, resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, options) if err != nil { return SensitivityLabelsClientEnableRecommendationResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SensitivityLabelsClientEnableRecommendationResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SensitivityLabelsClientEnableRecommendationResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SensitivityLabelsClientEnableRecommendationResponse{}, err } return SensitivityLabelsClientEnableRecommendationResponse{}, nil } @@ -351,18 +362,21 @@ func (client *SensitivityLabelsClient) enableRecommendationCreateRequest(ctx con // - sensitivityLabelSource - The source of the sensitivity label. // - options - SensitivityLabelsClientGetOptions contains the optional parameters for the SensitivityLabelsClient.Get method. func (client *SensitivityLabelsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, sensitivityLabelSource SensitivityLabelSource, options *SensitivityLabelsClientGetOptions) (SensitivityLabelsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, options) if err != nil { return SensitivityLabelsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SensitivityLabelsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SensitivityLabelsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SensitivityLabelsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -601,16 +615,18 @@ func (client *SensitivityLabelsClient) listRecommendedByDatabaseHandleResponse(r // - options - SensitivityLabelsClientUpdateOptions contains the optional parameters for the SensitivityLabelsClient.Update // method. func (client *SensitivityLabelsClient) Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters SensitivityLabelUpdateList, options *SensitivityLabelsClientUpdateOptions) (SensitivityLabelsClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { return SensitivityLabelsClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SensitivityLabelsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SensitivityLabelsClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SensitivityLabelsClientUpdateResponse{}, err } return SensitivityLabelsClientUpdateResponse{}, nil } @@ -641,5 +657,8 @@ func (client *SensitivityLabelsClient) updateCreateRequest(ctx context.Context, reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/sensitivitylabels_client_example_test.go b/sdk/resourcemanager/sql/armsql/sensitivitylabels_client_example_test.go index 49809e25a588..ec0b8d169f17 100644 --- a/sdk/resourcemanager/sql/armsql/sensitivitylabels_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/sensitivitylabels_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsListByDatabaseWithSourceCurrent.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -79,7 +79,7 @@ func ExampleSensitivityLabelsClient_NewListCurrentByDatabasePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsCurrentUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -140,7 +140,7 @@ func ExampleSensitivityLabelsClient_Update() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsListByDatabaseWithSourceRecommended.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -199,7 +199,7 @@ func ExampleSensitivityLabelsClient_NewListRecommendedByDatabasePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/RecommendedColumnSensitivityLabelEnable.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -216,7 +216,7 @@ func ExampleSensitivityLabelsClient_EnableRecommendation() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/RecommendedColumnSensitivityLabelDisable.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -233,7 +233,7 @@ func ExampleSensitivityLabelsClient_DisableRecommendation() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnSensitivityLabelGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -268,7 +268,7 @@ func ExampleSensitivityLabelsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnSensitivityLabelCreateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -311,7 +311,7 @@ func ExampleSensitivityLabelsClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnSensitivityLabelDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/serveradvancedthreatprotectionsettings_client.go b/sdk/resourcemanager/sql/armsql/serveradvancedthreatprotectionsettings_client.go index ca5ece224b5b..3f97bea5b7dd 100644 --- a/sdk/resourcemanager/sql/armsql/serveradvancedthreatprotectionsettings_client.go +++ b/sdk/resourcemanager/sql/armsql/serveradvancedthreatprotectionsettings_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -61,7 +60,8 @@ func (client *ServerAdvancedThreatProtectionSettingsClient) BeginCreateOrUpdate( if err != nil { return nil, err } - return runtime.NewPoller[ServerAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServerAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServerAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *ServerAdvancedThreatProtectionSettingsClient) BeginCreateOrUpdate( // // Generated from API version 2021-11-01-preview func (client *ServerAdvancedThreatProtectionSettingsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, advancedThreatProtectionName AdvancedThreatProtectionName, parameters ServerAdvancedThreatProtection, options *ServerAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, advancedThreatProtectionName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -113,7 +115,10 @@ func (client *ServerAdvancedThreatProtectionSettingsClient) createOrUpdateCreate 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) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Get - Get a server's Advanced Threat Protection state. @@ -127,18 +132,21 @@ func (client *ServerAdvancedThreatProtectionSettingsClient) createOrUpdateCreate // - options - ServerAdvancedThreatProtectionSettingsClientGetOptions contains the optional parameters for the ServerAdvancedThreatProtectionSettingsClient.Get // method. func (client *ServerAdvancedThreatProtectionSettingsClient) Get(ctx context.Context, resourceGroupName string, serverName string, advancedThreatProtectionName AdvancedThreatProtectionName, options *ServerAdvancedThreatProtectionSettingsClientGetOptions) (ServerAdvancedThreatProtectionSettingsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, advancedThreatProtectionName, options) if err != nil { return ServerAdvancedThreatProtectionSettingsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServerAdvancedThreatProtectionSettingsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerAdvancedThreatProtectionSettingsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerAdvancedThreatProtectionSettingsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/serveradvancedthreatprotectionsettings_client_example_test.go b/sdk/resourcemanager/sql/armsql/serveradvancedthreatprotectionsettings_client_example_test.go index 40102015ef6b..fac20a1fed06 100644 --- a/sdk/resourcemanager/sql/armsql/serveradvancedthreatprotectionsettings_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/serveradvancedthreatprotectionsettings_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsListByServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -63,7 +63,7 @@ func ExampleServerAdvancedThreatProtectionSettingsClient_NewListByServerPager() } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -100,7 +100,7 @@ func ExampleServerAdvancedThreatProtectionSettingsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsCreateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsCreateMax.json func ExampleServerAdvancedThreatProtectionSettingsClient_BeginCreateOrUpdate_updateAServersAdvancedThreatProtectionSettingsWithAllParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -145,7 +145,7 @@ func ExampleServerAdvancedThreatProtectionSettingsClient_BeginCreateOrUpdate_upd // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsCreateMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsCreateMin.json func ExampleServerAdvancedThreatProtectionSettingsClient_BeginCreateOrUpdate_updateAServersAdvancedThreatProtectionSettingsWithMinimalParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/sql/armsql/serveradvisors_client.go b/sdk/resourcemanager/sql/armsql/serveradvisors_client.go index f0888aabb73e..847a224b8476 100644 --- a/sdk/resourcemanager/sql/armsql/serveradvisors_client.go +++ b/sdk/resourcemanager/sql/armsql/serveradvisors_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -54,18 +53,21 @@ func NewServerAdvisorsClient(subscriptionID string, credential azcore.TokenCrede // - advisorName - The name of the Server Advisor. // - options - ServerAdvisorsClientGetOptions contains the optional parameters for the ServerAdvisorsClient.Get method. func (client *ServerAdvisorsClient) Get(ctx context.Context, resourceGroupName string, serverName string, advisorName string, options *ServerAdvisorsClientGetOptions) (ServerAdvisorsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, advisorName, options) if err != nil { return ServerAdvisorsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServerAdvisorsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerAdvisorsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerAdvisorsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -117,18 +119,21 @@ func (client *ServerAdvisorsClient) getHandleResponse(resp *http.Response) (Serv // - options - ServerAdvisorsClientListByServerOptions contains the optional parameters for the ServerAdvisorsClient.ListByServer // method. func (client *ServerAdvisorsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string, options *ServerAdvisorsClientListByServerOptions) (ServerAdvisorsClientListByServerResponse, error) { + var err error req, err := client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) if err != nil { return ServerAdvisorsClientListByServerResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServerAdvisorsClientListByServerResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerAdvisorsClientListByServerResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerAdvisorsClientListByServerResponse{}, err } - return client.listByServerHandleResponse(resp) + resp, err := client.listByServerHandleResponse(httpResp) + return resp, err } // listByServerCreateRequest creates the ListByServer request. @@ -180,18 +185,21 @@ func (client *ServerAdvisorsClient) listByServerHandleResponse(resp *http.Respon // - parameters - The requested advisor resource state. // - options - ServerAdvisorsClientUpdateOptions contains the optional parameters for the ServerAdvisorsClient.Update method. func (client *ServerAdvisorsClient) Update(ctx context.Context, resourceGroupName string, serverName string, advisorName string, parameters Advisor, options *ServerAdvisorsClientUpdateOptions) (ServerAdvisorsClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, advisorName, parameters, options) if err != nil { return ServerAdvisorsClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServerAdvisorsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerAdvisorsClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerAdvisorsClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -221,7 +229,10 @@ func (client *ServerAdvisorsClient) updateCreateRequest(ctx context.Context, res reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/sql/armsql/serveradvisors_client_example_test.go b/sdk/resourcemanager/sql/armsql/serveradvisors_client_example_test.go index 633805180c12..20bbbdb9f810 100644 --- a/sdk/resourcemanager/sql/armsql/serveradvisors_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/serveradvisors_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAdvisorList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAdvisorList.json func ExampleServerAdvisorsClient_ListByServer_listOfServerAdvisors() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -99,7 +99,7 @@ func ExampleServerAdvisorsClient_ListByServer_listOfServerAdvisors() { // }} } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerRecommendedActionListExpand.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerRecommendedActionListExpand.json func ExampleServerAdvisorsClient_ListByServer_listOfServerRecommendedActionsForAllAdvisors() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -743,7 +743,7 @@ func ExampleServerAdvisorsClient_ListByServer_listOfServerRecommendedActionsForA // }} } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAdvisorGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -775,7 +775,7 @@ func ExampleServerAdvisorsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAdvisorUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/serverautomatictuning_client.go b/sdk/resourcemanager/sql/armsql/serverautomatictuning_client.go index ac52a75bbb06..fd512bd4f3fe 100644 --- a/sdk/resourcemanager/sql/armsql/serverautomatictuning_client.go +++ b/sdk/resourcemanager/sql/armsql/serverautomatictuning_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -54,18 +53,21 @@ func NewServerAutomaticTuningClient(subscriptionID string, credential azcore.Tok // - options - ServerAutomaticTuningClientGetOptions contains the optional parameters for the ServerAutomaticTuningClient.Get // method. func (client *ServerAutomaticTuningClient) Get(ctx context.Context, resourceGroupName string, serverName string, options *ServerAutomaticTuningClientGetOptions) (ServerAutomaticTuningClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, options) if err != nil { return ServerAutomaticTuningClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServerAutomaticTuningClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerAutomaticTuningClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerAutomaticTuningClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -114,18 +116,21 @@ func (client *ServerAutomaticTuningClient) getHandleResponse(resp *http.Response // - options - ServerAutomaticTuningClientUpdateOptions contains the optional parameters for the ServerAutomaticTuningClient.Update // method. func (client *ServerAutomaticTuningClient) Update(ctx context.Context, resourceGroupName string, serverName string, parameters ServerAutomaticTuning, options *ServerAutomaticTuningClientUpdateOptions) (ServerAutomaticTuningClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, parameters, options) if err != nil { return ServerAutomaticTuningClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServerAutomaticTuningClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerAutomaticTuningClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerAutomaticTuningClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -151,7 +156,10 @@ func (client *ServerAutomaticTuningClient) updateCreateRequest(ctx context.Conte reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/sql/armsql/serverautomatictuning_client_example_test.go b/sdk/resourcemanager/sql/armsql/serverautomatictuning_client_example_test.go index b94eacfede4b..88111f7e999d 100644 --- a/sdk/resourcemanager/sql/armsql/serverautomatictuning_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/serverautomatictuning_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAutomaticTuningGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -73,7 +73,7 @@ func ExampleServerAutomaticTuningClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAutomaticTuningUpdateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAutomaticTuningUpdateMax.json func ExampleServerAutomaticTuningClient_Update_updatesServerAutomaticTuningSettingsWithAllProperties() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -139,7 +139,7 @@ func ExampleServerAutomaticTuningClient_Update_updatesServerAutomaticTuningSetti // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAutomaticTuningUpdateMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAutomaticTuningUpdateMin.json func ExampleServerAutomaticTuningClient_Update_updatesServerAutomaticTuningSettingsWithMinimalProperties() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/sql/armsql/serverazureadadministrators_client.go b/sdk/resourcemanager/sql/armsql/serverazureadadministrators_client.go index d5cac06b5b51..c31b92cbab74 100644 --- a/sdk/resourcemanager/sql/armsql/serverazureadadministrators_client.go +++ b/sdk/resourcemanager/sql/armsql/serverazureadadministrators_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -61,7 +60,8 @@ func (client *ServerAzureADAdministratorsClient) BeginCreateOrUpdate(ctx context if err != nil { return nil, err } - return runtime.NewPoller[ServerAzureADAdministratorsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServerAzureADAdministratorsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServerAzureADAdministratorsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *ServerAzureADAdministratorsClient) BeginCreateOrUpdate(ctx context // // Generated from API version 2020-11-01-preview func (client *ServerAzureADAdministratorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, administratorName AdministratorName, parameters ServerAzureADAdministrator, options *ServerAzureADAdministratorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, administratorName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -113,7 +115,10 @@ func (client *ServerAzureADAdministratorsClient) createOrUpdateCreateRequest(ctx reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes the Azure Active Directory administrator with the given name. @@ -132,7 +137,8 @@ func (client *ServerAzureADAdministratorsClient) BeginDelete(ctx context.Context if err != nil { return nil, err } - return runtime.NewPoller[ServerAzureADAdministratorsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServerAzureADAdministratorsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServerAzureADAdministratorsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -143,18 +149,20 @@ func (client *ServerAzureADAdministratorsClient) BeginDelete(ctx context.Context // // Generated from API version 2020-11-01-preview func (client *ServerAzureADAdministratorsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, administratorName AdministratorName, options *ServerAzureADAdministratorsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, administratorName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -197,18 +205,21 @@ func (client *ServerAzureADAdministratorsClient) deleteCreateRequest(ctx context // - options - ServerAzureADAdministratorsClientGetOptions contains the optional parameters for the ServerAzureADAdministratorsClient.Get // method. func (client *ServerAzureADAdministratorsClient) Get(ctx context.Context, resourceGroupName string, serverName string, administratorName AdministratorName, options *ServerAzureADAdministratorsClientGetOptions) (ServerAzureADAdministratorsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, administratorName, options) if err != nil { return ServerAzureADAdministratorsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServerAzureADAdministratorsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerAzureADAdministratorsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerAzureADAdministratorsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/serverazureadadministrators_client_example_test.go b/sdk/resourcemanager/sql/armsql/serverazureadadministrators_client_example_test.go index d6811f1457c0..41d44705629c 100644 --- a/sdk/resourcemanager/sql/armsql/serverazureadadministrators_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/serverazureadadministrators_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -50,7 +50,7 @@ func ExampleServerAzureADAdministratorsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorCreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -93,7 +93,7 @@ func ExampleServerAzureADAdministratorsClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -114,7 +114,7 @@ func ExampleServerAzureADAdministratorsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/serverazureadonlyauthentications_client.go b/sdk/resourcemanager/sql/armsql/serverazureadonlyauthentications_client.go index c0df84cfa40e..820073aab600 100644 --- a/sdk/resourcemanager/sql/armsql/serverazureadonlyauthentications_client.go +++ b/sdk/resourcemanager/sql/armsql/serverazureadonlyauthentications_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -62,7 +61,8 @@ func (client *ServerAzureADOnlyAuthenticationsClient) BeginCreateOrUpdate(ctx co if err != nil { return nil, err } - return runtime.NewPoller[ServerAzureADOnlyAuthenticationsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServerAzureADOnlyAuthenticationsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServerAzureADOnlyAuthenticationsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -74,18 +74,20 @@ func (client *ServerAzureADOnlyAuthenticationsClient) BeginCreateOrUpdate(ctx co // // Generated from API version 2020-11-01-preview func (client *ServerAzureADOnlyAuthenticationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, authenticationName AuthenticationName, parameters ServerAzureADOnlyAuthentication, options *ServerAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, authenticationName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -115,7 +117,10 @@ func (client *ServerAzureADOnlyAuthenticationsClient) createOrUpdateCreateReques reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes an existing server Active Directory only authentication property. @@ -134,7 +139,8 @@ func (client *ServerAzureADOnlyAuthenticationsClient) BeginDelete(ctx context.Co if err != nil { return nil, err } - return runtime.NewPoller[ServerAzureADOnlyAuthenticationsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServerAzureADOnlyAuthenticationsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServerAzureADOnlyAuthenticationsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -145,18 +151,20 @@ func (client *ServerAzureADOnlyAuthenticationsClient) BeginDelete(ctx context.Co // // Generated from API version 2020-11-01-preview func (client *ServerAzureADOnlyAuthenticationsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, authenticationName AuthenticationName, options *ServerAzureADOnlyAuthenticationsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, authenticationName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -199,18 +207,21 @@ func (client *ServerAzureADOnlyAuthenticationsClient) deleteCreateRequest(ctx co // - options - ServerAzureADOnlyAuthenticationsClientGetOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.Get // method. func (client *ServerAzureADOnlyAuthenticationsClient) Get(ctx context.Context, resourceGroupName string, serverName string, authenticationName AuthenticationName, options *ServerAzureADOnlyAuthenticationsClientGetOptions) (ServerAzureADOnlyAuthenticationsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, authenticationName, options) if err != nil { return ServerAzureADOnlyAuthenticationsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServerAzureADOnlyAuthenticationsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerAzureADOnlyAuthenticationsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerAzureADOnlyAuthenticationsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/serverazureadonlyauthentications_client_example_test.go b/sdk/resourcemanager/sql/armsql/serverazureadonlyauthentications_client_example_test.go index 68a9b1af8db0..202ae3d06acf 100644 --- a/sdk/resourcemanager/sql/armsql/serverazureadonlyauthentications_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/serverazureadonlyauthentications_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -46,7 +46,7 @@ func ExampleServerAzureADOnlyAuthenticationsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthCreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -82,7 +82,7 @@ func ExampleServerAzureADOnlyAuthenticationsClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -103,7 +103,7 @@ func ExampleServerAzureADOnlyAuthenticationsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/serverblobauditingpolicies_client.go b/sdk/resourcemanager/sql/armsql/serverblobauditingpolicies_client.go index cbbe9fc58537..9adc2a977bde 100644 --- a/sdk/resourcemanager/sql/armsql/serverblobauditingpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/serverblobauditingpolicies_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -60,7 +59,8 @@ func (client *ServerBlobAuditingPoliciesClient) BeginCreateOrUpdate(ctx context. if err != nil { return nil, err } - return runtime.NewPoller[ServerBlobAuditingPoliciesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServerBlobAuditingPoliciesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServerBlobAuditingPoliciesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,18 +71,20 @@ func (client *ServerBlobAuditingPoliciesClient) BeginCreateOrUpdate(ctx context. // // Generated from API version 2021-11-01-preview func (client *ServerBlobAuditingPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ServerBlobAuditingPolicy, options *ServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -109,7 +111,10 @@ func (client *ServerBlobAuditingPoliciesClient) createOrUpdateCreateRequest(ctx 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) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Get - Gets a server's blob auditing policy. @@ -122,18 +127,21 @@ func (client *ServerBlobAuditingPoliciesClient) createOrUpdateCreateRequest(ctx // - options - ServerBlobAuditingPoliciesClientGetOptions contains the optional parameters for the ServerBlobAuditingPoliciesClient.Get // method. func (client *ServerBlobAuditingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, options *ServerBlobAuditingPoliciesClientGetOptions) (ServerBlobAuditingPoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, options) if err != nil { return ServerBlobAuditingPoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServerBlobAuditingPoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerBlobAuditingPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerBlobAuditingPoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/serverblobauditingpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/serverblobauditingpolicies_client_example_test.go index 52cae9c8122e..c5c100a4fda7 100644 --- a/sdk/resourcemanager/sql/armsql/serverblobauditingpolicies_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/serverblobauditingpolicies_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAuditingSettingsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -62,7 +62,7 @@ func ExampleServerBlobAuditingPoliciesClient_NewListByServerPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerBlobAuditingGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -98,7 +98,7 @@ func ExampleServerBlobAuditingPoliciesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerBlobAuditingCreateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerBlobAuditingCreateMax.json func ExampleServerBlobAuditingPoliciesClient_BeginCreateOrUpdate_updateAServersBlobAuditingPolicyWithAllParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -155,7 +155,7 @@ func ExampleServerBlobAuditingPoliciesClient_BeginCreateOrUpdate_updateAServersB // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerBlobAuditingCreateMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerBlobAuditingCreateMin.json func ExampleServerBlobAuditingPoliciesClient_BeginCreateOrUpdate_updateAServersBlobAuditingPolicyWithMinimalParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/sql/armsql/servercommunicationlinks_client.go b/sdk/resourcemanager/sql/armsql/servercommunicationlinks_client.go index d6d8f71b1c0a..5d4dd36ca9bb 100644 --- a/sdk/resourcemanager/sql/armsql/servercommunicationlinks_client.go +++ b/sdk/resourcemanager/sql/armsql/servercommunicationlinks_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -61,7 +60,8 @@ func (client *ServerCommunicationLinksClient) BeginCreateOrUpdate(ctx context.Co if err != nil { return nil, err } - return runtime.NewPoller[ServerCommunicationLinksClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServerCommunicationLinksClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServerCommunicationLinksClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *ServerCommunicationLinksClient) BeginCreateOrUpdate(ctx context.Co // // Generated from API version 2014-04-01 func (client *ServerCommunicationLinksClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, parameters ServerCommunicationLink, options *ServerCommunicationLinksClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, communicationLinkName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -113,7 +115,10 @@ func (client *ServerCommunicationLinksClient) createOrUpdateCreateRequest(ctx co reqQP.Set("api-version", "2014-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Delete - Deletes a server communication link. @@ -127,16 +132,18 @@ func (client *ServerCommunicationLinksClient) createOrUpdateCreateRequest(ctx co // - options - ServerCommunicationLinksClientDeleteOptions contains the optional parameters for the ServerCommunicationLinksClient.Delete // method. func (client *ServerCommunicationLinksClient) Delete(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, options *ServerCommunicationLinksClientDeleteOptions) (ServerCommunicationLinksClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, communicationLinkName, options) if err != nil { return ServerCommunicationLinksClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServerCommunicationLinksClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerCommunicationLinksClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerCommunicationLinksClientDeleteResponse{}, err } return ServerCommunicationLinksClientDeleteResponse{}, nil } @@ -181,18 +188,21 @@ func (client *ServerCommunicationLinksClient) deleteCreateRequest(ctx context.Co // - options - ServerCommunicationLinksClientGetOptions contains the optional parameters for the ServerCommunicationLinksClient.Get // method. func (client *ServerCommunicationLinksClient) Get(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, options *ServerCommunicationLinksClientGetOptions) (ServerCommunicationLinksClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, communicationLinkName, options) if err != nil { return ServerCommunicationLinksClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServerCommunicationLinksClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerCommunicationLinksClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerCommunicationLinksClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/servercommunicationlinks_client_example_test.go b/sdk/resourcemanager/sql/armsql/servercommunicationlinks_client_example_test.go index 49da5629c6ff..2115e8194b1a 100644 --- a/sdk/resourcemanager/sql/armsql/servercommunicationlinks_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/servercommunicationlinks_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkDelete.json func ExampleServerCommunicationLinksClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -35,7 +35,7 @@ func ExampleServerCommunicationLinksClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkGet.json func ExampleServerCommunicationLinksClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -65,7 +65,7 @@ func ExampleServerCommunicationLinksClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkCreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkCreateOrUpdate.json func ExampleServerCommunicationLinksClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -90,7 +90,7 @@ func ExampleServerCommunicationLinksClient_BeginCreateOrUpdate() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkList.json func ExampleServerCommunicationLinksClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/sql/armsql/serverconfigurationoptions_client.go b/sdk/resourcemanager/sql/armsql/serverconfigurationoptions_client.go new file mode 100644 index 000000000000..c24f0b858558 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/serverconfigurationoptions_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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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" +) + +// ServerConfigurationOptionsClient contains the methods for the ServerConfigurationOptions group. +// Don't use this type directly, use NewServerConfigurationOptionsClient() instead. +type ServerConfigurationOptionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewServerConfigurationOptionsClient creates a new instance of ServerConfigurationOptionsClient 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 NewServerConfigurationOptionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerConfigurationOptionsClient, error) { + cl, err := arm.NewClient(moduleName+".ServerConfigurationOptionsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ServerConfigurationOptionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Updates managed instance server configuration option. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-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. +// - serverConfigurationOptionName - The name of the server configuration option. +// - parameters - Server configuration option parameters. +// - options - ServerConfigurationOptionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerConfigurationOptionsClient.BeginCreateOrUpdate +// method. +func (client *ServerConfigurationOptionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, serverConfigurationOptionName ServerConfigurationOptionName, parameters ServerConfigurationOption, options *ServerConfigurationOptionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerConfigurationOptionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, serverConfigurationOptionName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller[ServerConfigurationOptionsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ServerConfigurationOptionsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Updates managed instance server configuration option. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01-preview +func (client *ServerConfigurationOptionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, serverConfigurationOptionName ServerConfigurationOptionName, parameters ServerConfigurationOption, options *ServerConfigurationOptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, serverConfigurationOptionName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ServerConfigurationOptionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, serverConfigurationOptionName ServerConfigurationOptionName, parameters ServerConfigurationOption, options *ServerConfigurationOptionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverConfigurationOptions/{serverConfigurationOptionName}" + 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 serverConfigurationOptionName == "" { + return nil, errors.New("parameter serverConfigurationOptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverConfigurationOptionName}", url.PathEscape(string(serverConfigurationOptionName))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// Get - Gets managed instance server configuration option. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-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. +// - serverConfigurationOptionName - The name of the server configuration option. +// - options - ServerConfigurationOptionsClientGetOptions contains the optional parameters for the ServerConfigurationOptionsClient.Get +// method. +func (client *ServerConfigurationOptionsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, serverConfigurationOptionName ServerConfigurationOptionName, options *ServerConfigurationOptionsClientGetOptions) (ServerConfigurationOptionsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, serverConfigurationOptionName, options) + if err != nil { + return ServerConfigurationOptionsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServerConfigurationOptionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerConfigurationOptionsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ServerConfigurationOptionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, serverConfigurationOptionName ServerConfigurationOptionName, options *ServerConfigurationOptionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverConfigurationOptions/{serverConfigurationOptionName}" + 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 serverConfigurationOptionName == "" { + return nil, errors.New("parameter serverConfigurationOptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverConfigurationOptionName}", url.PathEscape(string(serverConfigurationOptionName))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-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 *ServerConfigurationOptionsClient) getHandleResponse(resp *http.Response) (ServerConfigurationOptionsClientGetResponse, error) { + result := ServerConfigurationOptionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServerConfigurationOption); err != nil { + return ServerConfigurationOptionsClientGetResponse{}, err + } + return result, nil +} + +// NewListByManagedInstancePager - Gets a list of managed instance server configuration options. +// +// Generated from API version 2022-08-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 - ServerConfigurationOptionsClientListByManagedInstanceOptions contains the optional parameters for the ServerConfigurationOptionsClient.NewListByManagedInstancePager +// method. +func (client *ServerConfigurationOptionsClient) NewListByManagedInstancePager(resourceGroupName string, managedInstanceName string, options *ServerConfigurationOptionsClientListByManagedInstanceOptions) *runtime.Pager[ServerConfigurationOptionsClientListByManagedInstanceResponse] { + return runtime.NewPager(runtime.PagingHandler[ServerConfigurationOptionsClientListByManagedInstanceResponse]{ + More: func(page ServerConfigurationOptionsClientListByManagedInstanceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ServerConfigurationOptionsClientListByManagedInstanceResponse) (ServerConfigurationOptionsClientListByManagedInstanceResponse, 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 ServerConfigurationOptionsClientListByManagedInstanceResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServerConfigurationOptionsClientListByManagedInstanceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ServerConfigurationOptionsClientListByManagedInstanceResponse{}, runtime.NewResponseError(resp) + } + return client.listByManagedInstanceHandleResponse(resp) + }, + }) +} + +// listByManagedInstanceCreateRequest creates the ListByManagedInstance request. +func (client *ServerConfigurationOptionsClient) listByManagedInstanceCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ServerConfigurationOptionsClientListByManagedInstanceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverConfigurationOptions" + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-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 *ServerConfigurationOptionsClient) listByManagedInstanceHandleResponse(resp *http.Response) (ServerConfigurationOptionsClientListByManagedInstanceResponse, error) { + result := ServerConfigurationOptionsClientListByManagedInstanceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServerConfigurationOptionListResult); err != nil { + return ServerConfigurationOptionsClientListByManagedInstanceResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/serverconfigurationoptions_client_example_test.go b/sdk/resourcemanager/sql/armsql/serverconfigurationoptions_client_example_test.go new file mode 100644 index 000000000000..daf317ccbc11 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/serverconfigurationoptions_client_example_test.go @@ -0,0 +1,122 @@ +//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_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/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerConfigurationOptionList.json +func ExampleServerConfigurationOptionsClient_NewListByManagedInstancePager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewServerConfigurationOptionsClient().NewListByManagedInstancePager("testrg", "testinstance", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ServerConfigurationOptionListResult = armsql.ServerConfigurationOptionListResult{ + // Value: []*armsql.ServerConfigurationOption{ + // { + // Name: to.Ptr("allowPolybaseExport"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/serverConfigurationOptions"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance/serverConfigurationOptions/allowPolybaseExport"), + // Properties: &armsql.ServerConfigurationOptionProperties{ + // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), + // ServerConfigurationOptionValue: to.Ptr[int32](1), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerConfigurationOptionGet.json +func ExampleServerConfigurationOptionsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewServerConfigurationOptionsClient().Get(ctx, "testrg", "testinstance", armsql.ServerConfigurationOptionNameAllowPolybaseExport, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ServerConfigurationOption = armsql.ServerConfigurationOption{ + // Name: to.Ptr("allowPolybaseExport"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/serverConfigurationOptions"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance/serverConfigurationOptions/allowPolybaseExport"), + // Properties: &armsql.ServerConfigurationOptionProperties{ + // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), + // ServerConfigurationOptionValue: to.Ptr[int32](1), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerConfigurationOptionUpdate.json +func ExampleServerConfigurationOptionsClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServerConfigurationOptionsClient().BeginCreateOrUpdate(ctx, "testrg", "testinstance", armsql.ServerConfigurationOptionNameAllowPolybaseExport, armsql.ServerConfigurationOption{ + Properties: &armsql.ServerConfigurationOptionProperties{ + ServerConfigurationOptionValue: to.Ptr[int32](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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ServerConfigurationOption = armsql.ServerConfigurationOption{ + // Name: to.Ptr("allowPolybaseExport"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/serverConfigurationOptions"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance/serverConfigurationOptions/allowPolybaseExport"), + // Properties: &armsql.ServerConfigurationOptionProperties{ + // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), + // ServerConfigurationOptionValue: to.Ptr[int32](1), + // }, + // } +} diff --git a/sdk/resourcemanager/sql/armsql/serverconnectionpolicies_client.go b/sdk/resourcemanager/sql/armsql/serverconnectionpolicies_client.go index 9db722c895ed..32ac2e1f3539 100644 --- a/sdk/resourcemanager/sql/armsql/serverconnectionpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/serverconnectionpolicies_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -61,7 +60,8 @@ func (client *ServerConnectionPoliciesClient) BeginCreateOrUpdate(ctx context.Co if err != nil { return nil, err } - return runtime.NewPoller[ServerConnectionPoliciesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServerConnectionPoliciesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServerConnectionPoliciesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *ServerConnectionPoliciesClient) BeginCreateOrUpdate(ctx context.Co // // Generated from API version 2021-05-01-preview func (client *ServerConnectionPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, connectionPolicyName ConnectionPolicyName, parameters ServerConnectionPolicy, options *ServerConnectionPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, connectionPolicyName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -113,7 +115,10 @@ func (client *ServerConnectionPoliciesClient) createOrUpdateCreateRequest(ctx co reqQP.Set("api-version", "2021-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Get - Gets a server connection policy @@ -127,18 +132,21 @@ func (client *ServerConnectionPoliciesClient) createOrUpdateCreateRequest(ctx co // - options - ServerConnectionPoliciesClientGetOptions contains the optional parameters for the ServerConnectionPoliciesClient.Get // method. func (client *ServerConnectionPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, connectionPolicyName ConnectionPolicyName, options *ServerConnectionPoliciesClientGetOptions) (ServerConnectionPoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, connectionPolicyName, options) if err != nil { return ServerConnectionPoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServerConnectionPoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerConnectionPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerConnectionPoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/serverconnectionpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/serverconnectionpolicies_client_example_test.go index 0742d7dd96b7..e4e42091d420 100644 --- a/sdk/resourcemanager/sql/armsql/serverconnectionpolicies_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/serverconnectionpolicies_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ServerConnectionPoliciesGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -47,7 +47,7 @@ func ExampleServerConnectionPoliciesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ServerConnectionPoliciesUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -84,7 +84,7 @@ func ExampleServerConnectionPoliciesClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ServerConnectionPoliciesList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/serverdevopsauditsettings_client.go b/sdk/resourcemanager/sql/armsql/serverdevopsauditsettings_client.go index 48f222bad976..0ec4d04ab733 100644 --- a/sdk/resourcemanager/sql/armsql/serverdevopsauditsettings_client.go +++ b/sdk/resourcemanager/sql/armsql/serverdevopsauditsettings_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -47,23 +46,23 @@ func NewServerDevOpsAuditSettingsClient(subscriptionID string, credential azcore // BeginCreateOrUpdate - Creates or updates a server's DevOps audit settings. // 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. // - serverName - The name of the server. -// - devOpsAuditingSettingsName - The name of the devops audit settings. This should always be 'default'. // - parameters - Properties of DevOps audit settings // - options - ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerDevOpsAuditSettingsClient.BeginCreateOrUpdate // method. -func (client *ServerDevOpsAuditSettingsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, devOpsAuditingSettingsName string, parameters ServerDevOpsAuditingSettings, options *ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerDevOpsAuditSettingsClientCreateOrUpdateResponse], error) { +func (client *ServerDevOpsAuditSettingsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, devOpsAuditingSettingsName DevOpsAuditingSettingsName, parameters ServerDevOpsAuditingSettings, options *ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerDevOpsAuditSettingsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, devOpsAuditingSettingsName, parameters, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServerDevOpsAuditSettingsClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServerDevOpsAuditSettingsClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServerDevOpsAuditSettingsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,24 +71,26 @@ func (client *ServerDevOpsAuditSettingsClient) BeginCreateOrUpdate(ctx context.C // CreateOrUpdate - Creates or updates a server's DevOps audit settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview -func (client *ServerDevOpsAuditSettingsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, devOpsAuditingSettingsName string, parameters ServerDevOpsAuditingSettings, options *ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions) (*http.Response, error) { +// Generated from API version 2022-02-01-preview +func (client *ServerDevOpsAuditSettingsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, devOpsAuditingSettingsName DevOpsAuditingSettingsName, parameters ServerDevOpsAuditingSettings, options *ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, devOpsAuditingSettingsName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ServerDevOpsAuditSettingsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, devOpsAuditingSettingsName string, parameters ServerDevOpsAuditingSettings, options *ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ServerDevOpsAuditSettingsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, devOpsAuditingSettingsName DevOpsAuditingSettingsName, parameters ServerDevOpsAuditingSettings, options *ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -102,7 +103,7 @@ func (client *ServerDevOpsAuditSettingsClient) createOrUpdateCreateRequest(ctx c if devOpsAuditingSettingsName == "" { return nil, errors.New("parameter devOpsAuditingSettingsName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{devOpsAuditingSettingsName}", url.PathEscape(devOpsAuditingSettingsName)) + urlPath = strings.ReplaceAll(urlPath, "{devOpsAuditingSettingsName}", url.PathEscape(string(devOpsAuditingSettingsName))) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -112,39 +113,44 @@ func (client *ServerDevOpsAuditSettingsClient) createOrUpdateCreateRequest(ctx 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() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Get - Gets a server's DevOps audit settings. // 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. // - serverName - The name of the server. -// - devOpsAuditingSettingsName - The name of the devops audit settings. This should always be 'default'. // - options - ServerDevOpsAuditSettingsClientGetOptions contains the optional parameters for the ServerDevOpsAuditSettingsClient.Get // method. -func (client *ServerDevOpsAuditSettingsClient) Get(ctx context.Context, resourceGroupName string, serverName string, devOpsAuditingSettingsName string, options *ServerDevOpsAuditSettingsClientGetOptions) (ServerDevOpsAuditSettingsClientGetResponse, error) { +func (client *ServerDevOpsAuditSettingsClient) Get(ctx context.Context, resourceGroupName string, serverName string, devOpsAuditingSettingsName DevOpsAuditingSettingsName, options *ServerDevOpsAuditSettingsClientGetOptions) (ServerDevOpsAuditSettingsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, devOpsAuditingSettingsName, options) if err != nil { return ServerDevOpsAuditSettingsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServerDevOpsAuditSettingsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerDevOpsAuditSettingsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerDevOpsAuditSettingsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. -func (client *ServerDevOpsAuditSettingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, devOpsAuditingSettingsName string, options *ServerDevOpsAuditSettingsClientGetOptions) (*policy.Request, error) { +func (client *ServerDevOpsAuditSettingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, devOpsAuditingSettingsName DevOpsAuditingSettingsName, options *ServerDevOpsAuditSettingsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -157,7 +163,7 @@ func (client *ServerDevOpsAuditSettingsClient) getCreateRequest(ctx context.Cont if devOpsAuditingSettingsName == "" { return nil, errors.New("parameter devOpsAuditingSettingsName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{devOpsAuditingSettingsName}", url.PathEscape(devOpsAuditingSettingsName)) + urlPath = strings.ReplaceAll(urlPath, "{devOpsAuditingSettingsName}", url.PathEscape(string(devOpsAuditingSettingsName))) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -167,7 +173,7 @@ func (client *ServerDevOpsAuditSettingsClient) getCreateRequest(ctx context.Cont 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 @@ -184,7 +190,7 @@ func (client *ServerDevOpsAuditSettingsClient) getHandleResponse(resp *http.Resp // NewListByServerPager - Lists DevOps audit settings of a server. // -// 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. // - serverName - The name of the server. @@ -238,7 +244,7 @@ func (client *ServerDevOpsAuditSettingsClient) listByServerCreateRequest(ctx con 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/serverdevopsauditsettings_client_example_test.go b/sdk/resourcemanager/sql/armsql/serverdevopsauditsettings_client_example_test.go index 5d3aedcd4e70..d3ea2e1b4cb5 100644 --- a/sdk/resourcemanager/sql/armsql/serverdevopsauditsettings_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/serverdevopsauditsettings_client_example_test.go @@ -15,10 +15,50 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDevOpsAuditGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ServerDevOpsAuditList.json +func ExampleServerDevOpsAuditSettingsClient_NewListByServerPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewServerDevOpsAuditSettingsClient().NewListByServerPager("devAuditTestRG", "devOpsAuditTestSvr", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ServerDevOpsAuditSettingsListResult = armsql.ServerDevOpsAuditSettingsListResult{ + // Value: []*armsql.ServerDevOpsAuditingSettings{ + // { + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.Sql/servers/devOpsAuditingSettings"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/devAuditTestRG/providers/Microsoft.Sql/servers/devOpsAuditTestSvr/devOpsAuditingSettings/default"), + // Properties: &armsql.ServerDevOpsAuditSettingsProperties{ + // IsAzureMonitorTargetEnabled: to.Ptr(false), + // IsManagedIdentityInUse: to.Ptr(false), + // State: to.Ptr(armsql.BlobAuditingPolicyStateDisabled), + // StorageAccountSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ServerDevOpsAuditGet.json func ExampleServerDevOpsAuditSettingsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -29,7 +69,7 @@ func ExampleServerDevOpsAuditSettingsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewServerDevOpsAuditSettingsClient().Get(ctx, "devAuditTestRG", "devOpsAuditTestSvr", "default", nil) + res, err := clientFactory.NewServerDevOpsAuditSettingsClient().Get(ctx, "devAuditTestRG", "devOpsAuditTestSvr", armsql.DevOpsAuditingSettingsNameDefault, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -37,19 +77,20 @@ func ExampleServerDevOpsAuditSettingsClient_Get() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.ServerDevOpsAuditingSettings = armsql.ServerDevOpsAuditingSettings{ - // Name: to.Ptr("default"), + // Name: to.Ptr("Default"), // Type: to.Ptr("Microsoft.Sql/servers/devOpsAuditingSettings"), // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/devAuditTestRG/providers/Microsoft.Sql/servers/devOpsAuditTestSvr/devOpsAuditingSettings/default"), // Properties: &armsql.ServerDevOpsAuditSettingsProperties{ // IsAzureMonitorTargetEnabled: to.Ptr(false), + // IsManagedIdentityInUse: to.Ptr(false), // State: to.Ptr(armsql.BlobAuditingPolicyStateDisabled), // StorageAccountSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // StorageEndpoint: to.Ptr(""), + // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDevOpsAuditCreateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ServerDevOpsAuditCreateMax.json func ExampleServerDevOpsAuditSettingsClient_BeginCreateOrUpdate_updateAServersDevOpsAuditSettingsWithAllParams() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -60,11 +101,11 @@ func ExampleServerDevOpsAuditSettingsClient_BeginCreateOrUpdate_updateAServersDe if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServerDevOpsAuditSettingsClient().BeginCreateOrUpdate(ctx, "devAuditTestRG", "devOpsAuditTestSvr", "default", armsql.ServerDevOpsAuditingSettings{ + poller, err := clientFactory.NewServerDevOpsAuditSettingsClient().BeginCreateOrUpdate(ctx, "devAuditTestRG", "devOpsAuditTestSvr", armsql.DevOpsAuditingSettingsNameDefault, armsql.ServerDevOpsAuditingSettings{ Properties: &armsql.ServerDevOpsAuditSettingsProperties{ IsAzureMonitorTargetEnabled: to.Ptr(true), State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), + StorageAccountAccessKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), StorageAccountSubscriptionID: to.Ptr("00000000-1234-0000-5678-000000000000"), StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), }, @@ -80,7 +121,7 @@ func ExampleServerDevOpsAuditSettingsClient_BeginCreateOrUpdate_updateAServersDe _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.ServerDevOpsAuditingSettings = armsql.ServerDevOpsAuditingSettings{ - // Name: to.Ptr("default"), + // Name: to.Ptr("Default"), // Type: to.Ptr("Microsoft.Sql/servers/devOpsAuditingSettings"), // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/devAuditTestRG/providers/Microsoft.Sql/servers/devOpsAuditTestSvr/devOpsAuditingSettings/default"), // Properties: &armsql.ServerDevOpsAuditSettingsProperties{ @@ -92,7 +133,7 @@ func ExampleServerDevOpsAuditSettingsClient_BeginCreateOrUpdate_updateAServersDe // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDevOpsAuditCreateMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ServerDevOpsAuditCreateMin.json func ExampleServerDevOpsAuditSettingsClient_BeginCreateOrUpdate_updateAServersDevOpsAuditSettingsWithMinimalInput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -103,10 +144,10 @@ func ExampleServerDevOpsAuditSettingsClient_BeginCreateOrUpdate_updateAServersDe if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServerDevOpsAuditSettingsClient().BeginCreateOrUpdate(ctx, "devAuditTestRG", "devOpsAuditTestSvr", "default", armsql.ServerDevOpsAuditingSettings{ + poller, err := clientFactory.NewServerDevOpsAuditSettingsClient().BeginCreateOrUpdate(ctx, "devAuditTestRG", "devOpsAuditTestSvr", armsql.DevOpsAuditingSettingsNameDefault, armsql.ServerDevOpsAuditingSettings{ Properties: &armsql.ServerDevOpsAuditSettingsProperties{ State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), + StorageAccountAccessKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), }, }, nil) @@ -121,7 +162,7 @@ func ExampleServerDevOpsAuditSettingsClient_BeginCreateOrUpdate_updateAServersDe _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.ServerDevOpsAuditingSettings = armsql.ServerDevOpsAuditingSettings{ - // Name: to.Ptr("default"), + // Name: to.Ptr("Default"), // Type: to.Ptr("Microsoft.Sql/servers/devOpsAuditingSettings"), // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/devAuditTestRG/providers/Microsoft.Sql/servers/devOpsAuditTestSvr/devOpsAuditingSettings/default"), // Properties: &armsql.ServerDevOpsAuditSettingsProperties{ @@ -131,42 +172,3 @@ func ExampleServerDevOpsAuditSettingsClient_BeginCreateOrUpdate_updateAServersDe // }, // } } - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/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() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerDevOpsAuditSettingsClient().NewListByServerPager("devAuditTestRG", "devOpsAuditTestSvr", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerDevOpsAuditSettingsListResult = armsql.ServerDevOpsAuditSettingsListResult{ - // Value: []*armsql.ServerDevOpsAuditingSettings{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/devOpsAuditingSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/devAuditTestRG/providers/Microsoft.Sql/servers/devOpsAuditTestSvr/devOpsAuditingSettings/default"), - // Properties: &armsql.ServerDevOpsAuditSettingsProperties{ - // IsAzureMonitorTargetEnabled: to.Ptr(false), - // State: to.Ptr(armsql.BlobAuditingPolicyStateDisabled), - // StorageAccountSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // StorageEndpoint: to.Ptr(""), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/serverdnsaliases_client.go b/sdk/resourcemanager/sql/armsql/serverdnsaliases_client.go index bd74dd460a27..e4e9c2d3c530 100644 --- a/sdk/resourcemanager/sql/armsql/serverdnsaliases_client.go +++ b/sdk/resourcemanager/sql/armsql/serverdnsaliases_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -60,7 +59,8 @@ func (client *ServerDNSAliasesClient) BeginAcquire(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller[ServerDNSAliasesClientAcquireResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServerDNSAliasesClientAcquireResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServerDNSAliasesClientAcquireResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,18 +71,20 @@ func (client *ServerDNSAliasesClient) BeginAcquire(ctx context.Context, resource // // Generated from API version 2020-11-01-preview func (client *ServerDNSAliasesClient) acquire(ctx context.Context, resourceGroupName string, serverName string, dnsAliasName string, parameters ServerDNSAliasAcquisition, options *ServerDNSAliasesClientBeginAcquireOptions) (*http.Response, error) { + var err error req, err := client.acquireCreateRequest(ctx, resourceGroupName, serverName, dnsAliasName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // acquireCreateRequest creates the Acquire request. @@ -112,7 +114,10 @@ func (client *ServerDNSAliasesClient) acquireCreateRequest(ctx context.Context, reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginCreateOrUpdate - Creates a server DNS alias. @@ -131,7 +136,8 @@ func (client *ServerDNSAliasesClient) BeginCreateOrUpdate(ctx context.Context, r if err != nil { return nil, err } - return runtime.NewPoller[ServerDNSAliasesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServerDNSAliasesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServerDNSAliasesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -142,18 +148,20 @@ func (client *ServerDNSAliasesClient) BeginCreateOrUpdate(ctx context.Context, r // // Generated from API version 2020-11-01-preview func (client *ServerDNSAliasesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, dnsAliasName string, options *ServerDNSAliasesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, dnsAliasName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -202,7 +210,8 @@ func (client *ServerDNSAliasesClient) BeginDelete(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller[ServerDNSAliasesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServerDNSAliasesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServerDNSAliasesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -213,18 +222,20 @@ func (client *ServerDNSAliasesClient) BeginDelete(ctx context.Context, resourceG // // Generated from API version 2020-11-01-preview func (client *ServerDNSAliasesClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, dnsAliasName string, options *ServerDNSAliasesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, dnsAliasName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -266,18 +277,21 @@ func (client *ServerDNSAliasesClient) deleteCreateRequest(ctx context.Context, r // - dnsAliasName - The name of the server dns alias. // - options - ServerDNSAliasesClientGetOptions contains the optional parameters for the ServerDNSAliasesClient.Get method. func (client *ServerDNSAliasesClient) Get(ctx context.Context, resourceGroupName string, serverName string, dnsAliasName string, options *ServerDNSAliasesClientGetOptions) (ServerDNSAliasesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, dnsAliasName, options) if err != nil { return ServerDNSAliasesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServerDNSAliasesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerDNSAliasesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerDNSAliasesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/serverdnsaliases_client_example_test.go b/sdk/resourcemanager/sql/armsql/serverdnsaliases_client_example_test.go index 4ee7f0afe521..45344565238f 100644 --- a/sdk/resourcemanager/sql/armsql/serverdnsaliases_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/serverdnsaliases_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -46,7 +46,7 @@ func ExampleServerDNSAliasesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasCreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -78,7 +78,7 @@ func ExampleServerDNSAliasesClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -99,7 +99,7 @@ func ExampleServerDNSAliasesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -143,7 +143,7 @@ func ExampleServerDNSAliasesClient_NewListByServerPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasAcquire.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/serverkeys_client.go b/sdk/resourcemanager/sql/armsql/serverkeys_client.go index 7fe19d9e7a0f..88e54e814177 100644 --- a/sdk/resourcemanager/sql/armsql/serverkeys_client.go +++ b/sdk/resourcemanager/sql/armsql/serverkeys_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -64,7 +63,8 @@ func (client *ServerKeysClient) BeginCreateOrUpdate(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller[ServerKeysClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServerKeysClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServerKeysClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -75,18 +75,20 @@ func (client *ServerKeysClient) BeginCreateOrUpdate(ctx context.Context, resourc // // Generated from API version 2020-11-01-preview func (client *ServerKeysClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, keyName string, parameters ServerKey, options *ServerKeysClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, keyName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -116,7 +118,10 @@ func (client *ServerKeysClient) createOrUpdateCreateRequest(ctx context.Context, reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes the server key with the given name. @@ -134,7 +139,8 @@ func (client *ServerKeysClient) BeginDelete(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller[ServerKeysClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServerKeysClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServerKeysClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -145,18 +151,20 @@ func (client *ServerKeysClient) BeginDelete(ctx context.Context, resourceGroupNa // // Generated from API version 2020-11-01-preview func (client *ServerKeysClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, keyName string, options *ServerKeysClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, keyName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -198,18 +206,21 @@ func (client *ServerKeysClient) deleteCreateRequest(ctx context.Context, resourc // - keyName - The name of the server key to be retrieved. // - options - ServerKeysClientGetOptions contains the optional parameters for the ServerKeysClient.Get method. func (client *ServerKeysClient) Get(ctx context.Context, resourceGroupName string, serverName string, keyName string, options *ServerKeysClientGetOptions) (ServerKeysClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, keyName, options) if err != nil { return ServerKeysClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServerKeysClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerKeysClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerKeysClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/serverkeys_client_example_test.go b/sdk/resourcemanager/sql/armsql/serverkeys_client_example_test.go index b64dbfc70144..d9334997fe6e 100644 --- a/sdk/resourcemanager/sql/armsql/serverkeys_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/serverkeys_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -79,7 +79,7 @@ func ExampleServerKeysClient_NewListByServerPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -111,7 +111,7 @@ func ExampleServerKeysClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyCreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -152,7 +152,7 @@ func ExampleServerKeysClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/serveroperations_client.go b/sdk/resourcemanager/sql/armsql/serveroperations_client.go index a339c9a7b3bf..9b8feaff7158 100644 --- a/sdk/resourcemanager/sql/armsql/serveroperations_client.go +++ b/sdk/resourcemanager/sql/armsql/serveroperations_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // 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/serveroperations_client_example_test.go b/sdk/resourcemanager/sql/armsql/serveroperations_client_example_test.go index 48f13933d910..fe9213445ac2 100644 --- a/sdk/resourcemanager/sql/armsql/serveroperations_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/serveroperations_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListServerOperations.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/servers_client.go b/sdk/resourcemanager/sql/armsql/servers_client.go index b97e8f01cf5f..2b48ed799198 100644 --- a/sdk/resourcemanager/sql/armsql/servers_client.go +++ b/sdk/resourcemanager/sql/armsql/servers_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -47,23 +46,26 @@ func NewServersClient(subscriptionID string, credential azcore.TokenCredential, // CheckNameAvailability - Determines whether a resource can be created with the specified name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2022-08-01-preview // - parameters - The name availability request parameters. // - options - ServersClientCheckNameAvailabilityOptions contains the optional parameters for the ServersClient.CheckNameAvailability // method. func (client *ServersClient) CheckNameAvailability(ctx context.Context, parameters CheckNameAvailabilityRequest, options *ServersClientCheckNameAvailabilityOptions) (ServersClientCheckNameAvailabilityResponse, error) { + var err error req, err := client.checkNameAvailabilityCreateRequest(ctx, parameters, options) if err != nil { return ServersClientCheckNameAvailabilityResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServersClientCheckNameAvailabilityResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServersClientCheckNameAvailabilityResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServersClientCheckNameAvailabilityResponse{}, err } - return client.checkNameAvailabilityHandleResponse(resp) + resp, err := client.checkNameAvailabilityHandleResponse(httpResp) + return resp, err } // checkNameAvailabilityCreateRequest creates the CheckNameAvailability request. @@ -78,10 +80,13 @@ func (client *ServersClient) checkNameAvailabilityCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // checkNameAvailabilityHandleResponse handles the CheckNameAvailability response. @@ -96,7 +101,7 @@ func (client *ServersClient) checkNameAvailabilityHandleResponse(resp *http.Resp // BeginCreateOrUpdate - Creates or updates a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2022-08-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. @@ -109,7 +114,8 @@ func (client *ServersClient) BeginCreateOrUpdate(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller[ServersClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServersClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServersClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -118,20 +124,22 @@ func (client *ServersClient) BeginCreateOrUpdate(ctx context.Context, resourceGr // CreateOrUpdate - Creates or updates a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2022-08-01-preview func (client *ServersClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters Server, options *ServersClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -154,16 +162,19 @@ func (client *ServersClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2022-08-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. @@ -174,7 +185,8 @@ func (client *ServersClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[ServersClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServersClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServersClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -183,20 +195,22 @@ func (client *ServersClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2022-08-01-preview func (client *ServersClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -219,7 +233,7 @@ func (client *ServersClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -227,24 +241,27 @@ func (client *ServersClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Gets a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2022-08-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. // - options - ServersClientGetOptions contains the optional parameters for the ServersClient.Get method. func (client *ServersClient) Get(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientGetOptions) (ServersClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, options) if err != nil { return ServersClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServersClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServersClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServersClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -270,7 +287,7 @@ func (client *ServersClient) getCreateRequest(ctx context.Context, resourceGroup if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -288,7 +305,7 @@ func (client *ServersClient) getHandleResponse(resp *http.Response) (ServersClie // BeginImportDatabase - Imports a bacpac into a new database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2022-08-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. @@ -301,7 +318,8 @@ func (client *ServersClient) BeginImportDatabase(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller[ServersClientImportDatabaseResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServersClientImportDatabaseResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServersClientImportDatabaseResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -310,20 +328,22 @@ func (client *ServersClient) BeginImportDatabase(ctx context.Context, resourceGr // ImportDatabase - Imports a bacpac into a new database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2022-08-01-preview func (client *ServersClient) importDatabase(ctx context.Context, resourceGroupName string, serverName string, parameters ImportNewDatabaseDefinition, options *ServersClientBeginImportDatabaseOptions) (*http.Response, error) { + var err error req, err := client.importDatabaseCreateRequest(ctx, resourceGroupName, serverName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // importDatabaseCreateRequest creates the ImportDatabase request. @@ -346,15 +366,18 @@ func (client *ServersClient) importDatabaseCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // NewListPager - Gets a list of all servers in the subscription. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2022-08-01-preview // - options - ServersClientListOptions contains the optional parameters for the ServersClient.NewListPager method. func (client *ServersClient) NewListPager(options *ServersClientListOptions) *runtime.Pager[ServersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ServersClientListResponse]{ @@ -399,7 +422,7 @@ func (client *ServersClient) listCreateRequest(ctx context.Context, options *Ser if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -416,7 +439,7 @@ func (client *ServersClient) listHandleResponse(resp *http.Response) (ServersCli // NewListByResourceGroupPager - Gets a list of servers in a resource groups. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2022-08-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. // - options - ServersClientListByResourceGroupOptions contains the optional parameters for the ServersClient.NewListByResourceGroupPager @@ -468,7 +491,7 @@ func (client *ServersClient) listByResourceGroupCreateRequest(ctx context.Contex if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -483,10 +506,81 @@ func (client *ServersClient) listByResourceGroupHandleResponse(resp *http.Respon return result, nil } +// BeginRefreshStatus - Refresh external governance enablement status. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-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. +// - options - ServersClientBeginRefreshStatusOptions contains the optional parameters for the ServersClient.BeginRefreshStatus +// method. +func (client *ServersClient) BeginRefreshStatus(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginRefreshStatusOptions) (*runtime.Poller[ServersClientRefreshStatusResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.refreshStatus(ctx, resourceGroupName, serverName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServersClientRefreshStatusResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ServersClientRefreshStatusResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// RefreshStatus - Refresh external governance enablement status. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01-preview +func (client *ServersClient) refreshStatus(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginRefreshStatusOptions) (*http.Response, error) { + var err error + req, err := client.refreshStatusCreateRequest(ctx, resourceGroupName, serverName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// refreshStatusCreateRequest creates the RefreshStatus request. +func (client *ServersClient) refreshStatusCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginRefreshStatusOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/refreshExternalGovernanceStatus" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // BeginUpdate - Updates a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2022-08-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. @@ -498,7 +592,8 @@ func (client *ServersClient) BeginUpdate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[ServersClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServersClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServersClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -507,20 +602,22 @@ func (client *ServersClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Updates a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2022-08-01-preview func (client *ServersClient) update(ctx context.Context, resourceGroupName string, serverName string, parameters ServerUpdate, options *ServersClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -543,8 +640,11 @@ func (client *ServersClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/servers_client_example_test.go b/sdk/resourcemanager/sql/armsql/servers_client_example_test.go index 42afc500c0b7..285fc78b694b 100644 --- a/sdk/resourcemanager/sql/armsql/servers_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/servers_client_example_test.go @@ -15,10 +15,293 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CheckNameAvailabilityServerAlreadyExists.json +func ExampleServersClient_CheckNameAvailability_checkForAServerNameThatAlreadyExists() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewServersClient().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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CheckNameAvailabilityResponse = armsql.CheckNameAvailabilityResponse{ + // Name: to.Ptr("server1"), + // Available: to.Ptr(false), + // Message: to.Ptr("Specified server name is already used"), + // Reason: to.Ptr(armsql.CheckNameAvailabilityReasonAlreadyExists), + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CheckNameAvailabilityServerAvailable.json +func ExampleServersClient_CheckNameAvailability_checkForAServerNameThatIsAvailable() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewServersClient().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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CheckNameAvailabilityResponse = armsql.CheckNameAvailabilityResponse{ + // Name: to.Ptr("server1"), + // Available: to.Ptr(true), + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CheckNameAvailabilityServerInvalid.json +func ExampleServersClient_CheckNameAvailability_checkForAServerNameThatIsInvalid() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewServersClient().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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CheckNameAvailabilityResponse = armsql.CheckNameAvailabilityResponse{ + // Name: to.Ptr("SERVER1"), + // Available: to.Ptr(false), + // Message: to.Ptr("Specified server name contains unsupported characters or is too long. Server name must be no longer than 63 characters long, contain only lower-case characters or digits, cannot contain '.' or '_' characters and can't start or end with '-' character."), + // Reason: to.Ptr(armsql.CheckNameAvailabilityReasonInvalid), + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerList.json +func ExampleServersClient_NewListPager_listServers() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewServersClient().NewListPager(&armsql.ServersClientListOptions{Expand: nil}) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ServerListResult = armsql.ServerListResult{ + // Value: []*armsql.Server{ + // { + // Name: to.Ptr("sqlcrudtest-4645"), + // Type: to.Ptr("Microsoft.Sql/servers"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645"), + // Location: to.Ptr("japaneast"), + // Kind: to.Ptr("v12.0"), + // Properties: &armsql.ServerProperties{ + // AdministratorLogin: to.Ptr("dummylogin"), + // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), + // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-4645.database.windows.net"), + // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ + // { + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), + // Properties: &armsql.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armsql.PrivateEndpointProperty{ + // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), + // }, + // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ + // Description: to.Ptr("Auto-approved"), + // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), + // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), + // }, + // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), + // }, + // }}, + // PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagEnabled), + // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), + // State: to.Ptr("Ready"), + // Version: to.Ptr("12.0"), + // WorkspaceFeature: to.Ptr(armsql.ServerWorkspaceFeatureConnected), + // }, + // }, + // { + // Name: to.Ptr("sqlcrudtest-6661"), + // Type: to.Ptr("Microsoft.Sql/servers"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-6661"), + // Location: to.Ptr("japaneast"), + // Kind: to.Ptr("v12.0"), + // Properties: &armsql.ServerProperties{ + // AdministratorLogin: to.Ptr("dummylogin"), + // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), + // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-6661.database.windows.net"), + // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ + // { + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), + // Properties: &armsql.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armsql.PrivateEndpointProperty{ + // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), + // }, + // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ + // Description: to.Ptr("Auto-approved"), + // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), + // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), + // }, + // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), + // }, + // }}, + // PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagEnabled), + // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), + // State: to.Ptr("Ready"), + // Version: to.Ptr("12.0"), + // WorkspaceFeature: to.Ptr(armsql.ServerWorkspaceFeatureConnected), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerListWithExpandEqualsAdministrators.json +func ExampleServersClient_NewListPager_listServersWithExpandAdministratorsActivedirectory() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewServersClient().NewListPager(&armsql.ServersClientListOptions{Expand: nil}) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ServerListResult = armsql.ServerListResult{ + // Value: []*armsql.Server{ + // { + // Name: to.Ptr("sqlcrudtest-4645"), + // Type: to.Ptr("Microsoft.Sql/servers"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645"), + // Location: to.Ptr("japaneast"), + // Kind: to.Ptr("v12.0"), + // Properties: &armsql.ServerProperties{ + // AdministratorLogin: to.Ptr("dummylogin"), + // 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"), + // }, + // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), + // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-4645.database.windows.net"), + // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ + // { + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), + // Properties: &armsql.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armsql.PrivateEndpointProperty{ + // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), + // }, + // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ + // Description: to.Ptr("Auto-approved"), + // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), + // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), + // }, + // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), + // }, + // }}, + // PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagEnabled), + // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), + // State: to.Ptr("Ready"), + // Version: to.Ptr("12.0"), + // WorkspaceFeature: to.Ptr(armsql.ServerWorkspaceFeatureConnected), + // }, + // }, + // { + // Name: to.Ptr("sqlcrudtest-6661"), + // Type: to.Ptr("Microsoft.Sql/servers"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-6661"), + // Location: to.Ptr("japaneast"), + // Kind: to.Ptr("v12.0"), + // Properties: &armsql.ServerProperties{ + // AdministratorLogin: to.Ptr("dummylogin"), + // 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"), + // }, + // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), + // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-6661.database.windows.net"), + // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ + // { + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), + // Properties: &armsql.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armsql.PrivateEndpointProperty{ + // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), + // }, + // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ + // Description: to.Ptr("Auto-approved"), + // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), + // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), + // }, + // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), + // }, + // }}, + // PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagEnabled), + // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), + // State: to.Ptr("Ready"), + // Version: to.Ptr("12.0"), + // WorkspaceFeature: to.Ptr(armsql.ServerWorkspaceFeatureConnected), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerListByResourceGroup.json func ExampleServersClient_NewListByResourceGroupPager_listServersByResourceGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -50,6 +333,7 @@ func ExampleServersClient_NewListByResourceGroupPager_listServersByResourceGroup // Kind: to.Ptr("v12.0"), // Properties: &armsql.ServerProperties{ // AdministratorLogin: to.Ptr("dummylogin"), + // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-4645.database.windows.net"), // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ // { @@ -66,7 +350,7 @@ func ExampleServersClient_NewListByResourceGroupPager_listServersByResourceGroup // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), // }, // }}, - // PublicNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), + // PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagEnabled), // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), // State: to.Ptr("Ready"), // Version: to.Ptr("12.0"), @@ -81,6 +365,7 @@ func ExampleServersClient_NewListByResourceGroupPager_listServersByResourceGroup // Kind: to.Ptr("v12.0"), // Properties: &armsql.ServerProperties{ // AdministratorLogin: to.Ptr("dummylogin"), + // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-6661.database.windows.net"), // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ // { @@ -97,7 +382,7 @@ func ExampleServersClient_NewListByResourceGroupPager_listServersByResourceGroup // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), // }, // }}, - // PublicNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), + // PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagEnabled), // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), // State: to.Ptr("Ready"), // Version: to.Ptr("12.0"), @@ -108,8 +393,8 @@ func ExampleServersClient_NewListByResourceGroupPager_listServersByResourceGroup } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerListByResourceGroupWithExpandEqualsAdministrators.json -func ExampleServersClient_NewListByResourceGroupPager_listServersByResourceGroupWithExpandAdministrators() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerListByResourceGroupWithExpandEqualsAdministrators.json +func ExampleServersClient_NewListByResourceGroupPager_listServersByResourceGroupWithExpandAdministratorsActivedirectory() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -147,6 +432,7 @@ func ExampleServersClient_NewListByResourceGroupPager_listServersByResourceGroup // Sid: to.Ptr("00000011-1111-2222-2222-123456789111"), // TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), // }, + // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-4645.database.windows.net"), // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ // { @@ -163,7 +449,7 @@ func ExampleServersClient_NewListByResourceGroupPager_listServersByResourceGroup // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), // }, // }}, - // PublicNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), + // PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagEnabled), // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), // State: to.Ptr("Ready"), // Version: to.Ptr("12.0"), @@ -185,6 +471,7 @@ func ExampleServersClient_NewListByResourceGroupPager_listServersByResourceGroup // Sid: to.Ptr("00000011-1111-2222-2222-123456789111"), // TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), // }, + // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-6661.database.windows.net"), // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ // { @@ -201,7 +488,7 @@ func ExampleServersClient_NewListByResourceGroupPager_listServersByResourceGroup // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), // }, // }}, - // PublicNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), + // PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagEnabled), // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), // State: to.Ptr("Ready"), // Version: to.Ptr("12.0"), @@ -212,7 +499,7 @@ func ExampleServersClient_NewListByResourceGroupPager_listServersByResourceGroup } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerGet.json func ExampleServersClient_Get_getServer() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -241,6 +528,7 @@ func ExampleServersClient_Get_getServer() { // Kind: to.Ptr("v12.0"), // Properties: &armsql.ServerProperties{ // AdministratorLogin: to.Ptr("dummylogin"), + // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-4645.database.windows.net"), // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ // { @@ -257,7 +545,7 @@ func ExampleServersClient_Get_getServer() { // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), // }, // }}, - // PublicNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), + // PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagEnabled), // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), // State: to.Ptr("Ready"), // Version: to.Ptr("12.0"), @@ -266,8 +554,8 @@ func ExampleServersClient_Get_getServer() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerGetWithExpandEqualsAdministrators.json -func ExampleServersClient_Get_getServerWithExpandAdministrators() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerGetWithExpandEqualsAdministrators.json +func ExampleServersClient_Get_getServerWithExpandAdministratorsActivedirectory() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -302,6 +590,7 @@ func ExampleServersClient_Get_getServerWithExpandAdministrators() { // Sid: to.Ptr("00000011-1111-2222-2222-123456789111"), // TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), // }, + // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-4645.database.windows.net"), // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ // { @@ -318,7 +607,7 @@ func ExampleServersClient_Get_getServerWithExpandAdministrators() { // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), // }, // }}, - // PublicNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), + // PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagEnabled), // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), // State: to.Ptr("Ready"), // Version: to.Ptr("12.0"), @@ -327,7 +616,7 @@ func ExampleServersClient_Get_getServerWithExpandAdministrators() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerCreate.json func ExampleServersClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -350,7 +639,7 @@ func ExampleServersClient_BeginCreateOrUpdate() { Sid: to.Ptr("00000011-1111-2222-2222-123456789111"), TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), }, - PublicNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), + PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagEnabled), RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), }, }, nil) @@ -395,7 +684,7 @@ func ExampleServersClient_BeginCreateOrUpdate() { // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), // }, // }}, - // PublicNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), + // PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagEnabled), // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), // State: to.Ptr("Ready"), // Version: to.Ptr("12.0"), @@ -403,7 +692,7 @@ func ExampleServersClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerDelete.json func ExampleServersClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -424,7 +713,7 @@ func ExampleServersClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerUpdate.json func ExampleServersClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -439,7 +728,7 @@ func ExampleServersClient_BeginUpdate() { Properties: &armsql.ServerProperties{ AdministratorLogin: to.Ptr("dummylogin"), AdministratorLoginPassword: to.Ptr("placeholder"), - PublicNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagDisabled), + PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagDisabled), RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), }, }, nil) @@ -480,7 +769,7 @@ func ExampleServersClient_BeginUpdate() { // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), // }, // }}, - // PublicNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagDisabled), + // PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagDisabled), // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), // State: to.Ptr("Ready"), // Version: to.Ptr("12.0"), @@ -488,201 +777,7 @@ func ExampleServersClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerList.json -func ExampleServersClient_NewListPager_listServers() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServersClient().NewListPager(&armsql.ServersClientListOptions{Expand: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerListResult = armsql.ServerListResult{ - // Value: []*armsql.Server{ - // { - // Name: to.Ptr("sqlcrudtest-4645"), - // Type: to.Ptr("Microsoft.Sql/servers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645"), - // Location: to.Ptr("japaneast"), - // Kind: to.Ptr("v12.0"), - // Properties: &armsql.ServerProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-4645.database.windows.net"), - // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armsql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // State: to.Ptr("Ready"), - // Version: to.Ptr("12.0"), - // WorkspaceFeature: to.Ptr(armsql.ServerWorkspaceFeatureConnected), - // }, - // }, - // { - // Name: to.Ptr("sqlcrudtest-6661"), - // Type: to.Ptr("Microsoft.Sql/servers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-6661"), - // Location: to.Ptr("japaneast"), - // Kind: to.Ptr("v12.0"), - // Properties: &armsql.ServerProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-6661.database.windows.net"), - // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armsql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // State: to.Ptr("Ready"), - // Version: to.Ptr("12.0"), - // WorkspaceFeature: to.Ptr(armsql.ServerWorkspaceFeatureConnected), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerListWithExpandEqualsAdministrators.json -func ExampleServersClient_NewListPager_listServersWithExpandEqualsAdministrators() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServersClient().NewListPager(&armsql.ServersClientListOptions{Expand: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerListResult = armsql.ServerListResult{ - // Value: []*armsql.Server{ - // { - // Name: to.Ptr("sqlcrudtest-4645"), - // Type: to.Ptr("Microsoft.Sql/servers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645"), - // Location: to.Ptr("japaneast"), - // Kind: to.Ptr("v12.0"), - // Properties: &armsql.ServerProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // 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"), - // }, - // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-4645.database.windows.net"), - // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armsql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // State: to.Ptr("Ready"), - // Version: to.Ptr("12.0"), - // WorkspaceFeature: to.Ptr(armsql.ServerWorkspaceFeatureConnected), - // }, - // }, - // { - // Name: to.Ptr("sqlcrudtest-6661"), - // Type: to.Ptr("Microsoft.Sql/servers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-6661"), - // Location: to.Ptr("japaneast"), - // Kind: to.Ptr("v12.0"), - // Properties: &armsql.ServerProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // 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"), - // }, - // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-6661.database.windows.net"), - // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armsql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // State: to.Ptr("Ready"), - // Version: to.Ptr("12.0"), - // WorkspaceFeature: to.Ptr(armsql.ServerWorkspaceFeatureConnected), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ImportNewDatabaseWithNetworkIsolation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ImportNewDatabaseWithNetworkIsolation.json func ExampleServersClient_BeginImportDatabase_importsToANewDatabaseUsingPrivateLinkForTheSqlServerAndStorageAccount() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -733,7 +828,7 @@ func ExampleServersClient_BeginImportDatabase_importsToANewDatabaseUsingPrivateL // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ImportNewDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ImportNewDatabase.json func ExampleServersClient_BeginImportDatabase_importsToANewDatabase() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -780,37 +875,8 @@ func ExampleServersClient_BeginImportDatabase_importsToANewDatabase() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CheckNameAvailabilityServerAlreadyExists.json -func ExampleServersClient_CheckNameAvailability_checkForAServerNameThatAlreadyExists() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServersClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameAvailabilityResponse = armsql.CheckNameAvailabilityResponse{ - // Name: to.Ptr("server1"), - // Available: to.Ptr(false), - // Message: to.Ptr("Specified server name is already used"), - // Reason: to.Ptr(armsql.CheckNameAvailabilityReasonAlreadyExists), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CheckNameAvailabilityServerAvailable.json -func ExampleServersClient_CheckNameAvailability_checkForAServerNameThatIsAvailable() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/RefreshExternalGovernanceStatus.json +func ExampleServersClient_BeginRefreshStatus() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -820,47 +886,27 @@ func ExampleServersClient_CheckNameAvailability_checkForAServerNameThatIsAvailab if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewServersClient().CheckNameAvailability(ctx, armsql.CheckNameAvailabilityRequest{ - Name: to.Ptr("server1"), - Type: to.Ptr("Microsoft.Sql/servers"), - }, nil) + poller, err := clientFactory.NewServersClient().BeginRefreshStatus(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameAvailabilityResponse = armsql.CheckNameAvailabilityResponse{ - // Name: to.Ptr("server1"), - // Available: to.Ptr(true), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CheckNameAvailabilityServerInvalid.json -func ExampleServersClient_CheckNameAvailability_checkForAServerNameThatIsInvalid() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServersClient().CheckNameAvailability(ctx, armsql.CheckNameAvailabilityRequest{ - Name: to.Ptr("SERVER1"), - Type: to.Ptr("Microsoft.Sql/servers"), - }, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameAvailabilityResponse = armsql.CheckNameAvailabilityResponse{ - // Name: to.Ptr("SERVER1"), - // Available: to.Ptr(false), - // Message: to.Ptr("Specified server name contains unsupported characters or is too long. Server name must be no longer than 63 characters long, contain only lower-case characters or digits, cannot contain '.' or '_' characters and can't start or end with '-' character."), - // Reason: to.Ptr(armsql.CheckNameAvailabilityReasonInvalid), + // res.RefreshExternalGovernanceStatusOperationResult = armsql.RefreshExternalGovernanceStatusOperationResult{ + // Name: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"), + // Type: to.Ptr("Microsoft.Sql/locations/refreshExternalGovernanceStatusOperationResults"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.Sql/locations/japaneast/refreshExternalGovernanceStatusOperationResults/9d9a794a-5cec-4f23-af70-d29511b522a4"), + // Properties: &armsql.RefreshExternalGovernanceStatusOperationResultProperties{ + // QueuedTime: to.Ptr("2/12/2022 8:33:27 PM"), + // RequestID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // RequestType: to.Ptr("UpdatePurviewMetadata"), + // ServerName: to.Ptr("testsvr.database.windows.net"), + // Status: to.Ptr("Completed"), + // }, // } } diff --git a/sdk/resourcemanager/sql/armsql/serversecurityalertpolicies_client.go b/sdk/resourcemanager/sql/armsql/serversecurityalertpolicies_client.go index 93d32cc490c0..0ad8fc7ec5dd 100644 --- a/sdk/resourcemanager/sql/armsql/serversecurityalertpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/serversecurityalertpolicies_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -61,7 +60,8 @@ func (client *ServerSecurityAlertPoliciesClient) BeginCreateOrUpdate(ctx context if err != nil { return nil, err } - return runtime.NewPoller[ServerSecurityAlertPoliciesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServerSecurityAlertPoliciesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServerSecurityAlertPoliciesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *ServerSecurityAlertPoliciesClient) BeginCreateOrUpdate(ctx context // // Generated from API version 2020-11-01-preview func (client *ServerSecurityAlertPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyName, parameters ServerSecurityAlertPolicy, options *ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, securityAlertPolicyName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -113,7 +115,10 @@ func (client *ServerSecurityAlertPoliciesClient) createOrUpdateCreateRequest(ctx reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Get - Get a server's security alert policy. @@ -127,18 +132,21 @@ func (client *ServerSecurityAlertPoliciesClient) createOrUpdateCreateRequest(ctx // - options - ServerSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.Get // method. func (client *ServerSecurityAlertPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyName, options *ServerSecurityAlertPoliciesClientGetOptions) (ServerSecurityAlertPoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, securityAlertPolicyName, options) if err != nil { return ServerSecurityAlertPoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServerSecurityAlertPoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerSecurityAlertPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerSecurityAlertPoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/serversecurityalertpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/serversecurityalertpolicies_client_example_test.go index 20d4afb0649b..55bf33aeb351 100644 --- a/sdk/resourcemanager/sql/armsql/serversecurityalertpolicies_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/serversecurityalertpolicies_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -63,7 +63,7 @@ func ExampleServerSecurityAlertPoliciesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsCreateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsCreateMax.json func ExampleServerSecurityAlertPoliciesClient_BeginCreateOrUpdate_updateAServersThreatDetectionPolicyWithAllParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -125,7 +125,7 @@ func ExampleServerSecurityAlertPoliciesClient_BeginCreateOrUpdate_updateAServers // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsCreateMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsCreateMin.json func ExampleServerSecurityAlertPoliciesClient_BeginCreateOrUpdate_updateAServersThreatDetectionPolicyWithMinimalParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -177,7 +177,7 @@ func ExampleServerSecurityAlertPoliciesClient_BeginCreateOrUpdate_updateAServers // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsListByServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/servertrustcertificates_client.go b/sdk/resourcemanager/sql/armsql/servertrustcertificates_client.go index 572dc78fea58..34ed1f51356c 100644 --- a/sdk/resourcemanager/sql/armsql/servertrustcertificates_client.go +++ b/sdk/resourcemanager/sql/armsql/servertrustcertificates_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -61,7 +60,8 @@ func (client *ServerTrustCertificatesClient) BeginCreateOrUpdate(ctx context.Con if err != nil { return nil, err } - return runtime.NewPoller[ServerTrustCertificatesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServerTrustCertificatesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServerTrustCertificatesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *ServerTrustCertificatesClient) BeginCreateOrUpdate(ctx context.Con // // Generated from API version 2021-11-01-preview func (client *ServerTrustCertificatesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, certificateName string, parameters ServerTrustCertificate, options *ServerTrustCertificatesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, certificateName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -113,7 +115,10 @@ func (client *ServerTrustCertificatesClient) createOrUpdateCreateRequest(ctx con 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) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a server trust certificate that was uploaded from box to Sql Managed Instance. @@ -132,7 +137,8 @@ func (client *ServerTrustCertificatesClient) BeginDelete(ctx context.Context, re if err != nil { return nil, err } - return runtime.NewPoller[ServerTrustCertificatesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServerTrustCertificatesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServerTrustCertificatesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -143,18 +149,20 @@ func (client *ServerTrustCertificatesClient) BeginDelete(ctx context.Context, re // // Generated from API version 2021-11-01-preview func (client *ServerTrustCertificatesClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, certificateName string, options *ServerTrustCertificatesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, certificateName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -197,18 +205,21 @@ func (client *ServerTrustCertificatesClient) deleteCreateRequest(ctx context.Con // - options - ServerTrustCertificatesClientGetOptions contains the optional parameters for the ServerTrustCertificatesClient.Get // method. func (client *ServerTrustCertificatesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, certificateName string, options *ServerTrustCertificatesClientGetOptions) (ServerTrustCertificatesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, certificateName, options) if err != nil { return ServerTrustCertificatesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServerTrustCertificatesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerTrustCertificatesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerTrustCertificatesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/servertrustcertificates_client_example_test.go b/sdk/resourcemanager/sql/armsql/servertrustcertificates_client_example_test.go index 1283a2bb8059..672b4160a034 100644 --- a/sdk/resourcemanager/sql/armsql/servertrustcertificates_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/servertrustcertificates_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesListByInstance.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -64,7 +64,7 @@ func ExampleServerTrustCertificatesClient_NewListByInstancePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -93,7 +93,7 @@ func ExampleServerTrustCertificatesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -130,7 +130,7 @@ func ExampleServerTrustCertificatesClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/servertrustgroups_client.go b/sdk/resourcemanager/sql/armsql/servertrustgroups_client.go index 8e52b16348e0..5fde6499c92b 100644 --- a/sdk/resourcemanager/sql/armsql/servertrustgroups_client.go +++ b/sdk/resourcemanager/sql/armsql/servertrustgroups_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -61,7 +60,8 @@ func (client *ServerTrustGroupsClient) BeginCreateOrUpdate(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[ServerTrustGroupsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServerTrustGroupsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServerTrustGroupsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *ServerTrustGroupsClient) BeginCreateOrUpdate(ctx context.Context, // // Generated from API version 2020-11-01-preview func (client *ServerTrustGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, locationName string, serverTrustGroupName string, parameters ServerTrustGroup, options *ServerTrustGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, locationName, serverTrustGroupName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -113,7 +115,10 @@ func (client *ServerTrustGroupsClient) createOrUpdateCreateRequest(ctx context.C reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a server trust group. @@ -132,7 +137,8 @@ func (client *ServerTrustGroupsClient) BeginDelete(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller[ServerTrustGroupsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServerTrustGroupsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServerTrustGroupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -143,18 +149,20 @@ func (client *ServerTrustGroupsClient) BeginDelete(ctx context.Context, resource // // Generated from API version 2020-11-01-preview func (client *ServerTrustGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, locationName string, serverTrustGroupName string, options *ServerTrustGroupsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, locationName, serverTrustGroupName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -196,18 +204,21 @@ func (client *ServerTrustGroupsClient) deleteCreateRequest(ctx context.Context, // - serverTrustGroupName - The name of the server trust group. // - options - ServerTrustGroupsClientGetOptions contains the optional parameters for the ServerTrustGroupsClient.Get method. func (client *ServerTrustGroupsClient) Get(ctx context.Context, resourceGroupName string, locationName string, serverTrustGroupName string, options *ServerTrustGroupsClientGetOptions) (ServerTrustGroupsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, locationName, serverTrustGroupName, options) if err != nil { return ServerTrustGroupsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServerTrustGroupsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerTrustGroupsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerTrustGroupsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/servertrustgroups_client_example_test.go b/sdk/resourcemanager/sql/armsql/servertrustgroups_client_example_test.go index aeb9b7c473ff..8fe440bddd91 100644 --- a/sdk/resourcemanager/sql/armsql/servertrustgroups_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/servertrustgroups_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -55,7 +55,7 @@ func ExampleServerTrustGroupsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -109,7 +109,7 @@ func ExampleServerTrustGroupsClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -130,7 +130,7 @@ func ExampleServerTrustGroupsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -192,7 +192,7 @@ func ExampleServerTrustGroupsClient_NewListByLocationPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupListByManagedInstance.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/serverusages_client.go b/sdk/resourcemanager/sql/armsql/serverusages_client.go index b200d5696729..f158f2a99064 100644 --- a/sdk/resourcemanager/sql/armsql/serverusages_client.go +++ b/sdk/resourcemanager/sql/armsql/serverusages_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // 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/serverusages_client_example_test.go b/sdk/resourcemanager/sql/armsql/serverusages_client_example_test.go index 064c691a6d4b..02137262e63e 100644 --- a/sdk/resourcemanager/sql/armsql/serverusages_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/serverusages_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ServerUsageMetricsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/servervulnerabilityassessments_client.go b/sdk/resourcemanager/sql/armsql/servervulnerabilityassessments_client.go index ccab0c996d61..98ed69b3256c 100644 --- a/sdk/resourcemanager/sql/armsql/servervulnerabilityassessments_client.go +++ b/sdk/resourcemanager/sql/armsql/servervulnerabilityassessments_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -58,18 +57,21 @@ func NewServerVulnerabilityAssessmentsClient(subscriptionID string, credential a // - options - ServerVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.CreateOrUpdate // method. func (client *ServerVulnerabilityAssessmentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, parameters ServerVulnerabilityAssessment, options *ServerVulnerabilityAssessmentsClientCreateOrUpdateOptions) (ServerVulnerabilityAssessmentsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, parameters, options) if err != nil { return ServerVulnerabilityAssessmentsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServerVulnerabilityAssessmentsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ServerVulnerabilityAssessmentsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ServerVulnerabilityAssessmentsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -99,7 +101,10 @@ func (client *ServerVulnerabilityAssessmentsClient) createOrUpdateCreateRequest( reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -122,16 +127,18 @@ func (client *ServerVulnerabilityAssessmentsClient) createOrUpdateHandleResponse // - options - ServerVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.Delete // method. func (client *ServerVulnerabilityAssessmentsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *ServerVulnerabilityAssessmentsClientDeleteOptions) (ServerVulnerabilityAssessmentsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, options) if err != nil { return ServerVulnerabilityAssessmentsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServerVulnerabilityAssessmentsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerVulnerabilityAssessmentsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerVulnerabilityAssessmentsClientDeleteResponse{}, err } return ServerVulnerabilityAssessmentsClientDeleteResponse{}, nil } @@ -176,18 +183,21 @@ func (client *ServerVulnerabilityAssessmentsClient) deleteCreateRequest(ctx cont // - options - ServerVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.Get // method. func (client *ServerVulnerabilityAssessmentsClient) Get(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *ServerVulnerabilityAssessmentsClientGetOptions) (ServerVulnerabilityAssessmentsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, options) if err != nil { return ServerVulnerabilityAssessmentsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServerVulnerabilityAssessmentsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerVulnerabilityAssessmentsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerVulnerabilityAssessmentsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/servervulnerabilityassessments_client_example_test.go b/sdk/resourcemanager/sql/armsql/servervulnerabilityassessments_client_example_test.go index e1c33196934b..fe18e68ecf40 100644 --- a/sdk/resourcemanager/sql/armsql/servervulnerabilityassessments_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/servervulnerabilityassessments_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -52,7 +52,7 @@ func ExampleServerVulnerabilityAssessmentsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentCreateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentCreateMax.json func ExampleServerVulnerabilityAssessmentsClient_CreateOrUpdate_createAServersVulnerabilityAssessmentWithAllParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -99,7 +99,7 @@ func ExampleServerVulnerabilityAssessmentsClient_CreateOrUpdate_createAServersVu // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentCreateStorageAccessKeyMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentCreateStorageAccessKeyMin.json func ExampleServerVulnerabilityAssessmentsClient_CreateOrUpdate_createAServersVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAccessKeyIsSpecified() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -137,7 +137,7 @@ func ExampleServerVulnerabilityAssessmentsClient_CreateOrUpdate_createAServersVu // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentCreateContainerSasKeyMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentCreateContainerSasKeyMin.json func ExampleServerVulnerabilityAssessmentsClient_CreateOrUpdate_createAServersVulnerabilityAssessmentWithMinimalParametersWhenStorageContainerSasKeyIsSpecified() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -175,7 +175,7 @@ func ExampleServerVulnerabilityAssessmentsClient_CreateOrUpdate_createAServersVu // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -192,7 +192,7 @@ func ExampleServerVulnerabilityAssessmentsClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentListByServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/serviceobjectives_client.go b/sdk/resourcemanager/sql/armsql/serviceobjectives_client.go index 8b02482df841..6ef3cceecb48 100644 --- a/sdk/resourcemanager/sql/armsql/serviceobjectives_client.go +++ b/sdk/resourcemanager/sql/armsql/serviceobjectives_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -54,18 +53,21 @@ func NewServiceObjectivesClient(subscriptionID string, credential azcore.TokenCr // - serviceObjectiveName - The name of the service objective to retrieve. // - options - ServiceObjectivesClientGetOptions contains the optional parameters for the ServiceObjectivesClient.Get method. func (client *ServiceObjectivesClient) Get(ctx context.Context, resourceGroupName string, serverName string, serviceObjectiveName string, options *ServiceObjectivesClientGetOptions) (ServiceObjectivesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, serviceObjectiveName, options) if err != nil { return ServiceObjectivesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServiceObjectivesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceObjectivesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServiceObjectivesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/serviceobjectives_client_example_test.go b/sdk/resourcemanager/sql/armsql/serviceobjectives_client_example_test.go index 532aa8f25d13..9784ad5ac0c3 100644 --- a/sdk/resourcemanager/sql/armsql/serviceobjectives_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/serviceobjectives_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServiceObjectiveGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServiceObjectiveGet.json func ExampleServiceObjectivesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -48,7 +48,7 @@ func ExampleServiceObjectivesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServiceObjectiveList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServiceObjectiveList.json func ExampleServiceObjectivesClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/sql/armsql/startstopmanagedinstanceschedules_client.go b/sdk/resourcemanager/sql/armsql/startstopmanagedinstanceschedules_client.go new file mode 100644 index 000000000000..0b47da1318a6 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/startstopmanagedinstanceschedules_client.go @@ -0,0 +1,309 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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" +) + +// StartStopManagedInstanceSchedulesClient contains the methods for the StartStopManagedInstanceSchedules group. +// Don't use this type directly, use NewStartStopManagedInstanceSchedulesClient() instead. +type StartStopManagedInstanceSchedulesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewStartStopManagedInstanceSchedulesClient creates a new instance of StartStopManagedInstanceSchedulesClient 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 NewStartStopManagedInstanceSchedulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StartStopManagedInstanceSchedulesClient, error) { + cl, err := arm.NewClient(moduleName+".StartStopManagedInstanceSchedulesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &StartStopManagedInstanceSchedulesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates the managed instance's Start/Stop schedule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-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. +// - startStopScheduleName - Name of the managed instance Start/Stop schedule. +// - parameters - The requested managed instance Start/Stop schedule. +// - options - StartStopManagedInstanceSchedulesClientCreateOrUpdateOptions contains the optional parameters for the StartStopManagedInstanceSchedulesClient.CreateOrUpdate +// method. +func (client *StartStopManagedInstanceSchedulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, startStopScheduleName StartStopScheduleName, parameters StartStopManagedInstanceSchedule, options *StartStopManagedInstanceSchedulesClientCreateOrUpdateOptions) (StartStopManagedInstanceSchedulesClientCreateOrUpdateResponse, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, startStopScheduleName, parameters, options) + if err != nil { + return StartStopManagedInstanceSchedulesClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return StartStopManagedInstanceSchedulesClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return StartStopManagedInstanceSchedulesClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *StartStopManagedInstanceSchedulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, startStopScheduleName StartStopScheduleName, parameters StartStopManagedInstanceSchedule, options *StartStopManagedInstanceSchedulesClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/startStopSchedules/{startStopScheduleName}" + 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 startStopScheduleName == "" { + return nil, errors.New("parameter startStopScheduleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{startStopScheduleName}", url.PathEscape(string(startStopScheduleName))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *StartStopManagedInstanceSchedulesClient) createOrUpdateHandleResponse(resp *http.Response) (StartStopManagedInstanceSchedulesClientCreateOrUpdateResponse, error) { + result := StartStopManagedInstanceSchedulesClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.StartStopManagedInstanceSchedule); err != nil { + return StartStopManagedInstanceSchedulesClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes the managed instance's Start/Stop schedule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-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. +// - startStopScheduleName - Name of the managed instance Start/Stop schedule. +// - options - StartStopManagedInstanceSchedulesClientDeleteOptions contains the optional parameters for the StartStopManagedInstanceSchedulesClient.Delete +// method. +func (client *StartStopManagedInstanceSchedulesClient) Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, startStopScheduleName StartStopScheduleName, options *StartStopManagedInstanceSchedulesClientDeleteOptions) (StartStopManagedInstanceSchedulesClientDeleteResponse, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, startStopScheduleName, options) + if err != nil { + return StartStopManagedInstanceSchedulesClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return StartStopManagedInstanceSchedulesClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return StartStopManagedInstanceSchedulesClientDeleteResponse{}, err + } + return StartStopManagedInstanceSchedulesClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *StartStopManagedInstanceSchedulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, startStopScheduleName StartStopScheduleName, options *StartStopManagedInstanceSchedulesClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/startStopSchedules/{startStopScheduleName}" + 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 startStopScheduleName == "" { + return nil, errors.New("parameter startStopScheduleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{startStopScheduleName}", url.PathEscape(string(startStopScheduleName))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// Get - Gets the managed instance's Start/Stop schedule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-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. +// - startStopScheduleName - Name of the managed instance Start/Stop schedule. +// - options - StartStopManagedInstanceSchedulesClientGetOptions contains the optional parameters for the StartStopManagedInstanceSchedulesClient.Get +// method. +func (client *StartStopManagedInstanceSchedulesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, startStopScheduleName StartStopScheduleName, options *StartStopManagedInstanceSchedulesClientGetOptions) (StartStopManagedInstanceSchedulesClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, startStopScheduleName, options) + if err != nil { + return StartStopManagedInstanceSchedulesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return StartStopManagedInstanceSchedulesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return StartStopManagedInstanceSchedulesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *StartStopManagedInstanceSchedulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, startStopScheduleName StartStopScheduleName, options *StartStopManagedInstanceSchedulesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/startStopSchedules/{startStopScheduleName}" + 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 startStopScheduleName == "" { + return nil, errors.New("parameter startStopScheduleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{startStopScheduleName}", url.PathEscape(string(startStopScheduleName))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-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 *StartStopManagedInstanceSchedulesClient) getHandleResponse(resp *http.Response) (StartStopManagedInstanceSchedulesClientGetResponse, error) { + result := StartStopManagedInstanceSchedulesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.StartStopManagedInstanceSchedule); err != nil { + return StartStopManagedInstanceSchedulesClientGetResponse{}, err + } + return result, nil +} + +// NewListByInstancePager - Lists the managed instance's Start/Stop schedules. +// +// Generated from API version 2022-08-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 - StartStopManagedInstanceSchedulesClientListByInstanceOptions contains the optional parameters for the StartStopManagedInstanceSchedulesClient.NewListByInstancePager +// method. +func (client *StartStopManagedInstanceSchedulesClient) NewListByInstancePager(resourceGroupName string, managedInstanceName string, options *StartStopManagedInstanceSchedulesClientListByInstanceOptions) *runtime.Pager[StartStopManagedInstanceSchedulesClientListByInstanceResponse] { + return runtime.NewPager(runtime.PagingHandler[StartStopManagedInstanceSchedulesClientListByInstanceResponse]{ + More: func(page StartStopManagedInstanceSchedulesClientListByInstanceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *StartStopManagedInstanceSchedulesClientListByInstanceResponse) (StartStopManagedInstanceSchedulesClientListByInstanceResponse, 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 StartStopManagedInstanceSchedulesClientListByInstanceResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return StartStopManagedInstanceSchedulesClientListByInstanceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StartStopManagedInstanceSchedulesClientListByInstanceResponse{}, runtime.NewResponseError(resp) + } + return client.listByInstanceHandleResponse(resp) + }, + }) +} + +// listByInstanceCreateRequest creates the ListByInstance request. +func (client *StartStopManagedInstanceSchedulesClient) listByInstanceCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, options *StartStopManagedInstanceSchedulesClientListByInstanceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/startStopSchedules" + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-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 *StartStopManagedInstanceSchedulesClient) listByInstanceHandleResponse(resp *http.Response) (StartStopManagedInstanceSchedulesClientListByInstanceResponse, error) { + result := StartStopManagedInstanceSchedulesClientListByInstanceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.StartStopManagedInstanceScheduleListResult); err != nil { + return StartStopManagedInstanceSchedulesClientListByInstanceResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/startstopmanagedinstanceschedules_client_example_test.go b/sdk/resourcemanager/sql/armsql/startstopmanagedinstanceschedules_client_example_test.go new file mode 100644 index 000000000000..5de402de1573 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/startstopmanagedinstanceschedules_client_example_test.go @@ -0,0 +1,286 @@ +//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_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/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StartStopManagedInstanceScheduleList.json +func ExampleStartStopManagedInstanceSchedulesClient_NewListByInstancePager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewStartStopManagedInstanceSchedulesClient().NewListByInstancePager("schedulerg", "schedulemi", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.StartStopManagedInstanceScheduleListResult = armsql.StartStopManagedInstanceScheduleListResult{ + // Value: []*armsql.StartStopManagedInstanceSchedule{ + // { + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/startStopSchedules"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/schedulerg/providers/Microsoft.Sql/managedInstances/schedulemi/startStopSchedules"), + // Properties: &armsql.StartStopManagedInstanceScheduleProperties{ + // Description: to.Ptr("This is a schedule for our Dev/Test environment."), + // NextExecutionTime: to.Ptr("2021-08-26T14:00:00"), + // NextRunAction: to.Ptr("Stop"), + // ScheduleList: []*armsql.ScheduleItem{ + // { + // StartDay: to.Ptr(armsql.DayOfWeekThursday), + // StartTime: to.Ptr("06:00 PM"), + // StopDay: to.Ptr(armsql.DayOfWeekThursday), + // StopTime: to.Ptr("05:00 PM"), + // }, + // { + // StartDay: to.Ptr(armsql.DayOfWeekThursday), + // StartTime: to.Ptr("03:00 PM"), + // StopDay: to.Ptr(armsql.DayOfWeekThursday), + // StopTime: to.Ptr("02:00 PM"), + // }}, + // TimeZoneID: to.Ptr("Central European Standard Time"), + // }, + // SystemData: &armsql.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-26T04:41:33.937Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-27T04:41:33.937Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StartStopManagedInstanceScheduleGet.json +func ExampleStartStopManagedInstanceSchedulesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewStartStopManagedInstanceSchedulesClient().Get(ctx, "schedulerg", "schedulemi", armsql.StartStopScheduleNameDefault, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.StartStopManagedInstanceSchedule = armsql.StartStopManagedInstanceSchedule{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/startStopSchedules"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/schedulerg/providers/Microsoft.Sql/managedInstances/schedulemi/startStopSchedules/default"), + // Properties: &armsql.StartStopManagedInstanceScheduleProperties{ + // Description: to.Ptr("This is a schedule for our Dev/Test environment."), + // NextExecutionTime: to.Ptr("2021-08-26T14:00:00"), + // NextRunAction: to.Ptr("Stop"), + // ScheduleList: []*armsql.ScheduleItem{ + // { + // StartDay: to.Ptr(armsql.DayOfWeekThursday), + // StartTime: to.Ptr("06:00 PM"), + // StopDay: to.Ptr(armsql.DayOfWeekThursday), + // StopTime: to.Ptr("05:00 PM"), + // }, + // { + // StartDay: to.Ptr(armsql.DayOfWeekThursday), + // StartTime: to.Ptr("03:00 PM"), + // StopDay: to.Ptr(armsql.DayOfWeekThursday), + // StopTime: to.Ptr("02:00 PM"), + // }}, + // TimeZoneID: to.Ptr("Central European Standard Time"), + // }, + // SystemData: &armsql.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-26T04:41:33.937Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-27T04:41:33.937Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StartStopManagedInstanceScheduleCreateOrUpdateMax.json +func ExampleStartStopManagedInstanceSchedulesClient_CreateOrUpdate_createsOrUpdatesTheManagedInstancesStartStopScheduleWithAllOptionalParametersSpecified() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewStartStopManagedInstanceSchedulesClient().CreateOrUpdate(ctx, "schedulerg", "schedulemi", armsql.StartStopScheduleNameDefault, armsql.StartStopManagedInstanceSchedule{ + Properties: &armsql.StartStopManagedInstanceScheduleProperties{ + Description: to.Ptr("This is a schedule for our Dev/Test environment."), + ScheduleList: []*armsql.ScheduleItem{ + { + StartDay: to.Ptr(armsql.DayOfWeekThursday), + StartTime: to.Ptr("18:00"), + StopDay: to.Ptr(armsql.DayOfWeekThursday), + StopTime: to.Ptr("17:00"), + }, + { + StartDay: to.Ptr(armsql.DayOfWeekThursday), + StartTime: to.Ptr("15:00"), + StopDay: to.Ptr(armsql.DayOfWeekThursday), + StopTime: to.Ptr("14:00"), + }}, + TimeZoneID: to.Ptr("Central European Standard Time"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.StartStopManagedInstanceSchedule = armsql.StartStopManagedInstanceSchedule{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/startStopSchedules"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/schedulerg/providers/Microsoft.Sql/managedInstances/schedulemi/startStopSchedules/default"), + // Properties: &armsql.StartStopManagedInstanceScheduleProperties{ + // Description: to.Ptr("This is a schedule for our Dev/Test environment."), + // NextExecutionTime: to.Ptr("2021-08-26T14:00:00"), + // NextRunAction: to.Ptr("Stop"), + // ScheduleList: []*armsql.ScheduleItem{ + // { + // StartDay: to.Ptr(armsql.DayOfWeekThursday), + // StartTime: to.Ptr("06:00 PM"), + // StopDay: to.Ptr(armsql.DayOfWeekThursday), + // StopTime: to.Ptr("05:00 PM"), + // }, + // { + // StartDay: to.Ptr(armsql.DayOfWeekThursday), + // StartTime: to.Ptr("03:00 PM"), + // StopDay: to.Ptr(armsql.DayOfWeekThursday), + // StopTime: to.Ptr("02:00 PM"), + // }}, + // TimeZoneID: to.Ptr("Central European Standard Time"), + // }, + // SystemData: &armsql.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-26T04:41:33.937Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-27T04:41:33.937Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StartStopManagedInstanceScheduleCreateOrUpdateMin.json +func ExampleStartStopManagedInstanceSchedulesClient_CreateOrUpdate_createsOrUpdatesTheManagedInstancesStartStopScheduleWithNoOptionalParametersSpecified() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewStartStopManagedInstanceSchedulesClient().CreateOrUpdate(ctx, "schedulerg", "schedulemi", armsql.StartStopScheduleNameDefault, armsql.StartStopManagedInstanceSchedule{ + Properties: &armsql.StartStopManagedInstanceScheduleProperties{ + ScheduleList: []*armsql.ScheduleItem{ + { + StartDay: to.Ptr(armsql.DayOfWeekThursday), + StartTime: to.Ptr("18:00"), + StopDay: to.Ptr(armsql.DayOfWeekThursday), + StopTime: to.Ptr("17:00"), + }, + { + StartDay: to.Ptr(armsql.DayOfWeekThursday), + StartTime: to.Ptr("15:00"), + StopDay: to.Ptr(armsql.DayOfWeekThursday), + StopTime: to.Ptr("14:00"), + }}, + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.StartStopManagedInstanceSchedule = armsql.StartStopManagedInstanceSchedule{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Sql/managedInstances/startStopSchedules"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/schedulerg/providers/Microsoft.Sql/managedInstances/schedulemi/startStopSchedules/default"), + // Properties: &armsql.StartStopManagedInstanceScheduleProperties{ + // Description: to.Ptr(""), + // NextExecutionTime: to.Ptr("2021-08-26T14:00:00"), + // NextRunAction: to.Ptr("Stop"), + // ScheduleList: []*armsql.ScheduleItem{ + // { + // StartDay: to.Ptr(armsql.DayOfWeekThursday), + // StartTime: to.Ptr("06:00 PM"), + // StopDay: to.Ptr(armsql.DayOfWeekThursday), + // StopTime: to.Ptr("05:00 PM"), + // }, + // { + // StartDay: to.Ptr(armsql.DayOfWeekThursday), + // StartTime: to.Ptr("03:00 PM"), + // StopDay: to.Ptr(armsql.DayOfWeekThursday), + // StopTime: to.Ptr("02:00 PM"), + // }}, + // TimeZoneID: to.Ptr("UTC"), + // }, + // SystemData: &armsql.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-26T04:41:33.937Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-27T04:41:33.937Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StartStopManagedInstanceScheduleDelete.json +func ExampleStartStopManagedInstanceSchedulesClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewStartStopManagedInstanceSchedulesClient().Delete(ctx, "schedulerg", "schedulemi", armsql.StartStopScheduleNameDefault, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} diff --git a/sdk/resourcemanager/sql/armsql/subscriptionusages_client.go b/sdk/resourcemanager/sql/armsql/subscriptionusages_client.go index 352e774d3350..529f902d3349 100644 --- a/sdk/resourcemanager/sql/armsql/subscriptionusages_client.go +++ b/sdk/resourcemanager/sql/armsql/subscriptionusages_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -52,18 +51,21 @@ func NewSubscriptionUsagesClient(subscriptionID string, credential azcore.TokenC // - usageName - Name of usage metric to return. // - options - SubscriptionUsagesClientGetOptions contains the optional parameters for the SubscriptionUsagesClient.Get method. func (client *SubscriptionUsagesClient) Get(ctx context.Context, locationName string, usageName string, options *SubscriptionUsagesClientGetOptions) (SubscriptionUsagesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, locationName, usageName, options) if err != nil { return SubscriptionUsagesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SubscriptionUsagesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SubscriptionUsagesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SubscriptionUsagesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/subscriptionusages_client_example_test.go b/sdk/resourcemanager/sql/armsql/subscriptionusages_client_example_test.go index 3b7dae11ec0b..608175d17bb5 100644 --- a/sdk/resourcemanager/sql/armsql/subscriptionusages_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/subscriptionusages_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SubscriptionUsageListByLocation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -78,7 +78,7 @@ func ExampleSubscriptionUsagesClient_NewListByLocationPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SubscriptionUsageGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/synapselinkworkspaces_client.go b/sdk/resourcemanager/sql/armsql/synapselinkworkspaces_client.go new file mode 100644 index 000000000000..6c8196b3b6be --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/synapselinkworkspaces_client.go @@ -0,0 +1,120 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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" +) + +// SynapseLinkWorkspacesClient contains the methods for the SynapseLinkWorkspaces group. +// Don't use this type directly, use NewSynapseLinkWorkspacesClient() instead. +type SynapseLinkWorkspacesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewSynapseLinkWorkspacesClient creates a new instance of SynapseLinkWorkspacesClient 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 NewSynapseLinkWorkspacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SynapseLinkWorkspacesClient, error) { + cl, err := arm.NewClient(moduleName+".SynapseLinkWorkspacesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SynapseLinkWorkspacesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListByDatabasePager - Gets all synapselink workspaces for a database. +// +// Generated from API version 2022-05-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 - SynapseLinkWorkspacesClientListByDatabaseOptions contains the optional parameters for the SynapseLinkWorkspacesClient.NewListByDatabasePager +// method. +func (client *SynapseLinkWorkspacesClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *SynapseLinkWorkspacesClientListByDatabaseOptions) *runtime.Pager[SynapseLinkWorkspacesClientListByDatabaseResponse] { + return runtime.NewPager(runtime.PagingHandler[SynapseLinkWorkspacesClientListByDatabaseResponse]{ + More: func(page SynapseLinkWorkspacesClientListByDatabaseResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SynapseLinkWorkspacesClientListByDatabaseResponse) (SynapseLinkWorkspacesClientListByDatabaseResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByDatabaseCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SynapseLinkWorkspacesClientListByDatabaseResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SynapseLinkWorkspacesClientListByDatabaseResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SynapseLinkWorkspacesClientListByDatabaseResponse{}, runtime.NewResponseError(resp) + } + return client.listByDatabaseHandleResponse(resp) + }, + }) +} + +// listByDatabaseCreateRequest creates the ListByDatabase request. +func (client *SynapseLinkWorkspacesClient) listByDatabaseCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *SynapseLinkWorkspacesClientListByDatabaseOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/linkWorkspaces" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-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 *SynapseLinkWorkspacesClient) listByDatabaseHandleResponse(resp *http.Response) (SynapseLinkWorkspacesClientListByDatabaseResponse, error) { + result := SynapseLinkWorkspacesClientListByDatabaseResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SynapseLinkWorkspaceListResult); err != nil { + return SynapseLinkWorkspacesClientListByDatabaseResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/synapselinkworkspaces_client_example_test.go b/sdk/resourcemanager/sql/armsql/synapselinkworkspaces_client_example_test.go new file mode 100644 index 000000000000..51457eda9c43 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/synapselinkworkspaces_client_example_test.go @@ -0,0 +1,62 @@ +//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_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/SynapseLinkWorkspaceListByDatabase.json +func ExampleSynapseLinkWorkspacesClient_NewListByDatabasePager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewSynapseLinkWorkspacesClient().NewListByDatabasePager("Default-SQL-SouthEastAsia", "testsvr", "dbSynapse", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.SynapseLinkWorkspaceListResult = armsql.SynapseLinkWorkspaceListResult{ + // Value: []*armsql.SynapseLinkWorkspace{ + // { + // Name: to.Ptr("current"), + // Type: to.Ptr("Microsoft.Sql/servers/databases/linkWorkspaces"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/dbSynapse/linkWorkspaces/current"), + // Properties: &armsql.SynapseLinkWorkspaceProperties{ + // Workspaces: []*armsql.SynapseLinkWorkspaceInfoProperties{ + // { + // LinkConnectionName: to.Ptr("buildlink-cloud1"), + // WorkspaceID: to.Ptr("/subcriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.Synapse/workspaces/workspace1"), + // }, + // { + // LinkConnectionName: to.Ptr("buildlink-cloud2"), + // WorkspaceID: to.Ptr("/subcriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.Synapse/workspaces/workspace2"), + // }}, + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/sql/armsql/syncagents_client.go b/sdk/resourcemanager/sql/armsql/syncagents_client.go index 9343428a7478..38304d711dd8 100644 --- a/sdk/resourcemanager/sql/armsql/syncagents_client.go +++ b/sdk/resourcemanager/sql/armsql/syncagents_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -61,7 +60,8 @@ func (client *SyncAgentsClient) BeginCreateOrUpdate(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller[SyncAgentsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[SyncAgentsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[SyncAgentsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *SyncAgentsClient) BeginCreateOrUpdate(ctx context.Context, resourc // // Generated from API version 2020-11-01-preview func (client *SyncAgentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string, parameters SyncAgent, options *SyncAgentsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, syncAgentName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -113,7 +115,10 @@ func (client *SyncAgentsClient) createOrUpdateCreateRequest(ctx context.Context, reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a sync agent. @@ -131,7 +136,8 @@ func (client *SyncAgentsClient) BeginDelete(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller[SyncAgentsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[SyncAgentsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[SyncAgentsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -142,18 +148,20 @@ func (client *SyncAgentsClient) BeginDelete(ctx context.Context, resourceGroupNa // // Generated from API version 2020-11-01-preview func (client *SyncAgentsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string, options *SyncAgentsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, syncAgentName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -195,18 +203,21 @@ func (client *SyncAgentsClient) deleteCreateRequest(ctx context.Context, resourc // - syncAgentName - The name of the sync agent. // - options - SyncAgentsClientGenerateKeyOptions contains the optional parameters for the SyncAgentsClient.GenerateKey method. func (client *SyncAgentsClient) GenerateKey(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string, options *SyncAgentsClientGenerateKeyOptions) (SyncAgentsClientGenerateKeyResponse, error) { + var err error req, err := client.generateKeyCreateRequest(ctx, resourceGroupName, serverName, syncAgentName, options) if err != nil { return SyncAgentsClientGenerateKeyResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SyncAgentsClientGenerateKeyResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SyncAgentsClientGenerateKeyResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SyncAgentsClientGenerateKeyResponse{}, err } - return client.generateKeyHandleResponse(resp) + resp, err := client.generateKeyHandleResponse(httpResp) + return resp, err } // generateKeyCreateRequest creates the GenerateKey request. @@ -258,18 +269,21 @@ func (client *SyncAgentsClient) generateKeyHandleResponse(resp *http.Response) ( // - syncAgentName - The name of the sync agent. // - options - SyncAgentsClientGetOptions contains the optional parameters for the SyncAgentsClient.Get method. func (client *SyncAgentsClient) Get(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string, options *SyncAgentsClientGetOptions) (SyncAgentsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, syncAgentName, options) if err != nil { return SyncAgentsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SyncAgentsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SyncAgentsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SyncAgentsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/syncagents_client_example_test.go b/sdk/resourcemanager/sql/armsql/syncagents_client_example_test.go index 17bdae791bfc..e4a6ae8ba48f 100644 --- a/sdk/resourcemanager/sql/armsql/syncagents_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/syncagents_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -50,7 +50,7 @@ func ExampleSyncAgentsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentCreate.json func ExampleSyncAgentsClient_BeginCreateOrUpdate_createANewSyncAgent() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -90,7 +90,7 @@ func ExampleSyncAgentsClient_BeginCreateOrUpdate_createANewSyncAgent() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentUpdate.json func ExampleSyncAgentsClient_BeginCreateOrUpdate_updateASyncAgent() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -130,7 +130,7 @@ func ExampleSyncAgentsClient_BeginCreateOrUpdate_updateASyncAgent() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -151,7 +151,7 @@ func ExampleSyncAgentsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentListByServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -191,7 +191,7 @@ func ExampleSyncAgentsClient_NewListByServerPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentGenerateKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -214,7 +214,7 @@ func ExampleSyncAgentsClient_GenerateKey() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentGetLinkedDatabases.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/syncgroups_client.go b/sdk/resourcemanager/sql/armsql/syncgroups_client.go index 58c567bc1286..a32adedfe74b 100644 --- a/sdk/resourcemanager/sql/armsql/syncgroups_client.go +++ b/sdk/resourcemanager/sql/armsql/syncgroups_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -55,16 +54,18 @@ func NewSyncGroupsClient(subscriptionID string, credential azcore.TokenCredentia // - syncGroupName - The name of the sync group. // - options - SyncGroupsClientCancelSyncOptions contains the optional parameters for the SyncGroupsClient.CancelSync method. func (client *SyncGroupsClient) CancelSync(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientCancelSyncOptions) (SyncGroupsClientCancelSyncResponse, error) { + var err error req, err := client.cancelSyncCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, options) if err != nil { return SyncGroupsClientCancelSyncResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SyncGroupsClientCancelSyncResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SyncGroupsClientCancelSyncResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SyncGroupsClientCancelSyncResponse{}, err } return SyncGroupsClientCancelSyncResponse{}, nil } @@ -120,7 +121,8 @@ func (client *SyncGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller[SyncGroupsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[SyncGroupsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[SyncGroupsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -131,18 +133,20 @@ func (client *SyncGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourc // // Generated from API version 2020-11-01-preview func (client *SyncGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters SyncGroup, options *SyncGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -176,7 +180,10 @@ func (client *SyncGroupsClient) createOrUpdateCreateRequest(ctx context.Context, reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a sync group. @@ -195,7 +202,8 @@ func (client *SyncGroupsClient) BeginDelete(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller[SyncGroupsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[SyncGroupsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[SyncGroupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -206,18 +214,20 @@ func (client *SyncGroupsClient) BeginDelete(ctx context.Context, resourceGroupNa // // Generated from API version 2020-11-01-preview func (client *SyncGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -264,18 +274,21 @@ func (client *SyncGroupsClient) deleteCreateRequest(ctx context.Context, resourc // - syncGroupName - The name of the sync group. // - options - SyncGroupsClientGetOptions contains the optional parameters for the SyncGroupsClient.Get method. func (client *SyncGroupsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientGetOptions) (SyncGroupsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, options) if err != nil { return SyncGroupsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SyncGroupsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SyncGroupsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SyncGroupsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -649,7 +662,8 @@ func (client *SyncGroupsClient) BeginRefreshHubSchema(ctx context.Context, resou if err != nil { return nil, err } - return runtime.NewPoller[SyncGroupsClientRefreshHubSchemaResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[SyncGroupsClientRefreshHubSchemaResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[SyncGroupsClientRefreshHubSchemaResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -660,18 +674,20 @@ func (client *SyncGroupsClient) BeginRefreshHubSchema(ctx context.Context, resou // // Generated from API version 2020-11-01-preview func (client *SyncGroupsClient) refreshHubSchema(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientBeginRefreshHubSchemaOptions) (*http.Response, error) { + var err error req, err := client.refreshHubSchemaCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // refreshHubSchemaCreateRequest creates the RefreshHubSchema request. @@ -718,16 +734,18 @@ func (client *SyncGroupsClient) refreshHubSchemaCreateRequest(ctx context.Contex // - syncGroupName - The name of the sync group. // - options - SyncGroupsClientTriggerSyncOptions contains the optional parameters for the SyncGroupsClient.TriggerSync method. func (client *SyncGroupsClient) TriggerSync(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientTriggerSyncOptions) (SyncGroupsClientTriggerSyncResponse, error) { + var err error req, err := client.triggerSyncCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, options) if err != nil { return SyncGroupsClientTriggerSyncResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SyncGroupsClientTriggerSyncResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SyncGroupsClientTriggerSyncResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SyncGroupsClientTriggerSyncResponse{}, err } return SyncGroupsClientTriggerSyncResponse{}, nil } @@ -782,7 +800,8 @@ func (client *SyncGroupsClient) BeginUpdate(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller[SyncGroupsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[SyncGroupsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[SyncGroupsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -793,18 +812,20 @@ func (client *SyncGroupsClient) BeginUpdate(ctx context.Context, resourceGroupNa // // Generated from API version 2020-11-01-preview func (client *SyncGroupsClient) update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters SyncGroup, options *SyncGroupsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -838,5 +859,8 @@ func (client *SyncGroupsClient) updateCreateRequest(ctx context.Context, resourc reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/syncgroups_client_example_test.go b/sdk/resourcemanager/sql/armsql/syncgroups_client_example_test.go index cf0d6ae1e39f..e9f037102780 100644 --- a/sdk/resourcemanager/sql/armsql/syncgroups_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/syncgroups_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGetSyncDatabaseId.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGetSyncDatabaseId.json func ExampleSyncGroupsClient_NewListSyncDatabaseIDsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -49,7 +49,7 @@ func ExampleSyncGroupsClient_NewListSyncDatabaseIDsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupRefreshHubSchema.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -70,7 +70,7 @@ func ExampleSyncGroupsClient_BeginRefreshHubSchema() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGetHubSchema.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -125,7 +125,7 @@ func ExampleSyncGroupsClient_NewListHubSchemasPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGetLog.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -169,7 +169,7 @@ func ExampleSyncGroupsClient_NewListLogsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupCancelSync.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -186,7 +186,7 @@ func ExampleSyncGroupsClient_CancelSync() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupTriggerSync.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -203,7 +203,7 @@ func ExampleSyncGroupsClient_TriggerSync() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -238,7 +238,7 @@ func ExampleSyncGroupsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupCreate.json func ExampleSyncGroupsClient_BeginCreateOrUpdate_createASyncGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -285,7 +285,7 @@ func ExampleSyncGroupsClient_BeginCreateOrUpdate_createASyncGroup() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupUpdate.json func ExampleSyncGroupsClient_BeginCreateOrUpdate_updateASyncGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -332,7 +332,7 @@ func ExampleSyncGroupsClient_BeginCreateOrUpdate_updateASyncGroup() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -353,7 +353,7 @@ func ExampleSyncGroupsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupPatch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -401,7 +401,7 @@ func ExampleSyncGroupsClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupListByDatabase.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/syncmembers_client.go b/sdk/resourcemanager/sql/armsql/syncmembers_client.go index 8b65f9494d67..6c4e9c7da081 100644 --- a/sdk/resourcemanager/sql/armsql/syncmembers_client.go +++ b/sdk/resourcemanager/sql/armsql/syncmembers_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -63,7 +62,8 @@ func (client *SyncMembersClient) BeginCreateOrUpdate(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller[SyncMembersClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[SyncMembersClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[SyncMembersClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -74,18 +74,20 @@ func (client *SyncMembersClient) BeginCreateOrUpdate(ctx context.Context, resour // // Generated from API version 2020-11-01-preview func (client *SyncMembersClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters SyncMember, options *SyncMembersClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -123,7 +125,10 @@ func (client *SyncMembersClient) createOrUpdateCreateRequest(ctx context.Context reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a sync member. @@ -143,7 +148,8 @@ func (client *SyncMembersClient) BeginDelete(ctx context.Context, resourceGroupN if err != nil { return nil, err } - return runtime.NewPoller[SyncMembersClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[SyncMembersClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[SyncMembersClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -154,18 +160,20 @@ func (client *SyncMembersClient) BeginDelete(ctx context.Context, resourceGroupN // // Generated from API version 2020-11-01-preview func (client *SyncMembersClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, options *SyncMembersClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -217,18 +225,21 @@ func (client *SyncMembersClient) deleteCreateRequest(ctx context.Context, resour // - syncMemberName - The name of the sync member. // - options - SyncMembersClientGetOptions contains the optional parameters for the SyncMembersClient.Get method. func (client *SyncMembersClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, options *SyncMembersClientGetOptions) (SyncMembersClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, options) if err != nil { return SyncMembersClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SyncMembersClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SyncMembersClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SyncMembersClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -463,7 +474,8 @@ func (client *SyncMembersClient) BeginRefreshMemberSchema(ctx context.Context, r if err != nil { return nil, err } - return runtime.NewPoller[SyncMembersClientRefreshMemberSchemaResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[SyncMembersClientRefreshMemberSchemaResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[SyncMembersClientRefreshMemberSchemaResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -474,18 +486,20 @@ func (client *SyncMembersClient) BeginRefreshMemberSchema(ctx context.Context, r // // Generated from API version 2020-11-01-preview func (client *SyncMembersClient) refreshMemberSchema(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, options *SyncMembersClientBeginRefreshMemberSchemaOptions) (*http.Response, error) { + var err error req, err := client.refreshMemberSchemaCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // refreshMemberSchemaCreateRequest creates the RefreshMemberSchema request. @@ -543,7 +557,8 @@ func (client *SyncMembersClient) BeginUpdate(ctx context.Context, resourceGroupN if err != nil { return nil, err } - return runtime.NewPoller[SyncMembersClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[SyncMembersClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[SyncMembersClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -554,18 +569,20 @@ func (client *SyncMembersClient) BeginUpdate(ctx context.Context, resourceGroupN // // Generated from API version 2020-11-01-preview func (client *SyncMembersClient) update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters SyncMember, options *SyncMembersClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -603,5 +620,8 @@ func (client *SyncMembersClient) updateCreateRequest(ctx context.Context, resour reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/syncmembers_client_example_test.go b/sdk/resourcemanager/sql/armsql/syncmembers_client_example_test.go index 32f78f3accfe..83a2dae0b99c 100644 --- a/sdk/resourcemanager/sql/armsql/syncmembers_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/syncmembers_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -54,7 +54,7 @@ func ExampleSyncMembersClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberCreate.json func ExampleSyncMembersClient_BeginCreateOrUpdate_createANewSyncMember() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -104,7 +104,7 @@ func ExampleSyncMembersClient_BeginCreateOrUpdate_createANewSyncMember() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberUpdate.json func ExampleSyncMembersClient_BeginCreateOrUpdate_updateASyncMember() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -154,7 +154,7 @@ func ExampleSyncMembersClient_BeginCreateOrUpdate_updateASyncMember() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -175,7 +175,7 @@ func ExampleSyncMembersClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberPatch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -225,7 +225,7 @@ func ExampleSyncMembersClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberListBySyncGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -269,7 +269,7 @@ func ExampleSyncMembersClient_NewListBySyncGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberGetSchema.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -324,7 +324,7 @@ func ExampleSyncMembersClient_NewListMemberSchemasPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberRefreshSchema.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/tdecertificates_client.go b/sdk/resourcemanager/sql/armsql/tdecertificates_client.go index 2a0c45c4c221..263e81fbe1b1 100644 --- a/sdk/resourcemanager/sql/armsql/tdecertificates_client.go +++ b/sdk/resourcemanager/sql/armsql/tdecertificates_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -60,7 +59,8 @@ func (client *TdeCertificatesClient) BeginCreate(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller[TdeCertificatesClientCreateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[TdeCertificatesClientCreateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[TdeCertificatesClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,18 +71,20 @@ func (client *TdeCertificatesClient) BeginCreate(ctx context.Context, resourceGr // // Generated from API version 2020-11-01-preview func (client *TdeCertificatesClient) create(ctx context.Context, resourceGroupName string, serverName string, parameters TdeCertificate, options *TdeCertificatesClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, serverName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -107,5 +109,8 @@ func (client *TdeCertificatesClient) createCreateRequest(ctx context.Context, re reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/tdecertificates_client_example_test.go b/sdk/resourcemanager/sql/armsql/tdecertificates_client_example_test.go index 552abf2f4ccf..f5c163a00af6 100644 --- a/sdk/resourcemanager/sql/armsql/tdecertificates_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/tdecertificates_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SqlTdeCertificateCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/time_rfc3339.go b/sdk/resourcemanager/sql/armsql/time_rfc3339.go index 65cedb7496c1..8361df297f10 100644 --- a/sdk/resourcemanager/sql/armsql/time_rfc3339.go +++ b/sdk/resourcemanager/sql/armsql/time_rfc3339.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // 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/timezones_client.go b/sdk/resourcemanager/sql/armsql/timezones_client.go index 2baabf47a468..c352a00b7308 100644 --- a/sdk/resourcemanager/sql/armsql/timezones_client.go +++ b/sdk/resourcemanager/sql/armsql/timezones_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -50,18 +49,21 @@ func NewTimeZonesClient(subscriptionID string, credential azcore.TokenCredential // Generated from API version 2020-11-01-preview // - options - TimeZonesClientGetOptions contains the optional parameters for the TimeZonesClient.Get method. func (client *TimeZonesClient) Get(ctx context.Context, locationName string, timeZoneID string, options *TimeZonesClientGetOptions) (TimeZonesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, locationName, timeZoneID, options) if err != nil { return TimeZonesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TimeZonesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TimeZonesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TimeZonesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/timezones_client_example_test.go b/sdk/resourcemanager/sql/armsql/timezones_client_example_test.go index 42a3610b511e..e15b6c4ffab4 100644 --- a/sdk/resourcemanager/sql/armsql/timezones_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/timezones_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceTimeZoneListByLocation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -262,7 +262,7 @@ func ExampleTimeZonesClient_NewListByLocationPager() { // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Central Asia Standard Time"), // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+06:00) Astana"), + // DisplayName: to.Ptr("(UTC+06:00) Nur-Sultan"), // TimeZoneID: to.Ptr("Central Asia Standard Time"), // }, // }, @@ -1296,7 +1296,7 @@ func ExampleTimeZonesClient_NewListByLocationPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceTimeZoneGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/transparentdataencryptions_client.go b/sdk/resourcemanager/sql/armsql/transparentdataencryptions_client.go index ec6c69a8a0f9..da948c29ce3a 100644 --- a/sdk/resourcemanager/sql/armsql/transparentdataencryptions_client.go +++ b/sdk/resourcemanager/sql/armsql/transparentdataencryptions_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -44,35 +43,56 @@ func NewTransparentDataEncryptionsClient(subscriptionID string, credential azcor return client, nil } -// CreateOrUpdate - Updates a logical database's transparent data encryption configuration. +// BeginCreateOrUpdate - Updates a logical database's transparent data encryption configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2022-08-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 logical database for which the security alert policy is defined. // - tdeName - The name of the transparent data encryption configuration. // - parameters - The database transparent data encryption. -// - options - TransparentDataEncryptionsClientCreateOrUpdateOptions contains the optional parameters for the TransparentDataEncryptionsClient.CreateOrUpdate +// - options - TransparentDataEncryptionsClientBeginCreateOrUpdateOptions contains the optional parameters for the TransparentDataEncryptionsClient.BeginCreateOrUpdate // method. -func (client *TransparentDataEncryptionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, tdeName TransparentDataEncryptionName, parameters LogicalDatabaseTransparentDataEncryption, options *TransparentDataEncryptionsClientCreateOrUpdateOptions) (TransparentDataEncryptionsClientCreateOrUpdateResponse, error) { +func (client *TransparentDataEncryptionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, tdeName TransparentDataEncryptionName, parameters LogicalDatabaseTransparentDataEncryption, options *TransparentDataEncryptionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[TransparentDataEncryptionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, databaseName, tdeName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TransparentDataEncryptionsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[TransparentDataEncryptionsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Updates a logical database's transparent data encryption configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01-preview +func (client *TransparentDataEncryptionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, tdeName TransparentDataEncryptionName, parameters LogicalDatabaseTransparentDataEncryption, options *TransparentDataEncryptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, tdeName, parameters, options) if err != nil { - return TransparentDataEncryptionsClientCreateOrUpdateResponse{}, err + return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return TransparentDataEncryptionsClientCreateOrUpdateResponse{}, err + return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return TransparentDataEncryptionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return client.createOrUpdateHandleResponse(resp) + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *TransparentDataEncryptionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, tdeName TransparentDataEncryptionName, parameters LogicalDatabaseTransparentDataEncryption, options *TransparentDataEncryptionsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *TransparentDataEncryptionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, tdeName TransparentDataEncryptionName, parameters LogicalDatabaseTransparentDataEncryption, options *TransparentDataEncryptionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -99,25 +119,19 @@ func (client *TransparentDataEncryptionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-08-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 *TransparentDataEncryptionsClient) createOrUpdateHandleResponse(resp *http.Response) (TransparentDataEncryptionsClientCreateOrUpdateResponse, error) { - result := TransparentDataEncryptionsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.LogicalDatabaseTransparentDataEncryption); err != nil { - return TransparentDataEncryptionsClientCreateOrUpdateResponse{}, err + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err } - return result, nil + return req, nil } // Get - Gets a logical database's transparent data encryption. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2022-08-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. @@ -126,18 +140,21 @@ func (client *TransparentDataEncryptionsClient) createOrUpdateHandleResponse(res // - options - TransparentDataEncryptionsClientGetOptions contains the optional parameters for the TransparentDataEncryptionsClient.Get // method. func (client *TransparentDataEncryptionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, tdeName TransparentDataEncryptionName, options *TransparentDataEncryptionsClientGetOptions) (TransparentDataEncryptionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, tdeName, options) if err != nil { return TransparentDataEncryptionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TransparentDataEncryptionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TransparentDataEncryptionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TransparentDataEncryptionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -168,7 +185,7 @@ func (client *TransparentDataEncryptionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -185,7 +202,7 @@ func (client *TransparentDataEncryptionsClient) getHandleResponse(resp *http.Res // NewListByDatabasePager - Gets a list of the logical database's transparent data encryption. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2022-08-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. @@ -244,7 +261,7 @@ func (client *TransparentDataEncryptionsClient) listByDatabaseCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-08-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/transparentdataencryptions_client_example_test.go b/sdk/resourcemanager/sql/armsql/transparentdataencryptions_client_example_test.go index 30d0d0e4f410..0112f950287a 100644 --- a/sdk/resourcemanager/sql/armsql/transparentdataencryptions_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/transparentdataencryptions_client_example_test.go @@ -15,10 +15,46 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/TransparentDataEncryptionGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-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() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewTransparentDataEncryptionsClient().NewListByDatabasePager("security-tde-resourcegroup", "securitytde", "testdb", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.LogicalDatabaseTransparentDataEncryptionListResult = armsql.LogicalDatabaseTransparentDataEncryptionListResult{ + // Value: []*armsql.LogicalDatabaseTransparentDataEncryption{ + // { + // Name: to.Ptr("current"), + // Type: to.Ptr("Microsoft.Sql/servers/databases/transparentDataEncryption"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/security-tde-resourcegroup/providers/Microsoft.Sql/servers/securitytde/databases/testdb"), + // Properties: &armsql.TransparentDataEncryptionProperties{ + // State: to.Ptr(armsql.TransparentDataEncryptionStateEnabled), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/TransparentDataEncryptionGet.json func ExampleTransparentDataEncryptionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -46,8 +82,8 @@ func ExampleTransparentDataEncryptionsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/TransparentDataEncryptionUpdate.json -func ExampleTransparentDataEncryptionsClient_CreateOrUpdate() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/TransparentDataEncryptionUpdate.json +func ExampleTransparentDataEncryptionsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -57,7 +93,7 @@ func ExampleTransparentDataEncryptionsClient_CreateOrUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewTransparentDataEncryptionsClient().CreateOrUpdate(ctx, "securitytde-42-rg", "securitytde-42", "testdb", armsql.TransparentDataEncryptionNameCurrent, armsql.LogicalDatabaseTransparentDataEncryption{ + poller, err := clientFactory.NewTransparentDataEncryptionsClient().BeginCreateOrUpdate(ctx, "securitytde-42-rg", "securitytde-42", "testdb", armsql.TransparentDataEncryptionNameCurrent, armsql.LogicalDatabaseTransparentDataEncryption{ Properties: &armsql.TransparentDataEncryptionProperties{ State: to.Ptr(armsql.TransparentDataEncryptionStateEnabled), }, @@ -65,6 +101,10 @@ func ExampleTransparentDataEncryptionsClient_CreateOrUpdate() { 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) + } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. @@ -77,39 +117,3 @@ func ExampleTransparentDataEncryptionsClient_CreateOrUpdate() { // }, // } } - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/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() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTransparentDataEncryptionsClient().NewListByDatabasePager("security-tde-resourcegroup", "securitytde", "testdb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LogicalDatabaseTransparentDataEncryptionListResult = armsql.LogicalDatabaseTransparentDataEncryptionListResult{ - // Value: []*armsql.LogicalDatabaseTransparentDataEncryption{ - // { - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/transparentDataEncryption"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/security-tde-resourcegroup/providers/Microsoft.Sql/servers/securitytde/databases/testdb"), - // Properties: &armsql.TransparentDataEncryptionProperties{ - // State: to.Ptr(armsql.TransparentDataEncryptionStateEnabled), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/usages_client.go b/sdk/resourcemanager/sql/armsql/usages_client.go index d21892171248..530bb3958bb2 100644 --- a/sdk/resourcemanager/sql/armsql/usages_client.go +++ b/sdk/resourcemanager/sql/armsql/usages_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // 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/usages_client_example_test.go b/sdk/resourcemanager/sql/armsql/usages_client_example_test.go index 09525ae64eb8..559b7859a439 100644 --- a/sdk/resourcemanager/sql/armsql/usages_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/usages_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListInstancePoolUsageExpanded.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListInstancePoolUsageExpanded.json func ExampleUsagesClient_NewListByInstancePoolPager_listInstancePoolUsagesExpandedWithChildren() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -144,7 +144,7 @@ func ExampleUsagesClient_NewListByInstancePoolPager_listInstancePoolUsagesExpand } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListInstancePoolUsage.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListInstancePoolUsage.json func ExampleUsagesClient_NewListByInstancePoolPager_listInstancePoolUsages() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/sql/armsql/virtualclusters_client.go b/sdk/resourcemanager/sql/armsql/virtualclusters_client.go index 15a736d32e53..14c256a612ed 100644 --- a/sdk/resourcemanager/sql/armsql/virtualclusters_client.go +++ b/sdk/resourcemanager/sql/armsql/virtualclusters_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -47,7 +46,7 @@ func NewVirtualClustersClient(subscriptionID string, credential azcore.TokenCred // BeginDelete - Deletes a virtual cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-05-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. // - virtualClusterName - The name of the virtual cluster. @@ -59,7 +58,8 @@ func (client *VirtualClustersClient) BeginDelete(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller[VirtualClustersClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[VirtualClustersClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[VirtualClustersClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -68,20 +68,22 @@ func (client *VirtualClustersClient) BeginDelete(ctx context.Context, resourceGr // Delete - Deletes a virtual cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-05-01-preview func (client *VirtualClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualClusterName string, options *VirtualClustersClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualClusterName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -104,7 +106,7 @@ func (client *VirtualClustersClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -112,24 +114,27 @@ func (client *VirtualClustersClient) deleteCreateRequest(ctx context.Context, re // Get - Gets a virtual cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-05-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. // - virtualClusterName - The name of the virtual cluster. // - options - VirtualClustersClientGetOptions contains the optional parameters for the VirtualClustersClient.Get method. func (client *VirtualClustersClient) Get(ctx context.Context, resourceGroupName string, virtualClusterName string, options *VirtualClustersClientGetOptions) (VirtualClustersClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, virtualClusterName, options) if err != nil { return VirtualClustersClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return VirtualClustersClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualClustersClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return VirtualClustersClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -152,7 +157,7 @@ func (client *VirtualClustersClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -169,7 +174,7 @@ func (client *VirtualClustersClient) getHandleResponse(resp *http.Response) (Vir // NewListPager - Gets a list of all virtualClusters in the subscription. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-05-01-preview // - options - VirtualClustersClientListOptions contains the optional parameters for the VirtualClustersClient.NewListPager // method. func (client *VirtualClustersClient) NewListPager(options *VirtualClustersClientListOptions) *runtime.Pager[VirtualClustersClientListResponse] { @@ -212,7 +217,7 @@ func (client *VirtualClustersClient) listCreateRequest(ctx context.Context, opti return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -229,7 +234,7 @@ func (client *VirtualClustersClient) listHandleResponse(resp *http.Response) (Vi // NewListByResourceGroupPager - Gets a list of virtual clusters in a resource group. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-05-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. // - options - VirtualClustersClientListByResourceGroupOptions contains the optional parameters for the VirtualClustersClient.NewListByResourceGroupPager @@ -278,7 +283,7 @@ func (client *VirtualClustersClient) listByResourceGroupCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -293,10 +298,10 @@ func (client *VirtualClustersClient) listByResourceGroupHandleResponse(resp *htt return result, nil } -// BeginUpdate - Updates a virtual cluster. +// BeginUpdate - Updates an existing virtual cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-05-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. // - virtualClusterName - The name of the virtual cluster. @@ -309,29 +314,32 @@ func (client *VirtualClustersClient) BeginUpdate(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller[VirtualClustersClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[VirtualClustersClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[VirtualClustersClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } -// Update - Updates a virtual cluster. +// Update - Updates an existing virtual cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-05-01-preview func (client *VirtualClustersClient) update(ctx context.Context, resourceGroupName string, virtualClusterName string, parameters VirtualClusterUpdate, options *VirtualClustersClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, virtualClusterName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -354,38 +362,60 @@ func (client *VirtualClustersClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } -// UpdateDNSServers - Synchronizes the DNS server settings used by the managed instances inside the given virtual cluster. +// BeginUpdateDNSServers - Synchronizes the DNS server settings used by the managed instances inside the given virtual cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2022-05-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. // - virtualClusterName - The name of the virtual cluster. -// - options - VirtualClustersClientUpdateDNSServersOptions contains the optional parameters for the VirtualClustersClient.UpdateDNSServers +// - options - VirtualClustersClientBeginUpdateDNSServersOptions contains the optional parameters for the VirtualClustersClient.BeginUpdateDNSServers // method. -func (client *VirtualClustersClient) UpdateDNSServers(ctx context.Context, resourceGroupName string, virtualClusterName string, options *VirtualClustersClientUpdateDNSServersOptions) (VirtualClustersClientUpdateDNSServersResponse, error) { +func (client *VirtualClustersClient) BeginUpdateDNSServers(ctx context.Context, resourceGroupName string, virtualClusterName string, options *VirtualClustersClientBeginUpdateDNSServersOptions) (*runtime.Poller[VirtualClustersClientUpdateDNSServersResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateDNSServers(ctx, resourceGroupName, virtualClusterName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller[VirtualClustersClientUpdateDNSServersResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[VirtualClustersClientUpdateDNSServersResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// UpdateDNSServers - Synchronizes the DNS server settings used by the managed instances inside the given virtual cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-05-01-preview +func (client *VirtualClustersClient) updateDNSServers(ctx context.Context, resourceGroupName string, virtualClusterName string, options *VirtualClustersClientBeginUpdateDNSServersOptions) (*http.Response, error) { + var err error req, err := client.updateDNSServersCreateRequest(ctx, resourceGroupName, virtualClusterName, options) if err != nil { - return VirtualClustersClientUpdateDNSServersResponse{}, err + return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return VirtualClustersClientUpdateDNSServersResponse{}, err + return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualClustersClientUpdateDNSServersResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return client.updateDNSServersHandleResponse(resp) + return httpResp, nil } // updateDNSServersCreateRequest creates the UpdateDNSServers request. -func (client *VirtualClustersClient) updateDNSServersCreateRequest(ctx context.Context, resourceGroupName string, virtualClusterName string, options *VirtualClustersClientUpdateDNSServersOptions) (*policy.Request, error) { +func (client *VirtualClustersClient) updateDNSServersCreateRequest(ctx context.Context, resourceGroupName string, virtualClusterName string, options *VirtualClustersClientBeginUpdateDNSServersOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}/updateManagedInstanceDnsServers" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -404,17 +434,8 @@ func (client *VirtualClustersClient) updateDNSServersCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } - -// updateDNSServersHandleResponse handles the UpdateDNSServers response. -func (client *VirtualClustersClient) updateDNSServersHandleResponse(resp *http.Response) (VirtualClustersClientUpdateDNSServersResponse, error) { - result := VirtualClustersClientUpdateDNSServersResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.UpdateManagedInstanceDNSServersOperation); err != nil { - return VirtualClustersClientUpdateDNSServersResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/sql/armsql/virtualclusters_client_example_test.go b/sdk/resourcemanager/sql/armsql/virtualclusters_client_example_test.go index d705f6c41faf..ec33811490a7 100644 --- a/sdk/resourcemanager/sql/armsql/virtualclusters_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/virtualclusters_client_example_test.go @@ -15,36 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateManagedInstanceDnsServers.json -func ExampleVirtualClustersClient_UpdateDNSServers() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualClustersClient().UpdateDNSServers(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.UpdateManagedInstanceDNSServersOperation = armsql.UpdateManagedInstanceDNSServersOperation{ - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/test-rg/providers/Microsoft.Sql/virtualClusters/test-virtualcluster/updateManagedInstanceDnsServers"), - // Properties: &armsql.DNSRefreshConfigurationProperties{ - // Status: to.Ptr(armsql.DNSRefreshConfigurationPropertiesStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualClusterList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterList.json func ExampleVirtualClustersClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -69,38 +43,47 @@ func ExampleVirtualClustersClient_NewListPager() { // page.VirtualClusterListResult = armsql.VirtualClusterListResult{ // Value: []*armsql.VirtualCluster{ // { - // Name: to.Ptr("vc-subnet1-f769ed71-b3ad-491a-a9d5-26eeceaa6be2"), + // Name: to.Ptr("VirtualClustercltest"), // Type: to.Ptr("Microsoft.Sql/virtualClusters"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-subnet1-f769ed71-b3ad-491a-a9d5-26eeceaa6be2"), - // Location: to.Ptr("onebox"), + // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/VirtualClustercltest"), + // Location: to.Ptr("japaneast"), // Properties: &armsql.VirtualClusterProperties{ // ChildResources: []*string{ - // to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance1"), - // to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance2")}, - // Family: to.Ptr("Gen4"), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/ab0e51c0-83c0-4380-8ae9-025516df392f/resourceGroups/Federation/providers/Microsoft.Maintenance/maintenanceConfigurations/MiPolicy1"), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl")}, + // SubnetID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/cltest"), + // Version: to.Ptr("1.0"), + // }, + // }, + // { + // Name: to.Ptr("vc2"), + // Type: to.Ptr("Microsoft.Sql/virtualClusters"), + // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc2"), + // Location: to.Ptr("japaneast"), + // Properties: &armsql.VirtualClusterProperties{ + // ChildResources: []*string{ + // }, + // SubnetID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/cltest2"), + // Version: to.Ptr("2.0"), // }, // }, // { - // Name: to.Ptr("vc-subnet1-14b795bd-9c8f-46ec-adb8-2b8eff56ac16"), + // Name: to.Ptr("vc1"), // Type: to.Ptr("Microsoft.Sql/virtualClusters"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-subnet2-14b795bd-9c8f-46ec-adb8-2b8eff56ac16"), - // Location: to.Ptr("onebox"), + // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc1"), + // Location: to.Ptr("japaneast"), // Properties: &armsql.VirtualClusterProperties{ // ChildResources: []*string{ - // to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance3"), - // to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance4")}, - // Family: to.Ptr("Gen5"), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/ab0e51c0-83c0-4380-8ae9-025516df392f/resourceGroups/Federation/providers/Microsoft.Maintenance/maintenanceConfigurations/MiPolicy1"), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/subnet2"), + // to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl"), + // to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/mi")}, + // SubnetID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/cltest"), + // Version: to.Ptr("2.0"), // }, // }}, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualClusterListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterListByResourceGroup.json func ExampleVirtualClustersClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -125,38 +108,50 @@ func ExampleVirtualClustersClient_NewListByResourceGroupPager() { // page.VirtualClusterListResult = armsql.VirtualClusterListResult{ // Value: []*armsql.VirtualCluster{ // { - // Name: to.Ptr("vc-subnet1-f769ed71-b3ad-491a-a9d5-26eeceaa6be2"), + // Name: to.Ptr("VirtualClustercltest"), // Type: to.Ptr("Microsoft.Sql/virtualClusters"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-subnet1-f769ed71-b3ad-491a-a9d5-26eeceaa6be2"), - // Location: to.Ptr("onebox"), + // ID: to.Ptr("/subscriptions/65dc2520-d3b9-4d11-b638-f3c41f962550/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/VirtualClustercltest"), + // Location: to.Ptr("japaneast"), // Properties: &armsql.VirtualClusterProperties{ // ChildResources: []*string{ - // to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance1"), - // to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance2")}, - // Family: to.Ptr("Gen4"), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/ab0e51c0-83c0-4380-8ae9-025516df392f/resourceGroups/Federation/providers/Microsoft.Maintenance/maintenanceConfigurations/MiPolicy1"), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // to.Ptr("/subscriptions/65dc2520-d3b9-4d11-b638-f3c41f962550/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl")}, + // SubnetID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/cltest"), + // Version: to.Ptr("1.0"), + // }, + // }, + // { + // Name: to.Ptr("vc2"), + // Type: to.Ptr("Microsoft.Sql/virtualClusters"), + // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc2"), + // Location: to.Ptr("japaneast"), + // Properties: &armsql.VirtualClusterProperties{ + // ChildResources: []*string{ + // }, + // SubnetID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/cltest2"), + // Version: to.Ptr("2.0"), // }, // }, // { - // Name: to.Ptr("vc-subnet1-14b795bd-9c8f-46ec-adb8-2b8eff56ac16"), + // Name: to.Ptr("vc1"), // Type: to.Ptr("Microsoft.Sql/virtualClusters"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-subnet2-14b795bd-9c8f-46ec-adb8-2b8eff56ac16"), - // Location: to.Ptr("onebox"), + // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc1"), + // Location: to.Ptr("japaneast"), + // Tags: map[string]*string{ + // "tkey": to.Ptr("tvalue3"), + // }, // Properties: &armsql.VirtualClusterProperties{ // ChildResources: []*string{ - // to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance3"), - // to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance4")}, - // Family: to.Ptr("Gen4"), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/ab0e51c0-83c0-4380-8ae9-025516df392f/resourceGroups/Federation/providers/Microsoft.Maintenance/maintenanceConfigurations/MiPolicy1"), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/subnet2"), + // to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl"), + // to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/mi")}, + // SubnetID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/cltest"), + // Version: to.Ptr("2.0"), // }, // }}, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualClusterGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterGet.json func ExampleVirtualClustersClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -167,7 +162,7 @@ func ExampleVirtualClustersClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewVirtualClustersClient().Get(ctx, "testrg", "vc-subnet1-f769ed71-b3ad-491a-a9d5-26eeceaa6be2", nil) + res, err := clientFactory.NewVirtualClustersClient().Get(ctx, "testrg", "vc-f769ed71-b3ad-491a-a9d5-26eeceaa6be2", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -175,22 +170,24 @@ func ExampleVirtualClustersClient_Get() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualCluster = armsql.VirtualCluster{ - // Name: to.Ptr("vc-subnet1-f769ed71-b3ad-491a-a9d5-26eeceaa6be2"), + // Name: to.Ptr("vc-f769ed71-b3ad-491a-a9d5-26eeceaa6be2"), // Type: to.Ptr("Microsoft.Sql/virtualClusters"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-subnet1-f769ed71-b3ad-491a-a9d5-26eeceaa6be2"), - // Location: to.Ptr("onebox"), + // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-f769ed71-b3ad-491a-a9d5-26eeceaa6be2"), + // Location: to.Ptr("japaneast"), + // Tags: map[string]*string{ + // "key": to.Ptr("value"), + // }, // Properties: &armsql.VirtualClusterProperties{ // ChildResources: []*string{ - // to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance1"), - // to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance2")}, - // Family: to.Ptr("Gen4"), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/ab0e51c0-83c0-4380-8ae9-025516df392f/resourceGroups/Federation/providers/Microsoft.Maintenance/maintenanceConfigurations/MiPolicy1"), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl"), + // to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/mi")}, + // SubnetID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/cltest"), + // Version: to.Ptr("2.0"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualClusterDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterDelete.json func ExampleVirtualClustersClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -211,7 +208,7 @@ func ExampleVirtualClustersClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualClusterUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterUpdate.json func ExampleVirtualClustersClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -223,8 +220,8 @@ func ExampleVirtualClustersClient_BeginUpdate() { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualClustersClient().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"), + Tags: map[string]*string{ + "tkey": to.Ptr("tvalue1"), }, }, nil) if err != nil { @@ -241,13 +238,41 @@ func ExampleVirtualClustersClient_BeginUpdate() { // Name: to.Ptr("vc-subnet1-f769ed71-b3ad-491a-a9d5-26eeceaa6be2"), // Type: to.Ptr("Microsoft.Sql/virtualClusters"), // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-subnet1-f769ed71-b3ad-491a-a9d5-26eeceaa6be2"), - // Location: to.Ptr("onebox"), + // Location: to.Ptr("japaneast"), + // Tags: map[string]*string{ + // "tkey": to.Ptr("tvalue3"), + // }, // Properties: &armsql.VirtualClusterProperties{ - // ChildResources: []*string{ - // to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance1"), - // to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance2")}, - // MaintenanceConfigurationID: to.Ptr("/subscriptions/ab0e51c0-83c0-4380-8ae9-025516df392f/resourceGroups/Federation/providers/Microsoft.Maintenance/maintenanceConfigurations/MiPolicy1"), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // } + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/UpdateVirtualClusterDnsServers.json +func ExampleVirtualClustersClient_BeginUpdateDNSServers() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewVirtualClustersClient().BeginUpdateDNSServers(ctx, "sqlcrudtest-7398", "VirtualCluster2b9a846b-2e37-43ef-a8e9-f2c6d645c1d7", 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.UpdateVirtualClusterDNSServersOperation = armsql.UpdateVirtualClusterDNSServersOperation{ + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/virtualClusters/VirtualCluster2b9a846b-2e37-43ef-a8e9-f2c6d645c1d7/updateManagedInstanceDnsServers"), + // Properties: &armsql.VirtualClusterDNSServersProperties{ + // Status: to.Ptr(armsql.DNSRefreshOperationStatusSucceeded), + // }, + // } } diff --git a/sdk/resourcemanager/sql/armsql/virtualnetworkrules_client.go b/sdk/resourcemanager/sql/armsql/virtualnetworkrules_client.go index a7844877f6cd..eeec326cd013 100644 --- a/sdk/resourcemanager/sql/armsql/virtualnetworkrules_client.go +++ b/sdk/resourcemanager/sql/armsql/virtualnetworkrules_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -61,7 +60,8 @@ func (client *VirtualNetworkRulesClient) BeginCreateOrUpdate(ctx context.Context if err != nil { return nil, err } - return runtime.NewPoller[VirtualNetworkRulesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[VirtualNetworkRulesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[VirtualNetworkRulesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *VirtualNetworkRulesClient) BeginCreateOrUpdate(ctx context.Context // // Generated from API version 2020-11-01-preview func (client *VirtualNetworkRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters VirtualNetworkRule, options *VirtualNetworkRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, virtualNetworkRuleName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -113,7 +115,10 @@ func (client *VirtualNetworkRulesClient) createOrUpdateCreateRequest(ctx context reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes the virtual network rule with the given name. @@ -132,7 +137,8 @@ func (client *VirtualNetworkRulesClient) BeginDelete(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller[VirtualNetworkRulesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[VirtualNetworkRulesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[VirtualNetworkRulesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -143,18 +149,20 @@ func (client *VirtualNetworkRulesClient) BeginDelete(ctx context.Context, resour // // Generated from API version 2020-11-01-preview func (client *VirtualNetworkRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, options *VirtualNetworkRulesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, virtualNetworkRuleName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -196,18 +204,21 @@ func (client *VirtualNetworkRulesClient) deleteCreateRequest(ctx context.Context // - virtualNetworkRuleName - The name of the virtual network rule. // - options - VirtualNetworkRulesClientGetOptions contains the optional parameters for the VirtualNetworkRulesClient.Get method. func (client *VirtualNetworkRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, options *VirtualNetworkRulesClientGetOptions) (VirtualNetworkRulesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, virtualNetworkRuleName, options) if err != nil { return VirtualNetworkRulesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return VirtualNetworkRulesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualNetworkRulesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return VirtualNetworkRulesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/virtualnetworkrules_client_example_test.go b/sdk/resourcemanager/sql/armsql/virtualnetworkrules_client_example_test.go index 907e03da6805..d34da6f1a1d3 100644 --- a/sdk/resourcemanager/sql/armsql/virtualnetworkrules_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/virtualnetworkrules_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -48,7 +48,7 @@ func ExampleVirtualNetworkRulesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesCreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -86,7 +86,7 @@ func ExampleVirtualNetworkRulesClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -107,7 +107,7 @@ func ExampleVirtualNetworkRulesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaseline_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaseline_client.go new file mode 100644 index 000000000000..267cec117d8d --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaseline_client.go @@ -0,0 +1,193 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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" +) + +// VulnerabilityAssessmentBaselineClient contains the methods for the SQLVulnerabilityAssessmentBaseline group. +// Don't use this type directly, use NewVulnerabilityAssessmentBaselineClient() instead. +type VulnerabilityAssessmentBaselineClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVulnerabilityAssessmentBaselineClient creates a new instance of VulnerabilityAssessmentBaselineClient 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 NewVulnerabilityAssessmentBaselineClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VulnerabilityAssessmentBaselineClient, error) { + cl, err := arm.NewClient(moduleName+".VulnerabilityAssessmentBaselineClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VulnerabilityAssessmentBaselineClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Gets a list of database's sql vulnerability assessment rule baselines. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - VulnerabilityAssessmentBaselineClientGetOptions contains the optional parameters for the VulnerabilityAssessmentBaselineClient.Get +// method. +func (client *VulnerabilityAssessmentBaselineClient) Get(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, options *VulnerabilityAssessmentBaselineClientGetOptions) (VulnerabilityAssessmentBaselineClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, baselineName, options) + if err != nil { + return VulnerabilityAssessmentBaselineClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VulnerabilityAssessmentBaselineClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return VulnerabilityAssessmentBaselineClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *VulnerabilityAssessmentBaselineClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, options *VulnerabilityAssessmentBaselineClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if baselineName == "" { + return nil, errors.New("parameter baselineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baselineName}", url.PathEscape(string(baselineName))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("systemDatabaseName", "master") + reqQP.Set("api-version", "2022-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 *VulnerabilityAssessmentBaselineClient) getHandleResponse(resp *http.Response) (VulnerabilityAssessmentBaselineClientGetResponse, error) { + result := VulnerabilityAssessmentBaselineClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseSQLVulnerabilityAssessmentBaselineSet); err != nil { + return VulnerabilityAssessmentBaselineClientGetResponse{}, err + } + return result, nil +} + +// NewListBySQLVulnerabilityAssessmentPager - Gets a list of database's sql vulnerability assessment rule baselines. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentOptions contains the optional parameters +// for the VulnerabilityAssessmentBaselineClient.NewListBySQLVulnerabilityAssessmentPager method. +func (client *VulnerabilityAssessmentBaselineClient) NewListBySQLVulnerabilityAssessmentPager(resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentOptions) *runtime.Pager[VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse] { + return runtime.NewPager(runtime.PagingHandler[VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse]{ + More: func(page VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse) (VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySQLVulnerabilityAssessmentCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse{}, runtime.NewResponseError(resp) + } + return client.listBySQLVulnerabilityAssessmentHandleResponse(resp) + }, + }) +} + +// listBySQLVulnerabilityAssessmentCreateRequest creates the ListBySQLVulnerabilityAssessment request. +func (client *VulnerabilityAssessmentBaselineClient) listBySQLVulnerabilityAssessmentCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("systemDatabaseName", "master") + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySQLVulnerabilityAssessmentHandleResponse handles the ListBySQLVulnerabilityAssessment response. +func (client *VulnerabilityAssessmentBaselineClient) listBySQLVulnerabilityAssessmentHandleResponse(resp *http.Response) (VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse, error) { + result := VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseSQLVulnerabilityAssessmentBaselineSetListResult); err != nil { + return VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaseline_client_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaseline_client_example_test.go new file mode 100644 index 000000000000..228de3dcb635 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaseline_client_example_test.go @@ -0,0 +1,140 @@ +//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_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentBaselineListBySqlVulnerabilityAssessment.json +func ExampleVulnerabilityAssessmentBaselineClient_NewListBySQLVulnerabilityAssessmentPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewVulnerabilityAssessmentBaselineClient().NewListBySQLVulnerabilityAssessmentPager("vulnerabilityaseessmenttest-4711", "vulnerabilityaseessmenttest-6411", armsql.VulnerabilityAssessmentNameDefault, nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.DatabaseSQLVulnerabilityAssessmentBaselineSetListResult = armsql.DatabaseSQLVulnerabilityAssessmentBaselineSetListResult{ + // Value: []*armsql.DatabaseSQLVulnerabilityAssessmentBaselineSet{ + // { + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/baselines"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/sqlVulnerabilityAssessments/Default/baselines/Default"), + // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentBaselineSetProperties{ + // Results: map[string][][]*string{ + // "VA1223": [][]*string{ + // }, + // "VA2060": [][]*string{ + // []*string{ + // to.Ptr("False")}}, + // "VA2061": [][]*string{ + // []*string{ + // to.Ptr("True")}}, + // "VA2062": [][]*string{ + // }, + // "VA2063": [][]*string{ + // []*string{ + // to.Ptr("AllowAll"), + // to.Ptr("0.0.0.0"), + // to.Ptr("255.255.255.255")}}, + // "VA2064": [][]*string{ + // }, + // "VA2065": [][]*string{ + // []*string{ + // to.Ptr("AllowAll"), + // to.Ptr("0.0.0.0"), + // to.Ptr("255.255.255.255")}}, + // "VA2107": [][]*string{ + // }, + // "VA2130": [][]*string{ + // []*string{ + // to.Ptr("Value1"), + // to.Ptr("Value2")}}, + // }, + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentBaselineGet.json +func ExampleVulnerabilityAssessmentBaselineClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVulnerabilityAssessmentBaselineClient().Get(ctx, "vulnerabilityaseessmenttest-4711", "vulnerabilityaseessmenttest-6411", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.DatabaseSQLVulnerabilityAssessmentBaselineSet = armsql.DatabaseSQLVulnerabilityAssessmentBaselineSet{ + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/baselines"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/sqlVulnerabilityAssessments/Default/baselines/Default"), + // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentBaselineSetProperties{ + // Results: map[string][][]*string{ + // "VA1223": [][]*string{ + // }, + // "VA2060": [][]*string{ + // []*string{ + // to.Ptr("False")}}, + // "VA2061": [][]*string{ + // []*string{ + // to.Ptr("True")}}, + // "VA2062": [][]*string{ + // }, + // "VA2063": [][]*string{ + // []*string{ + // to.Ptr("AllowAll"), + // to.Ptr("0.0.0.0"), + // to.Ptr("255.255.255.255")}}, + // "VA2064": [][]*string{ + // }, + // "VA2065": [][]*string{ + // []*string{ + // to.Ptr("AllowAll"), + // to.Ptr("0.0.0.0"), + // to.Ptr("255.255.255.255")}}, + // "VA2107": [][]*string{ + // }, + // "VA2130": [][]*string{ + // []*string{ + // to.Ptr("Value1"), + // to.Ptr("Value2")}}, + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaselines_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaselines_client.go new file mode 100644 index 000000000000..6aa52ff7cac5 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaselines_client.go @@ -0,0 +1,120 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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" +) + +// VulnerabilityAssessmentBaselinesClient contains the methods for the SQLVulnerabilityAssessmentBaselines group. +// Don't use this type directly, use NewVulnerabilityAssessmentBaselinesClient() instead. +type VulnerabilityAssessmentBaselinesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVulnerabilityAssessmentBaselinesClient creates a new instance of VulnerabilityAssessmentBaselinesClient 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 NewVulnerabilityAssessmentBaselinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VulnerabilityAssessmentBaselinesClient, error) { + cl, err := arm.NewClient(moduleName+".VulnerabilityAssessmentBaselinesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VulnerabilityAssessmentBaselinesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Add a database's vulnerability assessment rule baseline list. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - parameters - The requested rule baseline resource. +// - options - VulnerabilityAssessmentBaselinesClientCreateOrUpdateOptions contains the optional parameters for the VulnerabilityAssessmentBaselinesClient.CreateOrUpdate +// method. +func (client *VulnerabilityAssessmentBaselinesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, parameters DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput, options *VulnerabilityAssessmentBaselinesClientCreateOrUpdateOptions) (VulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, baselineName, parameters, options) + if err != nil { + return VulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return VulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *VulnerabilityAssessmentBaselinesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, parameters DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput, options *VulnerabilityAssessmentBaselinesClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if baselineName == "" { + return nil, errors.New("parameter baselineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baselineName}", url.PathEscape(string(baselineName))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("systemDatabaseName", "master") + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *VulnerabilityAssessmentBaselinesClient) createOrUpdateHandleResponse(resp *http.Response) (VulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse, error) { + result := VulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseSQLVulnerabilityAssessmentBaselineSet); err != nil { + return VulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaselines_client_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaselines_client_example_test.go new file mode 100644 index 000000000000..cec1575cdf7c --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaselines_client_example_test.go @@ -0,0 +1,136 @@ +//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_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/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentBaselineAddLatest.json +func ExampleVulnerabilityAssessmentBaselinesClient_CreateOrUpdate_addADatabasesVulnerabilityAssessmentRuleBaselineFromTheLatestScanResult() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVulnerabilityAssessmentBaselinesClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput{ + Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineListInputProperties{ + LatestScan: to.Ptr(true), + Results: map[string][][]*string{}, + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.DatabaseSQLVulnerabilityAssessmentBaselineSet = armsql.DatabaseSQLVulnerabilityAssessmentBaselineSet{ + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/baselines"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/sqlVulnerabilityAssessments/Default/baselines/Default"), + // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentBaselineSetProperties{ + // Results: map[string][][]*string{ + // "VA1223": [][]*string{ + // }, + // "VA2060": [][]*string{ + // []*string{ + // to.Ptr("False")}}, + // "VA2061": [][]*string{ + // []*string{ + // to.Ptr("True")}}, + // "VA2062": [][]*string{ + // }, + // "VA2063": [][]*string{ + // []*string{ + // to.Ptr("AllowAll"), + // to.Ptr("0.0.0.0"), + // to.Ptr("255.255.255.255")}}, + // "VA2064": [][]*string{ + // }, + // "VA2065": [][]*string{ + // []*string{ + // to.Ptr("AllowAll"), + // to.Ptr("0.0.0.0"), + // to.Ptr("255.255.255.255")}}, + // "VA2107": [][]*string{ + // }, + // "VA2130": [][]*string{ + // []*string{ + // to.Ptr("Value1"), + // to.Ptr("Value2")}}, + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentBaselineAdd.json +func ExampleVulnerabilityAssessmentBaselinesClient_CreateOrUpdate_addADatabasesVulnerabilityAssessmentRuleBaselineList() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVulnerabilityAssessmentBaselinesClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4711", "vulnerabilityaseessmenttest-6411", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput{ + Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineListInputProperties{ + LatestScan: to.Ptr(false), + Results: map[string][][]*string{ + "VA2063": { + { + to.Ptr("AllowAll"), + to.Ptr("0.0.0.0"), + to.Ptr("255.255.255.255")}}, + "VA2065": { + { + to.Ptr("AllowAll"), + to.Ptr("0.0.0.0"), + to.Ptr("255.255.255.255")}}, + }, + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.DatabaseSQLVulnerabilityAssessmentBaselineSet = armsql.DatabaseSQLVulnerabilityAssessmentBaselineSet{ + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/baselines"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/sqlVulnerabilityAssessments/Default/baselines/Default"), + // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentBaselineSetProperties{ + // Results: map[string][][]*string{ + // "VA2063": [][]*string{ + // []*string{ + // to.Ptr("AllowAll"), + // to.Ptr("0.0.0.0"), + // to.Ptr("255.255.255.255")}}, + // "VA2065": [][]*string{ + // []*string{ + // to.Ptr("AllowAll"), + // to.Ptr("0.0.0.0"), + // to.Ptr("255.255.255.255")}}, + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentexecutescan_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentexecutescan_client.go new file mode 100644 index 000000000000..b8f40f3b7cce --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentexecutescan_client.go @@ -0,0 +1,118 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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" +) + +// VulnerabilityAssessmentExecuteScanClient contains the methods for the SQLVulnerabilityAssessmentExecuteScan group. +// Don't use this type directly, use NewVulnerabilityAssessmentExecuteScanClient() instead. +type VulnerabilityAssessmentExecuteScanClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVulnerabilityAssessmentExecuteScanClient creates a new instance of VulnerabilityAssessmentExecuteScanClient 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 NewVulnerabilityAssessmentExecuteScanClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VulnerabilityAssessmentExecuteScanClient, error) { + cl, err := arm.NewClient(moduleName+".VulnerabilityAssessmentExecuteScanClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VulnerabilityAssessmentExecuteScanClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginExecute - Executes a Vulnerability Assessment database scan. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - VulnerabilityAssessmentExecuteScanClientBeginExecuteOptions contains the optional parameters for the VulnerabilityAssessmentExecuteScanClient.BeginExecute +// method. +func (client *VulnerabilityAssessmentExecuteScanClient) BeginExecute(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *VulnerabilityAssessmentExecuteScanClientBeginExecuteOptions) (*runtime.Poller[VulnerabilityAssessmentExecuteScanClientExecuteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.execute(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller[VulnerabilityAssessmentExecuteScanClientExecuteResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[VulnerabilityAssessmentExecuteScanClientExecuteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Execute - Executes a Vulnerability Assessment database scan. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *VulnerabilityAssessmentExecuteScanClient) execute(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *VulnerabilityAssessmentExecuteScanClientBeginExecuteOptions) (*http.Response, error) { + var err error + req, err := client.executeCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// executeCreateRequest creates the Execute request. +func (client *VulnerabilityAssessmentExecuteScanClient) executeCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *VulnerabilityAssessmentExecuteScanClientBeginExecuteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("systemDatabaseName", "master") + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentexecutescan_client_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentexecutescan_client_example_test.go new file mode 100644 index 000000000000..fdb825bbc795 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentexecutescan_client_example_test.go @@ -0,0 +1,39 @@ +//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_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentScansExecute.json +func ExampleVulnerabilityAssessmentExecuteScanClient_BeginExecute() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewVulnerabilityAssessmentExecuteScanClient().BeginExecute(ctx, "vulnerabilityassessmenttest-4711", "vulnerabilityassessmenttest-6411", armsql.VulnerabilityAssessmentNameDefault, 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/vulnerabilityassessmentrulebaseline_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaseline_client.go new file mode 100644 index 000000000000..cd26f7135f66 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaseline_client.go @@ -0,0 +1,283 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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" +) + +// VulnerabilityAssessmentRuleBaselineClient contains the methods for the SQLVulnerabilityAssessmentRuleBaseline group. +// Don't use this type directly, use NewVulnerabilityAssessmentRuleBaselineClient() instead. +type VulnerabilityAssessmentRuleBaselineClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVulnerabilityAssessmentRuleBaselineClient creates a new instance of VulnerabilityAssessmentRuleBaselineClient 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 NewVulnerabilityAssessmentRuleBaselineClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VulnerabilityAssessmentRuleBaselineClient, error) { + cl, err := arm.NewClient(moduleName+".VulnerabilityAssessmentRuleBaselineClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VulnerabilityAssessmentRuleBaselineClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates a database's vulnerability assessment rule baseline. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - ruleID - The vulnerability assessment rule ID. +// - parameters - The requested rule baseline resource. +// - options - VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateOptions contains the optional parameters for the VulnerabilityAssessmentRuleBaselineClient.CreateOrUpdate +// method. +func (client *VulnerabilityAssessmentRuleBaselineClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, ruleID string, parameters DatabaseSQLVulnerabilityAssessmentRuleBaselineInput, options *VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateOptions) (VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateResponse, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, baselineName, ruleID, parameters, options) + if err != nil { + return VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *VulnerabilityAssessmentRuleBaselineClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, ruleID string, parameters DatabaseSQLVulnerabilityAssessmentRuleBaselineInput, options *VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if baselineName == "" { + return nil, errors.New("parameter baselineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baselineName}", url.PathEscape(string(baselineName))) + if ruleID == "" { + return nil, errors.New("parameter ruleID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("systemDatabaseName", "master") + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *VulnerabilityAssessmentRuleBaselineClient) createOrUpdateHandleResponse(resp *http.Response) (VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateResponse, error) { + result := VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseSQLVulnerabilityAssessmentRuleBaseline); err != nil { + return VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Get - Gets a system database's sql vulnerability assessment rule baseline. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - ruleID - The vulnerability assessment rule ID. +// - options - VulnerabilityAssessmentRuleBaselineClientGetOptions contains the optional parameters for the VulnerabilityAssessmentRuleBaselineClient.Get +// method. +func (client *VulnerabilityAssessmentRuleBaselineClient) Get(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, ruleID string, options *VulnerabilityAssessmentRuleBaselineClientGetOptions) (VulnerabilityAssessmentRuleBaselineClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, baselineName, ruleID, options) + if err != nil { + return VulnerabilityAssessmentRuleBaselineClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VulnerabilityAssessmentRuleBaselineClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return VulnerabilityAssessmentRuleBaselineClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *VulnerabilityAssessmentRuleBaselineClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, ruleID string, options *VulnerabilityAssessmentRuleBaselineClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if baselineName == "" { + return nil, errors.New("parameter baselineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baselineName}", url.PathEscape(string(baselineName))) + if ruleID == "" { + return nil, errors.New("parameter ruleID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("systemDatabaseName", "master") + reqQP.Set("api-version", "2022-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 *VulnerabilityAssessmentRuleBaselineClient) getHandleResponse(resp *http.Response) (VulnerabilityAssessmentRuleBaselineClientGetResponse, error) { + result := VulnerabilityAssessmentRuleBaselineClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseSQLVulnerabilityAssessmentRuleBaseline); err != nil { + return VulnerabilityAssessmentRuleBaselineClientGetResponse{}, err + } + return result, nil +} + +// NewListByBaselinePager - Gets a system database's sql vulnerability assessment rule baseline. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - VulnerabilityAssessmentRuleBaselineClientListByBaselineOptions contains the optional parameters for the VulnerabilityAssessmentRuleBaselineClient.NewListByBaselinePager +// method. +func (client *VulnerabilityAssessmentRuleBaselineClient) NewListByBaselinePager(resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, options *VulnerabilityAssessmentRuleBaselineClientListByBaselineOptions) *runtime.Pager[VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse] { + return runtime.NewPager(runtime.PagingHandler[VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse]{ + More: func(page VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse) (VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByBaselineCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, baselineName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse{}, runtime.NewResponseError(resp) + } + return client.listByBaselineHandleResponse(resp) + }, + }) +} + +// listByBaselineCreateRequest creates the ListByBaseline request. +func (client *VulnerabilityAssessmentRuleBaselineClient) listByBaselineCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, options *VulnerabilityAssessmentRuleBaselineClientListByBaselineOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if baselineName == "" { + return nil, errors.New("parameter baselineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baselineName}", url.PathEscape(string(baselineName))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("systemDatabaseName", "master") + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByBaselineHandleResponse handles the ListByBaseline response. +func (client *VulnerabilityAssessmentRuleBaselineClient) listByBaselineHandleResponse(resp *http.Response) (VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse, error) { + result := VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult); err != nil { + return VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaseline_client_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaseline_client_example_test.go new file mode 100644 index 000000000000..9724b376614f --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaseline_client_example_test.go @@ -0,0 +1,169 @@ +//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_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/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentRuleBaselineListByBaseline.json +func ExampleVulnerabilityAssessmentRuleBaselineClient_NewListByBaselinePager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewVulnerabilityAssessmentRuleBaselineClient().NewListByBaselinePager("vulnerabilityaseessmenttest-4711", "vulnerabilityaseessmenttest-6411", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult = armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult{ + // Value: []*armsql.DatabaseSQLVulnerabilityAssessmentRuleBaseline{ + // { + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/baselines"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/sqlVulnerabilityAssessments/default/baselines/default/rules/VA1001"), + // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties{ + // Results: [][]*string{ + // []*string{ + // to.Ptr("userA"), + // to.Ptr("SELECT")}, + // []*string{ + // to.Ptr("userB"), + // to.Ptr("SELECT")}, + // []*string{ + // to.Ptr("userC"), + // to.Ptr("SELECT")}}, + // }, + // }, + // { + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/baselines"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/sqlVulnerabilityAssessments/default/baselines/default/rules/VA1002"), + // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties{ + // Results: [][]*string{ + // []*string{ + // to.Ptr("userA"), + // to.Ptr("SELECT")}, + // []*string{ + // to.Ptr("userB"), + // to.Ptr("SELECT")}, + // []*string{ + // to.Ptr("userC"), + // to.Ptr("SELECT")}}, + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentRuleBaselineGet.json +func ExampleVulnerabilityAssessmentRuleBaselineClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVulnerabilityAssessmentRuleBaselineClient().Get(ctx, "vulnerabilityaseessmenttest-4711", "vulnerabilityaseessmenttest-6411", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, "VA1001", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.DatabaseSQLVulnerabilityAssessmentRuleBaseline = armsql.DatabaseSQLVulnerabilityAssessmentRuleBaseline{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/baselines"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/sqlVulnerabilityAssessments/default/baselines/default/rules/VA1001"), + // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties{ + // Results: [][]*string{ + // []*string{ + // to.Ptr("userA"), + // to.Ptr("SELECT")}, + // []*string{ + // to.Ptr("userB"), + // to.Ptr("SELECT")}, + // []*string{ + // to.Ptr("userC"), + // to.Ptr("SELECT")}}, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentRuleBaselineCreate.json +func ExampleVulnerabilityAssessmentRuleBaselineClient_CreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVulnerabilityAssessmentRuleBaselineClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, "VA1001", armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineInput{ + Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineInputProperties{ + LatestScan: to.Ptr(false), + Results: [][]*string{ + { + to.Ptr("userA"), + to.Ptr("SELECT")}, + { + to.Ptr("userB"), + to.Ptr("SELECT")}, + { + to.Ptr("userC"), + to.Ptr("SELECT")}}, + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.DatabaseSQLVulnerabilityAssessmentRuleBaseline = armsql.DatabaseSQLVulnerabilityAssessmentRuleBaseline{ + // Name: to.Ptr("Scan123"), + // Type: to.Ptr("Microsoft.Sql/servers/vulnerabilityAssessments/rules/baselines"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/sqlVulnerabilityAssessments/default/rules/VA1001"), + // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties{ + // Results: [][]*string{ + // []*string{ + // to.Ptr("userA"), + // to.Ptr("SELECT")}, + // []*string{ + // to.Ptr("userB"), + // to.Ptr("SELECT")}, + // []*string{ + // to.Ptr("userC"), + // to.Ptr("SELECT")}}, + // }, + // } +} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaselines_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaselines_client.go new file mode 100644 index 000000000000..5df71ea6b1e8 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaselines_client.go @@ -0,0 +1,110 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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" +) + +// VulnerabilityAssessmentRuleBaselinesClient contains the methods for the SQLVulnerabilityAssessmentRuleBaselines group. +// Don't use this type directly, use NewVulnerabilityAssessmentRuleBaselinesClient() instead. +type VulnerabilityAssessmentRuleBaselinesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVulnerabilityAssessmentRuleBaselinesClient creates a new instance of VulnerabilityAssessmentRuleBaselinesClient 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 NewVulnerabilityAssessmentRuleBaselinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VulnerabilityAssessmentRuleBaselinesClient, error) { + cl, err := arm.NewClient(moduleName+".VulnerabilityAssessmentRuleBaselinesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VulnerabilityAssessmentRuleBaselinesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Delete - Removes the database's vulnerability assessment rule baseline. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - ruleID - The vulnerability assessment rule ID. +// - options - VulnerabilityAssessmentRuleBaselinesClientDeleteOptions contains the optional parameters for the VulnerabilityAssessmentRuleBaselinesClient.Delete +// method. +func (client *VulnerabilityAssessmentRuleBaselinesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, ruleID string, options *VulnerabilityAssessmentRuleBaselinesClientDeleteOptions) (VulnerabilityAssessmentRuleBaselinesClientDeleteResponse, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, baselineName, ruleID, options) + if err != nil { + return VulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return VulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, err + } + return VulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *VulnerabilityAssessmentRuleBaselinesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, ruleID string, options *VulnerabilityAssessmentRuleBaselinesClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if baselineName == "" { + return nil, errors.New("parameter baselineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baselineName}", url.PathEscape(string(baselineName))) + if ruleID == "" { + return nil, errors.New("parameter ruleID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("systemDatabaseName", "master") + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaselines_client_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaselines_client_example_test.go new file mode 100644 index 000000000000..bc598ea6ac94 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaselines_client_example_test.go @@ -0,0 +1,35 @@ +//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_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentRuleBaselineDelete.json +func ExampleVulnerabilityAssessmentRuleBaselinesClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewVulnerabilityAssessmentRuleBaselinesClient().Delete(ctx, "vulnerabilityaseessmenttest-4711", "vulnerabilityaseessmenttest-6411", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, "VA1001", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessments_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessments_client.go new file mode 100644 index 000000000000..3921f6455ac4 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessments_client.go @@ -0,0 +1,100 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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" +) + +// VulnerabilityAssessmentsClient contains the methods for the SQLVulnerabilityAssessments group. +// Don't use this type directly, use NewVulnerabilityAssessmentsClient() instead. +type VulnerabilityAssessmentsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVulnerabilityAssessmentsClient creates a new instance of VulnerabilityAssessmentsClient 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 NewVulnerabilityAssessmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VulnerabilityAssessmentsClient, error) { + cl, err := arm.NewClient(moduleName+".VulnerabilityAssessmentsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VulnerabilityAssessmentsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Delete - Removes SQL Vulnerability Assessment. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the SQL Vulnerability Assessment. +// - options - VulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the VulnerabilityAssessmentsClient.Delete +// method. +func (client *VulnerabilityAssessmentsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *VulnerabilityAssessmentsClientDeleteOptions) (VulnerabilityAssessmentsClientDeleteResponse, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, options) + if err != nil { + return VulnerabilityAssessmentsClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VulnerabilityAssessmentsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return VulnerabilityAssessmentsClientDeleteResponse{}, err + } + return VulnerabilityAssessmentsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *VulnerabilityAssessmentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *VulnerabilityAssessmentsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessments_client_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessments_client_example_test.go new file mode 100644 index 000000000000..887a18d824d0 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessments_client_example_test.go @@ -0,0 +1,35 @@ +//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_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentDelete.json +func ExampleVulnerabilityAssessmentsClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewVulnerabilityAssessmentsClient().Delete(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", armsql.VulnerabilityAssessmentNameDefault, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscanresult_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscanresult_client.go new file mode 100644 index 000000000000..6add9bba8800 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscanresult_client.go @@ -0,0 +1,204 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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" +) + +// VulnerabilityAssessmentScanResultClient contains the methods for the SQLVulnerabilityAssessmentScanResult group. +// Don't use this type directly, use NewVulnerabilityAssessmentScanResultClient() instead. +type VulnerabilityAssessmentScanResultClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVulnerabilityAssessmentScanResultClient creates a new instance of VulnerabilityAssessmentScanResultClient 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 NewVulnerabilityAssessmentScanResultClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VulnerabilityAssessmentScanResultClient, error) { + cl, err := arm.NewClient(moduleName+".VulnerabilityAssessmentScanResultClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VulnerabilityAssessmentScanResultClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Gets a vulnerability assessment scan record of a database. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the SQL Vulnerability Assessment. +// - scanID - The scan id of the SQL Vulnerability Assessment scan to retrieve result from. +// - scanResultID - The scan result id of the specific result to retrieve. +// - options - VulnerabilityAssessmentScanResultClientGetOptions contains the optional parameters for the VulnerabilityAssessmentScanResultClient.Get +// method. +func (client *VulnerabilityAssessmentScanResultClient) Get(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName SQLVulnerabilityAssessmentName, scanID string, scanResultID string, options *VulnerabilityAssessmentScanResultClientGetOptions) (VulnerabilityAssessmentScanResultClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, scanID, scanResultID, options) + if err != nil { + return VulnerabilityAssessmentScanResultClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VulnerabilityAssessmentScanResultClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return VulnerabilityAssessmentScanResultClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *VulnerabilityAssessmentScanResultClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName SQLVulnerabilityAssessmentName, scanID string, scanResultID string, options *VulnerabilityAssessmentScanResultClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults/{scanResultId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if scanID == "" { + return nil, errors.New("parameter scanID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scanId}", url.PathEscape(scanID)) + if scanResultID == "" { + return nil, errors.New("parameter scanResultID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scanResultId}", url.PathEscape(scanResultID)) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("systemDatabaseName", "master") + reqQP.Set("api-version", "2022-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 *VulnerabilityAssessmentScanResultClient) getHandleResponse(resp *http.Response) (VulnerabilityAssessmentScanResultClientGetResponse, error) { + result := VulnerabilityAssessmentScanResultClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessmentScanResults); err != nil { + return VulnerabilityAssessmentScanResultClientGetResponse{}, err + } + return result, nil +} + +// NewListByScanPager - Gets a vulnerability assessment scan record of a database. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the SQL Vulnerability Assessment. +// - scanID - The scan id of the SQL Vulnerability Assessment scan to retrieve result from. +// - options - VulnerabilityAssessmentScanResultClientListByScanOptions contains the optional parameters for the VulnerabilityAssessmentScanResultClient.NewListByScanPager +// method. +func (client *VulnerabilityAssessmentScanResultClient) NewListByScanPager(resourceGroupName string, serverName string, vulnerabilityAssessmentName SQLVulnerabilityAssessmentName, scanID string, options *VulnerabilityAssessmentScanResultClientListByScanOptions) *runtime.Pager[VulnerabilityAssessmentScanResultClientListByScanResponse] { + return runtime.NewPager(runtime.PagingHandler[VulnerabilityAssessmentScanResultClientListByScanResponse]{ + More: func(page VulnerabilityAssessmentScanResultClientListByScanResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VulnerabilityAssessmentScanResultClientListByScanResponse) (VulnerabilityAssessmentScanResultClientListByScanResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByScanCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, scanID, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VulnerabilityAssessmentScanResultClientListByScanResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VulnerabilityAssessmentScanResultClientListByScanResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VulnerabilityAssessmentScanResultClientListByScanResponse{}, runtime.NewResponseError(resp) + } + return client.listByScanHandleResponse(resp) + }, + }) +} + +// listByScanCreateRequest creates the ListByScan request. +func (client *VulnerabilityAssessmentScanResultClient) listByScanCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName SQLVulnerabilityAssessmentName, scanID string, options *VulnerabilityAssessmentScanResultClientListByScanOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if scanID == "" { + return nil, errors.New("parameter scanID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scanId}", url.PathEscape(scanID)) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("systemDatabaseName", "master") + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByScanHandleResponse handles the ListByScan response. +func (client *VulnerabilityAssessmentScanResultClient) listByScanHandleResponse(resp *http.Response) (VulnerabilityAssessmentScanResultClientListByScanResponse, error) { + result := VulnerabilityAssessmentScanResultClientListByScanResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessmentScanListResult); err != nil { + return VulnerabilityAssessmentScanResultClientListByScanResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscanresult_client_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscanresult_client_example_test.go new file mode 100644 index 000000000000..fb330f255000 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscanresult_client_example_test.go @@ -0,0 +1,213 @@ +//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_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentListScansResults.json +func ExampleVulnerabilityAssessmentScanResultClient_NewListByScanPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewVulnerabilityAssessmentScanResultClient().NewListByScanPager("vulnerabilityassessmenttest-4711", "testsvr", armsql.SQLVulnerabilityAssessmentNameDefault, "scanId1", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.VulnerabilityAssessmentScanListResult = armsql.VulnerabilityAssessmentScanListResult{ + // Value: []*armsql.VulnerabilityAssessmentScanResults{ + // { + // Name: to.Ptr("VA1234"), + // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/scans/scanResults"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/testsvr/sqlVulnerabilityAssessments/Default/scans/scanId1/scanResults/VA1234"), + // Properties: &armsql.VulnerabilityAssessmentScanResultProperties{ + // IsTrimmed: to.Ptr(false), + // QueryResults: [][]*string{ + // []*string{ + // to.Ptr("a1"), + // to.Ptr("a2"), + // to.Ptr("a3")}, + // []*string{ + // to.Ptr("b1"), + // to.Ptr("b2"), + // to.Ptr("b3")}}, + // Remediation: &armsql.Remediation{ + // Description: to.Ptr("Remove users"), + // Automated: to.Ptr(false), + // Scripts: []*string{ + // to.Ptr("drop user a"), + // to.Ptr("drop user b")}, + // }, + // RuleID: to.Ptr("VA1234"), + // RuleMetadata: &armsql.VaRule{ + // Description: to.Ptr("This is an example check"), + // BenchmarkReferences: []*armsql.BenchmarkReference{ + // { + // Benchmark: to.Ptr("fedramp"), + // Reference: to.Ptr("v1"), + // }}, + // Category: to.Ptr("information"), + // QueryCheck: &armsql.QueryCheck{ + // ColumnNames: []*string{ + // to.Ptr("col1"), + // to.Ptr("col2"), + // to.Ptr("col3")}, + // ExpectedResult: [][]*string{ + // }, + // Query: to.Ptr("Select a1,a2, a3"), + // }, + // Rationale: to.Ptr("This is important"), + // RuleID: to.Ptr("VA1234"), + // RuleType: to.Ptr(armsql.RuleTypeNegativeList), + // Severity: to.Ptr(armsql.RuleSeverityInformational), + // Title: to.Ptr("This is the title"), + // }, + // Status: to.Ptr(armsql.RuleStatusNonFinding), + // }, + // }, + // { + // Name: to.Ptr("VA2341"), + // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/scans/scanResults"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/testsvr/sqlVulnerabilityAssessments/Default/scans/scanId1/scanResults/VA2341"), + // Properties: &armsql.VulnerabilityAssessmentScanResultProperties{ + // IsTrimmed: to.Ptr(false), + // QueryResults: [][]*string{ + // []*string{ + // to.Ptr("a1"), + // to.Ptr("a2"), + // to.Ptr("a3")}, + // []*string{ + // to.Ptr("b1"), + // to.Ptr("b2"), + // to.Ptr("b3")}}, + // Remediation: &armsql.Remediation{ + // Description: to.Ptr("Remove users"), + // Automated: to.Ptr(false), + // Scripts: []*string{ + // to.Ptr("drop user a"), + // to.Ptr("drop user b")}, + // }, + // RuleID: to.Ptr("VA2341"), + // RuleMetadata: &armsql.VaRule{ + // Description: to.Ptr("This is an example check"), + // BenchmarkReferences: []*armsql.BenchmarkReference{ + // { + // Benchmark: to.Ptr("fedramp"), + // Reference: to.Ptr("v1"), + // }}, + // Category: to.Ptr("information"), + // QueryCheck: &armsql.QueryCheck{ + // ColumnNames: []*string{ + // to.Ptr("col1"), + // to.Ptr("col2"), + // to.Ptr("col3")}, + // ExpectedResult: [][]*string{ + // }, + // Query: to.Ptr("Select a1,a2, a3"), + // }, + // Rationale: to.Ptr("This is important"), + // RuleID: to.Ptr("VA1234"), + // RuleType: to.Ptr(armsql.RuleTypeNegativeList), + // Severity: to.Ptr(armsql.RuleSeverityInformational), + // Title: to.Ptr("This is the title"), + // }, + // Status: to.Ptr(armsql.RuleStatusNonFinding), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentScansResults.json +func ExampleVulnerabilityAssessmentScanResultClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVulnerabilityAssessmentScanResultClient().Get(ctx, "vulnerabilityassessmenttest-4711", "vulnerabilityassessmenttest-6411", armsql.SQLVulnerabilityAssessmentNameDefault, "scanId1", "VA1234", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.VulnerabilityAssessmentScanResults = armsql.VulnerabilityAssessmentScanResults{ + // Name: to.Ptr("VA1234"), + // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/scans/scanResults"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6411/sqlVulnerabilityAssessments/Default/scans/scanId1/scanResults/VA1234"), + // Properties: &armsql.VulnerabilityAssessmentScanResultProperties{ + // IsTrimmed: to.Ptr(false), + // QueryResults: [][]*string{ + // []*string{ + // to.Ptr("a1"), + // to.Ptr("a2"), + // to.Ptr("a3")}, + // []*string{ + // to.Ptr("b1"), + // to.Ptr("b2"), + // to.Ptr("b3")}}, + // Remediation: &armsql.Remediation{ + // Description: to.Ptr("Remove users"), + // Automated: to.Ptr(false), + // Scripts: []*string{ + // to.Ptr("drop user a"), + // to.Ptr("drop user b")}, + // }, + // RuleID: to.Ptr("VA1234"), + // RuleMetadata: &armsql.VaRule{ + // Description: to.Ptr("This is an example check"), + // BenchmarkReferences: []*armsql.BenchmarkReference{ + // { + // Benchmark: to.Ptr("fedramp"), + // Reference: to.Ptr("v1"), + // }}, + // Category: to.Ptr("information"), + // QueryCheck: &armsql.QueryCheck{ + // ColumnNames: []*string{ + // to.Ptr("col1"), + // to.Ptr("col2"), + // to.Ptr("col3")}, + // ExpectedResult: [][]*string{ + // }, + // Query: to.Ptr("Select a1,a2, a3"), + // }, + // Rationale: to.Ptr("This is important"), + // RuleID: to.Ptr("VA1234"), + // RuleType: to.Ptr(armsql.RuleTypeNegativeList), + // Severity: to.Ptr(armsql.RuleSeverityInformational), + // Title: to.Ptr("This is the title"), + // }, + // Status: to.Ptr(armsql.RuleStatusNonFinding), + // }, + // } +} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscans_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscans_client.go new file mode 100644 index 000000000000..430d670851f3 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscans_client.go @@ -0,0 +1,193 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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" +) + +// VulnerabilityAssessmentScansClient contains the methods for the SQLVulnerabilityAssessmentScans group. +// Don't use this type directly, use NewVulnerabilityAssessmentScansClient() instead. +type VulnerabilityAssessmentScansClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVulnerabilityAssessmentScansClient creates a new instance of VulnerabilityAssessmentScansClient 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 NewVulnerabilityAssessmentScansClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VulnerabilityAssessmentScansClient, error) { + cl, err := arm.NewClient(moduleName+".VulnerabilityAssessmentScansClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VulnerabilityAssessmentScansClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Get a system database vulnerability assessment scan record. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - VulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the VulnerabilityAssessmentScansClient.Get +// method. +func (client *VulnerabilityAssessmentScansClient) Get(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, scanID string, options *VulnerabilityAssessmentScansClientGetOptions) (VulnerabilityAssessmentScansClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, scanID, options) + if err != nil { + return VulnerabilityAssessmentScansClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VulnerabilityAssessmentScansClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return VulnerabilityAssessmentScansClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *VulnerabilityAssessmentScansClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, scanID string, options *VulnerabilityAssessmentScansClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if scanID == "" { + return nil, errors.New("parameter scanID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scanId}", url.PathEscape(scanID)) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("systemDatabaseName", "master") + reqQP.Set("api-version", "2022-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 *VulnerabilityAssessmentScansClient) getHandleResponse(resp *http.Response) (VulnerabilityAssessmentScansClientGetResponse, error) { + result := VulnerabilityAssessmentScansClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessmentScanRecordForSQL); err != nil { + return VulnerabilityAssessmentScansClientGetResponse{}, err + } + return result, nil +} + +// NewListBySQLVulnerabilityAssessmentsPager - Lists the vulnerability assessment scans of a database. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsOptions contains the optional parameters for +// the VulnerabilityAssessmentScansClient.NewListBySQLVulnerabilityAssessmentsPager method. +func (client *VulnerabilityAssessmentScansClient) NewListBySQLVulnerabilityAssessmentsPager(resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsOptions) *runtime.Pager[VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse] { + return runtime.NewPager(runtime.PagingHandler[VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse]{ + More: func(page VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse) (VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySQLVulnerabilityAssessmentsCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse{}, runtime.NewResponseError(resp) + } + return client.listBySQLVulnerabilityAssessmentsHandleResponse(resp) + }, + }) +} + +// listBySQLVulnerabilityAssessmentsCreateRequest creates the ListBySQLVulnerabilityAssessments request. +func (client *VulnerabilityAssessmentScansClient) listBySQLVulnerabilityAssessmentsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("systemDatabaseName", "master") + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySQLVulnerabilityAssessmentsHandleResponse handles the ListBySQLVulnerabilityAssessments response. +func (client *VulnerabilityAssessmentScansClient) listBySQLVulnerabilityAssessmentsHandleResponse(resp *http.Response) (VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse, error) { + result := VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessmentScanRecordForSQLListResult); err != nil { + return VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscans_client_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscans_client_example_test.go new file mode 100644 index 000000000000..805fc10257c2 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscans_client_example_test.go @@ -0,0 +1,158 @@ +//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_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentScanRecordsListByDatabase.json +func ExampleVulnerabilityAssessmentScansClient_NewListBySQLVulnerabilityAssessmentsPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewVulnerabilityAssessmentScansClient().NewListBySQLVulnerabilityAssessmentsPager("vulnerabilityassessmenttest-4711", "vulnerabilityassessmenttest-6411", armsql.VulnerabilityAssessmentNameDefault, nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.VulnerabilityAssessmentScanRecordForSQLListResult = armsql.VulnerabilityAssessmentScanRecordForSQLListResult{ + // Value: []*armsql.VulnerabilityAssessmentScanRecordForSQL{ + // { + // Name: to.Ptr("scan001"), + // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/scans"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6411/sqlVulnerabilityAssessments/default/scans/scan001"), + // Properties: &armsql.VulnerabilityAssessmentScanRecordForSQLProperties{ + // Database: to.Ptr("master"), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.7236217Z"); return t}()), + // HighSeverityFailedRulesCount: to.Ptr[int32](3), + // IsBaselineApplied: to.Ptr(false), + // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), + // LowSeverityFailedRulesCount: to.Ptr[int32](1), + // MediumSeverityFailedRulesCount: to.Ptr[int32](2), + // ScanID: to.Ptr("scan001"), + // Server: to.Ptr("vulnerabilityassessmenttest-6411"), + // SQLVersion: to.Ptr("15.0.2000"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), + // State: to.Ptr(armsql.VulnerabilityAssessmentScanStateFailed), + // TotalFailedRulesCount: to.Ptr[int32](6), + // TotalPassedRulesCount: to.Ptr[int32](20), + // TotalRulesCount: to.Ptr[int32](26), + // TriggerType: to.Ptr(armsql.VulnerabilityAssessmentScanTriggerTypeRecurring), + // }, + // }, + // { + // Name: to.Ptr("scan001"), + // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/scans"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6411/sqlVulnerabilityAssessments/default/scans/scan002"), + // Properties: &armsql.VulnerabilityAssessmentScanRecordForSQLProperties{ + // Database: to.Ptr("master"), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.7236217Z"); return t}()), + // HighSeverityFailedRulesCount: to.Ptr[int32](3), + // IsBaselineApplied: to.Ptr(false), + // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), + // LowSeverityFailedRulesCount: to.Ptr[int32](1), + // MediumSeverityFailedRulesCount: to.Ptr[int32](2), + // ScanID: to.Ptr("scan002"), + // Server: to.Ptr("vulnerabilityassessmenttest-6411"), + // SQLVersion: to.Ptr("15.0.2000"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), + // State: to.Ptr(armsql.VulnerabilityAssessmentScanStateFailed), + // TotalFailedRulesCount: to.Ptr[int32](6), + // TotalPassedRulesCount: to.Ptr[int32](20), + // TotalRulesCount: to.Ptr[int32](26), + // TriggerType: to.Ptr(armsql.VulnerabilityAssessmentScanTriggerTypeRecurring), + // }, + // }, + // { + // Name: to.Ptr("scan001"), + // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/scans"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6411/sqlVulnerabilityAssessments/default/scans/scan003"), + // Properties: &armsql.VulnerabilityAssessmentScanRecordForSQLProperties{ + // Database: to.Ptr("master"), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.7236217Z"); return t}()), + // HighSeverityFailedRulesCount: to.Ptr[int32](0), + // IsBaselineApplied: to.Ptr(true), + // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), + // LowSeverityFailedRulesCount: to.Ptr[int32](0), + // MediumSeverityFailedRulesCount: to.Ptr[int32](0), + // ScanID: to.Ptr("scan003"), + // Server: to.Ptr("vulnerabilityassessmenttest-6411"), + // SQLVersion: to.Ptr("15.0.2000"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), + // State: to.Ptr(armsql.VulnerabilityAssessmentScanStateFailed), + // TotalFailedRulesCount: to.Ptr[int32](6), + // TotalPassedRulesCount: to.Ptr[int32](20), + // TotalRulesCount: to.Ptr[int32](26), + // TriggerType: to.Ptr(armsql.VulnerabilityAssessmentScanTriggerTypeRecurring), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentScan.json +func ExampleVulnerabilityAssessmentScansClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVulnerabilityAssessmentScansClient().Get(ctx, "vulnerabilityassessmenttest-4711", "vulnerabilityassessmenttest-6411", armsql.VulnerabilityAssessmentNameDefault, "scan001", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.VulnerabilityAssessmentScanRecordForSQL = armsql.VulnerabilityAssessmentScanRecordForSQL{ + // Name: to.Ptr("scan001"), + // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/scans"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6411/sqlVulnerabilityAssessments/default/scans/scan001"), + // Properties: &armsql.VulnerabilityAssessmentScanRecordForSQLProperties{ + // Database: to.Ptr("master"), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.7236217Z"); return t}()), + // HighSeverityFailedRulesCount: to.Ptr[int32](3), + // IsBaselineApplied: to.Ptr(false), + // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), + // LowSeverityFailedRulesCount: to.Ptr[int32](1), + // MediumSeverityFailedRulesCount: to.Ptr[int32](2), + // ScanID: to.Ptr("scan001"), + // Server: to.Ptr("vulnerabilityassessmenttest-6411"), + // SQLVersion: to.Ptr("15.0.2000"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), + // State: to.Ptr(armsql.VulnerabilityAssessmentScanStateFailed), + // TotalFailedRulesCount: to.Ptr[int32](6), + // TotalPassedRulesCount: to.Ptr[int32](20), + // TotalRulesCount: to.Ptr[int32](26), + // TriggerType: to.Ptr(armsql.VulnerabilityAssessmentScanTriggerTypeRecurring), + // }, + // } +} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentssettings_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentssettings_client.go new file mode 100644 index 000000000000..f8690e0c51ad --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentssettings_client.go @@ -0,0 +1,253 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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" +) + +// VulnerabilityAssessmentsSettingsClient contains the methods for the SQLVulnerabilityAssessmentsSettings group. +// Don't use this type directly, use NewVulnerabilityAssessmentsSettingsClient() instead. +type VulnerabilityAssessmentsSettingsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVulnerabilityAssessmentsSettingsClient creates a new instance of VulnerabilityAssessmentsSettingsClient 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 NewVulnerabilityAssessmentsSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VulnerabilityAssessmentsSettingsClient, error) { + cl, err := arm.NewClient(moduleName+".VulnerabilityAssessmentsSettingsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VulnerabilityAssessmentsSettingsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates SQL Vulnerability Assessment policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the SQL Vulnerability Assessment. +// - parameters - The requested resource. +// - options - VulnerabilityAssessmentsSettingsClientCreateOrUpdateOptions contains the optional parameters for the VulnerabilityAssessmentsSettingsClient.CreateOrUpdate +// method. +func (client *VulnerabilityAssessmentsSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, parameters VulnerabilityAssessment, options *VulnerabilityAssessmentsSettingsClientCreateOrUpdateOptions) (VulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, parameters, options) + if err != nil { + return VulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return VulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *VulnerabilityAssessmentsSettingsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, parameters VulnerabilityAssessment, options *VulnerabilityAssessmentsSettingsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *VulnerabilityAssessmentsSettingsClient) createOrUpdateHandleResponse(resp *http.Response) (VulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse, error) { + result := VulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessment); err != nil { + return VulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Get - Gets SQL Vulnerability Assessment policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the SQL Vulnerability Assessment. +// - options - VulnerabilityAssessmentsSettingsClientGetOptions contains the optional parameters for the VulnerabilityAssessmentsSettingsClient.Get +// method. +func (client *VulnerabilityAssessmentsSettingsClient) Get(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName SQLVulnerabilityAssessmentName, options *VulnerabilityAssessmentsSettingsClientGetOptions) (VulnerabilityAssessmentsSettingsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, options) + if err != nil { + return VulnerabilityAssessmentsSettingsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VulnerabilityAssessmentsSettingsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return VulnerabilityAssessmentsSettingsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *VulnerabilityAssessmentsSettingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName SQLVulnerabilityAssessmentName, options *VulnerabilityAssessmentsSettingsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *VulnerabilityAssessmentsSettingsClient) getHandleResponse(resp *http.Response) (VulnerabilityAssessmentsSettingsClientGetResponse, error) { + result := VulnerabilityAssessmentsSettingsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessment); err != nil { + return VulnerabilityAssessmentsSettingsClientGetResponse{}, err + } + return result, nil +} + +// NewListByServerPager - Lists SQL Vulnerability Assessment policies associated with a server. +// +// Generated from API version 2022-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. +// - serverName - The name of the server. +// - options - VulnerabilityAssessmentsSettingsClientListByServerOptions contains the optional parameters for the VulnerabilityAssessmentsSettingsClient.NewListByServerPager +// method. +func (client *VulnerabilityAssessmentsSettingsClient) NewListByServerPager(resourceGroupName string, serverName string, options *VulnerabilityAssessmentsSettingsClientListByServerOptions) *runtime.Pager[VulnerabilityAssessmentsSettingsClientListByServerResponse] { + return runtime.NewPager(runtime.PagingHandler[VulnerabilityAssessmentsSettingsClientListByServerResponse]{ + More: func(page VulnerabilityAssessmentsSettingsClientListByServerResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VulnerabilityAssessmentsSettingsClientListByServerResponse) (VulnerabilityAssessmentsSettingsClientListByServerResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VulnerabilityAssessmentsSettingsClientListByServerResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VulnerabilityAssessmentsSettingsClientListByServerResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VulnerabilityAssessmentsSettingsClientListByServerResponse{}, runtime.NewResponseError(resp) + } + return client.listByServerHandleResponse(resp) + }, + }) +} + +// listByServerCreateRequest creates the ListByServer request. +func (client *VulnerabilityAssessmentsSettingsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *VulnerabilityAssessmentsSettingsClientListByServerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByServerHandleResponse handles the ListByServer response. +func (client *VulnerabilityAssessmentsSettingsClient) listByServerHandleResponse(resp *http.Response) (VulnerabilityAssessmentsSettingsClientListByServerResponse, error) { + result := VulnerabilityAssessmentsSettingsClientListByServerResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessmentListResult); err != nil { + return VulnerabilityAssessmentsSettingsClientListByServerResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentssettings_client_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentssettings_client_example_test.go new file mode 100644 index 000000000000..7662c09ae5fa --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentssettings_client_example_test.go @@ -0,0 +1,115 @@ +//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_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/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentListByServer.json +func ExampleVulnerabilityAssessmentsSettingsClient_NewListByServerPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewVulnerabilityAssessmentsSettingsClient().NewListByServerPager("vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.VulnerabilityAssessmentListResult = armsql.VulnerabilityAssessmentListResult{ + // Value: []*armsql.VulnerabilityAssessment{ + // { + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/sqlVulnerabilityAssessments/"), + // Properties: &armsql.VulnerabilityAssessmentPolicyProperties{ + // State: to.Ptr(armsql.SQLVulnerabilityAssessmentStateEnabled), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentGet.json +func ExampleVulnerabilityAssessmentsSettingsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVulnerabilityAssessmentsSettingsClient().Get(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", armsql.SQLVulnerabilityAssessmentNameDefault, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.VulnerabilityAssessment = armsql.VulnerabilityAssessment{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/sqlVulnerabilityAssessments/default"), + // Properties: &armsql.VulnerabilityAssessmentPolicyProperties{ + // State: to.Ptr(armsql.SQLVulnerabilityAssessmentStateEnabled), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentCreate.json +func ExampleVulnerabilityAssessmentsSettingsClient_CreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsql.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVulnerabilityAssessmentsSettingsClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", armsql.VulnerabilityAssessmentNameDefault, armsql.VulnerabilityAssessment{ + Properties: &armsql.VulnerabilityAssessmentPolicyProperties{ + State: to.Ptr(armsql.SQLVulnerabilityAssessmentStateEnabled), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.VulnerabilityAssessment = armsql.VulnerabilityAssessment{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/sqlVulnerabilityAssessments/default"), + // Properties: &armsql.VulnerabilityAssessmentPolicyProperties{ + // State: to.Ptr(armsql.SQLVulnerabilityAssessmentStateEnabled), + // }, + // } +} diff --git a/sdk/resourcemanager/sql/armsql/workloadclassifiers_client.go b/sdk/resourcemanager/sql/armsql/workloadclassifiers_client.go index 49b503a20e29..cb9fd6b2a845 100644 --- a/sdk/resourcemanager/sql/armsql/workloadclassifiers_client.go +++ b/sdk/resourcemanager/sql/armsql/workloadclassifiers_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -63,7 +62,8 @@ func (client *WorkloadClassifiersClient) BeginCreateOrUpdate(ctx context.Context if err != nil { return nil, err } - return runtime.NewPoller[WorkloadClassifiersClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[WorkloadClassifiersClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[WorkloadClassifiersClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -74,18 +74,20 @@ func (client *WorkloadClassifiersClient) BeginCreateOrUpdate(ctx context.Context // // Generated from API version 2020-11-01-preview func (client *WorkloadClassifiersClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, workloadClassifierName string, parameters WorkloadClassifier, options *WorkloadClassifiersClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, workloadGroupName, workloadClassifierName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -123,7 +125,10 @@ func (client *WorkloadClassifiersClient) createOrUpdateCreateRequest(ctx context reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a workload classifier. @@ -144,7 +149,8 @@ func (client *WorkloadClassifiersClient) BeginDelete(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller[WorkloadClassifiersClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[WorkloadClassifiersClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[WorkloadClassifiersClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -155,18 +161,20 @@ func (client *WorkloadClassifiersClient) BeginDelete(ctx context.Context, resour // // Generated from API version 2020-11-01-preview func (client *WorkloadClassifiersClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, workloadClassifierName string, options *WorkloadClassifiersClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, workloadGroupName, workloadClassifierName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -218,18 +226,21 @@ func (client *WorkloadClassifiersClient) deleteCreateRequest(ctx context.Context // - workloadClassifierName - The name of the workload classifier. // - options - WorkloadClassifiersClientGetOptions contains the optional parameters for the WorkloadClassifiersClient.Get method. func (client *WorkloadClassifiersClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, workloadClassifierName string, options *WorkloadClassifiersClientGetOptions) (WorkloadClassifiersClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, workloadGroupName, workloadClassifierName, options) if err != nil { return WorkloadClassifiersClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return WorkloadClassifiersClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WorkloadClassifiersClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return WorkloadClassifiersClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/workloadclassifiers_client_example_test.go b/sdk/resourcemanager/sql/armsql/workloadclassifiers_client_example_test.go index b11fdde58158..674c1c9aad8c 100644 --- a/sdk/resourcemanager/sql/armsql/workloadclassifiers_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/workloadclassifiers_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadClassifier.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -51,7 +51,7 @@ func ExampleWorkloadClassifiersClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadClassifierMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadClassifierMax.json func ExampleWorkloadClassifiersClient_BeginCreateOrUpdate_createAWorkloadGroupWithAllPropertiesSpecified() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -97,7 +97,7 @@ func ExampleWorkloadClassifiersClient_BeginCreateOrUpdate_createAWorkloadGroupWi // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadClassifierMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadClassifierMin.json func ExampleWorkloadClassifiersClient_BeginCreateOrUpdate_createAWorkloadGroupWithTheRequiredPropertiesSpecified() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -138,7 +138,7 @@ func ExampleWorkloadClassifiersClient_BeginCreateOrUpdate_createAWorkloadGroupWi // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteWorkloadClassifier.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -159,7 +159,7 @@ func ExampleWorkloadClassifiersClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadClassifierList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { diff --git a/sdk/resourcemanager/sql/armsql/workloadgroups_client.go b/sdk/resourcemanager/sql/armsql/workloadgroups_client.go index acda65e91237..38e032c9745b 100644 --- a/sdk/resourcemanager/sql/armsql/workloadgroups_client.go +++ b/sdk/resourcemanager/sql/armsql/workloadgroups_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armsql @@ -62,7 +61,8 @@ func (client *WorkloadGroupsClient) BeginCreateOrUpdate(ctx context.Context, res if err != nil { return nil, err } - return runtime.NewPoller[WorkloadGroupsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[WorkloadGroupsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[WorkloadGroupsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -73,18 +73,20 @@ func (client *WorkloadGroupsClient) BeginCreateOrUpdate(ctx context.Context, res // // Generated from API version 2020-11-01-preview func (client *WorkloadGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, parameters WorkloadGroup, options *WorkloadGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, workloadGroupName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -118,7 +120,10 @@ func (client *WorkloadGroupsClient) createOrUpdateCreateRequest(ctx context.Cont reqQP.Set("api-version", "2020-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a workload group. @@ -138,7 +143,8 @@ func (client *WorkloadGroupsClient) BeginDelete(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller[WorkloadGroupsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[WorkloadGroupsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[WorkloadGroupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -149,18 +155,20 @@ func (client *WorkloadGroupsClient) BeginDelete(ctx context.Context, resourceGro // // Generated from API version 2020-11-01-preview func (client *WorkloadGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, options *WorkloadGroupsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, workloadGroupName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -207,18 +215,21 @@ func (client *WorkloadGroupsClient) deleteCreateRequest(ctx context.Context, res // - workloadGroupName - The name of the workload group. // - options - WorkloadGroupsClientGetOptions contains the optional parameters for the WorkloadGroupsClient.Get method. func (client *WorkloadGroupsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, options *WorkloadGroupsClientGetOptions) (WorkloadGroupsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, workloadGroupName, options) if err != nil { return WorkloadGroupsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return WorkloadGroupsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WorkloadGroupsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return WorkloadGroupsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/sql/armsql/workloadgroups_client_example_test.go b/sdk/resourcemanager/sql/armsql/workloadgroups_client_example_test.go index 1714a2e5dc4c..fa3c3cfce3c6 100644 --- a/sdk/resourcemanager/sql/armsql/workloadgroups_client_example_test.go +++ b/sdk/resourcemanager/sql/armsql/workloadgroups_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -51,7 +51,7 @@ func ExampleWorkloadGroupsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadGroupMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadGroupMax.json func ExampleWorkloadGroupsClient_BeginCreateOrUpdate_createAWorkloadGroupWithAllPropertiesSpecified() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -97,7 +97,7 @@ func ExampleWorkloadGroupsClient_BeginCreateOrUpdate_createAWorkloadGroupWithAll // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadGroupMin.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadGroupMin.json func ExampleWorkloadGroupsClient_BeginCreateOrUpdate_createAWorkloadGroupWithTheRequiredPropertiesSpecified() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -140,7 +140,7 @@ func ExampleWorkloadGroupsClient_BeginCreateOrUpdate_createAWorkloadGroupWithThe // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteWorkloadGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 { @@ -161,7 +161,7 @@ func ExampleWorkloadGroupsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadGroupList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/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 {