From dba9350a27f49e04f00f3bfff795f9fdab08d556 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Mon, 13 Oct 2025 07:43:13 +0000 Subject: [PATCH 1/2] Configurations: 'specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/tspconfig.yaml', API Version: 2024-12-30, SDK Release Type: stable, and CommitSHA: '91e3aca0bfa4b59a9f578959d0b214a26b90df40' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5445906 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../armmysqlflexibleservers/CHANGELOG.md | 174 + ...advancedthreatprotectionsettings_client.go | 74 +- ...tprotectionsettings_client_example_test.go | 303 +- .../mysql/armmysqlflexibleservers/autorest.md | 14 - .../azureadadministrators_client.go | 39 +- ...ureadadministrators_client_example_test.go | 106 +- .../backupandexport_client.go | 24 +- .../backupandexport_client_example_test.go | 63 +- .../armmysqlflexibleservers/backups_client.go | 24 +- .../backups_client_example_test.go | 303 +- .../mysql/armmysqlflexibleservers/build.go | 7 - .../checknameavailability_client.go | 15 +- ...ecknameavailability_client_example_test.go | 24 +- ...knameavailabilitywithoutlocation_client.go | 15 +- ...litywithoutlocation_client_example_test.go | 24 +- .../checkvirtualnetworksubnetusage_client.go | 15 +- ...lnetworksubnetusage_client_example_test.go | 39 +- .../armmysqlflexibleservers/client_factory.go | 22 +- .../configurations_client.go | 43 +- .../configurations_client_example_test.go | 531 ++- .../armmysqlflexibleservers/constants.go | 78 +- .../databases_client.go | 36 +- .../databases_client_example_test.go | 104 +- ...advancedthreatprotectionsettings_server.go | 75 +- .../fake/azureadadministrators_server.go | 75 +- .../fake/backupandexport_server.go | 63 +- .../fake/backups_server.go | 69 +- .../fake/checknameavailability_server.go | 57 +- ...knameavailabilitywithoutlocation_server.go | 57 +- .../checkvirtualnetworksubnetusage_server.go | 57 +- .../fake/configurations_server.go | 81 +- .../fake/databases_server.go | 75 +- .../fake/firewallrules_server.go | 75 +- .../fake/getprivatednszonesuffix_server.go | 55 +- .../armmysqlflexibleservers/fake/internal.go | 11 +- .../fake/locationbasedcapabilities_server.go | 57 +- .../fake/locationbasedcapabilityset_server.go | 63 +- .../fake/logfiles_server.go | 57 +- .../fake/longrunningbackup_server.go | 68 +- .../fake/longrunningbackups_server.go | 63 +- .../fake/maintenances_server.go | 80 +- .../fake/operationprogress_server.go | 57 +- .../fake/operationresults_server.go | 57 +- .../fake/operations_server.go | 55 +- .../fake/privateendpointconnections_server.go | 282 ++ .../fake/privatelinkresources_server.go | 173 + .../fake/replicas_server.go | 57 +- .../fake/server_factory.go | 113 +- .../fake/servers_server.go | 161 +- .../fake/serversmigration_server.go | 57 +- .../fake/time_rfc3339.go | 110 - .../firewallrules_client.go | 36 +- .../firewallrules_client_example_test.go | 104 +- .../getprivatednszonesuffix_client.go | 12 +- ...rivatednszonesuffix_client_example_test.go | 20 +- .../mysql/armmysqlflexibleservers/go.mod | 22 +- .../mysql/armmysqlflexibleservers/go.sum | 46 +- .../armmysqlflexibleservers/interfaces.go | 6 +- .../locationbasedcapabilities_client.go | 12 +- ...onbasedcapabilities_client_example_test.go | 1725 +++---- .../locationbasedcapabilityset_client.go | 18 +- ...nbasedcapabilityset_client_example_test.go | 4219 +++++++++-------- .../logfiles_client.go | 12 +- .../logfiles_client_example_test.go | 43 +- .../longrunningbackup_client.go | 31 +- .../longrunningbackup_client_example_test.go | 36 +- .../longrunningbackups_client.go | 18 +- .../longrunningbackups_client_example_test.go | 65 +- .../maintenances_client.go | 43 +- .../maintenances_client_example_test.go | 203 +- .../mysql/armmysqlflexibleservers/models.go | 287 +- .../armmysqlflexibleservers/models_serde.go | 259 +- .../operationprogress_client.go | 14 +- .../operationprogress_client_example_test.go | 62 +- .../operationresults_client.go | 16 +- .../operationresults_client_example_test.go | 46 +- .../operations_client.go | 14 +- .../operations_client_example_test.go | 351 +- .../mysql/armmysqlflexibleservers/options.go | 97 +- .../polymorphic_helpers.go | 6 +- .../privateendpointconnections_client.go | 342 ++ ...endpointconnections_client_example_test.go | 184 + .../privatelinkresources_client.go | 176 + ...rivatelinkresources_client_example_test.go | 87 + .../replicas_client.go | 12 +- .../replicas_client_example_test.go | 214 +- .../armmysqlflexibleservers/responses.go | 74 +- .../armmysqlflexibleservers/servers_client.go | 117 +- .../servers_client_example_test.go | 2408 +++++----- .../serversmigration_client.go | 14 +- .../serversmigration_client_example_test.go | 109 +- .../testdata/_metadata.json | 4 + .../armmysqlflexibleservers/time_rfc3339.go | 9 +- .../armmysqlflexibleservers/tsp-location.yaml | 4 + .../mysql/armmysqlflexibleservers/version.go | 10 + 95 files changed, 9019 insertions(+), 6905 deletions(-) delete mode 100644 sdk/resourcemanager/mysql/armmysqlflexibleservers/autorest.md delete mode 100644 sdk/resourcemanager/mysql/armmysqlflexibleservers/build.go create mode 100644 sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/privateendpointconnections_server.go create mode 100644 sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/privatelinkresources_server.go delete mode 100644 sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/time_rfc3339.go create mode 100644 sdk/resourcemanager/mysql/armmysqlflexibleservers/privateendpointconnections_client.go create mode 100644 sdk/resourcemanager/mysql/armmysqlflexibleservers/privateendpointconnections_client_example_test.go create mode 100644 sdk/resourcemanager/mysql/armmysqlflexibleservers/privatelinkresources_client.go create mode 100644 sdk/resourcemanager/mysql/armmysqlflexibleservers/privatelinkresources_client_example_test.go create mode 100644 sdk/resourcemanager/mysql/armmysqlflexibleservers/testdata/_metadata.json create mode 100644 sdk/resourcemanager/mysql/armmysqlflexibleservers/tsp-location.yaml create mode 100644 sdk/resourcemanager/mysql/armmysqlflexibleservers/version.go diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/CHANGELOG.md b/sdk/resourcemanager/mysql/armmysqlflexibleservers/CHANGELOG.md index 9e7ea7a2a895..255327fbdecf 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/CHANGELOG.md +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/CHANGELOG.md @@ -1,5 +1,179 @@ # Release History +## 2.0.0 (2025-10-13) +### Breaking Changes + +- Type of `Operation.Origin` has been changed from `*string` to `*Origin` +- Type of `Server.Identity` has been changed from `*Identity` to `*MySQLServerIdentity` +- Type of `Server.SKU` has been changed from `*SKU` to `*MySQLServerSKU` +- Type of `ServerForUpdate.Identity` has been changed from `*Identity` to `*MySQLServerIdentity` +- Type of `ServerForUpdate.SKU` has been changed from `*SKU` to `*MySQLServerSKU` +- Enum `SKUTier` has been removed +- Struct `ErrorResponse` has been removed +- Struct `Identity` has been removed +- Struct `ProxyResource` has been removed +- Struct `Resource` has been removed +- Struct `SKU` has been removed +- Struct `TrackedResource` has been removed + +### Features Added + +- New enum type `AdministratorName` with values `AdministratorNameActiveDirectory` +- New enum type `AdministratorType` with values `AdministratorTypeActiveDirectory` +- New enum type `AdvancedThreatProtectionName` with values `AdvancedThreatProtectionNameDefault` +- New enum type `AdvancedThreatProtectionProvisioningState` with values `AdvancedThreatProtectionProvisioningStateCanceled`, `AdvancedThreatProtectionProvisioningStateFailed`, `AdvancedThreatProtectionProvisioningStateSucceeded`, `AdvancedThreatProtectionProvisioningStateUpdating` +- New enum type `AdvancedThreatProtectionState` with values `AdvancedThreatProtectionStateDisabled`, `AdvancedThreatProtectionStateEnabled` +- New enum type `BackupFormat` with values `BackupFormatCollatedFormat`, `BackupFormatRaw` +- New enum type `BackupType` with values `BackupTypeFULL` +- New enum type `BatchOfMaintenance` with values `BatchOfMaintenanceBatch1`, `BatchOfMaintenanceBatch2`, `BatchOfMaintenanceDefault` +- New enum type `ImportSourceStorageType` with values `ImportSourceStorageTypeAzureBlob` +- New enum type `MaintenanceProvisioningState` with values `MaintenanceProvisioningStateCreating`, `MaintenanceProvisioningStateDeleting`, `MaintenanceProvisioningStateFailed`, `MaintenanceProvisioningStateSucceeded` +- New enum type `MaintenanceState` with values `MaintenanceStateCanceled`, `MaintenanceStateCompleted`, `MaintenanceStateInPreparation`, `MaintenanceStateProcessing`, `MaintenanceStateReScheduled`, `MaintenanceStateScheduled` +- New enum type `MaintenanceType` with values `MaintenanceTypeHotFixes`, `MaintenanceTypeMinorVersionUpgrade`, `MaintenanceTypeRoutineMaintenance`, `MaintenanceTypeSecurityPatches` +- New enum type `ManagedServiceIdentityType` with values `ManagedServiceIdentityTypeUserAssigned` +- New enum type `ObjectType` with values `ObjectTypeBackupAndExportResponse`, `ObjectTypeImportFromStorageResponse` +- New enum type `OperationStatus` with values `OperationStatusCancelInProgress`, `OperationStatusCanceled`, `OperationStatusFailed`, `OperationStatusInProgress`, `OperationStatusPending`, `OperationStatusSucceeded` +- New enum type `Origin` with values `OriginSystem`, `OriginUser`, `OriginUserSystem` +- New enum type `PatchStrategy` with values `PatchStrategyRegular`, `PatchStrategyVirtualCanary` +- New enum type `PrivateEndpointConnectionProvisioningState` with values `PrivateEndpointConnectionProvisioningStateCreating`, `PrivateEndpointConnectionProvisioningStateDeleting`, `PrivateEndpointConnectionProvisioningStateFailed`, `PrivateEndpointConnectionProvisioningStateSucceeded` +- New enum type `PrivateEndpointServiceConnectionStatus` with values `PrivateEndpointServiceConnectionStatusApproved`, `PrivateEndpointServiceConnectionStatusPending`, `PrivateEndpointServiceConnectionStatusRejected` +- New enum type `ProvisioningState` with values `ProvisioningStateCanceled`, `ProvisioningStateCreating`, `ProvisioningStateDeleting`, `ProvisioningStateFailed`, `ProvisioningStateSucceeded` +- New enum type `ResetAllToDefault` with values `ResetAllToDefaultFalse`, `ResetAllToDefaultTrue` +- New enum type `ServerSKUTier` with values `ServerSKUTierBurstable`, `ServerSKUTierGeneralPurpose`, `ServerSKUTierMemoryOptimized` +- New enum type `StorageRedundancyEnum` with values `StorageRedundancyEnumLocalRedundancy`, `StorageRedundancyEnumZoneRedundancy` +- New function `NewAdvancedThreatProtectionSettingsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AdvancedThreatProtectionSettingsClient, error)` +- New function `*AdvancedThreatProtectionSettingsClient.Get(context.Context, string, string, AdvancedThreatProtectionName, *AdvancedThreatProtectionSettingsClientGetOptions) (AdvancedThreatProtectionSettingsClientGetResponse, error)` +- New function `*AdvancedThreatProtectionSettingsClient.NewListPager(string, string, *AdvancedThreatProtectionSettingsClientListOptions) *runtime.Pager[AdvancedThreatProtectionSettingsClientListResponse]` +- New function `*AdvancedThreatProtectionSettingsClient.BeginUpdate(context.Context, string, string, AdvancedThreatProtectionName, AdvancedThreatProtectionForUpdate, *AdvancedThreatProtectionSettingsClientBeginUpdateOptions) (*runtime.Poller[AdvancedThreatProtectionSettingsClientUpdateResponse], error)` +- New function `*AdvancedThreatProtectionSettingsClient.BeginUpdatePut(context.Context, string, string, AdvancedThreatProtectionName, AdvancedThreatProtection, *AdvancedThreatProtectionSettingsClientBeginUpdatePutOptions) (*runtime.Poller[AdvancedThreatProtectionSettingsClientUpdatePutResponse], error)` +- New function `NewAzureADAdministratorsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AzureADAdministratorsClient, error)` +- New function `*AzureADAdministratorsClient.BeginCreateOrUpdate(context.Context, string, string, AdministratorName, AzureADAdministrator, *AzureADAdministratorsClientBeginCreateOrUpdateOptions) (*runtime.Poller[AzureADAdministratorsClientCreateOrUpdateResponse], error)` +- New function `*AzureADAdministratorsClient.BeginDelete(context.Context, string, string, AdministratorName, *AzureADAdministratorsClientBeginDeleteOptions) (*runtime.Poller[AzureADAdministratorsClientDeleteResponse], error)` +- New function `*AzureADAdministratorsClient.Get(context.Context, string, string, AdministratorName, *AzureADAdministratorsClientGetOptions) (AzureADAdministratorsClientGetResponse, error)` +- New function `*AzureADAdministratorsClient.NewListByServerPager(string, string, *AzureADAdministratorsClientListByServerOptions) *runtime.Pager[AzureADAdministratorsClientListByServerResponse]` +- New function `NewBackupAndExportClient(string, azcore.TokenCredential, *arm.ClientOptions) (*BackupAndExportClient, error)` +- New function `*BackupAndExportClient.BeginCreate(context.Context, string, string, BackupAndExportRequest, *BackupAndExportClientBeginCreateOptions) (*runtime.Poller[BackupAndExportClientCreateResponse], error)` +- New function `*BackupAndExportClient.ValidateBackup(context.Context, string, string, *BackupAndExportClientValidateBackupOptions) (BackupAndExportClientValidateBackupResponse, error)` +- New function `*BackupAndExportResponseType.GetOperationProgressResponseType() *OperationProgressResponseType` +- New function `*BackupStoreDetails.GetBackupStoreDetails() *BackupStoreDetails` +- New function `*BackupsClient.Put(context.Context, string, string, string, *BackupsClientPutOptions) (BackupsClientPutResponse, error)` +- New function `NewCheckNameAvailabilityWithoutLocationClient(string, azcore.TokenCredential, *arm.ClientOptions) (*CheckNameAvailabilityWithoutLocationClient, error)` +- New function `*CheckNameAvailabilityWithoutLocationClient.Execute(context.Context, NameAvailabilityRequest, *CheckNameAvailabilityWithoutLocationClientExecuteOptions) (CheckNameAvailabilityWithoutLocationClientExecuteResponse, error)` +- New function `*ClientFactory.NewAdvancedThreatProtectionSettingsClient() *AdvancedThreatProtectionSettingsClient` +- New function `*ClientFactory.NewAzureADAdministratorsClient() *AzureADAdministratorsClient` +- New function `*ClientFactory.NewBackupAndExportClient() *BackupAndExportClient` +- New function `*ClientFactory.NewCheckNameAvailabilityWithoutLocationClient() *CheckNameAvailabilityWithoutLocationClient` +- New function `*ClientFactory.NewLocationBasedCapabilitySetClient() *LocationBasedCapabilitySetClient` +- New function `*ClientFactory.NewLogFilesClient() *LogFilesClient` +- New function `*ClientFactory.NewLongRunningBackupClient() *LongRunningBackupClient` +- New function `*ClientFactory.NewLongRunningBackupsClient() *LongRunningBackupsClient` +- New function `*ClientFactory.NewMaintenancesClient() *MaintenancesClient` +- New function `*ClientFactory.NewOperationProgressClient() *OperationProgressClient` +- New function `*ClientFactory.NewOperationResultsClient() *OperationResultsClient` +- New function `*ClientFactory.NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient` +- New function `*ClientFactory.NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient` +- New function `*ClientFactory.NewServersMigrationClient() *ServersMigrationClient` +- New function `*ConfigurationsClient.BeginCreateOrUpdate(context.Context, string, string, string, Configuration, *ConfigurationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ConfigurationsClientCreateOrUpdateResponse], error)` +- New function `*FullBackupStoreDetails.GetBackupStoreDetails() *BackupStoreDetails` +- New function `*ImportFromStorageResponseType.GetOperationProgressResponseType() *OperationProgressResponseType` +- New function `NewLocationBasedCapabilitySetClient(string, azcore.TokenCredential, *arm.ClientOptions) (*LocationBasedCapabilitySetClient, error)` +- New function `*LocationBasedCapabilitySetClient.Get(context.Context, string, string, *LocationBasedCapabilitySetClientGetOptions) (LocationBasedCapabilitySetClientGetResponse, error)` +- New function `*LocationBasedCapabilitySetClient.NewListPager(string, *LocationBasedCapabilitySetClientListOptions) *runtime.Pager[LocationBasedCapabilitySetClientListResponse]` +- New function `NewLogFilesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*LogFilesClient, error)` +- New function `*LogFilesClient.NewListByServerPager(string, string, *LogFilesClientListByServerOptions) *runtime.Pager[LogFilesClientListByServerResponse]` +- New function `NewLongRunningBackupClient(string, azcore.TokenCredential, *arm.ClientOptions) (*LongRunningBackupClient, error)` +- New function `*LongRunningBackupClient.BeginCreate(context.Context, string, string, string, ServerBackupV2, *LongRunningBackupClientBeginCreateOptions) (*runtime.Poller[LongRunningBackupClientCreateResponse], error)` +- New function `NewLongRunningBackupsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*LongRunningBackupsClient, error)` +- New function `*LongRunningBackupsClient.Get(context.Context, string, string, string, *LongRunningBackupsClientGetOptions) (LongRunningBackupsClientGetResponse, error)` +- New function `*LongRunningBackupsClient.NewListPager(string, string, *LongRunningBackupsClientListOptions) *runtime.Pager[LongRunningBackupsClientListResponse]` +- New function `NewMaintenancesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*MaintenancesClient, error)` +- New function `*MaintenancesClient.NewListPager(string, string, *MaintenancesClientListOptions) *runtime.Pager[MaintenancesClientListResponse]` +- New function `*MaintenancesClient.Read(context.Context, string, string, string, *MaintenancesClientReadOptions) (MaintenancesClientReadResponse, error)` +- New function `*MaintenancesClient.BeginUpdate(context.Context, string, string, string, MaintenanceUpdate, *MaintenancesClientBeginUpdateOptions) (*runtime.Poller[MaintenancesClientUpdateResponse], error)` +- New function `NewOperationProgressClient(string, azcore.TokenCredential, *arm.ClientOptions) (*OperationProgressClient, error)` +- New function `*OperationProgressClient.Get(context.Context, string, string, *OperationProgressClientGetOptions) (OperationProgressClientGetResponse, error)` +- New function `*OperationProgressResponseType.GetOperationProgressResponseType() *OperationProgressResponseType` +- New function `NewOperationResultsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*OperationResultsClient, error)` +- New function `*OperationResultsClient.Get(context.Context, string, string, *OperationResultsClientGetOptions) (OperationResultsClientGetResponse, error)` +- New function `NewPrivateEndpointConnectionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error)` +- New function `*PrivateEndpointConnectionsClient.BeginCreateOrUpdate(context.Context, string, string, string, PrivateEndpointConnection, *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PrivateEndpointConnectionsClientCreateOrUpdateResponse], error)` +- New function `*PrivateEndpointConnectionsClient.BeginDelete(context.Context, string, string, string, *PrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error)` +- New function `*PrivateEndpointConnectionsClient.Get(context.Context, string, string, string, *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error)` +- New function `*PrivateEndpointConnectionsClient.ListByServer(context.Context, string, string, *PrivateEndpointConnectionsClientListByServerOptions) (PrivateEndpointConnectionsClientListByServerResponse, error)` +- New function `NewPrivateLinkResourcesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*PrivateLinkResourcesClient, error)` +- New function `*PrivateLinkResourcesClient.Get(context.Context, string, string, string, *PrivateLinkResourcesClientGetOptions) (PrivateLinkResourcesClientGetResponse, error)` +- New function `*PrivateLinkResourcesClient.NewListByServerPager(string, string, *PrivateLinkResourcesClientListByServerOptions) *runtime.Pager[PrivateLinkResourcesClientListByServerResponse]` +- New function `*ServersClient.BeginDetachVNet(context.Context, string, string, ServerDetachVNetParameter, *ServersClientBeginDetachVNetOptions) (*runtime.Poller[ServersClientDetachVNetResponse], error)` +- New function `*ServersClient.BeginResetGtid(context.Context, string, string, ServerGtidSetParameter, *ServersClientBeginResetGtidOptions) (*runtime.Poller[ServersClientResetGtidResponse], error)` +- New function `*ServersClient.ValidateEstimateHighAvailability(context.Context, string, string, HighAvailabilityValidationEstimation, *ServersClientValidateEstimateHighAvailabilityOptions) (ServersClientValidateEstimateHighAvailabilityResponse, error)` +- New function `NewServersMigrationClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ServersMigrationClient, error)` +- New function `*ServersMigrationClient.BeginCutoverMigration(context.Context, string, string, *ServersMigrationClientBeginCutoverMigrationOptions) (*runtime.Poller[ServersMigrationClientCutoverMigrationResponse], error)` +- New struct `AdministratorListResult` +- New struct `AdministratorProperties` +- New struct `AdvancedThreatProtection` +- New struct `AdvancedThreatProtectionForUpdate` +- New struct `AdvancedThreatProtectionListResult` +- New struct `AdvancedThreatProtectionProperties` +- New struct `AdvancedThreatProtectionUpdateProperties` +- New struct `AzureADAdministrator` +- New struct `BackupAndExportRequest` +- New struct `BackupAndExportResponse` +- New struct `BackupAndExportResponseProperties` +- New struct `BackupAndExportResponseType` +- New struct `BackupSettings` +- New struct `Capability` +- New struct `CapabilityPropertiesV2` +- New struct `CapabilitySetsList` +- New struct `ErrorDetail` +- New struct `FeatureProperty` +- New struct `FullBackupStoreDetails` +- New struct `HighAvailabilityValidationEstimation` +- New struct `ImportFromStorageResponseType` +- New struct `ImportSourceProperties` +- New struct `LogFile` +- New struct `LogFileListResult` +- New struct `LogFileProperties` +- New struct `Maintenance` +- New struct `MaintenanceListResult` +- New struct `MaintenancePolicy` +- New struct `MaintenanceProperties` +- New struct `MaintenancePropertiesForUpdate` +- New struct `MaintenanceUpdate` +- New struct `MySQLServerIdentity` +- New struct `MySQLServerSKU` +- New struct `OperationProgressResult` +- New struct `OperationStatusExtendedResult` +- New struct `OperationStatusResult` +- New struct `PrivateEndpoint` +- New struct `PrivateEndpointConnection` +- New struct `PrivateEndpointConnectionListResult` +- New struct `PrivateEndpointConnectionProperties` +- New struct `PrivateLinkResource` +- New struct `PrivateLinkResourceListResult` +- New struct `PrivateLinkResourceProperties` +- New struct `PrivateLinkServiceConnectionState` +- New struct `SKUCapabilityV2` +- New struct `ServerBackupPropertiesV2` +- New struct `ServerBackupV2` +- New struct `ServerBackupV2ListResult` +- New struct `ServerDetachVNetParameter` +- New struct `ServerEditionCapabilityV2` +- New struct `ServerGtidSetParameter` +- New struct `ServerVersionCapabilityV2` +- New struct `ValidateBackupResponse` +- New struct `ValidateBackupResponseProperties` +- New field `BackupIntervalHours` in struct `Backup` +- New field `ResetAllToDefault` in struct `ConfigurationListForBatchUpdate` +- New field `CurrentValue`, `DocumentationLink` in struct `ConfigurationProperties` +- New field `Keyword`, `Page`, `PageSize`, `Tags` in struct `ConfigurationsClientListByServerOptions` +- New field `BatchOfMaintenance` in struct `MaintenanceWindow` +- New field `DatabasePort`, `FullVersion`, `ImportSourceProperties`, `MaintenancePolicy`, `PrivateEndpointConnections` in struct `ServerProperties` +- New field `MaintenancePolicy`, `Network`, `Version` in struct `ServerPropertiesForUpdate` +- New field `AutoIoScaling`, `LogOnDisk`, `StorageRedundancy` in struct `Storage` +- New field `MaxBackupIntervalHours`, `MinBackupIntervalHours` in struct `StorageEditionCapability` +- New field `Location`, `SubscriptionID` in struct `VirtualNetworkSubnetUsageResult` + + ## 2.0.0-beta.4 (2025-02-27) ### Features Added diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/advancedthreatprotectionsettings_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/advancedthreatprotectionsettings_client.go index 32737a373d74..db59f07df19e 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/advancedthreatprotectionsettings_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/advancedthreatprotectionsettings_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -46,7 +42,7 @@ func NewAdvancedThreatProtectionSettingsClient(subscriptionID string, credential // Get - Get a server's Advanced Threat Protection state // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - advancedThreatProtectionName - The name of the Advanced Threat Protection state. @@ -75,8 +71,12 @@ func (client *AdvancedThreatProtectionSettingsClient) Get(ctx context.Context, r } // getCreateRequest creates the Get request. -func (client *AdvancedThreatProtectionSettingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, advancedThreatProtectionName AdvancedThreatProtectionName, options *AdvancedThreatProtectionSettingsClientGetOptions) (*policy.Request, error) { +func (client *AdvancedThreatProtectionSettingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, advancedThreatProtectionName AdvancedThreatProtectionName, _ *AdvancedThreatProtectionSettingsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + 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") } @@ -89,16 +89,12 @@ func (client *AdvancedThreatProtectionSettingsClient) getCreateRequest(ctx conte 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", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +111,7 @@ func (client *AdvancedThreatProtectionSettingsClient) getHandleResponse(resp *ht // NewListPager - Gets a list of server's Advanced Threat Protection states. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - AdvancedThreatProtectionSettingsClientListOptions contains the optional parameters for the AdvancedThreatProtectionSettingsClient.NewListPager @@ -144,8 +140,12 @@ func (client *AdvancedThreatProtectionSettingsClient) NewListPager(resourceGroup } // listCreateRequest creates the List request. -func (client *AdvancedThreatProtectionSettingsClient) listCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *AdvancedThreatProtectionSettingsClientListOptions) (*policy.Request, error) { +func (client *AdvancedThreatProtectionSettingsClient) listCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *AdvancedThreatProtectionSettingsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/advancedThreatProtectionSettings" + 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") } @@ -154,16 +154,12 @@ func (client *AdvancedThreatProtectionSettingsClient) listCreateRequest(ctx cont 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", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +177,7 @@ func (client *AdvancedThreatProtectionSettingsClient) listHandleResponse(resp *h // BeginUpdate - Updates a server's Advanced Threat Protection state. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - advancedThreatProtectionName - The name of the Advanced Threat Protection state. @@ -195,8 +191,7 @@ func (client *AdvancedThreatProtectionSettingsClient) BeginUpdate(ctx context.Co return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AdvancedThreatProtectionSettingsClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -209,7 +204,7 @@ func (client *AdvancedThreatProtectionSettingsClient) BeginUpdate(ctx context.Co // Update - Updates a server's Advanced Threat Protection state. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 func (client *AdvancedThreatProtectionSettingsClient) update(ctx context.Context, resourceGroupName string, serverName string, advancedThreatProtectionName AdvancedThreatProtectionName, parameters AdvancedThreatProtectionForUpdate, options *AdvancedThreatProtectionSettingsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "AdvancedThreatProtectionSettingsClient.BeginUpdate" @@ -232,8 +227,12 @@ func (client *AdvancedThreatProtectionSettingsClient) update(ctx context.Context } // updateCreateRequest creates the Update request. -func (client *AdvancedThreatProtectionSettingsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, advancedThreatProtectionName AdvancedThreatProtectionName, parameters AdvancedThreatProtectionForUpdate, options *AdvancedThreatProtectionSettingsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *AdvancedThreatProtectionSettingsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, advancedThreatProtectionName AdvancedThreatProtectionName, parameters AdvancedThreatProtectionForUpdate, _ *AdvancedThreatProtectionSettingsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + 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") } @@ -246,18 +245,15 @@ func (client *AdvancedThreatProtectionSettingsClient) updateCreateRequest(ctx co 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.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -267,7 +263,7 @@ func (client *AdvancedThreatProtectionSettingsClient) updateCreateRequest(ctx co // BeginUpdatePut - Updates a server's Advanced Threat Protection state. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - advancedThreatProtectionName - The name of the Advanced Threat Protection state. @@ -281,8 +277,7 @@ func (client *AdvancedThreatProtectionSettingsClient) BeginUpdatePut(ctx context return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AdvancedThreatProtectionSettingsClientUpdatePutResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -295,7 +290,7 @@ func (client *AdvancedThreatProtectionSettingsClient) BeginUpdatePut(ctx context // UpdatePut - Updates a server's Advanced Threat Protection state. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 func (client *AdvancedThreatProtectionSettingsClient) updatePut(ctx context.Context, resourceGroupName string, serverName string, advancedThreatProtectionName AdvancedThreatProtectionName, parameters AdvancedThreatProtection, options *AdvancedThreatProtectionSettingsClientBeginUpdatePutOptions) (*http.Response, error) { var err error const operationName = "AdvancedThreatProtectionSettingsClient.BeginUpdatePut" @@ -318,8 +313,12 @@ func (client *AdvancedThreatProtectionSettingsClient) updatePut(ctx context.Cont } // updatePutCreateRequest creates the UpdatePut request. -func (client *AdvancedThreatProtectionSettingsClient) updatePutCreateRequest(ctx context.Context, resourceGroupName string, serverName string, advancedThreatProtectionName AdvancedThreatProtectionName, parameters AdvancedThreatProtection, options *AdvancedThreatProtectionSettingsClientBeginUpdatePutOptions) (*policy.Request, error) { +func (client *AdvancedThreatProtectionSettingsClient) updatePutCreateRequest(ctx context.Context, resourceGroupName string, serverName string, advancedThreatProtectionName AdvancedThreatProtectionName, parameters AdvancedThreatProtection, _ *AdvancedThreatProtectionSettingsClientBeginUpdatePutOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + 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") } @@ -332,18 +331,15 @@ func (client *AdvancedThreatProtectionSettingsClient) updatePutCreateRequest(ctx 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", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/advancedthreatprotectionsettings_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/advancedthreatprotectionsettings_client_example_test.go index badadc254f96..27ca9efb86f1 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/advancedthreatprotectionsettings_client_example_test.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/advancedthreatprotectionsettings_client_example_test.go @@ -1,31 +1,25 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers_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/mysql/armmysqlflexibleservers/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/AdvancedThreatProtectionSettingsGet.json +// Generated from example definition: 2024-12-30/AdvancedThreatProtectionSettingsGet.json func ExampleAdvancedThreatProtectionSettingsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,34 +30,85 @@ func ExampleAdvancedThreatProtectionSettingsClient_Get() { // 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.AdvancedThreatProtection = armmysqlflexibleservers.AdvancedThreatProtection{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.DBforMySQL/flexibleServers/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // SystemData: &armmysqlflexibleservers.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(armmysqlflexibleservers.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(armmysqlflexibleservers.CreatedByTypeUser), - // }, - // Properties: &armmysqlflexibleservers.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // ProvisioningState: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionProvisioningStateSucceeded), - // State: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionStateEnabled), + // res = armmysqlflexibleservers.AdvancedThreatProtectionSettingsClientGetResponse{ + // AdvancedThreatProtection: &armmysqlflexibleservers.AdvancedThreatProtection{ + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/advancedThreatProtectionSettings"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.DBforMySQL/flexibleServers/threatprotection-6440/advancedThreatProtectionSettings/Default"), + // Properties: &armmysqlflexibleservers.AdvancedThreatProtectionProperties{ + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // ProvisioningState: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionProvisioningStateSucceeded), + // State: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionStateEnabled), + // }, + // SystemData: &armmysqlflexibleservers.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(armmysqlflexibleservers.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(armmysqlflexibleservers.CreatedByTypeUser), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/AdvancedThreatProtectionSettingsPatchDisabled.json -func ExampleAdvancedThreatProtectionSettingsClient_BeginUpdate_disableAServersAdvancedThreatProtectionSettingsWithAllParameters() { +// Generated from example definition: 2024-12-30/AdvancedThreatProtectionSettingsList.json +func ExampleAdvancedThreatProtectionSettingsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmysqlflexibleservers.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewAdvancedThreatProtectionSettingsClient().NewListPager("threatprotection-6852", "threatprotection-2080", 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 = armmysqlflexibleservers.AdvancedThreatProtectionSettingsClientListResponse{ + // AdvancedThreatProtectionListResult: armmysqlflexibleservers.AdvancedThreatProtectionListResult{ + // Value: []*armmysqlflexibleservers.AdvancedThreatProtection{ + // { + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/advancedThreatProtectionSettings"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-6852/providers/Microsoft.DBforMySQL/flexibleServers/threatprotection-2080/advancedThreatProtectionSettings/Default"), + // Properties: &armmysqlflexibleservers.AdvancedThreatProtectionProperties{ + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // ProvisioningState: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionProvisioningStateSucceeded), + // State: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionStateEnabled), + // }, + // SystemData: &armmysqlflexibleservers.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(armmysqlflexibleservers.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(armmysqlflexibleservers.CreatedByTypeUser), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2024-12-30/AdvancedThreatProtectionSettingsPatchDisabled.json +func ExampleAdvancedThreatProtectionSettingsClient_BeginUpdate_disableAServerSAdvancedThreatProtectionSettingsWithAllParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -82,34 +127,36 @@ func ExampleAdvancedThreatProtectionSettingsClient_BeginUpdate_disableAServersAd // 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.AdvancedThreatProtection = armmysqlflexibleservers.AdvancedThreatProtection{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.DBforMySQL/flexibleServers/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // SystemData: &armmysqlflexibleservers.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(armmysqlflexibleservers.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(armmysqlflexibleservers.CreatedByTypeUser), - // }, - // Properties: &armmysqlflexibleservers.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // ProvisioningState: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionProvisioningStateSucceeded), - // State: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionStateDisabled), + // res = armmysqlflexibleservers.AdvancedThreatProtectionSettingsClientUpdateResponse{ + // AdvancedThreatProtection: &armmysqlflexibleservers.AdvancedThreatProtection{ + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/advancedThreatProtectionSettings"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.DBforMySQL/flexibleServers/threatprotection-6440/advancedThreatProtectionSettings/Default"), + // Properties: &armmysqlflexibleservers.AdvancedThreatProtectionProperties{ + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // ProvisioningState: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionProvisioningStateSucceeded), + // State: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionStateDisabled), + // }, + // SystemData: &armmysqlflexibleservers.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(armmysqlflexibleservers.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(armmysqlflexibleservers.CreatedByTypeUser), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/AdvancedThreatProtectionSettingsPatchEnabled.json -func ExampleAdvancedThreatProtectionSettingsClient_BeginUpdate_enableAServersAdvancedThreatProtectionSettings() { +// Generated from example definition: 2024-12-30/AdvancedThreatProtectionSettingsPatchEnabled.json +func ExampleAdvancedThreatProtectionSettingsClient_BeginUpdate_enableAServerSAdvancedThreatProtectionSettings() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -128,34 +175,36 @@ func ExampleAdvancedThreatProtectionSettingsClient_BeginUpdate_enableAServersAdv // 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.AdvancedThreatProtection = armmysqlflexibleservers.AdvancedThreatProtection{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.DBforMySQL/flexibleServers/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // SystemData: &armmysqlflexibleservers.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(armmysqlflexibleservers.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(armmysqlflexibleservers.CreatedByTypeUser), - // }, - // Properties: &armmysqlflexibleservers.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // ProvisioningState: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionProvisioningStateSucceeded), - // State: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionStateEnabled), + // res = armmysqlflexibleservers.AdvancedThreatProtectionSettingsClientUpdateResponse{ + // AdvancedThreatProtection: &armmysqlflexibleservers.AdvancedThreatProtection{ + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/advancedThreatProtectionSettings"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.DBforMySQL/flexibleServers/threatprotection-6440/advancedThreatProtectionSettings/Default"), + // Properties: &armmysqlflexibleservers.AdvancedThreatProtectionProperties{ + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // ProvisioningState: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionProvisioningStateSucceeded), + // State: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionStateEnabled), + // }, + // SystemData: &armmysqlflexibleservers.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(armmysqlflexibleservers.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(armmysqlflexibleservers.CreatedByTypeUser), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/AdvancedThreatProtectionSettingsPutDisabled.json -func ExampleAdvancedThreatProtectionSettingsClient_BeginUpdatePut_disableAServersAdvancedThreatProtectionSettingsWithAllParametersUsingPut() { +// Generated from example definition: 2024-12-30/AdvancedThreatProtectionSettingsPutDisabled.json +func ExampleAdvancedThreatProtectionSettingsClient_BeginUpdatePut_disableAServerSAdvancedThreatProtectionSettingsWithAllParametersUsingPut() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -174,34 +223,36 @@ func ExampleAdvancedThreatProtectionSettingsClient_BeginUpdatePut_disableAServer // 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.AdvancedThreatProtection = armmysqlflexibleservers.AdvancedThreatProtection{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.DBforMySQL/flexibleServers/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // SystemData: &armmysqlflexibleservers.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(armmysqlflexibleservers.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(armmysqlflexibleservers.CreatedByTypeUser), - // }, - // Properties: &armmysqlflexibleservers.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // ProvisioningState: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionProvisioningStateSucceeded), - // State: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionStateDisabled), + // res = armmysqlflexibleservers.AdvancedThreatProtectionSettingsClientUpdatePutResponse{ + // AdvancedThreatProtection: &armmysqlflexibleservers.AdvancedThreatProtection{ + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/advancedThreatProtectionSettings"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.DBforMySQL/flexibleServers/threatprotection-6440/advancedThreatProtectionSettings/Default"), + // Properties: &armmysqlflexibleservers.AdvancedThreatProtectionProperties{ + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // ProvisioningState: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionProvisioningStateSucceeded), + // State: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionStateDisabled), + // }, + // SystemData: &armmysqlflexibleservers.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(armmysqlflexibleservers.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(armmysqlflexibleservers.CreatedByTypeUser), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/AdvancedThreatProtectionSettingsPutEnabled.json -func ExampleAdvancedThreatProtectionSettingsClient_BeginUpdatePut_enableAServersAdvancedThreatProtectionSettingsUsingPut() { +// Generated from example definition: 2024-12-30/AdvancedThreatProtectionSettingsPutEnabled.json +func ExampleAdvancedThreatProtectionSettingsClient_BeginUpdatePut_enableAServerSAdvancedThreatProtectionSettingsUsingPut() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -220,68 +271,24 @@ func ExampleAdvancedThreatProtectionSettingsClient_BeginUpdatePut_enableAServers // 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.AdvancedThreatProtection = armmysqlflexibleservers.AdvancedThreatProtection{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.DBforMySQL/flexibleServers/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // SystemData: &armmysqlflexibleservers.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(armmysqlflexibleservers.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(armmysqlflexibleservers.CreatedByTypeUser), - // }, - // Properties: &armmysqlflexibleservers.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // ProvisioningState: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionProvisioningStateSucceeded), - // State: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionStateEnabled), + // res = armmysqlflexibleservers.AdvancedThreatProtectionSettingsClientUpdatePutResponse{ + // AdvancedThreatProtection: &armmysqlflexibleservers.AdvancedThreatProtection{ + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/advancedThreatProtectionSettings"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.DBforMySQL/flexibleServers/threatprotection-6440/advancedThreatProtectionSettings/Default"), + // Properties: &armmysqlflexibleservers.AdvancedThreatProtectionProperties{ + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), + // ProvisioningState: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionProvisioningStateSucceeded), + // State: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionStateEnabled), + // }, + // SystemData: &armmysqlflexibleservers.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(armmysqlflexibleservers.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(armmysqlflexibleservers.CreatedByTypeUser), + // }, // }, // } } - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/AdvancedThreatProtectionSettingsList.json -func ExampleAdvancedThreatProtectionSettingsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAdvancedThreatProtectionSettingsClient().NewListPager("threatprotection-6852", "threatprotection-2080", 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.AdvancedThreatProtectionListResult = armmysqlflexibleservers.AdvancedThreatProtectionListResult{ - // Value: []*armmysqlflexibleservers.AdvancedThreatProtection{ - // { - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-6852/providers/Microsoft.DBforMySQL/flexibleServers/threatprotection-2080/advancedThreatProtectionSettings/Default"), - // SystemData: &armmysqlflexibleservers.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(armmysqlflexibleservers.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(armmysqlflexibleservers.CreatedByTypeUser), - // }, - // Properties: &armmysqlflexibleservers.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // ProvisioningState: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionProvisioningStateSucceeded), - // State: to.Ptr(armmysqlflexibleservers.AdvancedThreatProtectionStateEnabled), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/autorest.md b/sdk/resourcemanager/mysql/armmysqlflexibleservers/autorest.md deleted file mode 100644 index d326a3a827b1..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/autorest.md +++ /dev/null @@ -1,14 +0,0 @@ -### AutoRest Configuration - -> see https://aka.ms/autorest - -``` yaml -azure-arm: true -require: -- https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/readme.go.md -license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.0.0-beta.4 -package-flexibleservers: true -tag: package-flexibleserver-2024-10-01-preview -``` \ No newline at end of file diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/azureadadministrators_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/azureadadministrators_client.go index 954ee46d3b57..3f862324f415 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/azureadadministrators_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/azureadadministrators_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -46,7 +42,7 @@ func NewAzureADAdministratorsClient(subscriptionID string, credential azcore.Tok // BeginCreateOrUpdate - Creates or updates an existing Azure Active Directory administrator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - administratorName - The name of the Azure AD Administrator. @@ -73,7 +69,7 @@ func (client *AzureADAdministratorsClient) BeginCreateOrUpdate(ctx context.Conte // CreateOrUpdate - Creates or updates an existing Azure Active Directory administrator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 func (client *AzureADAdministratorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, administratorName AdministratorName, parameters AzureADAdministrator, options *AzureADAdministratorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "AzureADAdministratorsClient.BeginCreateOrUpdate" @@ -96,7 +92,7 @@ func (client *AzureADAdministratorsClient) createOrUpdate(ctx context.Context, r } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *AzureADAdministratorsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, administratorName AdministratorName, parameters AzureADAdministrator, options *AzureADAdministratorsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *AzureADAdministratorsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, administratorName AdministratorName, parameters AzureADAdministrator, _ *AzureADAdministratorsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators/{administratorName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -119,9 +115,10 @@ func (client *AzureADAdministratorsClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -131,7 +128,7 @@ func (client *AzureADAdministratorsClient) createOrUpdateCreateRequest(ctx conte // BeginDelete - Deletes an Azure AD Administrator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - administratorName - The name of the Azure AD Administrator. @@ -144,8 +141,7 @@ func (client *AzureADAdministratorsClient) BeginDelete(ctx context.Context, reso return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AzureADAdministratorsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -158,7 +154,7 @@ func (client *AzureADAdministratorsClient) BeginDelete(ctx context.Context, reso // Delete - Deletes an Azure AD Administrator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 func (client *AzureADAdministratorsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, administratorName AdministratorName, options *AzureADAdministratorsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AzureADAdministratorsClient.BeginDelete" @@ -181,7 +177,7 @@ func (client *AzureADAdministratorsClient) deleteOperation(ctx context.Context, } // deleteCreateRequest creates the Delete request. -func (client *AzureADAdministratorsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, administratorName AdministratorName, options *AzureADAdministratorsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *AzureADAdministratorsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, administratorName AdministratorName, _ *AzureADAdministratorsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators/{administratorName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -204,16 +200,15 @@ func (client *AzureADAdministratorsClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Gets information about an azure ad administrator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - administratorName - The name of the Azure AD Administrator. @@ -242,7 +237,7 @@ func (client *AzureADAdministratorsClient) Get(ctx context.Context, resourceGrou } // getCreateRequest creates the Get request. -func (client *AzureADAdministratorsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, administratorName AdministratorName, options *AzureADAdministratorsClientGetOptions) (*policy.Request, error) { +func (client *AzureADAdministratorsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, administratorName AdministratorName, _ *AzureADAdministratorsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators/{administratorName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -265,7 +260,7 @@ func (client *AzureADAdministratorsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +277,7 @@ func (client *AzureADAdministratorsClient) getHandleResponse(resp *http.Response // NewListByServerPager - List all the AAD administrators in a given server. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - AzureADAdministratorsClientListByServerOptions contains the optional parameters for the AzureADAdministratorsClient.NewListByServerPager @@ -311,7 +306,7 @@ func (client *AzureADAdministratorsClient) NewListByServerPager(resourceGroupNam } // listByServerCreateRequest creates the ListByServer request. -func (client *AzureADAdministratorsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *AzureADAdministratorsClientListByServerOptions) (*policy.Request, error) { +func (client *AzureADAdministratorsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *AzureADAdministratorsClientListByServerOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -330,7 +325,7 @@ func (client *AzureADAdministratorsClient) listByServerCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/azureadadministrators_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/azureadadministrators_client_example_test.go index 1a720c2aecd0..0b6aa200f331 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/azureadadministrators_client_example_test.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/azureadadministrators_client_example_test.go @@ -1,31 +1,25 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers_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/mysql/armmysqlflexibleservers/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/stable/2023-12-30/examples/AzureADAdministratorCreate.json +// Generated from example definition: 2024-12-30/AzureADAdministratorCreate.json func ExampleAzureADAdministratorsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -48,28 +42,30 @@ func ExampleAzureADAdministratorsClient_BeginCreateOrUpdate() { // 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.AzureADAdministrator = armmysqlflexibleservers.AzureADAdministrator{ - // Name: to.Ptr("ActiveDirectory"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestsvc4/administrators/ActiveDirectory"), - // Properties: &armmysqlflexibleservers.AdministratorProperties{ - // AdministratorType: to.Ptr(armmysqlflexibleservers.AdministratorTypeActiveDirectory), - // IdentityResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/test-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi"), - // Login: to.Ptr("bob@contoso.com"), - // Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - // TenantID: to.Ptr("c12b7025-bfe2-46c1-b463-993b5e4cd467"), + // res = armmysqlflexibleservers.AzureADAdministratorsClientCreateOrUpdateResponse{ + // AzureADAdministrator: &armmysqlflexibleservers.AzureADAdministrator{ + // Name: to.Ptr("ActiveDirectory"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/administrators"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestsvc4/administrators/ActiveDirectory"), + // Properties: &armmysqlflexibleservers.AdministratorProperties{ + // AdministratorType: to.Ptr(armmysqlflexibleservers.AdministratorTypeActiveDirectory), + // IdentityResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/test-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi"), + // Login: to.Ptr("bob@contoso.com"), + // Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), + // TenantID: to.Ptr("c12b7025-bfe2-46c1-b463-993b5e4cd467"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/stable/2023-12-30/examples/AzureADAdministratorDelete.json +// Generated from example definition: 2024-12-30/AzureADAdministratorDelete.json func ExampleAzureADAdministratorsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -77,20 +73,25 @@ func ExampleAzureADAdministratorsClient_BeginDelete() { 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 = armmysqlflexibleservers.AzureADAdministratorsClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/stable/2023-12-30/examples/AzureADAdministratorGet.json +// Generated from example definition: 2024-12-30/AzureADAdministratorGet.json func ExampleAzureADAdministratorsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -101,28 +102,30 @@ func ExampleAzureADAdministratorsClient_Get() { // 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.AzureADAdministrator = armmysqlflexibleservers.AzureADAdministrator{ - // Name: to.Ptr("ActiveDirectory"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestsvc4/administrators/ActiveDirectory"), - // Properties: &armmysqlflexibleservers.AdministratorProperties{ - // AdministratorType: to.Ptr(armmysqlflexibleservers.AdministratorTypeActiveDirectory), - // IdentityResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/test-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi"), - // Login: to.Ptr("bob@contoso.com"), - // Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - // TenantID: to.Ptr("c12b7025-bfe2-46c1-b463-993b5e4cd467"), + // res = armmysqlflexibleservers.AzureADAdministratorsClientGetResponse{ + // AzureADAdministrator: &armmysqlflexibleservers.AzureADAdministrator{ + // Name: to.Ptr("ActiveDirectory"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/administrators"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestsvc4/administrators/ActiveDirectory"), + // Properties: &armmysqlflexibleservers.AdministratorProperties{ + // AdministratorType: to.Ptr(armmysqlflexibleservers.AdministratorTypeActiveDirectory), + // IdentityResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/test-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi"), + // Login: to.Ptr("bob@contoso.com"), + // Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), + // TenantID: to.Ptr("c12b7025-bfe2-46c1-b463-993b5e4cd467"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/stable/2023-12-30/examples/AzureADAdministratorsListByServer.json +// Generated from example definition: 2024-12-30/AzureADAdministratorsListByServer.json func ExampleAzureADAdministratorsClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -137,20 +140,23 @@ func ExampleAzureADAdministratorsClient_NewListByServerPager() { _ = 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.AdministratorListResult = armmysqlflexibleservers.AdministratorListResult{ - // Value: []*armmysqlflexibleservers.AzureADAdministrator{ - // { - // Name: to.Ptr("ActiveDirectory"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestsvc4/administrators/ActiveDirectory"), - // Properties: &armmysqlflexibleservers.AdministratorProperties{ - // AdministratorType: to.Ptr(armmysqlflexibleservers.AdministratorTypeActiveDirectory), - // IdentityResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/test-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi"), - // Login: to.Ptr("bob@contoso.com"), - // Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - // TenantID: to.Ptr("c12b7025-bfe2-46c1-b463-993b5e4cd467"), + // page = armmysqlflexibleservers.AzureADAdministratorsClientListByServerResponse{ + // AdministratorListResult: armmysqlflexibleservers.AdministratorListResult{ + // Value: []*armmysqlflexibleservers.AzureADAdministrator{ + // { + // Name: to.Ptr("ActiveDirectory"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/administrators"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestsvc4/administrators/ActiveDirectory"), + // Properties: &armmysqlflexibleservers.AdministratorProperties{ + // AdministratorType: to.Ptr(armmysqlflexibleservers.AdministratorTypeActiveDirectory), + // IdentityResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/test-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi"), + // Login: to.Ptr("bob@contoso.com"), + // Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), + // TenantID: to.Ptr("c12b7025-bfe2-46c1-b463-993b5e4cd467"), + // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/backupandexport_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/backupandexport_client.go index ef236f4245b8..4b3ba89f9dd9 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/backupandexport_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/backupandexport_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -46,7 +42,7 @@ func NewBackupAndExportClient(subscriptionID string, credential azcore.TokenCred // BeginCreate - Exports the backup of the given server by creating a backup if not existing. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - parameters - The required parameters for creating and exporting backup of the given server. @@ -59,8 +55,7 @@ func (client *BackupAndExportClient) BeginCreate(ctx context.Context, resourceGr return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupAndExportClientCreateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -73,7 +68,7 @@ func (client *BackupAndExportClient) BeginCreate(ctx context.Context, resourceGr // Create - Exports the backup of the given server by creating a backup if not existing. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 func (client *BackupAndExportClient) create(ctx context.Context, resourceGroupName string, serverName string, parameters BackupAndExportRequest, options *BackupAndExportClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "BackupAndExportClient.BeginCreate" @@ -96,7 +91,7 @@ func (client *BackupAndExportClient) create(ctx context.Context, resourceGroupNa } // createCreateRequest creates the Create request. -func (client *BackupAndExportClient) createCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters BackupAndExportRequest, options *BackupAndExportClientBeginCreateOptions) (*policy.Request, error) { +func (client *BackupAndExportClient) createCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters BackupAndExportRequest, _ *BackupAndExportClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backupAndExport" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -115,9 +110,10 @@ func (client *BackupAndExportClient) createCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -127,7 +123,7 @@ func (client *BackupAndExportClient) createCreateRequest(ctx context.Context, re // ValidateBackup - Validates if backup can be performed for given server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - BackupAndExportClientValidateBackupOptions contains the optional parameters for the BackupAndExportClient.ValidateBackup @@ -155,7 +151,7 @@ func (client *BackupAndExportClient) ValidateBackup(ctx context.Context, resourc } // validateBackupCreateRequest creates the ValidateBackup request. -func (client *BackupAndExportClient) validateBackupCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *BackupAndExportClientValidateBackupOptions) (*policy.Request, error) { +func (client *BackupAndExportClient) validateBackupCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *BackupAndExportClientValidateBackupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/validateBackup" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -174,7 +170,7 @@ func (client *BackupAndExportClient) validateBackupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/backupandexport_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/backupandexport_client_example_test.go index 6edfd33bcd58..2a93f7e134f6 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/backupandexport_client_example_test.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/backupandexport_client_example_test.go @@ -1,31 +1,25 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers_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/mysql/armmysqlflexibleservers/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/stable/2023-12-30/examples/BackupAndExport.json +// Generated from example definition: 2024-12-30/BackupAndExport.json func ExampleBackupAndExportClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -37,7 +31,8 @@ func ExampleBackupAndExportClient_BeginCreate() { ObjectType: to.Ptr("FullBackupStoreDetails"), SasURIList: []*string{ to.Ptr("sasuri1"), - to.Ptr("sasuri2")}, + to.Ptr("sasuri2"), + }, }, }, nil) if err != nil { @@ -50,34 +45,36 @@ func ExampleBackupAndExportClient_BeginCreate() { // 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.BackupAndExportResponse = armmysqlflexibleservers.BackupAndExportResponse{ - // Error: &armmysqlflexibleservers.ErrorDetail{ - // Code: to.Ptr("AggregateException"), - // Message: to.Ptr("System.AggregateException: One or more errors occurred. (Mismatch in count of number of Commited-Blocks from service.)"), - // }, - // Name: to.Ptr("custom-backup101"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backupAndExport"), - // ID: to.Ptr("/subscriptions/cb9d743d-2140-4e73-b871-cd31abab1d2f/resourceGroups/mrgsumitkumatest1/providers/Microsoft.DBforMySQL/flexibleServers/servermysql-01/backupAndExport/custom-backup101"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-29T07:37:05.640Z"); return t}()), - // PercentComplete: to.Ptr[float64](100), - // Properties: &armmysqlflexibleservers.BackupAndExportResponseProperties{ - // BackupMetadata: to.Ptr("{\"key1\":\"value1\",\"key2\":\"value2\"}"), - // DataTransferredInBytes: to.Ptr[int64](1024), - // DatasourceSizeInBytes: to.Ptr[int64](1024), + // res = armmysqlflexibleservers.BackupAndExportClientCreateResponse{ + // BackupAndExportResponse: &armmysqlflexibleservers.BackupAndExportResponse{ + // Name: to.Ptr("custom-backup101"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backupAndExport"), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-29T07:37:05.6406008Z"); return t}()), + // Error: &armmysqlflexibleservers.ErrorDetail{ + // Code: to.Ptr("AggregateException"), + // Message: to.Ptr("System.AggregateException: One or more errors occurred. (Mismatch in count of number of Commited-Blocks from service.)"), + // }, + // ID: to.Ptr("/subscriptions/cb9d743d-2140-4e73-b871-cd31abab1d2f/resourceGroups/mrgsumitkumatest1/providers/Microsoft.DBforMySQL/flexibleServers/servermysql-01/backupAndExport/custom-backup101"), + // PercentComplete: to.Ptr[float64](100), + // Properties: &armmysqlflexibleservers.BackupAndExportResponseProperties{ + // BackupMetadata: to.Ptr("{\"key1\":\"value1\",\"key2\":\"value2\"}"), + // DataTransferredInBytes: to.Ptr[int64](1024), + // DatasourceSizeInBytes: to.Ptr[int64](1024), + // }, + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-29T07:34:02.328326Z"); return t}()), + // Status: to.Ptr(armmysqlflexibleservers.OperationStatusFailed), // }, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-29T07:34:02.328Z"); return t}()), - // Status: to.Ptr(armmysqlflexibleservers.OperationStatusFailed), // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/stable/2023-12-30/examples/ValidateBackup.json +// Generated from example definition: 2024-12-30/ValidateBackup.json func ExampleBackupAndExportClient_ValidateBackup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -88,9 +85,11 @@ func ExampleBackupAndExportClient_ValidateBackup() { // 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.ValidateBackupResponse = armmysqlflexibleservers.ValidateBackupResponse{ - // Properties: &armmysqlflexibleservers.ValidateBackupResponseProperties{ - // NumberOfContainers: to.Ptr[int32](1), + // res = armmysqlflexibleservers.BackupAndExportClientValidateBackupResponse{ + // ValidateBackupResponse: &armmysqlflexibleservers.ValidateBackupResponse{ + // Properties: &armmysqlflexibleservers.ValidateBackupResponseProperties{ + // NumberOfContainers: to.Ptr[int32](1), + // }, // }, // } } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/backups_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/backups_client.go index 505a17a57f29..374262fa8297 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/backups_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/backups_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -46,7 +42,7 @@ func NewBackupsClient(subscriptionID string, credential azcore.TokenCredential, // Get - List all the backups for a given server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - backupName - The name of the backup. @@ -74,7 +70,7 @@ func (client *BackupsClient) Get(ctx context.Context, resourceGroupName string, } // getCreateRequest creates the Get request. -func (client *BackupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *BackupsClientGetOptions) (*policy.Request, error) { +func (client *BackupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, backupName string, _ *BackupsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backups/{backupName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -97,7 +93,7 @@ func (client *BackupsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,7 +110,7 @@ func (client *BackupsClient) getHandleResponse(resp *http.Response) (BackupsClie // NewListByServerPager - List all the backups for a given server. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - BackupsClientListByServerOptions contains the optional parameters for the BackupsClient.NewListByServerPager @@ -143,7 +139,7 @@ func (client *BackupsClient) NewListByServerPager(resourceGroupName string, serv } // listByServerCreateRequest creates the ListByServer request. -func (client *BackupsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *BackupsClientListByServerOptions) (*policy.Request, error) { +func (client *BackupsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *BackupsClientListByServerOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backups" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -162,7 +158,7 @@ func (client *BackupsClient) listByServerCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +176,7 @@ func (client *BackupsClient) listByServerHandleResponse(resp *http.Response) (Ba // Put - Create backup for a given server with specified backup name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - backupName - The name of the backup. @@ -208,7 +204,7 @@ func (client *BackupsClient) Put(ctx context.Context, resourceGroupName string, } // putCreateRequest creates the Put request. -func (client *BackupsClient) putCreateRequest(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *BackupsClientPutOptions) (*policy.Request, error) { +func (client *BackupsClient) putCreateRequest(ctx context.Context, resourceGroupName string, serverName string, backupName string, _ *BackupsClientPutOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backups/{backupName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -231,7 +227,7 @@ func (client *BackupsClient) putCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/backups_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/backups_client_example_test.go index ca28911b37bd..4e6ebb63f942 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/backups_client_example_test.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/backups_client_example_test.go @@ -1,60 +1,24 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/stable/2023-12-30/examples/BackupPut.json -func ExampleBackupsClient_Put() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupsClient().Put(ctx, "TestGroup", "mysqltestserver", "mybackup", 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.ServerBackup = armmysqlflexibleservers.ServerBackup{ - // Name: to.Ptr("customer_20220507t073755_bb392c3b-17c6-4d3f-9742-8479ca87b3ac_mybackup"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/customer_20220507t073755_bb392c3b-17c6-4d3f-9742-8479ca87b3ac_mybackup"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-07T07:38:01.149Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/stable/2023-12-30/examples/BackupGet.json +// Generated from example definition: 2024-12-30/BackupGet.json func ExampleBackupsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -65,26 +29,28 @@ func ExampleBackupsClient_Get() { // 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.ServerBackup = armmysqlflexibleservers.ServerBackup{ - // Name: to.Ptr("daily_20210615T160516"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210615T160516"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T16:05:19.902Z"); return t}()), - // Source: to.Ptr("Automatic"), + // res = armmysqlflexibleservers.BackupsClientGetResponse{ + // ServerBackup: &armmysqlflexibleservers.ServerBackup{ + // Name: to.Ptr("daily_20210615T160516"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210615T160516"), + // Properties: &armmysqlflexibleservers.ServerBackupProperties{ + // BackupType: to.Ptr("FULL"), + // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T16:05:19.902522+00:00"); return t}()), + // Source: to.Ptr("Automatic"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/stable/2023-12-30/examples/BackupsListByServer.json +// Generated from example definition: 2024-12-30/BackupsListByServer.json func ExampleBackupsClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -99,118 +65,153 @@ func ExampleBackupsClient_NewListByServerPager() { _ = 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.ServerBackupListResult = armmysqlflexibleservers.ServerBackupListResult{ - // Value: []*armmysqlflexibleservers.ServerBackup{ - // { - // Name: to.Ptr("daily_20210615T160516"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210615T160516"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T16:05:19.902Z"); return t}()), - // Source: to.Ptr("Automatic"), + // page = armmysqlflexibleservers.BackupsClientListByServerResponse{ + // ServerBackupListResult: armmysqlflexibleservers.ServerBackupListResult{ + // Value: []*armmysqlflexibleservers.ServerBackup{ + // { + // Name: to.Ptr("daily_20210615T160516"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210615T160516"), + // Properties: &armmysqlflexibleservers.ServerBackupProperties{ + // BackupType: to.Ptr("FULL"), + // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T16:05:19.902522+00:00"); return t}()), + // Source: to.Ptr("Automatic"), + // }, // }, - // }, - // { - // Name: to.Ptr("daily_20210616T160520"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210616T160520"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T16:05:23.924Z"); return t}()), - // Source: to.Ptr("Automatic"), + // { + // Name: to.Ptr("daily_20210616T160520"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210616T160520"), + // Properties: &armmysqlflexibleservers.ServerBackupProperties{ + // BackupType: to.Ptr("FULL"), + // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T16:05:23.9243453+00:00"); return t}()), + // Source: to.Ptr("Automatic"), + // }, // }, - // }, - // { - // Name: to.Ptr("daily_20210617T160525"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210617T160525"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T16:05:28.124Z"); return t}()), - // Source: to.Ptr("Automatic"), + // { + // Name: to.Ptr("daily_20210617T160525"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210617T160525"), + // Properties: &armmysqlflexibleservers.ServerBackupProperties{ + // BackupType: to.Ptr("FULL"), + // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T16:05:28.1247488+00:00"); return t}()), + // Source: to.Ptr("Automatic"), + // }, // }, - // }, - // { - // Name: to.Ptr("daily_20210618T160529"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210618T160529"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-18T16:05:32.273Z"); return t}()), - // Source: to.Ptr("Automatic"), + // { + // Name: to.Ptr("daily_20210618T160529"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210618T160529"), + // Properties: &armmysqlflexibleservers.ServerBackupProperties{ + // BackupType: to.Ptr("FULL"), + // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-18T16:05:32.2736701+00:00"); return t}()), + // Source: to.Ptr("Automatic"), + // }, // }, - // }, - // { - // Name: to.Ptr("daily_20210619T160533"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210619T160533"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-19T16:05:36.860Z"); return t}()), - // Source: to.Ptr("Automatic"), + // { + // Name: to.Ptr("daily_20210619T160533"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210619T160533"), + // Properties: &armmysqlflexibleservers.ServerBackupProperties{ + // BackupType: to.Ptr("FULL"), + // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-19T16:05:36.8603354+00:00"); return t}()), + // Source: to.Ptr("Automatic"), + // }, // }, - // }, - // { - // Name: to.Ptr("daily_20210620T160538"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210620T160538"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-20T16:05:41.920Z"); return t}()), - // Source: to.Ptr("Automatic"), + // { + // Name: to.Ptr("daily_20210620T160538"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210620T160538"), + // Properties: &armmysqlflexibleservers.ServerBackupProperties{ + // BackupType: to.Ptr("FULL"), + // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-20T16:05:41.9200138+00:00"); return t}()), + // Source: to.Ptr("Automatic"), + // }, // }, - // }, - // { - // Name: to.Ptr("daily_20210621T160543"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210621T160543"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-21T16:05:48.852Z"); return t}()), - // Source: to.Ptr("Automatic"), + // { + // Name: to.Ptr("daily_20210621T160543"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210621T160543"), + // Properties: &armmysqlflexibleservers.ServerBackupProperties{ + // BackupType: to.Ptr("FULL"), + // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-21T16:05:48.8528447+00:00"); return t}()), + // Source: to.Ptr("Automatic"), + // }, // }, - // }, - // { - // Name: to.Ptr("daily_20210622T160803"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210622T160803"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-22T16:08:06.312Z"); return t}()), - // Source: to.Ptr("Automatic"), + // { + // Name: to.Ptr("daily_20210622T160803"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210622T160803"), + // Properties: &armmysqlflexibleservers.ServerBackupProperties{ + // BackupType: to.Ptr("FULL"), + // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-22T16:08:06.3121688+00:00"); return t}()), + // Source: to.Ptr("Automatic"), + // }, // }, - // }, - // { - // Name: to.Ptr("daily_20210622T210807"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210622T210807"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-22T21:08:10.505Z"); return t}()), - // Source: to.Ptr("Automatic"), + // { + // Name: to.Ptr("daily_20210622T210807"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210622T210807"), + // Properties: &armmysqlflexibleservers.ServerBackupProperties{ + // BackupType: to.Ptr("FULL"), + // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-22T21:08:10.5057354+00:00"); return t}()), + // Source: to.Ptr("Automatic"), + // }, // }, - // }, - // { - // Name: to.Ptr("daily_20210623T212413"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210623T212413"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-23T21:24:16.940Z"); return t}()), - // Source: to.Ptr("Automatic"), + // { + // Name: to.Ptr("daily_20210623T212413"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210623T212413"), + // Properties: &armmysqlflexibleservers.ServerBackupProperties{ + // BackupType: to.Ptr("FULL"), + // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-23T21:24:16.9401531+00:00"); return t}()), + // Source: to.Ptr("Automatic"), + // }, // }, - // }, - // { - // Name: to.Ptr("daily_20210624T061328"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210624T061328"), - // Properties: &armmysqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr("FULL"), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-24T06:13:31.496Z"); return t}()), - // Source: to.Ptr("Automatic"), + // { + // Name: to.Ptr("daily_20210624T061328"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/daily_20210624T061328"), + // Properties: &armmysqlflexibleservers.ServerBackupProperties{ + // BackupType: to.Ptr("FULL"), + // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-24T06:13:31.4962137+00:00"); return t}()), + // Source: to.Ptr("Automatic"), + // }, // }, - // }}, + // }, + // }, // } } } + +// Generated from example definition: 2024-12-30/BackupPut.json +func ExampleBackupsClient_Put() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewBackupsClient().Put(ctx, "TestGroup", "mysqltestserver", "mybackup", 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 = armmysqlflexibleservers.BackupsClientPutResponse{ + // ServerBackup: &armmysqlflexibleservers.ServerBackup{ + // Name: to.Ptr("customer_20220507t073755_bb392c3b-17c6-4d3f-9742-8479ca87b3ac_mybackup"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backups/customer_20220507t073755_bb392c3b-17c6-4d3f-9742-8479ca87b3ac_mybackup"), + // Properties: &armmysqlflexibleservers.ServerBackupProperties{ + // BackupType: to.Ptr("FULL"), + // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-07T07:38:01.1498043+00:00"); return t}()), + // Source: to.Ptr("Automatic"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/build.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/build.go deleted file mode 100644 index 01fea770d306..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/build.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. - -// This file enables 'go generate' to regenerate this specific SDK -//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate resourcemanager/mysql/armmysqlflexibleservers - -package armmysqlflexibleservers diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailability_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailability_client.go index dd2506d11ff0..b0586e9ac635 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailability_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailability_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -46,9 +42,9 @@ func NewCheckNameAvailabilityClient(subscriptionID string, credential azcore.Tok // Execute - Check the availability of name for server // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - locationName - The name of the location. -// - nameAvailabilityRequest - The required parameters for checking if server name is available. +// - nameAvailabilityRequest - The request body // - options - CheckNameAvailabilityClientExecuteOptions contains the optional parameters for the CheckNameAvailabilityClient.Execute // method. func (client *CheckNameAvailabilityClient) Execute(ctx context.Context, locationName string, nameAvailabilityRequest NameAvailabilityRequest, options *CheckNameAvailabilityClientExecuteOptions) (CheckNameAvailabilityClientExecuteResponse, error) { @@ -74,7 +70,7 @@ func (client *CheckNameAvailabilityClient) Execute(ctx context.Context, location } // executeCreateRequest creates the Execute request. -func (client *CheckNameAvailabilityClient) executeCreateRequest(ctx context.Context, locationName string, nameAvailabilityRequest NameAvailabilityRequest, options *CheckNameAvailabilityClientExecuteOptions) (*policy.Request, error) { +func (client *CheckNameAvailabilityClient) executeCreateRequest(ctx context.Context, locationName string, nameAvailabilityRequest NameAvailabilityRequest, _ *CheckNameAvailabilityClientExecuteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/checkNameAvailability" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -89,9 +85,10 @@ func (client *CheckNameAvailabilityClient) executeCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, nameAvailabilityRequest); err != nil { return nil, err } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailability_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailability_client_example_test.go index 88a48462e9dc..a13f7843597d 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailability_client_example_test.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailability_client_example_test.go @@ -1,31 +1,25 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers_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/mysql/armmysqlflexibleservers/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2024-10-01-preview/examples/CheckNameAvailability.json +// Generated from example definition: 2024-12-30/CheckNameAvailability.json func ExampleCheckNameAvailabilityClient_Execute() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -39,9 +33,11 @@ func ExampleCheckNameAvailabilityClient_Execute() { // 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.NameAvailability = armmysqlflexibleservers.NameAvailability{ - // Message: to.Ptr(""), - // NameAvailable: to.Ptr(true), - // Reason: to.Ptr(""), + // res = armmysqlflexibleservers.CheckNameAvailabilityClientExecuteResponse{ + // NameAvailability: &armmysqlflexibleservers.NameAvailability{ + // Message: to.Ptr(""), + // NameAvailable: to.Ptr(true), + // Reason: to.Ptr(""), + // }, // } } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailabilitywithoutlocation_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailabilitywithoutlocation_client.go index ace1806bbb70..c3ff54775644 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailabilitywithoutlocation_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailabilitywithoutlocation_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -46,8 +42,8 @@ func NewCheckNameAvailabilityWithoutLocationClient(subscriptionID string, creden // Execute - Check the availability of name for server // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview -// - nameAvailabilityRequest - The required parameters for checking if server name is available. +// Generated from API version 2024-12-30 +// - nameAvailabilityRequest - The request body // - options - CheckNameAvailabilityWithoutLocationClientExecuteOptions contains the optional parameters for the CheckNameAvailabilityWithoutLocationClient.Execute // method. func (client *CheckNameAvailabilityWithoutLocationClient) Execute(ctx context.Context, nameAvailabilityRequest NameAvailabilityRequest, options *CheckNameAvailabilityWithoutLocationClientExecuteOptions) (CheckNameAvailabilityWithoutLocationClientExecuteResponse, error) { @@ -73,7 +69,7 @@ func (client *CheckNameAvailabilityWithoutLocationClient) Execute(ctx context.Co } // executeCreateRequest creates the Execute request. -func (client *CheckNameAvailabilityWithoutLocationClient) executeCreateRequest(ctx context.Context, nameAvailabilityRequest NameAvailabilityRequest, options *CheckNameAvailabilityWithoutLocationClientExecuteOptions) (*policy.Request, error) { +func (client *CheckNameAvailabilityWithoutLocationClient) executeCreateRequest(ctx context.Context, nameAvailabilityRequest NameAvailabilityRequest, _ *CheckNameAvailabilityWithoutLocationClientExecuteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/checkNameAvailability" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -84,9 +80,10 @@ func (client *CheckNameAvailabilityWithoutLocationClient) executeCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, nameAvailabilityRequest); err != nil { return nil, err } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailabilitywithoutlocation_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailabilitywithoutlocation_client_example_test.go index c54a9883dd37..9be81f5c5dc5 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailabilitywithoutlocation_client_example_test.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/checknameavailabilitywithoutlocation_client_example_test.go @@ -1,31 +1,25 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers_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/mysql/armmysqlflexibleservers/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2024-10-01-preview/examples/CheckNameAvailability.json +// Generated from example definition: 2024-12-30/CheckNameAvailabilityWithoutLocation.json func ExampleCheckNameAvailabilityWithoutLocationClient_Execute() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -39,9 +33,11 @@ func ExampleCheckNameAvailabilityWithoutLocationClient_Execute() { // 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.NameAvailability = armmysqlflexibleservers.NameAvailability{ - // Message: to.Ptr(""), - // NameAvailable: to.Ptr(true), - // Reason: to.Ptr(""), + // res = armmysqlflexibleservers.CheckNameAvailabilityWithoutLocationClientExecuteResponse{ + // NameAvailability: &armmysqlflexibleservers.NameAvailability{ + // Message: to.Ptr(""), + // NameAvailable: to.Ptr(true), + // Reason: to.Ptr(""), + // }, // } } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/checkvirtualnetworksubnetusage_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/checkvirtualnetworksubnetusage_client.go index 615f14de3062..8e6dd1def16d 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/checkvirtualnetworksubnetusage_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/checkvirtualnetworksubnetusage_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -46,9 +42,9 @@ func NewCheckVirtualNetworkSubnetUsageClient(subscriptionID string, credential a // Execute - Get virtual network subnet usage for a given vNet resource id. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - locationName - The name of the location. -// - parameters - The required parameters for creating or updating a server. +// - parameters - The request body // - options - CheckVirtualNetworkSubnetUsageClientExecuteOptions contains the optional parameters for the CheckVirtualNetworkSubnetUsageClient.Execute // method. func (client *CheckVirtualNetworkSubnetUsageClient) Execute(ctx context.Context, locationName string, parameters VirtualNetworkSubnetUsageParameter, options *CheckVirtualNetworkSubnetUsageClientExecuteOptions) (CheckVirtualNetworkSubnetUsageClientExecuteResponse, error) { @@ -74,7 +70,7 @@ func (client *CheckVirtualNetworkSubnetUsageClient) Execute(ctx context.Context, } // executeCreateRequest creates the Execute request. -func (client *CheckVirtualNetworkSubnetUsageClient) executeCreateRequest(ctx context.Context, locationName string, parameters VirtualNetworkSubnetUsageParameter, options *CheckVirtualNetworkSubnetUsageClientExecuteOptions) (*policy.Request, error) { +func (client *CheckVirtualNetworkSubnetUsageClient) executeCreateRequest(ctx context.Context, locationName string, parameters VirtualNetworkSubnetUsageParameter, _ *CheckVirtualNetworkSubnetUsageClientExecuteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/checkVirtualNetworkSubnetUsage" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -89,9 +85,10 @@ func (client *CheckVirtualNetworkSubnetUsageClient) executeCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/checkvirtualnetworksubnetusage_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/checkvirtualnetworksubnetusage_client_example_test.go index 594105de16d9..2e55ba7c4335 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/checkvirtualnetworksubnetusage_client_example_test.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/checkvirtualnetworksubnetusage_client_example_test.go @@ -1,31 +1,25 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers_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/mysql/armmysqlflexibleservers/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2024-10-01-preview/examples/CheckVirtualNetworkSubnetUsage.json +// Generated from example definition: 2024-12-30/CheckVirtualNetworkSubnetUsage.json func ExampleCheckVirtualNetworkSubnetUsageClient_Execute() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -38,17 +32,20 @@ func ExampleCheckVirtualNetworkSubnetUsageClient_Execute() { // 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.VirtualNetworkSubnetUsageResult = armmysqlflexibleservers.VirtualNetworkSubnetUsageResult{ - // DelegatedSubnetsUsage: []*armmysqlflexibleservers.DelegatedSubnetUsage{ - // { - // SubnetName: to.Ptr("test-subnet-1"), - // Usage: to.Ptr[int64](2), + // res = armmysqlflexibleservers.CheckVirtualNetworkSubnetUsageClientExecuteResponse{ + // VirtualNetworkSubnetUsageResult: &armmysqlflexibleservers.VirtualNetworkSubnetUsageResult{ + // DelegatedSubnetsUsage: []*armmysqlflexibleservers.DelegatedSubnetUsage{ + // { + // SubnetName: to.Ptr("test-subnet-1"), + // Usage: to.Ptr[int64](2), + // }, + // { + // SubnetName: to.Ptr("test-subnet-2"), + // Usage: to.Ptr[int64](3), + // }, // }, - // { - // SubnetName: to.Ptr("test-subnet-2"), - // Usage: to.Ptr[int64](3), - // }}, - // Location: to.Ptr("WestUS"), - // SubscriptionID: to.Ptr("ffffffff-ffff-ffff-ffff-ffffffffffff"), + // Location: to.Ptr("WestUS"), + // SubscriptionID: to.Ptr("ffffffff-ffff-ffff-ffff-ffffffffffff"), + // }, // } } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/client_factory.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/client_factory.go index af878d37efa8..3b42787ea27d 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/client_factory.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/client_factory.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -194,6 +190,22 @@ func (c *ClientFactory) NewOperationsClient() *OperationsClient { } } +// NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient. +func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { + return &PrivateEndpointConnectionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient. +func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient { + return &PrivateLinkResourcesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewReplicasClient creates a new instance of ReplicasClient. func (c *ClientFactory) NewReplicasClient() *ReplicasClient { return &ReplicasClient{ diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/configurations_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/configurations_client.go index 346da80ee932..4137cb0cf2d2 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/configurations_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/configurations_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -47,7 +43,7 @@ func NewConfigurationsClient(subscriptionID string, credential azcore.TokenCrede // BeginBatchUpdate - Update a list of configurations in a given server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - parameters - The parameters for updating a list of server configuration. @@ -74,7 +70,7 @@ func (client *ConfigurationsClient) BeginBatchUpdate(ctx context.Context, resour // BatchUpdate - Update a list of configurations in a given server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 func (client *ConfigurationsClient) batchUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ConfigurationListForBatchUpdate, options *ConfigurationsClientBeginBatchUpdateOptions) (*http.Response, error) { var err error const operationName = "ConfigurationsClient.BeginBatchUpdate" @@ -97,7 +93,7 @@ func (client *ConfigurationsClient) batchUpdate(ctx context.Context, resourceGro } // batchUpdateCreateRequest creates the BatchUpdate request. -func (client *ConfigurationsClient) batchUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters ConfigurationListForBatchUpdate, options *ConfigurationsClientBeginBatchUpdateOptions) (*policy.Request, error) { +func (client *ConfigurationsClient) batchUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters ConfigurationListForBatchUpdate, _ *ConfigurationsClientBeginBatchUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/updateConfigurations" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -116,9 +112,10 @@ func (client *ConfigurationsClient) batchUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -128,7 +125,7 @@ func (client *ConfigurationsClient) batchUpdateCreateRequest(ctx context.Context // BeginCreateOrUpdate - Updates a configuration of a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - configurationName - The name of the server configuration. @@ -155,7 +152,7 @@ func (client *ConfigurationsClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Updates a configuration of a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 func (client *ConfigurationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration, options *ConfigurationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ConfigurationsClient.BeginCreateOrUpdate" @@ -178,7 +175,7 @@ func (client *ConfigurationsClient) createOrUpdate(ctx context.Context, resource } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration, options *ConfigurationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration, _ *ConfigurationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations/{configurationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -201,9 +198,10 @@ func (client *ConfigurationsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -213,7 +211,7 @@ func (client *ConfigurationsClient) createOrUpdateCreateRequest(ctx context.Cont // Get - Gets information about a configuration of server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - configurationName - The name of the server configuration. @@ -241,7 +239,7 @@ func (client *ConfigurationsClient) Get(ctx context.Context, resourceGroupName s } // getCreateRequest creates the Get request. -func (client *ConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, configurationName string, options *ConfigurationsClientGetOptions) (*policy.Request, error) { +func (client *ConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, configurationName string, _ *ConfigurationsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations/{configurationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -264,7 +262,7 @@ func (client *ConfigurationsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,7 +279,7 @@ func (client *ConfigurationsClient) getHandleResponse(resp *http.Response) (Conf // NewListByServerPager - List all the configurations in a given server. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ConfigurationsClientListByServerOptions contains the optional parameters for the ConfigurationsClient.NewListByServerPager @@ -329,7 +327,7 @@ func (client *ConfigurationsClient) listByServerCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") if options != nil && options.Keyword != nil { reqQP.Set("keyword", *options.Keyword) } @@ -359,7 +357,7 @@ func (client *ConfigurationsClient) listByServerHandleResponse(resp *http.Respon // BeginUpdate - Updates a configuration of a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - configurationName - The name of the server configuration. @@ -386,7 +384,7 @@ func (client *ConfigurationsClient) BeginUpdate(ctx context.Context, resourceGro // Update - Updates a configuration of a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 func (client *ConfigurationsClient) update(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration, options *ConfigurationsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ConfigurationsClient.BeginUpdate" @@ -409,7 +407,7 @@ func (client *ConfigurationsClient) update(ctx context.Context, resourceGroupNam } // updateCreateRequest creates the Update request. -func (client *ConfigurationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration, options *ConfigurationsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *ConfigurationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration, _ *ConfigurationsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations/{configurationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -432,9 +430,10 @@ func (client *ConfigurationsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/configurations_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/configurations_client_example_test.go index c3c12801dd58..1efcfd2ef557 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/configurations_client_example_test.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/configurations_client_example_test.go @@ -1,38 +1,43 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers_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/mysql/armmysqlflexibleservers/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/stable/2023-12-30/examples/ConfigurationCreateOrUpdate.json -func ExampleConfigurationsClient_BeginCreateOrUpdate() { +// Generated from example definition: 2024-12-30/ConfigurationsBatchUpdate.json +func ExampleConfigurationsClient_BeginBatchUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewConfigurationsClient().BeginCreateOrUpdate(ctx, "TestGroup", "testserver", "event_scheduler", armmysqlflexibleservers.Configuration{ - Properties: &armmysqlflexibleservers.ConfigurationProperties{ - Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceUserOverride), - Value: to.Ptr("off"), + poller, err := clientFactory.NewConfigurationsClient().BeginBatchUpdate(ctx, "testrg", "mysqltestserver", armmysqlflexibleservers.ConfigurationListForBatchUpdate{ + ResetAllToDefault: to.Ptr(armmysqlflexibleservers.ResetAllToDefaultFalse), + Value: []*armmysqlflexibleservers.ConfigurationForBatchUpdate{ + { + Name: to.Ptr("event_scheduler"), + Properties: &armmysqlflexibleservers.ConfigurationForBatchUpdateProperties{ + Value: to.Ptr("OFF"), + }, + }, + { + Name: to.Ptr("div_precision_increment"), + Properties: &armmysqlflexibleservers.ConfigurationForBatchUpdateProperties{ + Value: to.Ptr("8"), + }, + }, }, }, nil) if err != nil { @@ -45,36 +50,61 @@ func ExampleConfigurationsClient_BeginCreateOrUpdate() { // 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.Configuration = armmysqlflexibleservers.Configuration{ - // Name: to.Ptr("event_scheduler"), - // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver/configurations/event_scheduler"), - // Properties: &armmysqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Indicates the status of the Event Scheduler."), - // AllowedValues: to.Ptr("ON,OFF,DISABLED"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("OFF"), - // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceUserOverride), - // Value: to.Ptr("ON"), + // res = armmysqlflexibleservers.ConfigurationsClientBatchUpdateResponse{ + // ConfigurationListResult: &armmysqlflexibleservers.ConfigurationListResult{ + // Value: []*armmysqlflexibleservers.Configuration{ + // { + // Name: to.Ptr("event_scheduler"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/event_scheduler"), + // Properties: &armmysqlflexibleservers.ConfigurationProperties{ + // Description: to.Ptr("Indicates the status of the Event Scheduler. It is always OFF for a replica server to keep the replication consistency."), + // AllowedValues: to.Ptr("ON,OFF"), + // DataType: to.Ptr("Enumeration"), + // DefaultValue: to.Ptr("OFF"), + // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), + // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), + // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), + // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceUserOverride), + // Value: to.Ptr("ON"), + // }, + // }, + // { + // Name: to.Ptr("div_precision_increment"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/div_precision_increment"), + // Properties: &armmysqlflexibleservers.ConfigurationProperties{ + // Description: to.Ptr("Number of digits by which to increase the scale of the result of division operations."), + // AllowedValues: to.Ptr("0-30"), + // DataType: to.Ptr("Integer"), + // DefaultValue: to.Ptr("4"), + // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), + // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), + // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), + // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceUserOverride), + // Value: to.Ptr("8"), + // }, + // }, + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/stable/2023-12-30/examples/ConfigurationUpdate.json -func ExampleConfigurationsClient_BeginUpdate() { +// Generated from example definition: 2024-12-30/ConfigurationCreateOrUpdate.json +func ExampleConfigurationsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewConfigurationsClient().BeginUpdate(ctx, "testrg", "testserver", "event_scheduler", armmysqlflexibleservers.Configuration{ + poller, err := clientFactory.NewConfigurationsClient().BeginCreateOrUpdate(ctx, "TestGroup", "testserver", "event_scheduler", armmysqlflexibleservers.Configuration{ Properties: &armmysqlflexibleservers.ConfigurationProperties{ Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceUserOverride), - Value: to.Ptr("on"), + Value: to.Ptr("off"), }, }, nil) if err != nil { @@ -87,32 +117,31 @@ func ExampleConfigurationsClient_BeginUpdate() { // 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.Configuration = armmysqlflexibleservers.Configuration{ - // Name: to.Ptr("event_scheduler"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/configurations/event_scheduler"), - // Properties: &armmysqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Indicates the status of the Event Scheduler. It is always OFF for a replica server to keep the replication consistency."), - // AllowedValues: to.Ptr("ON,OFF"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("OFF"), - // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), - // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), - // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), - // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceUserOverride), - // Value: to.Ptr("ON"), + // res = armmysqlflexibleservers.ConfigurationsClientCreateOrUpdateResponse{ + // Configuration: &armmysqlflexibleservers.Configuration{ + // Name: to.Ptr("event_scheduler"), + // Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver/configurations/event_scheduler"), + // Properties: &armmysqlflexibleservers.ConfigurationProperties{ + // Description: to.Ptr("Indicates the status of the Event Scheduler."), + // AllowedValues: to.Ptr("ON,OFF,DISABLED"), + // DataType: to.Ptr("Enumeration"), + // DefaultValue: to.Ptr("OFF"), + // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceUserOverride), + // Value: to.Ptr("ON"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/stable/2023-12-30/examples/ConfigurationGet.json +// Generated from example definition: 2024-12-30/ConfigurationGet.json func ExampleConfigurationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -123,114 +152,40 @@ func ExampleConfigurationsClient_Get() { // 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.Configuration = armmysqlflexibleservers.Configuration{ - // Name: to.Ptr("event_scheduler"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/configurations/event_scheduler"), - // Properties: &armmysqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Indicates the status of the Event Scheduler. It is always OFF for a replica server to keep the replication consistency."), - // AllowedValues: to.Ptr("ON,OFF"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("OFF"), - // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), - // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), - // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), - // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), - // Value: to.Ptr("OFF"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/stable/2023-12-30/examples/ConfigurationsBatchUpdate.json -func ExampleConfigurationsClient_BeginBatchUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationsClient().BeginBatchUpdate(ctx, "testrg", "mysqltestserver", armmysqlflexibleservers.ConfigurationListForBatchUpdate{ - ResetAllToDefault: to.Ptr(armmysqlflexibleservers.ResetAllToDefaultFalse), - Value: []*armmysqlflexibleservers.ConfigurationForBatchUpdate{ - { - Name: to.Ptr("event_scheduler"), - Properties: &armmysqlflexibleservers.ConfigurationForBatchUpdateProperties{ - Value: to.Ptr("OFF"), - }, - }, - { - Name: to.Ptr("div_precision_increment"), - Properties: &armmysqlflexibleservers.ConfigurationForBatchUpdateProperties{ - Value: to.Ptr("8"), - }, - }}, - }, 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.ConfigurationListResult = armmysqlflexibleservers.ConfigurationListResult{ - // Value: []*armmysqlflexibleservers.Configuration{ - // { - // Name: to.Ptr("event_scheduler"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/event_scheduler"), - // Properties: &armmysqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Indicates the status of the Event Scheduler. It is always OFF for a replica server to keep the replication consistency."), - // AllowedValues: to.Ptr("ON,OFF"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("OFF"), - // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), - // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), - // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), - // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceUserOverride), - // Value: to.Ptr("ON"), - // }, + // res = armmysqlflexibleservers.ConfigurationsClientGetResponse{ + // Configuration: &armmysqlflexibleservers.Configuration{ + // Name: to.Ptr("event_scheduler"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/configurations/event_scheduler"), + // Properties: &armmysqlflexibleservers.ConfigurationProperties{ + // Description: to.Ptr("Indicates the status of the Event Scheduler. It is always OFF for a replica server to keep the replication consistency."), + // AllowedValues: to.Ptr("ON,OFF"), + // DataType: to.Ptr("Enumeration"), + // DefaultValue: to.Ptr("OFF"), + // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), + // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), + // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), + // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), + // Value: to.Ptr("OFF"), // }, - // { - // Name: to.Ptr("div_precision_increment"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/div_precision_increment"), - // Properties: &armmysqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Number of digits by which to increase the scale of the result of division operations."), - // AllowedValues: to.Ptr("0-30"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("4"), - // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), - // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), - // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), - // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceUserOverride), - // Value: to.Ptr("8"), - // }, - // }}, + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/stable/2023-12-30/examples/ConfigurationsListByServer.json +// Generated from example definition: 2024-12-30/ConfigurationsListByServer.json func ExampleConfigurationsClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewConfigurationsClient().NewListByServerPager("testrg", "mysqltestserver", &armmysqlflexibleservers.ConfigurationsClientListByServerOptions{Tags: nil, - Keyword: nil, + pager := clientFactory.NewConfigurationsClient().NewListByServerPager("testrg", "mysqltestserver", &armmysqlflexibleservers.ConfigurationsClientListByServerOptions{ Page: to.Ptr[int32](1), - PageSize: to.Ptr[int32](8), - }) + PageSize: to.Ptr[int32](8)}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -241,136 +196,186 @@ func ExampleConfigurationsClient_NewListByServerPager() { _ = 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.ConfigurationListResult = armmysqlflexibleservers.ConfigurationListResult{ - // Value: []*armmysqlflexibleservers.Configuration{ - // { - // Name: to.Ptr("archive"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/archive"), - // Properties: &armmysqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Tell the server to enable or disable archive engine."), - // AllowedValues: to.Ptr("ON,OFF"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("OFF"), - // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), - // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigFalse), - // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyTrue), - // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), - // Value: to.Ptr("OFF"), + // page = armmysqlflexibleservers.ConfigurationsClientListByServerResponse{ + // ConfigurationListResult: armmysqlflexibleservers.ConfigurationListResult{ + // Value: []*armmysqlflexibleservers.Configuration{ + // { + // Name: to.Ptr("archive"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/archive"), + // Properties: &armmysqlflexibleservers.ConfigurationProperties{ + // Description: to.Ptr("Tell the server to enable or disable archive engine."), + // AllowedValues: to.Ptr("ON,OFF"), + // DataType: to.Ptr("Enumeration"), + // DefaultValue: to.Ptr("OFF"), + // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), + // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigFalse), + // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyTrue), + // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), + // Value: to.Ptr("OFF"), + // }, // }, - // }, - // { - // Name: to.Ptr("audit_log_enabled"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/audit_log_enabled"), - // Properties: &armmysqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Allow to audit the log."), - // AllowedValues: to.Ptr("ON,OFF"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("OFF"), - // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), - // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), - // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), - // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), - // Value: to.Ptr("OFF"), + // { + // Name: to.Ptr("audit_log_enabled"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/audit_log_enabled"), + // Properties: &armmysqlflexibleservers.ConfigurationProperties{ + // Description: to.Ptr("Allow to audit the log."), + // AllowedValues: to.Ptr("ON,OFF"), + // DataType: to.Ptr("Enumeration"), + // DefaultValue: to.Ptr("OFF"), + // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), + // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), + // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), + // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), + // Value: to.Ptr("OFF"), + // }, // }, - // }, - // { - // Name: to.Ptr("audit_log_events"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/audit_log_events"), - // Properties: &armmysqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Select the events to audit logs."), - // AllowedValues: to.Ptr("DDL,DML_SELECT,DML_NONSELECT,DCL,ADMIN,DML,GENERAL,CONNECTION,TABLE_ACCESS"), - // DataType: to.Ptr("Set"), - // DefaultValue: to.Ptr("CONNECTION"), - // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), - // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), - // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), - // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), - // Value: to.Ptr("CONNECTION"), + // { + // Name: to.Ptr("audit_log_events"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/audit_log_events"), + // Properties: &armmysqlflexibleservers.ConfigurationProperties{ + // Description: to.Ptr("Select the events to audit logs."), + // AllowedValues: to.Ptr("DDL,DML_SELECT,DML_NONSELECT,DCL,ADMIN,DML,GENERAL,CONNECTION,TABLE_ACCESS"), + // DataType: to.Ptr("Set"), + // DefaultValue: to.Ptr("CONNECTION"), + // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), + // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), + // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), + // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), + // Value: to.Ptr("CONNECTION"), + // }, // }, - // }, - // { - // Name: to.Ptr("audit_log_exclude_users"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/audit_log_exclude_users"), - // Properties: &armmysqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("The comma-separated user list whose commands will not be in the audit logs."), - // AllowedValues: to.Ptr(""), - // DataType: to.Ptr("String"), - // DefaultValue: to.Ptr("azure_superuser"), - // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), - // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), - // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), - // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), - // Value: to.Ptr("azure_superuser"), + // { + // Name: to.Ptr("audit_log_exclude_users"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/audit_log_exclude_users"), + // Properties: &armmysqlflexibleservers.ConfigurationProperties{ + // Description: to.Ptr("The comma-separated user list whose commands will not be in the audit logs."), + // AllowedValues: to.Ptr(""), + // DataType: to.Ptr("String"), + // DefaultValue: to.Ptr("azure_superuser"), + // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), + // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), + // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), + // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), + // Value: to.Ptr("azure_superuser"), + // }, // }, - // }, - // { - // Name: to.Ptr("audit_log_include_users"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/audit_log_include_users"), - // Properties: &armmysqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("The comma-separated user list whose commands will be in the audit logs. It takes higher priority if the same user name is found in audit_log_exclude_users."), - // AllowedValues: to.Ptr(""), - // DataType: to.Ptr("String"), - // DefaultValue: to.Ptr(""), - // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), - // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), - // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), - // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), - // Value: to.Ptr(""), + // { + // Name: to.Ptr("audit_log_include_users"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/audit_log_include_users"), + // Properties: &armmysqlflexibleservers.ConfigurationProperties{ + // Description: to.Ptr("The comma-separated user list whose commands will be in the audit logs. It takes higher priority if the same user name is found in audit_log_exclude_users."), + // AllowedValues: to.Ptr(""), + // DataType: to.Ptr("String"), + // DefaultValue: to.Ptr(""), + // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), + // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), + // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), + // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), + // Value: to.Ptr(""), + // }, // }, - // }, - // { - // Name: to.Ptr("audit_slow_log_enabled"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/audit_slow_log_enabled"), - // Properties: &armmysqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Allow to audit the slow log."), - // AllowedValues: to.Ptr("ON,OFF"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("ON"), - // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), - // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), - // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyTrue), - // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), - // Value: to.Ptr("ON"), + // { + // Name: to.Ptr("audit_slow_log_enabled"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/audit_slow_log_enabled"), + // Properties: &armmysqlflexibleservers.ConfigurationProperties{ + // Description: to.Ptr("Allow to audit the slow log."), + // AllowedValues: to.Ptr("ON,OFF"), + // DataType: to.Ptr("Enumeration"), + // DefaultValue: to.Ptr("ON"), + // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), + // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), + // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyTrue), + // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), + // Value: to.Ptr("ON"), + // }, // }, - // }, - // { - // Name: to.Ptr("auto_generate_certs"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/auto_generate_certs"), - // Properties: &armmysqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Controls whether the server autogenerates SSL key and certificate files in the data directory, if they do not already exist."), - // AllowedValues: to.Ptr("ON,OFF"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("OFF"), - // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), - // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigFalse), - // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyTrue), - // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), - // Value: to.Ptr("OFF"), + // { + // Name: to.Ptr("auto_generate_certs"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/auto_generate_certs"), + // Properties: &armmysqlflexibleservers.ConfigurationProperties{ + // Description: to.Ptr("Controls whether the server autogenerates SSL key and certificate files in the data directory, if they do not already exist."), + // AllowedValues: to.Ptr("ON,OFF"), + // DataType: to.Ptr("Enumeration"), + // DefaultValue: to.Ptr("OFF"), + // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), + // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigFalse), + // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyTrue), + // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), + // Value: to.Ptr("OFF"), + // }, // }, - // }, - // { - // Name: to.Ptr("auto_increment_increment"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/auto_increment_increment"), - // Properties: &armmysqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("The auto_increment_increment is intended for use with source-to-source replication, and can be used to control the operation of AUTO_INCREMENT columns."), - // AllowedValues: to.Ptr("1-65535"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("1"), - // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), - // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), - // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), - // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), - // Value: to.Ptr("1"), + // { + // Name: to.Ptr("auto_increment_increment"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/configurations/auto_increment_increment"), + // Properties: &armmysqlflexibleservers.ConfigurationProperties{ + // Description: to.Ptr("The auto_increment_increment is intended for use with source-to-source replication, and can be used to control the operation of AUTO_INCREMENT columns."), + // AllowedValues: to.Ptr("1-65535"), + // DataType: to.Ptr("Integer"), + // DefaultValue: to.Ptr("1"), + // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), + // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), + // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), + // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceSystemDefault), + // Value: to.Ptr("1"), + // }, // }, - // }}, + // }, + // }, // } } } + +// Generated from example definition: 2024-12-30/ConfigurationUpdate.json +func ExampleConfigurationsClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewConfigurationsClient().BeginUpdate(ctx, "testrg", "testserver", "event_scheduler", armmysqlflexibleservers.Configuration{ + Properties: &armmysqlflexibleservers.ConfigurationProperties{ + Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceUserOverride), + Value: to.Ptr("on"), + }, + }, 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 = armmysqlflexibleservers.ConfigurationsClientUpdateResponse{ + // Configuration: &armmysqlflexibleservers.Configuration{ + // Name: to.Ptr("event_scheduler"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/configurations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/configurations/event_scheduler"), + // Properties: &armmysqlflexibleservers.ConfigurationProperties{ + // Description: to.Ptr("Indicates the status of the Event Scheduler. It is always OFF for a replica server to keep the replication consistency."), + // AllowedValues: to.Ptr("ON,OFF"), + // DataType: to.Ptr("Enumeration"), + // DefaultValue: to.Ptr("OFF"), + // IsConfigPendingRestart: to.Ptr(armmysqlflexibleservers.IsConfigPendingRestartFalse), + // IsDynamicConfig: to.Ptr(armmysqlflexibleservers.IsDynamicConfigTrue), + // IsReadOnly: to.Ptr(armmysqlflexibleservers.IsReadOnlyFalse), + // Source: to.Ptr(armmysqlflexibleservers.ConfigurationSourceUserOverride), + // Value: to.Ptr("ON"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/constants.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/constants.go index 4ec8762b1ff8..1e817c597f31 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/constants.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/constants.go @@ -1,18 +1,9 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers -const ( - moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers" - moduleVersion = "v2.0.0-beta.4" -) - type AdministratorName string const ( @@ -119,6 +110,24 @@ func PossibleBackupTypeValues() []BackupType { } } +// BatchOfMaintenance - The batch of maintenance when enabled the custom managed maintenance window of a server. +type BatchOfMaintenance string + +const ( + BatchOfMaintenanceBatch1 BatchOfMaintenance = "Batch1" + BatchOfMaintenanceBatch2 BatchOfMaintenance = "Batch2" + BatchOfMaintenanceDefault BatchOfMaintenance = "Default" +) + +// PossibleBatchOfMaintenanceValues returns the possible values for the BatchOfMaintenance const type. +func PossibleBatchOfMaintenanceValues() []BatchOfMaintenance { + return []BatchOfMaintenance{ + BatchOfMaintenanceBatch1, + BatchOfMaintenanceBatch2, + BatchOfMaintenanceDefault, + } +} + // ConfigurationSource - Source of the configuration. type ConfigurationSource string @@ -155,14 +164,18 @@ func PossibleCreateModeValues() []CreateMode { } } -// CreatedByType - The type of identity that created the resource. +// CreatedByType - The kind of entity that created the resource. type CreatedByType string const ( - CreatedByTypeApplication CreatedByType = "Application" - CreatedByTypeKey CreatedByType = "Key" + // CreatedByTypeApplication - The entity was created by an application. + CreatedByTypeApplication CreatedByType = "Application" + // CreatedByTypeKey - The entity was created by a key. + CreatedByTypeKey CreatedByType = "Key" + // CreatedByTypeManagedIdentity - The entity was created by a managed identity. CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" - CreatedByTypeUser CreatedByType = "User" + // CreatedByTypeUser - The entity was created by a user. + CreatedByTypeUser CreatedByType = "User" ) // PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. @@ -433,6 +446,28 @@ func PossibleOperationStatusValues() []OperationStatus { } } +// Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default +// value is "user,system" +type Origin string + +const ( + // OriginSystem - Indicates the operation is initiated by a system. + OriginSystem Origin = "system" + // OriginUser - Indicates the operation is initiated by a user. + OriginUser Origin = "user" + // OriginUserSystem - Indicates the operation is initiated by a user or system. + OriginUserSystem Origin = "user,system" +) + +// PossibleOriginValues returns the possible values for the Origin const type. +func PossibleOriginValues() []Origin { + return []Origin{ + OriginSystem, + OriginUser, + OriginUserSystem, + } +} + // PatchStrategy - Enum to indicate the patch strategy of a server type PatchStrategy string @@ -453,9 +488,13 @@ func PossiblePatchStrategyValues() []PatchStrategy { type PrivateEndpointConnectionProvisioningState string const ( - PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" - PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" - PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" + // PrivateEndpointConnectionProvisioningStateCreating - Connection is being created + PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" + // PrivateEndpointConnectionProvisioningStateDeleting - Connection is being deleted + PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" + // PrivateEndpointConnectionProvisioningStateFailed - Connection provisioning has failed + PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" + // PrivateEndpointConnectionProvisioningStateSucceeded - Connection has been provisioned PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" ) @@ -473,8 +512,11 @@ func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpoin type PrivateEndpointServiceConnectionStatus string const ( + // PrivateEndpointServiceConnectionStatusApproved - Connection approved PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" - PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" + // PrivateEndpointServiceConnectionStatusPending - Connection waiting for approval or rejection + PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" + // PrivateEndpointServiceConnectionStatusRejected - Connection Rejected PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected" ) diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/databases_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/databases_client.go index 798bc71baf24..3789d9f1fe9d 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/databases_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/databases_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -46,7 +42,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 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - databaseName - The name of the database. @@ -73,7 +69,7 @@ func (client *DatabasesClient) BeginCreateOrUpdate(ctx context.Context, resource // CreateOrUpdate - Creates a new database or updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 func (client *DatabasesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database, options *DatabasesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "DatabasesClient.BeginCreateOrUpdate" @@ -96,7 +92,7 @@ func (client *DatabasesClient) createOrUpdate(ctx context.Context, resourceGroup } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DatabasesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database, options *DatabasesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *DatabasesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database, _ *DatabasesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/databases/{databaseName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -119,9 +115,10 @@ func (client *DatabasesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -131,7 +128,7 @@ func (client *DatabasesClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - databaseName - The name of the database. @@ -156,7 +153,7 @@ func (client *DatabasesClient) BeginDelete(ctx context.Context, resourceGroupNam // Delete - Deletes a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 func (client *DatabasesClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DatabasesClient.BeginDelete" @@ -179,7 +176,7 @@ func (client *DatabasesClient) deleteOperation(ctx context.Context, resourceGrou } // deleteCreateRequest creates the Delete request. -func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginDeleteOptions) (*policy.Request, error) { +func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, _ *DatabasesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/databases/{databaseName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -202,16 +199,15 @@ func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Gets information about a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - databaseName - The name of the database. @@ -239,7 +235,7 @@ func (client *DatabasesClient) Get(ctx context.Context, resourceGroupName string } // getCreateRequest creates the Get request. -func (client *DatabasesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientGetOptions) (*policy.Request, error) { +func (client *DatabasesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, _ *DatabasesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/databases/{databaseName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -262,7 +258,7 @@ func (client *DatabasesClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,7 +275,7 @@ func (client *DatabasesClient) getHandleResponse(resp *http.Response) (Databases // NewListByServerPager - List all the databases in a given server. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - DatabasesClientListByServerOptions contains the optional parameters for the DatabasesClient.NewListByServerPager @@ -308,7 +304,7 @@ func (client *DatabasesClient) NewListByServerPager(resourceGroupName string, se } // listByServerCreateRequest creates the ListByServer request. -func (client *DatabasesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *DatabasesClientListByServerOptions) (*policy.Request, error) { +func (client *DatabasesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *DatabasesClientListByServerOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/databases" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -327,7 +323,7 @@ func (client *DatabasesClient) listByServerCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/databases_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/databases_client_example_test.go index 2a8115e53eac..795ac1a81d01 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/databases_client_example_test.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/databases_client_example_test.go @@ -1,31 +1,25 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers_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/mysql/armmysqlflexibleservers/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/stable/2023-12-30/examples/DatabaseCreate.json +// Generated from example definition: 2024-12-30/DatabaseCreate.json func ExampleDatabasesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -45,25 +39,27 @@ func ExampleDatabasesClient_BeginCreateOrUpdate() { // 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 = armmysqlflexibleservers.Database{ - // Name: to.Ptr("db1"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/databases/db1"), - // Properties: &armmysqlflexibleservers.DatabaseProperties{ - // Charset: to.Ptr("utf8"), - // Collation: to.Ptr("utf8_general_ci"), + // res = armmysqlflexibleservers.DatabasesClientCreateOrUpdateResponse{ + // Database: &armmysqlflexibleservers.Database{ + // Name: to.Ptr("db1"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/databases"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/databases/db1"), + // Properties: &armmysqlflexibleservers.DatabaseProperties{ + // Charset: to.Ptr("utf8"), + // Collation: to.Ptr("utf8_general_ci"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/stable/2023-12-30/examples/DatabaseDelete.json +// Generated from example definition: 2024-12-30/DatabaseDelete.json func ExampleDatabasesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -71,20 +67,25 @@ func ExampleDatabasesClient_BeginDelete() { 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 = armmysqlflexibleservers.DatabasesClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/stable/2023-12-30/examples/DatabaseGet.json +// Generated from example definition: 2024-12-30/DatabaseGet.json func ExampleDatabasesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -95,25 +96,27 @@ func ExampleDatabasesClient_Get() { // 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 = armmysqlflexibleservers.Database{ - // Name: to.Ptr("db1"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/databases/db1"), - // Properties: &armmysqlflexibleservers.DatabaseProperties{ - // Charset: to.Ptr("utf8"), - // Collation: to.Ptr("utf8_general_ci"), + // res = armmysqlflexibleservers.DatabasesClientGetResponse{ + // Database: &armmysqlflexibleservers.Database{ + // Name: to.Ptr("db1"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/databases"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/databases/db1"), + // Properties: &armmysqlflexibleservers.DatabaseProperties{ + // Charset: to.Ptr("utf8"), + // Collation: to.Ptr("utf8_general_ci"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/stable/2023-12-30/examples/DatabasesListByServer.json +// Generated from example definition: 2024-12-30/DatabasesListByServer.json func ExampleDatabasesClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -128,26 +131,29 @@ func ExampleDatabasesClient_NewListByServerPager() { _ = 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 = armmysqlflexibleservers.DatabaseListResult{ - // Value: []*armmysqlflexibleservers.Database{ - // { - // Name: to.Ptr("db1"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/databases/db1"), - // Properties: &armmysqlflexibleservers.DatabaseProperties{ - // Charset: to.Ptr("utf8"), - // Collation: to.Ptr("utf8_general_ci"), + // page = armmysqlflexibleservers.DatabasesClientListByServerResponse{ + // DatabaseListResult: armmysqlflexibleservers.DatabaseListResult{ + // Value: []*armmysqlflexibleservers.Database{ + // { + // Name: to.Ptr("db1"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/databases"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/databases/db1"), + // Properties: &armmysqlflexibleservers.DatabaseProperties{ + // Charset: to.Ptr("utf8"), + // Collation: to.Ptr("utf8_general_ci"), + // }, // }, - // }, - // { - // Name: to.Ptr("db2"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/databases/db2"), - // Properties: &armmysqlflexibleservers.DatabaseProperties{ - // Charset: to.Ptr("utf8"), - // Collation: to.Ptr("utf8_general_ci"), + // { + // Name: to.Ptr("db2"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/databases"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/databases/db2"), + // Properties: &armmysqlflexibleservers.DatabaseProperties{ + // Charset: to.Ptr("utf8"), + // Collation: to.Ptr("utf8_general_ci"), + // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/advancedthreatprotectionsettings_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/advancedthreatprotectionsettings_server.go index 1fcd8d16fc2f..03ae9d0de2d3 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/advancedthreatprotectionsettings_server.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/advancedthreatprotectionsettings_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -70,27 +66,46 @@ func (a *AdvancedThreatProtectionSettingsServerTransport) Do(req *http.Request) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AdvancedThreatProtectionSettingsClient.Get": - resp, err = a.dispatchGet(req) - case "AdvancedThreatProtectionSettingsClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - case "AdvancedThreatProtectionSettingsClient.BeginUpdate": - resp, err = a.dispatchBeginUpdate(req) - case "AdvancedThreatProtectionSettingsClient.BeginUpdatePut": - resp, err = a.dispatchBeginUpdatePut(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AdvancedThreatProtectionSettingsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if advancedThreatProtectionSettingsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = advancedThreatProtectionSettingsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AdvancedThreatProtectionSettingsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AdvancedThreatProtectionSettingsClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + case "AdvancedThreatProtectionSettingsClient.BeginUpdate": + res.resp, res.err = a.dispatchBeginUpdate(req) + case "AdvancedThreatProtectionSettingsClient.BeginUpdatePut": + res.resp, res.err = a.dispatchBeginUpdatePut(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AdvancedThreatProtectionSettingsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -100,7 +115,7 @@ func (a *AdvancedThreatProtectionSettingsServerTransport) dispatchGet(req *http. const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/advancedThreatProtectionSettings/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -145,7 +160,7 @@ func (a *AdvancedThreatProtectionSettingsServerTransport) dispatchNewListPager(r const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/advancedThreatProtectionSettings` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -186,7 +201,7 @@ func (a *AdvancedThreatProtectionSettingsServerTransport) dispatchBeginUpdate(re const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/advancedThreatProtectionSettings/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armmysqlflexibleservers.AdvancedThreatProtectionForUpdate](req) @@ -244,7 +259,7 @@ func (a *AdvancedThreatProtectionSettingsServerTransport) dispatchBeginUpdatePut const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/advancedThreatProtectionSettings/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armmysqlflexibleservers.AdvancedThreatProtection](req) @@ -292,3 +307,9 @@ func (a *AdvancedThreatProtectionSettingsServerTransport) dispatchBeginUpdatePut return resp, nil } + +// set this to conditionally intercept incoming requests to AdvancedThreatProtectionSettingsServerTransport +var advancedThreatProtectionSettingsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/azureadadministrators_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/azureadadministrators_server.go index a1ad670b8afc..5c4cb73c0e2b 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/azureadadministrators_server.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/azureadadministrators_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -70,27 +66,46 @@ func (a *AzureADAdministratorsServerTransport) Do(req *http.Request) (*http.Resp return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AzureADAdministratorsClient.BeginCreateOrUpdate": - resp, err = a.dispatchBeginCreateOrUpdate(req) - case "AzureADAdministratorsClient.BeginDelete": - resp, err = a.dispatchBeginDelete(req) - case "AzureADAdministratorsClient.Get": - resp, err = a.dispatchGet(req) - case "AzureADAdministratorsClient.NewListByServerPager": - resp, err = a.dispatchNewListByServerPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AzureADAdministratorsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if azureAdAdministratorsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = azureAdAdministratorsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AzureADAdministratorsClient.BeginCreateOrUpdate": + res.resp, res.err = a.dispatchBeginCreateOrUpdate(req) + case "AzureADAdministratorsClient.BeginDelete": + res.resp, res.err = a.dispatchBeginDelete(req) + case "AzureADAdministratorsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AzureADAdministratorsClient.NewListByServerPager": + res.resp, res.err = a.dispatchNewListByServerPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AzureADAdministratorsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -102,7 +117,7 @@ func (a *AzureADAdministratorsServerTransport) dispatchBeginCreateOrUpdate(req * const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/administrators/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armmysqlflexibleservers.AzureADAdministrator](req) @@ -160,7 +175,7 @@ func (a *AzureADAdministratorsServerTransport) dispatchBeginDelete(req *http.Req const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/administrators/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -212,7 +227,7 @@ func (a *AzureADAdministratorsServerTransport) dispatchGet(req *http.Request) (* const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/administrators/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -257,7 +272,7 @@ func (a *AzureADAdministratorsServerTransport) dispatchNewListByServerPager(req const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/administrators` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -288,3 +303,9 @@ func (a *AzureADAdministratorsServerTransport) dispatchNewListByServerPager(req } return resp, nil } + +// set this to conditionally intercept incoming requests to AzureADAdministratorsServerTransport +var azureAdAdministratorsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/backupandexport_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/backupandexport_server.go index 05339d0cbbba..8639ab2a6d82 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/backupandexport_server.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/backupandexport_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -57,23 +53,42 @@ func (b *BackupAndExportServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return b.dispatchToMethodFake(req, method) +} - switch method { - case "BackupAndExportClient.BeginCreate": - resp, err = b.dispatchBeginCreate(req) - case "BackupAndExportClient.ValidateBackup": - resp, err = b.dispatchValidateBackup(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (b *BackupAndExportServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if backupAndExportServerTransportInterceptor != nil { + res.resp, res.err, intercepted = backupAndExportServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "BackupAndExportClient.BeginCreate": + res.resp, res.err = b.dispatchBeginCreate(req) + case "BackupAndExportClient.ValidateBackup": + res.resp, res.err = b.dispatchValidateBackup(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (b *BackupAndExportServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { @@ -85,7 +100,7 @@ func (b *BackupAndExportServerTransport) dispatchBeginCreate(req *http.Request) const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backupAndExport` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armmysqlflexibleservers.BackupAndExportRequest](req) @@ -131,7 +146,7 @@ func (b *BackupAndExportServerTransport) dispatchValidateBackup(req *http.Reques const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/validateBackup` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -156,3 +171,9 @@ func (b *BackupAndExportServerTransport) dispatchValidateBackup(req *http.Reques } return resp, nil } + +// set this to conditionally intercept incoming requests to BackupAndExportServerTransport +var backupAndExportServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/backups_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/backups_server.go index f8fa45f5a890..0478c16d206c 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/backups_server.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/backups_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -62,25 +58,44 @@ func (b *BackupsServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return b.dispatchToMethodFake(req, method) +} - switch method { - case "BackupsClient.Get": - resp, err = b.dispatchGet(req) - case "BackupsClient.NewListByServerPager": - resp, err = b.dispatchNewListByServerPager(req) - case "BackupsClient.Put": - resp, err = b.dispatchPut(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (b *BackupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if backupsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = backupsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "BackupsClient.Get": + res.resp, res.err = b.dispatchGet(req) + case "BackupsClient.NewListByServerPager": + res.resp, res.err = b.dispatchNewListByServerPager(req) + case "BackupsClient.Put": + res.resp, res.err = b.dispatchPut(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (b *BackupsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -90,7 +105,7 @@ func (b *BackupsServerTransport) dispatchGet(req *http.Request) (*http.Response, const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -129,7 +144,7 @@ func (b *BackupsServerTransport) dispatchNewListByServerPager(req *http.Request) const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backups` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -168,7 +183,7 @@ func (b *BackupsServerTransport) dispatchPut(req *http.Request) (*http.Response, const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -197,3 +212,9 @@ func (b *BackupsServerTransport) dispatchPut(req *http.Request) (*http.Response, } return resp, nil } + +// set this to conditionally intercept incoming requests to BackupsServerTransport +var backupsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/checknameavailability_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/checknameavailability_server.go index e7326e6a662c..993127b14ba7 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/checknameavailability_server.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/checknameavailability_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -49,21 +45,40 @@ func (c *CheckNameAvailabilityServerTransport) Do(req *http.Request) (*http.Resp return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "CheckNameAvailabilityClient.Execute": - resp, err = c.dispatchExecute(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *CheckNameAvailabilityServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if checkNameAvailabilityServerTransportInterceptor != nil { + res.resp, res.err, intercepted = checkNameAvailabilityServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "CheckNameAvailabilityClient.Execute": + res.resp, res.err = c.dispatchExecute(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *CheckNameAvailabilityServerTransport) dispatchExecute(req *http.Request) (*http.Response, error) { @@ -73,7 +88,7 @@ func (c *CheckNameAvailabilityServerTransport) dispatchExecute(req *http.Request const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/checkNameAvailability` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armmysqlflexibleservers.NameAvailabilityRequest](req) @@ -98,3 +113,9 @@ func (c *CheckNameAvailabilityServerTransport) dispatchExecute(req *http.Request } return resp, nil } + +// set this to conditionally intercept incoming requests to CheckNameAvailabilityServerTransport +var checkNameAvailabilityServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/checknameavailabilitywithoutlocation_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/checknameavailabilitywithoutlocation_server.go index ac70af2fa780..b3009060c703 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/checknameavailabilitywithoutlocation_server.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/checknameavailabilitywithoutlocation_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -48,21 +44,40 @@ func (c *CheckNameAvailabilityWithoutLocationServerTransport) Do(req *http.Reque return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "CheckNameAvailabilityWithoutLocationClient.Execute": - resp, err = c.dispatchExecute(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *CheckNameAvailabilityWithoutLocationServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if checkNameAvailabilityWithoutLocationServerTransportInterceptor != nil { + res.resp, res.err, intercepted = checkNameAvailabilityWithoutLocationServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "CheckNameAvailabilityWithoutLocationClient.Execute": + res.resp, res.err = c.dispatchExecute(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *CheckNameAvailabilityWithoutLocationServerTransport) dispatchExecute(req *http.Request) (*http.Response, error) { @@ -72,7 +87,7 @@ func (c *CheckNameAvailabilityWithoutLocationServerTransport) dispatchExecute(re const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/checkNameAvailability` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { + if len(matches) < 2 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armmysqlflexibleservers.NameAvailabilityRequest](req) @@ -93,3 +108,9 @@ func (c *CheckNameAvailabilityWithoutLocationServerTransport) dispatchExecute(re } return resp, nil } + +// set this to conditionally intercept incoming requests to CheckNameAvailabilityWithoutLocationServerTransport +var checkNameAvailabilityWithoutLocationServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/checkvirtualnetworksubnetusage_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/checkvirtualnetworksubnetusage_server.go index fa78a6cc0f55..3174a5f20d87 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/checkvirtualnetworksubnetusage_server.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/checkvirtualnetworksubnetusage_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -49,21 +45,40 @@ func (c *CheckVirtualNetworkSubnetUsageServerTransport) Do(req *http.Request) (* return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "CheckVirtualNetworkSubnetUsageClient.Execute": - resp, err = c.dispatchExecute(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *CheckVirtualNetworkSubnetUsageServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if checkVirtualNetworkSubnetUsageServerTransportInterceptor != nil { + res.resp, res.err, intercepted = checkVirtualNetworkSubnetUsageServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "CheckVirtualNetworkSubnetUsageClient.Execute": + res.resp, res.err = c.dispatchExecute(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *CheckVirtualNetworkSubnetUsageServerTransport) dispatchExecute(req *http.Request) (*http.Response, error) { @@ -73,7 +88,7 @@ func (c *CheckVirtualNetworkSubnetUsageServerTransport) dispatchExecute(req *htt const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/checkVirtualNetworkSubnetUsage` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armmysqlflexibleservers.VirtualNetworkSubnetUsageParameter](req) @@ -98,3 +113,9 @@ func (c *CheckVirtualNetworkSubnetUsageServerTransport) dispatchExecute(req *htt } return resp, nil } + +// set this to conditionally intercept incoming requests to CheckVirtualNetworkSubnetUsageServerTransport +var checkVirtualNetworkSubnetUsageServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/configurations_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/configurations_server.go index 4ea662096f1d..0fd4390e6d9b 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/configurations_server.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/configurations_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -77,29 +73,48 @@ func (c *ConfigurationsServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "ConfigurationsClient.BeginBatchUpdate": - resp, err = c.dispatchBeginBatchUpdate(req) - case "ConfigurationsClient.BeginCreateOrUpdate": - resp, err = c.dispatchBeginCreateOrUpdate(req) - case "ConfigurationsClient.Get": - resp, err = c.dispatchGet(req) - case "ConfigurationsClient.NewListByServerPager": - resp, err = c.dispatchNewListByServerPager(req) - case "ConfigurationsClient.BeginUpdate": - resp, err = c.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *ConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if configurationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = configurationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ConfigurationsClient.BeginBatchUpdate": + res.resp, res.err = c.dispatchBeginBatchUpdate(req) + case "ConfigurationsClient.BeginCreateOrUpdate": + res.resp, res.err = c.dispatchBeginCreateOrUpdate(req) + case "ConfigurationsClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "ConfigurationsClient.NewListByServerPager": + res.resp, res.err = c.dispatchNewListByServerPager(req) + case "ConfigurationsClient.BeginUpdate": + res.resp, res.err = c.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *ConfigurationsServerTransport) dispatchBeginBatchUpdate(req *http.Request) (*http.Response, error) { @@ -111,7 +126,7 @@ func (c *ConfigurationsServerTransport) dispatchBeginBatchUpdate(req *http.Reque const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/updateConfigurations` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armmysqlflexibleservers.ConfigurationListForBatchUpdate](req) @@ -159,7 +174,7 @@ func (c *ConfigurationsServerTransport) dispatchBeginCreateOrUpdate(req *http.Re const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/configurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armmysqlflexibleservers.Configuration](req) @@ -209,7 +224,7 @@ func (c *ConfigurationsServerTransport) dispatchGet(req *http.Request) (*http.Re const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/configurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -248,7 +263,7 @@ func (c *ConfigurationsServerTransport) dispatchNewListByServerPager(req *http.R const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/configurations` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } qp := req.URL.Query() @@ -337,7 +352,7 @@ func (c *ConfigurationsServerTransport) dispatchBeginUpdate(req *http.Request) ( const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/configurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armmysqlflexibleservers.Configuration](req) @@ -379,3 +394,9 @@ func (c *ConfigurationsServerTransport) dispatchBeginUpdate(req *http.Request) ( return resp, nil } + +// set this to conditionally intercept incoming requests to ConfigurationsServerTransport +var configurationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/databases_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/databases_server.go index ef9ac0c2b22d..cbaa9705b946 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/databases_server.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/databases_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -70,27 +66,46 @@ func (d *DatabasesServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return d.dispatchToMethodFake(req, method) +} - switch method { - case "DatabasesClient.BeginCreateOrUpdate": - resp, err = d.dispatchBeginCreateOrUpdate(req) - case "DatabasesClient.BeginDelete": - resp, err = d.dispatchBeginDelete(req) - case "DatabasesClient.Get": - resp, err = d.dispatchGet(req) - case "DatabasesClient.NewListByServerPager": - resp, err = d.dispatchNewListByServerPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (d *DatabasesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if databasesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = databasesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DatabasesClient.BeginCreateOrUpdate": + res.resp, res.err = d.dispatchBeginCreateOrUpdate(req) + case "DatabasesClient.BeginDelete": + res.resp, res.err = d.dispatchBeginDelete(req) + case "DatabasesClient.Get": + res.resp, res.err = d.dispatchGet(req) + case "DatabasesClient.NewListByServerPager": + res.resp, res.err = d.dispatchNewListByServerPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (d *DatabasesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -102,7 +117,7 @@ func (d *DatabasesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armmysqlflexibleservers.Database](req) @@ -154,7 +169,7 @@ func (d *DatabasesServerTransport) dispatchBeginDelete(req *http.Request) (*http const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -200,7 +215,7 @@ func (d *DatabasesServerTransport) dispatchGet(req *http.Request) (*http.Respons const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -239,7 +254,7 @@ func (d *DatabasesServerTransport) dispatchNewListByServerPager(req *http.Reques const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -270,3 +285,9 @@ func (d *DatabasesServerTransport) dispatchNewListByServerPager(req *http.Reques } return resp, nil } + +// set this to conditionally intercept incoming requests to DatabasesServerTransport +var databasesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/firewallrules_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/firewallrules_server.go index 303d5f8c4f38..3085e215e7d1 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/firewallrules_server.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/firewallrules_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -70,27 +66,46 @@ func (f *FirewallRulesServerTransport) Do(req *http.Request) (*http.Response, er return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return f.dispatchToMethodFake(req, method) +} - switch method { - case "FirewallRulesClient.BeginCreateOrUpdate": - resp, err = f.dispatchBeginCreateOrUpdate(req) - case "FirewallRulesClient.BeginDelete": - resp, err = f.dispatchBeginDelete(req) - case "FirewallRulesClient.Get": - resp, err = f.dispatchGet(req) - case "FirewallRulesClient.NewListByServerPager": - resp, err = f.dispatchNewListByServerPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (f *FirewallRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if firewallRulesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = firewallRulesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "FirewallRulesClient.BeginCreateOrUpdate": + res.resp, res.err = f.dispatchBeginCreateOrUpdate(req) + case "FirewallRulesClient.BeginDelete": + res.resp, res.err = f.dispatchBeginDelete(req) + case "FirewallRulesClient.Get": + res.resp, res.err = f.dispatchGet(req) + case "FirewallRulesClient.NewListByServerPager": + res.resp, res.err = f.dispatchNewListByServerPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (f *FirewallRulesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -102,7 +117,7 @@ func (f *FirewallRulesServerTransport) dispatchBeginCreateOrUpdate(req *http.Req const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/firewallRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armmysqlflexibleservers.FirewallRule](req) @@ -154,7 +169,7 @@ func (f *FirewallRulesServerTransport) dispatchBeginDelete(req *http.Request) (* const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/firewallRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -200,7 +215,7 @@ func (f *FirewallRulesServerTransport) dispatchGet(req *http.Request) (*http.Res const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/firewallRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -239,7 +254,7 @@ func (f *FirewallRulesServerTransport) dispatchNewListByServerPager(req *http.Re const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/firewallRules` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -270,3 +285,9 @@ func (f *FirewallRulesServerTransport) dispatchNewListByServerPager(req *http.Re } return resp, nil } + +// set this to conditionally intercept incoming requests to FirewallRulesServerTransport +var firewallRulesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/getprivatednszonesuffix_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/getprivatednszonesuffix_server.go index 6899657ea36d..a3d42a5ab08c 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/getprivatednszonesuffix_server.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/getprivatednszonesuffix_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -47,21 +43,40 @@ func (g *GetPrivateDNSZoneSuffixServerTransport) Do(req *http.Request) (*http.Re return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return g.dispatchToMethodFake(req, method) +} - switch method { - case "GetPrivateDNSZoneSuffixClient.Execute": - resp, err = g.dispatchExecute(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (g *GetPrivateDNSZoneSuffixServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if getPrivateDnsZoneSuffixServerTransportInterceptor != nil { + res.resp, res.err, intercepted = getPrivateDnsZoneSuffixServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "GetPrivateDNSZoneSuffixClient.Execute": + res.resp, res.err = g.dispatchExecute(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (g *GetPrivateDNSZoneSuffixServerTransport) dispatchExecute(req *http.Request) (*http.Response, error) { @@ -82,3 +97,9 @@ func (g *GetPrivateDNSZoneSuffixServerTransport) dispatchExecute(req *http.Reque } return resp, nil } + +// set this to conditionally intercept incoming requests to GetPrivateDNSZoneSuffixServerTransport +var getPrivateDnsZoneSuffixServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/internal.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/internal.go index 72f540f217a1..fced6722f7f0 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/internal.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/internal.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -15,6 +11,11 @@ import ( "sync" ) +type result struct { + resp *http.Response + err error +} + type nonRetriableError struct { error } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/locationbasedcapabilities_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/locationbasedcapabilities_server.go index 01cf3dc93a93..c6747793f365 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/locationbasedcapabilities_server.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/locationbasedcapabilities_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -53,21 +49,40 @@ func (l *LocationBasedCapabilitiesServerTransport) Do(req *http.Request) (*http. return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return l.dispatchToMethodFake(req, method) +} - switch method { - case "LocationBasedCapabilitiesClient.NewListPager": - resp, err = l.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (l *LocationBasedCapabilitiesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if locationBasedCapabilitiesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = locationBasedCapabilitiesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "LocationBasedCapabilitiesClient.NewListPager": + res.resp, res.err = l.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (l *LocationBasedCapabilitiesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -79,7 +94,7 @@ func (l *LocationBasedCapabilitiesServerTransport) dispatchNewListPager(req *htt const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/capabilities` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } locationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("locationName")]) @@ -106,3 +121,9 @@ func (l *LocationBasedCapabilitiesServerTransport) dispatchNewListPager(req *htt } return resp, nil } + +// set this to conditionally intercept incoming requests to LocationBasedCapabilitiesServerTransport +var locationBasedCapabilitiesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/locationbasedcapabilityset_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/locationbasedcapabilityset_server.go index 38cd9ff7de49..6c64d820499c 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/locationbasedcapabilityset_server.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/locationbasedcapabilityset_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -58,23 +54,42 @@ func (l *LocationBasedCapabilitySetServerTransport) Do(req *http.Request) (*http return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return l.dispatchToMethodFake(req, method) +} - switch method { - case "LocationBasedCapabilitySetClient.Get": - resp, err = l.dispatchGet(req) - case "LocationBasedCapabilitySetClient.NewListPager": - resp, err = l.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (l *LocationBasedCapabilitySetServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if locationBasedCapabilitySetServerTransportInterceptor != nil { + res.resp, res.err, intercepted = locationBasedCapabilitySetServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "LocationBasedCapabilitySetClient.Get": + res.resp, res.err = l.dispatchGet(req) + case "LocationBasedCapabilitySetClient.NewListPager": + res.resp, res.err = l.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (l *LocationBasedCapabilitySetServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -84,7 +99,7 @@ func (l *LocationBasedCapabilitySetServerTransport) dispatchGet(req *http.Reques const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/capabilitySets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } locationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("locationName")]) @@ -119,7 +134,7 @@ func (l *LocationBasedCapabilitySetServerTransport) dispatchNewListPager(req *ht const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/capabilitySets` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } locationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("locationName")]) @@ -146,3 +161,9 @@ func (l *LocationBasedCapabilitySetServerTransport) dispatchNewListPager(req *ht } return resp, nil } + +// set this to conditionally intercept incoming requests to LocationBasedCapabilitySetServerTransport +var locationBasedCapabilitySetServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/logfiles_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/logfiles_server.go index 497171a85c9d..a74db35fdf2a 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/logfiles_server.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/logfiles_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -53,21 +49,40 @@ func (l *LogFilesServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return l.dispatchToMethodFake(req, method) +} - switch method { - case "LogFilesClient.NewListByServerPager": - resp, err = l.dispatchNewListByServerPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (l *LogFilesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if logFilesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = logFilesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "LogFilesClient.NewListByServerPager": + res.resp, res.err = l.dispatchNewListByServerPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (l *LogFilesServerTransport) dispatchNewListByServerPager(req *http.Request) (*http.Response, error) { @@ -79,7 +94,7 @@ func (l *LogFilesServerTransport) dispatchNewListByServerPager(req *http.Request const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/logFiles` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -110,3 +125,9 @@ func (l *LogFilesServerTransport) dispatchNewListByServerPager(req *http.Request } return resp, nil } + +// set this to conditionally intercept incoming requests to LogFilesServerTransport +var logFilesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/longrunningbackup_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/longrunningbackup_server.go index 15e324920739..87ff639c9cea 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/longrunningbackup_server.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/longrunningbackup_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -18,7 +14,6 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" "net/http" "net/url" - "reflect" "regexp" ) @@ -26,7 +21,7 @@ import ( type LongRunningBackupServer struct { // BeginCreate is the fake for method LongRunningBackupClient.BeginCreate // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated, http.StatusAccepted - BeginCreate func(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *armmysqlflexibleservers.LongRunningBackupClientBeginCreateOptions) (resp azfake.PollerResponder[armmysqlflexibleservers.LongRunningBackupClientCreateResponse], errResp azfake.ErrorResponder) + BeginCreate func(ctx context.Context, resourceGroupName string, serverName string, backupName string, parameters armmysqlflexibleservers.ServerBackupV2, options *armmysqlflexibleservers.LongRunningBackupClientBeginCreateOptions) (resp azfake.PollerResponder[armmysqlflexibleservers.LongRunningBackupClientCreateResponse], errResp azfake.ErrorResponder) } // NewLongRunningBackupServerTransport creates a new instance of LongRunningBackupServerTransport with the provided implementation. @@ -54,21 +49,40 @@ func (l *LongRunningBackupServerTransport) Do(req *http.Request) (*http.Response return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return l.dispatchToMethodFake(req, method) +} - switch method { - case "LongRunningBackupClient.BeginCreate": - resp, err = l.dispatchBeginCreate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (l *LongRunningBackupServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if longRunningBackupServerTransportInterceptor != nil { + res.resp, res.err, intercepted = longRunningBackupServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "LongRunningBackupClient.BeginCreate": + res.resp, res.err = l.dispatchBeginCreate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (l *LongRunningBackupServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { @@ -80,7 +94,7 @@ func (l *LongRunningBackupServerTransport) dispatchBeginCreate(req *http.Request const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backupsV2/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armmysqlflexibleservers.ServerBackupV2](req) @@ -99,13 +113,7 @@ func (l *LongRunningBackupServerTransport) dispatchBeginCreate(req *http.Request if err != nil { return nil, err } - var options *armmysqlflexibleservers.LongRunningBackupClientBeginCreateOptions - if !reflect.ValueOf(body).IsZero() { - options = &armmysqlflexibleservers.LongRunningBackupClientBeginCreateOptions{ - Parameters: &body, - } - } - respr, errRespr := l.srv.BeginCreate(req.Context(), resourceGroupNameParam, serverNameParam, backupNameParam, options) + respr, errRespr := l.srv.BeginCreate(req.Context(), resourceGroupNameParam, serverNameParam, backupNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -128,3 +136,9 @@ func (l *LongRunningBackupServerTransport) dispatchBeginCreate(req *http.Request return resp, nil } + +// set this to conditionally intercept incoming requests to LongRunningBackupServerTransport +var longRunningBackupServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/longrunningbackups_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/longrunningbackups_server.go index 5270b63c17ba..8fd68d3cc806 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/longrunningbackups_server.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/longrunningbackups_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -58,23 +54,42 @@ func (l *LongRunningBackupsServerTransport) Do(req *http.Request) (*http.Respons return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return l.dispatchToMethodFake(req, method) +} - switch method { - case "LongRunningBackupsClient.Get": - resp, err = l.dispatchGet(req) - case "LongRunningBackupsClient.NewListPager": - resp, err = l.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (l *LongRunningBackupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if longRunningBackupsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = longRunningBackupsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "LongRunningBackupsClient.Get": + res.resp, res.err = l.dispatchGet(req) + case "LongRunningBackupsClient.NewListPager": + res.resp, res.err = l.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (l *LongRunningBackupsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -84,7 +99,7 @@ func (l *LongRunningBackupsServerTransport) dispatchGet(req *http.Request) (*htt const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backupsV2/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -123,7 +138,7 @@ func (l *LongRunningBackupsServerTransport) dispatchNewListPager(req *http.Reque const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backupsV2` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -154,3 +169,9 @@ func (l *LongRunningBackupsServerTransport) dispatchNewListPager(req *http.Reque } return resp, nil } + +// set this to conditionally intercept incoming requests to LongRunningBackupsServerTransport +var longRunningBackupsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/maintenances_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/maintenances_server.go index 0accb8b77a77..5d28c3820d2f 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/maintenances_server.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/maintenances_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -19,7 +15,6 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" "net/http" "net/url" - "reflect" "regexp" ) @@ -35,7 +30,7 @@ type MaintenancesServer struct { // BeginUpdate is the fake for method MaintenancesClient.BeginUpdate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdate func(ctx context.Context, resourceGroupName string, serverName string, maintenanceName string, options *armmysqlflexibleservers.MaintenancesClientBeginUpdateOptions) (resp azfake.PollerResponder[armmysqlflexibleservers.MaintenancesClientUpdateResponse], errResp azfake.ErrorResponder) + BeginUpdate func(ctx context.Context, resourceGroupName string, serverName string, maintenanceName string, parameters armmysqlflexibleservers.MaintenanceUpdate, options *armmysqlflexibleservers.MaintenancesClientBeginUpdateOptions) (resp azfake.PollerResponder[armmysqlflexibleservers.MaintenancesClientUpdateResponse], errResp azfake.ErrorResponder) } // NewMaintenancesServerTransport creates a new instance of MaintenancesServerTransport with the provided implementation. @@ -65,25 +60,44 @@ func (m *MaintenancesServerTransport) Do(req *http.Request) (*http.Response, err return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return m.dispatchToMethodFake(req, method) +} - switch method { - case "MaintenancesClient.NewListPager": - resp, err = m.dispatchNewListPager(req) - case "MaintenancesClient.Read": - resp, err = m.dispatchRead(req) - case "MaintenancesClient.BeginUpdate": - resp, err = m.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (m *MaintenancesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if maintenancesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = maintenancesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "MaintenancesClient.NewListPager": + res.resp, res.err = m.dispatchNewListPager(req) + case "MaintenancesClient.Read": + res.resp, res.err = m.dispatchRead(req) + case "MaintenancesClient.BeginUpdate": + res.resp, res.err = m.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (m *MaintenancesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -95,7 +109,7 @@ func (m *MaintenancesServerTransport) dispatchNewListPager(req *http.Request) (* const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/maintenances` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -134,7 +148,7 @@ func (m *MaintenancesServerTransport) dispatchRead(req *http.Request) (*http.Res const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/maintenances/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -173,7 +187,7 @@ func (m *MaintenancesServerTransport) dispatchBeginUpdate(req *http.Request) (*h const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/maintenances/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armmysqlflexibleservers.MaintenanceUpdate](req) @@ -192,13 +206,7 @@ func (m *MaintenancesServerTransport) dispatchBeginUpdate(req *http.Request) (*h if err != nil { return nil, err } - var options *armmysqlflexibleservers.MaintenancesClientBeginUpdateOptions - if !reflect.ValueOf(body).IsZero() { - options = &armmysqlflexibleservers.MaintenancesClientBeginUpdateOptions{ - Parameters: &body, - } - } - respr, errRespr := m.srv.BeginUpdate(req.Context(), resourceGroupNameParam, serverNameParam, maintenanceNameParam, options) + respr, errRespr := m.srv.BeginUpdate(req.Context(), resourceGroupNameParam, serverNameParam, maintenanceNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -221,3 +229,9 @@ func (m *MaintenancesServerTransport) dispatchBeginUpdate(req *http.Request) (*h return resp, nil } + +// set this to conditionally intercept incoming requests to MaintenancesServerTransport +var maintenancesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/operationprogress_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/operationprogress_server.go index f3f8c18839ae..7bec6aab098c 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/operationprogress_server.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/operationprogress_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -49,21 +45,40 @@ func (o *OperationProgressServerTransport) Do(req *http.Request) (*http.Response return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return o.dispatchToMethodFake(req, method) +} - switch method { - case "OperationProgressClient.Get": - resp, err = o.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (o *OperationProgressServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if operationProgressServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operationProgressServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperationProgressClient.Get": + res.resp, res.err = o.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (o *OperationProgressServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -73,7 +88,7 @@ func (o *OperationProgressServerTransport) dispatchGet(req *http.Request) (*http const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/operationProgress/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } locationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("locationName")]) @@ -98,3 +113,9 @@ func (o *OperationProgressServerTransport) dispatchGet(req *http.Request) (*http } return resp, nil } + +// set this to conditionally intercept incoming requests to OperationProgressServerTransport +var operationProgressServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/operationresults_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/operationresults_server.go index 403d329f16a8..81c4fcc9d801 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/operationresults_server.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/operationresults_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -49,21 +45,40 @@ func (o *OperationResultsServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return o.dispatchToMethodFake(req, method) +} - switch method { - case "OperationResultsClient.Get": - resp, err = o.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (o *OperationResultsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if operationResultsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operationResultsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperationResultsClient.Get": + res.resp, res.err = o.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (o *OperationResultsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -73,7 +88,7 @@ func (o *OperationResultsServerTransport) dispatchGet(req *http.Request) (*http. const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/operationResults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } locationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("locationName")]) @@ -98,3 +113,9 @@ func (o *OperationResultsServerTransport) dispatchGet(req *http.Request) (*http. } return resp, nil } + +// set this to conditionally intercept incoming requests to OperationResultsServerTransport +var operationResultsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/operations_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/operations_server.go index 935b8227fa55..54d48496f132 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/operations_server.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/operations_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -51,21 +47,40 @@ func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return o.dispatchToMethodFake(req, method) +} - switch method { - case "OperationsClient.NewListPager": - resp, err = o.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if operationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperationsClient.NewListPager": + res.resp, res.err = o.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -94,3 +109,9 @@ func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*ht } return resp, nil } + +// set this to conditionally intercept incoming requests to OperationsServerTransport +var operationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/privateendpointconnections_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/privateendpointconnections_server.go new file mode 100644 index 000000000000..66a46e7bf90a --- /dev/null +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/privateendpointconnections_server.go @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" + "net/http" + "net/url" + "regexp" +) + +// PrivateEndpointConnectionsServer is a fake server for instances of the armmysqlflexibleservers.PrivateEndpointConnectionsClient type. +type PrivateEndpointConnectionsServer struct { + // BeginCreateOrUpdate is the fake for method PrivateEndpointConnectionsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated, http.StatusAccepted + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters armmysqlflexibleservers.PrivateEndpointConnection, options *armmysqlflexibleservers.PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmysqlflexibleservers.PrivateEndpointConnectionsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method PrivateEndpointConnectionsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *armmysqlflexibleservers.PrivateEndpointConnectionsClientBeginDeleteOptions) (resp azfake.PollerResponder[armmysqlflexibleservers.PrivateEndpointConnectionsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method PrivateEndpointConnectionsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *armmysqlflexibleservers.PrivateEndpointConnectionsClientGetOptions) (resp azfake.Responder[armmysqlflexibleservers.PrivateEndpointConnectionsClientGetResponse], errResp azfake.ErrorResponder) + + // ListByServer is the fake for method PrivateEndpointConnectionsClient.ListByServer + // HTTP status codes to indicate success: http.StatusOK + ListByServer func(ctx context.Context, resourceGroupName string, serverName string, options *armmysqlflexibleservers.PrivateEndpointConnectionsClientListByServerOptions) (resp azfake.Responder[armmysqlflexibleservers.PrivateEndpointConnectionsClientListByServerResponse], errResp azfake.ErrorResponder) +} + +// NewPrivateEndpointConnectionsServerTransport creates a new instance of PrivateEndpointConnectionsServerTransport with the provided implementation. +// The returned PrivateEndpointConnectionsServerTransport instance is connected to an instance of armmysqlflexibleservers.PrivateEndpointConnectionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewPrivateEndpointConnectionsServerTransport(srv *PrivateEndpointConnectionsServer) *PrivateEndpointConnectionsServerTransport { + return &PrivateEndpointConnectionsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmysqlflexibleservers.PrivateEndpointConnectionsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmysqlflexibleservers.PrivateEndpointConnectionsClientDeleteResponse]](), + } +} + +// PrivateEndpointConnectionsServerTransport connects instances of armmysqlflexibleservers.PrivateEndpointConnectionsClient to instances of PrivateEndpointConnectionsServer. +// Don't use this type directly, use NewPrivateEndpointConnectionsServerTransport instead. +type PrivateEndpointConnectionsServerTransport struct { + srv *PrivateEndpointConnectionsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmysqlflexibleservers.PrivateEndpointConnectionsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmysqlflexibleservers.PrivateEndpointConnectionsClientDeleteResponse]] +} + +// Do implements the policy.Transporter interface for PrivateEndpointConnectionsServerTransport. +func (p *PrivateEndpointConnectionsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return p.dispatchToMethodFake(req, method) +} + +func (p *PrivateEndpointConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if privateEndpointConnectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = privateEndpointConnectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "PrivateEndpointConnectionsClient.BeginCreateOrUpdate": + res.resp, res.err = p.dispatchBeginCreateOrUpdate(req) + case "PrivateEndpointConnectionsClient.BeginDelete": + res.resp, res.err = p.dispatchBeginDelete(req) + case "PrivateEndpointConnectionsClient.Get": + res.resp, res.err = p.dispatchGet(req) + case "PrivateEndpointConnectionsClient.ListByServer": + res.resp, res.err = p.dispatchListByServer(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (p *PrivateEndpointConnectionsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if p.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := p.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmysqlflexibleservers.PrivateEndpointConnection](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) + if err != nil { + return nil, err + } + privateEndpointConnectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("privateEndpointConnectionName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, serverNameParam, privateEndpointConnectionNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + p.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { + p.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + p.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (p *PrivateEndpointConnectionsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if p.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := p.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) + if err != nil { + return nil, err + } + privateEndpointConnectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("privateEndpointConnectionName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.BeginDelete(req.Context(), resourceGroupNameParam, serverNameParam, privateEndpointConnectionNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + p.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + p.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + p.beginDelete.remove(req) + } + + return resp, nil +} + +func (p *PrivateEndpointConnectionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if p.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) + if err != nil { + return nil, err + } + privateEndpointConnectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("privateEndpointConnectionName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.Get(req.Context(), resourceGroupNameParam, serverNameParam, privateEndpointConnectionNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PrivateEndpointConnection, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (p *PrivateEndpointConnectionsServerTransport) dispatchListByServer(req *http.Request) (*http.Response, error) { + if p.srv.ListByServer == nil { + return nil, &nonRetriableError{errors.New("fake for method ListByServer not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.ListByServer(req.Context(), resourceGroupNameParam, serverNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PrivateEndpointConnectionListResult, req) + if err != nil { + return nil, err + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to PrivateEndpointConnectionsServerTransport +var privateEndpointConnectionsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/privatelinkresources_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/privatelinkresources_server.go new file mode 100644 index 000000000000..f9e6718a2be3 --- /dev/null +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/privatelinkresources_server.go @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" + "net/http" + "net/url" + "regexp" +) + +// PrivateLinkResourcesServer is a fake server for instances of the armmysqlflexibleservers.PrivateLinkResourcesClient type. +type PrivateLinkResourcesServer struct { + // Get is the fake for method PrivateLinkResourcesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, serverName string, groupName string, options *armmysqlflexibleservers.PrivateLinkResourcesClientGetOptions) (resp azfake.Responder[armmysqlflexibleservers.PrivateLinkResourcesClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByServerPager is the fake for method PrivateLinkResourcesClient.NewListByServerPager + // HTTP status codes to indicate success: http.StatusOK + NewListByServerPager func(resourceGroupName string, serverName string, options *armmysqlflexibleservers.PrivateLinkResourcesClientListByServerOptions) (resp azfake.PagerResponder[armmysqlflexibleservers.PrivateLinkResourcesClientListByServerResponse]) +} + +// NewPrivateLinkResourcesServerTransport creates a new instance of PrivateLinkResourcesServerTransport with the provided implementation. +// The returned PrivateLinkResourcesServerTransport instance is connected to an instance of armmysqlflexibleservers.PrivateLinkResourcesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewPrivateLinkResourcesServerTransport(srv *PrivateLinkResourcesServer) *PrivateLinkResourcesServerTransport { + return &PrivateLinkResourcesServerTransport{ + srv: srv, + newListByServerPager: newTracker[azfake.PagerResponder[armmysqlflexibleservers.PrivateLinkResourcesClientListByServerResponse]](), + } +} + +// PrivateLinkResourcesServerTransport connects instances of armmysqlflexibleservers.PrivateLinkResourcesClient to instances of PrivateLinkResourcesServer. +// Don't use this type directly, use NewPrivateLinkResourcesServerTransport instead. +type PrivateLinkResourcesServerTransport struct { + srv *PrivateLinkResourcesServer + newListByServerPager *tracker[azfake.PagerResponder[armmysqlflexibleservers.PrivateLinkResourcesClientListByServerResponse]] +} + +// Do implements the policy.Transporter interface for PrivateLinkResourcesServerTransport. +func (p *PrivateLinkResourcesServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return p.dispatchToMethodFake(req, method) +} + +func (p *PrivateLinkResourcesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if privateLinkResourcesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = privateLinkResourcesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "PrivateLinkResourcesClient.Get": + res.resp, res.err = p.dispatchGet(req) + case "PrivateLinkResourcesClient.NewListByServerPager": + res.resp, res.err = p.dispatchNewListByServerPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (p *PrivateLinkResourcesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if p.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateLinkResources/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) + if err != nil { + return nil, err + } + groupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("groupName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.Get(req.Context(), resourceGroupNameParam, serverNameParam, groupNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PrivateLinkResource, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (p *PrivateLinkResourcesServerTransport) dispatchNewListByServerPager(req *http.Request) (*http.Response, error) { + if p.srv.NewListByServerPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByServerPager not implemented")} + } + newListByServerPager := p.newListByServerPager.get(req) + if newListByServerPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateLinkResources` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) + if err != nil { + return nil, err + } + resp := p.srv.NewListByServerPager(resourceGroupNameParam, serverNameParam, nil) + newListByServerPager = &resp + p.newListByServerPager.add(req, newListByServerPager) + } + resp, err := server.PagerResponderNext(newListByServerPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + p.newListByServerPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByServerPager) { + p.newListByServerPager.remove(req) + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to PrivateLinkResourcesServerTransport +var privateLinkResourcesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/replicas_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/replicas_server.go index 1f5e81af8ab5..e9b2c61bf93f 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/replicas_server.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/replicas_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -53,21 +49,40 @@ func (r *ReplicasServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return r.dispatchToMethodFake(req, method) +} - switch method { - case "ReplicasClient.NewListByServerPager": - resp, err = r.dispatchNewListByServerPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (r *ReplicasServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if replicasServerTransportInterceptor != nil { + res.resp, res.err, intercepted = replicasServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ReplicasClient.NewListByServerPager": + res.resp, res.err = r.dispatchNewListByServerPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (r *ReplicasServerTransport) dispatchNewListByServerPager(req *http.Request) (*http.Response, error) { @@ -79,7 +94,7 @@ func (r *ReplicasServerTransport) dispatchNewListByServerPager(req *http.Request const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicas` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -110,3 +125,9 @@ func (r *ReplicasServerTransport) dispatchNewListByServerPager(req *http.Request } return resp, nil } + +// set this to conditionally intercept incoming requests to ReplicasServerTransport +var replicasServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/server_factory.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/server_factory.go index feba2423ea2c..5f00878179d8 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/server_factory.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/server_factory.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -19,29 +15,80 @@ import ( // ServerFactory is a fake server for instances of the armmysqlflexibleservers.ClientFactory type. type ServerFactory struct { - AdvancedThreatProtectionSettingsServer AdvancedThreatProtectionSettingsServer - AzureADAdministratorsServer AzureADAdministratorsServer - BackupAndExportServer BackupAndExportServer - BackupsServer BackupsServer - CheckNameAvailabilityServer CheckNameAvailabilityServer + // AdvancedThreatProtectionSettingsServer contains the fakes for client AdvancedThreatProtectionSettingsClient + AdvancedThreatProtectionSettingsServer AdvancedThreatProtectionSettingsServer + + // AzureADAdministratorsServer contains the fakes for client AzureADAdministratorsClient + AzureADAdministratorsServer AzureADAdministratorsServer + + // BackupAndExportServer contains the fakes for client BackupAndExportClient + BackupAndExportServer BackupAndExportServer + + // BackupsServer contains the fakes for client BackupsClient + BackupsServer BackupsServer + + // CheckNameAvailabilityServer contains the fakes for client CheckNameAvailabilityClient + CheckNameAvailabilityServer CheckNameAvailabilityServer + + // CheckNameAvailabilityWithoutLocationServer contains the fakes for client CheckNameAvailabilityWithoutLocationClient CheckNameAvailabilityWithoutLocationServer CheckNameAvailabilityWithoutLocationServer - CheckVirtualNetworkSubnetUsageServer CheckVirtualNetworkSubnetUsageServer - ConfigurationsServer ConfigurationsServer - DatabasesServer DatabasesServer - FirewallRulesServer FirewallRulesServer - GetPrivateDNSZoneSuffixServer GetPrivateDNSZoneSuffixServer - LocationBasedCapabilitiesServer LocationBasedCapabilitiesServer - LocationBasedCapabilitySetServer LocationBasedCapabilitySetServer - LogFilesServer LogFilesServer - LongRunningBackupServer LongRunningBackupServer - LongRunningBackupsServer LongRunningBackupsServer - MaintenancesServer MaintenancesServer - OperationProgressServer OperationProgressServer - OperationResultsServer OperationResultsServer - OperationsServer OperationsServer - ReplicasServer ReplicasServer - ServersServer ServersServer - ServersMigrationServer ServersMigrationServer + + // CheckVirtualNetworkSubnetUsageServer contains the fakes for client CheckVirtualNetworkSubnetUsageClient + CheckVirtualNetworkSubnetUsageServer CheckVirtualNetworkSubnetUsageServer + + // ConfigurationsServer contains the fakes for client ConfigurationsClient + ConfigurationsServer ConfigurationsServer + + // DatabasesServer contains the fakes for client DatabasesClient + DatabasesServer DatabasesServer + + // FirewallRulesServer contains the fakes for client FirewallRulesClient + FirewallRulesServer FirewallRulesServer + + // GetPrivateDNSZoneSuffixServer contains the fakes for client GetPrivateDNSZoneSuffixClient + GetPrivateDNSZoneSuffixServer GetPrivateDNSZoneSuffixServer + + // LocationBasedCapabilitiesServer contains the fakes for client LocationBasedCapabilitiesClient + LocationBasedCapabilitiesServer LocationBasedCapabilitiesServer + + // LocationBasedCapabilitySetServer contains the fakes for client LocationBasedCapabilitySetClient + LocationBasedCapabilitySetServer LocationBasedCapabilitySetServer + + // LogFilesServer contains the fakes for client LogFilesClient + LogFilesServer LogFilesServer + + // LongRunningBackupServer contains the fakes for client LongRunningBackupClient + LongRunningBackupServer LongRunningBackupServer + + // LongRunningBackupsServer contains the fakes for client LongRunningBackupsClient + LongRunningBackupsServer LongRunningBackupsServer + + // MaintenancesServer contains the fakes for client MaintenancesClient + MaintenancesServer MaintenancesServer + + // OperationProgressServer contains the fakes for client OperationProgressClient + OperationProgressServer OperationProgressServer + + // OperationResultsServer contains the fakes for client OperationResultsClient + OperationResultsServer OperationResultsServer + + // OperationsServer contains the fakes for client OperationsClient + OperationsServer OperationsServer + + // PrivateEndpointConnectionsServer contains the fakes for client PrivateEndpointConnectionsClient + PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer + + // PrivateLinkResourcesServer contains the fakes for client PrivateLinkResourcesClient + PrivateLinkResourcesServer PrivateLinkResourcesServer + + // ReplicasServer contains the fakes for client ReplicasClient + ReplicasServer ReplicasServer + + // ServersServer contains the fakes for client ServersClient + ServersServer ServersServer + + // ServersMigrationServer contains the fakes for client ServersMigrationClient + ServersMigrationServer ServersMigrationServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. @@ -78,6 +125,8 @@ type ServerFactoryTransport struct { trOperationProgressServer *OperationProgressServerTransport trOperationResultsServer *OperationResultsServerTransport trOperationsServer *OperationsServerTransport + trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport + trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport trReplicasServer *ReplicasServerTransport trServersServer *ServersServerTransport trServersMigrationServer *ServersMigrationServerTransport @@ -186,6 +235,16 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "OperationsClient": initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) resp, err = s.trOperationsServer.Do(req) + case "PrivateEndpointConnectionsClient": + initServer(s, &s.trPrivateEndpointConnectionsServer, func() *PrivateEndpointConnectionsServerTransport { + return NewPrivateEndpointConnectionsServerTransport(&s.srv.PrivateEndpointConnectionsServer) + }) + resp, err = s.trPrivateEndpointConnectionsServer.Do(req) + case "PrivateLinkResourcesClient": + initServer(s, &s.trPrivateLinkResourcesServer, func() *PrivateLinkResourcesServerTransport { + return NewPrivateLinkResourcesServerTransport(&s.srv.PrivateLinkResourcesServer) + }) + resp, err = s.trPrivateLinkResourcesServer.Do(req) case "ReplicasClient": initServer(s, &s.trReplicasServer, func() *ReplicasServerTransport { return NewReplicasServerTransport(&s.srv.ReplicasServer) }) resp, err = s.trReplicasServer.Do(req) diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/servers_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/servers_server.go index 4c939bcc6e2a..1e4991e4f161 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/servers_server.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/servers_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -37,7 +33,7 @@ type ServersServer struct { BeginDetachVNet func(ctx context.Context, resourceGroupName string, serverName string, parameters armmysqlflexibleservers.ServerDetachVNetParameter, options *armmysqlflexibleservers.ServersClientBeginDetachVNetOptions) (resp azfake.PollerResponder[armmysqlflexibleservers.ServersClientDetachVNetResponse], errResp azfake.ErrorResponder) // BeginFailover is the fake for method ServersClient.BeginFailover - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginFailover func(ctx context.Context, resourceGroupName string, serverName string, options *armmysqlflexibleservers.ServersClientBeginFailoverOptions) (resp azfake.PollerResponder[armmysqlflexibleservers.ServersClientFailoverResponse], errResp azfake.ErrorResponder) // Get is the fake for method ServersClient.Get @@ -53,19 +49,19 @@ type ServersServer struct { NewListByResourceGroupPager func(resourceGroupName string, options *armmysqlflexibleservers.ServersClientListByResourceGroupOptions) (resp azfake.PagerResponder[armmysqlflexibleservers.ServersClientListByResourceGroupResponse]) // BeginResetGtid is the fake for method ServersClient.BeginResetGtid - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginResetGtid func(ctx context.Context, resourceGroupName string, serverName string, parameters armmysqlflexibleservers.ServerGtidSetParameter, options *armmysqlflexibleservers.ServersClientBeginResetGtidOptions) (resp azfake.PollerResponder[armmysqlflexibleservers.ServersClientResetGtidResponse], errResp azfake.ErrorResponder) // BeginRestart is the fake for method ServersClient.BeginRestart - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginRestart func(ctx context.Context, resourceGroupName string, serverName string, parameters armmysqlflexibleservers.ServerRestartParameter, options *armmysqlflexibleservers.ServersClientBeginRestartOptions) (resp azfake.PollerResponder[armmysqlflexibleservers.ServersClientRestartResponse], errResp azfake.ErrorResponder) // BeginStart is the fake for method ServersClient.BeginStart - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginStart func(ctx context.Context, resourceGroupName string, serverName string, options *armmysqlflexibleservers.ServersClientBeginStartOptions) (resp azfake.PollerResponder[armmysqlflexibleservers.ServersClientStartResponse], errResp azfake.ErrorResponder) // BeginStop is the fake for method ServersClient.BeginStop - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginStop func(ctx context.Context, resourceGroupName string, serverName string, options *armmysqlflexibleservers.ServersClientBeginStopOptions) (resp azfake.PollerResponder[armmysqlflexibleservers.ServersClientStopResponse], errResp azfake.ErrorResponder) // BeginUpdate is the fake for method ServersClient.BeginUpdate @@ -122,45 +118,64 @@ func (s *ServersServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "ServersClient.BeginCreate": - resp, err = s.dispatchBeginCreate(req) - case "ServersClient.BeginDelete": - resp, err = s.dispatchBeginDelete(req) - case "ServersClient.BeginDetachVNet": - resp, err = s.dispatchBeginDetachVNet(req) - case "ServersClient.BeginFailover": - resp, err = s.dispatchBeginFailover(req) - case "ServersClient.Get": - resp, err = s.dispatchGet(req) - case "ServersClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - case "ServersClient.NewListByResourceGroupPager": - resp, err = s.dispatchNewListByResourceGroupPager(req) - case "ServersClient.BeginResetGtid": - resp, err = s.dispatchBeginResetGtid(req) - case "ServersClient.BeginRestart": - resp, err = s.dispatchBeginRestart(req) - case "ServersClient.BeginStart": - resp, err = s.dispatchBeginStart(req) - case "ServersClient.BeginStop": - resp, err = s.dispatchBeginStop(req) - case "ServersClient.BeginUpdate": - resp, err = s.dispatchBeginUpdate(req) - case "ServersClient.ValidateEstimateHighAvailability": - resp, err = s.dispatchValidateEstimateHighAvailability(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return s.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err +func (s *ServersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if serversServerTransportInterceptor != nil { + res.resp, res.err, intercepted = serversServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ServersClient.BeginCreate": + res.resp, res.err = s.dispatchBeginCreate(req) + case "ServersClient.BeginDelete": + res.resp, res.err = s.dispatchBeginDelete(req) + case "ServersClient.BeginDetachVNet": + res.resp, res.err = s.dispatchBeginDetachVNet(req) + case "ServersClient.BeginFailover": + res.resp, res.err = s.dispatchBeginFailover(req) + case "ServersClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "ServersClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + case "ServersClient.NewListByResourceGroupPager": + res.resp, res.err = s.dispatchNewListByResourceGroupPager(req) + case "ServersClient.BeginResetGtid": + res.resp, res.err = s.dispatchBeginResetGtid(req) + case "ServersClient.BeginRestart": + res.resp, res.err = s.dispatchBeginRestart(req) + case "ServersClient.BeginStart": + res.resp, res.err = s.dispatchBeginStart(req) + case "ServersClient.BeginStop": + res.resp, res.err = s.dispatchBeginStop(req) + case "ServersClient.BeginUpdate": + res.resp, res.err = s.dispatchBeginUpdate(req) + case "ServersClient.ValidateEstimateHighAvailability": + res.resp, res.err = s.dispatchValidateEstimateHighAvailability(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - - return resp, nil } func (s *ServersServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { @@ -172,7 +187,7 @@ func (s *ServersServerTransport) dispatchBeginCreate(req *http.Request) (*http.R const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armmysqlflexibleservers.Server](req) @@ -220,7 +235,7 @@ func (s *ServersServerTransport) dispatchBeginDelete(req *http.Request) (*http.R const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -264,7 +279,7 @@ func (s *ServersServerTransport) dispatchBeginDetachVNet(req *http.Request) (*ht const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/detachVNet` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armmysqlflexibleservers.ServerDetachVNetParameter](req) @@ -312,7 +327,7 @@ func (s *ServersServerTransport) dispatchBeginFailover(req *http.Request) (*http const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/failover` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -336,9 +351,9 @@ func (s *ServersServerTransport) dispatchBeginFailover(req *http.Request) (*http return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginFailover.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginFailover) { s.beginFailover.remove(req) @@ -354,7 +369,7 @@ func (s *ServersServerTransport) dispatchGet(req *http.Request) (*http.Response, const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -389,7 +404,7 @@ func (s *ServersServerTransport) dispatchNewListPager(req *http.Request) (*http. const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { + if len(matches) < 2 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := s.srv.NewListPager(nil) @@ -422,7 +437,7 @@ func (s *ServersServerTransport) dispatchNewListByResourceGroupPager(req *http.R const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -459,7 +474,7 @@ func (s *ServersServerTransport) dispatchBeginResetGtid(req *http.Request) (*htt const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resetGtid` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armmysqlflexibleservers.ServerGtidSetParameter](req) @@ -487,9 +502,9 @@ func (s *ServersServerTransport) dispatchBeginResetGtid(req *http.Request) (*htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginResetGtid.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginResetGtid) { s.beginResetGtid.remove(req) @@ -507,7 +522,7 @@ func (s *ServersServerTransport) dispatchBeginRestart(req *http.Request) (*http. const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/restart` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armmysqlflexibleservers.ServerRestartParameter](req) @@ -535,9 +550,9 @@ func (s *ServersServerTransport) dispatchBeginRestart(req *http.Request) (*http. return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginRestart.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginRestart) { s.beginRestart.remove(req) @@ -555,7 +570,7 @@ func (s *ServersServerTransport) dispatchBeginStart(req *http.Request) (*http.Re const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/start` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -579,9 +594,9 @@ func (s *ServersServerTransport) dispatchBeginStart(req *http.Request) (*http.Re return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginStart.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginStart) { s.beginStart.remove(req) @@ -599,7 +614,7 @@ func (s *ServersServerTransport) dispatchBeginStop(req *http.Request) (*http.Res const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/stop` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -623,9 +638,9 @@ func (s *ServersServerTransport) dispatchBeginStop(req *http.Request) (*http.Res return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginStop.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginStop) { s.beginStop.remove(req) @@ -643,7 +658,7 @@ func (s *ServersServerTransport) dispatchBeginUpdate(req *http.Request) (*http.R const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armmysqlflexibleservers.ServerForUpdate](req) @@ -689,7 +704,7 @@ func (s *ServersServerTransport) dispatchValidateEstimateHighAvailability(req *h const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/validateEstimateHighAvailability` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armmysqlflexibleservers.HighAvailabilityValidationEstimation](req) @@ -718,3 +733,9 @@ func (s *ServersServerTransport) dispatchValidateEstimateHighAvailability(req *h } return resp, nil } + +// set this to conditionally intercept incoming requests to ServersServerTransport +var serversServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/serversmigration_server.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/serversmigration_server.go index c8a13f6fa52f..a23c997701fd 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/serversmigration_server.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/serversmigration_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -53,21 +49,40 @@ func (s *ServersMigrationServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "ServersMigrationClient.BeginCutoverMigration": - resp, err = s.dispatchBeginCutoverMigration(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *ServersMigrationServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if serversMigrationServerTransportInterceptor != nil { + res.resp, res.err, intercepted = serversMigrationServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ServersMigrationClient.BeginCutoverMigration": + res.resp, res.err = s.dispatchBeginCutoverMigration(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *ServersMigrationServerTransport) dispatchBeginCutoverMigration(req *http.Request) (*http.Response, error) { @@ -79,7 +94,7 @@ func (s *ServersMigrationServerTransport) dispatchBeginCutoverMigration(req *htt const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforMySQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cutoverMigration` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -113,3 +128,9 @@ func (s *ServersMigrationServerTransport) dispatchBeginCutoverMigration(req *htt return resp, nil } + +// set this to conditionally intercept incoming requests to ServersMigrationServerTransport +var serversMigrationServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/time_rfc3339.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/time_rfc3339.go deleted file mode 100644 index 81f308b0d343..000000000000 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/fake/time_rfc3339.go +++ /dev/null @@ -1,110 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) - -const ( - utcDateTime = "2006-01-02T15:04:05.999999999" - utcDateTimeJSON = `"` + utcDateTime + `"` - utcDateTimeNoT = "2006-01-02 15:04:05.999999999" - utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` - dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` - dateTimeJSON = `"` + time.RFC3339Nano + `"` - dateTimeJSONNoT = `"` + dateTimeNoT + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = dateTimeJSON - } else if tzOffset { - layout = dateTimeJSONNoT - } else if hasT { - layout = utcDateTimeJSON - } else { - layout = utcDateTimeJSONNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = time.RFC3339Nano - } else if tzOffset { - layout = dateTimeNoT - } else if hasT { - layout = utcDateTime - } else { - layout = utcDateTimeNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func (t dateTimeRFC3339) String() string { - return time.Time(t).Format(time.RFC3339Nano) -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || string(data) == "null" { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/firewallrules_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/firewallrules_client.go index 196480a7c049..05b6a702e8da 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/firewallrules_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/firewallrules_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -46,7 +42,7 @@ func NewFirewallRulesClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Creates a new firewall rule or updates an existing firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - firewallRuleName - The name of the server firewall rule. @@ -73,7 +69,7 @@ func (client *FirewallRulesClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Creates a new firewall rule or updates an existing firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 func (client *FirewallRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters FirewallRule, options *FirewallRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "FirewallRulesClient.BeginCreateOrUpdate" @@ -96,7 +92,7 @@ func (client *FirewallRulesClient) createOrUpdate(ctx context.Context, resourceG } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *FirewallRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters FirewallRule, options *FirewallRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *FirewallRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters FirewallRule, _ *FirewallRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -119,9 +115,10 @@ func (client *FirewallRulesClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -131,7 +128,7 @@ func (client *FirewallRulesClient) createOrUpdateCreateRequest(ctx context.Conte // BeginDelete - Deletes a firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - firewallRuleName - The name of the server firewall rule. @@ -157,7 +154,7 @@ func (client *FirewallRulesClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Deletes a firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 func (client *FirewallRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *FirewallRulesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "FirewallRulesClient.BeginDelete" @@ -180,7 +177,7 @@ func (client *FirewallRulesClient) deleteOperation(ctx context.Context, resource } // deleteCreateRequest creates the Delete request. -func (client *FirewallRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *FirewallRulesClientBeginDeleteOptions) (*policy.Request, error) { +func (client *FirewallRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, _ *FirewallRulesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -203,16 +200,15 @@ func (client *FirewallRulesClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Gets information about a server firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - firewallRuleName - The name of the server firewall rule. @@ -240,7 +236,7 @@ func (client *FirewallRulesClient) Get(ctx context.Context, resourceGroupName st } // getCreateRequest creates the Get request. -func (client *FirewallRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *FirewallRulesClientGetOptions) (*policy.Request, error) { +func (client *FirewallRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, _ *FirewallRulesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -263,7 +259,7 @@ func (client *FirewallRulesClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,7 +276,7 @@ func (client *FirewallRulesClient) getHandleResponse(resp *http.Response) (Firew // NewListByServerPager - List all the firewall rules in a given server. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - FirewallRulesClientListByServerOptions contains the optional parameters for the FirewallRulesClient.NewListByServerPager @@ -309,7 +305,7 @@ func (client *FirewallRulesClient) NewListByServerPager(resourceGroupName string } // listByServerCreateRequest creates the ListByServer request. -func (client *FirewallRulesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *FirewallRulesClientListByServerOptions) (*policy.Request, error) { +func (client *FirewallRulesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *FirewallRulesClientListByServerOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/firewallRules" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -328,7 +324,7 @@ func (client *FirewallRulesClient) listByServerCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/firewallrules_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/firewallrules_client_example_test.go index e7a281e343b1..c470aff359c9 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/firewallrules_client_example_test.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/firewallrules_client_example_test.go @@ -1,31 +1,25 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers_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/mysql/armmysqlflexibleservers/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/stable/2023-12-30/examples/FirewallRuleCreate.json +// Generated from example definition: 2024-12-30/FirewallRuleCreate.json func ExampleFirewallRulesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -45,25 +39,27 @@ func ExampleFirewallRulesClient_BeginCreateOrUpdate() { // 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.FirewallRule = armmysqlflexibleservers.FirewallRule{ - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/firewallRules/rule1"), - // Properties: &armmysqlflexibleservers.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.255.255.255"), - // StartIPAddress: to.Ptr("0.0.0.0"), + // res = armmysqlflexibleservers.FirewallRulesClientCreateOrUpdateResponse{ + // FirewallRule: &armmysqlflexibleservers.FirewallRule{ + // Name: to.Ptr("rule1"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/firewallRules"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/firewallRules/rule1"), + // Properties: &armmysqlflexibleservers.FirewallRuleProperties{ + // EndIPAddress: to.Ptr("255.255.255.255"), + // StartIPAddress: to.Ptr("0.0.0.0"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/stable/2023-12-30/examples/FirewallRuleDelete.json +// Generated from example definition: 2024-12-30/FirewallRuleDelete.json func ExampleFirewallRulesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -71,20 +67,25 @@ func ExampleFirewallRulesClient_BeginDelete() { 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 = armmysqlflexibleservers.FirewallRulesClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/stable/2023-12-30/examples/FirewallRuleGet.json +// Generated from example definition: 2024-12-30/FirewallRuleGet.json func ExampleFirewallRulesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -95,25 +96,27 @@ func ExampleFirewallRulesClient_Get() { // 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.FirewallRule = armmysqlflexibleservers.FirewallRule{ - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/firewallRules/rule1"), - // Properties: &armmysqlflexibleservers.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.255.255.255"), - // StartIPAddress: to.Ptr("0.0.0.0"), + // res = armmysqlflexibleservers.FirewallRulesClientGetResponse{ + // FirewallRule: &armmysqlflexibleservers.FirewallRule{ + // Name: to.Ptr("rule1"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/firewallRules"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/firewallRules/rule1"), + // Properties: &armmysqlflexibleservers.FirewallRuleProperties{ + // EndIPAddress: to.Ptr("255.255.255.255"), + // StartIPAddress: to.Ptr("0.0.0.0"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/stable/2023-12-30/examples/FirewallRulesListByServer.json +// Generated from example definition: 2024-12-30/FirewallRulesListByServer.json func ExampleFirewallRulesClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -128,26 +131,29 @@ func ExampleFirewallRulesClient_NewListByServerPager() { _ = 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.FirewallRuleListResult = armmysqlflexibleservers.FirewallRuleListResult{ - // Value: []*armmysqlflexibleservers.FirewallRule{ - // { - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/firewallRules/rule1"), - // Properties: &armmysqlflexibleservers.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.255.255.255"), - // StartIPAddress: to.Ptr("0.0.0.0"), + // page = armmysqlflexibleservers.FirewallRulesClientListByServerResponse{ + // FirewallRuleListResult: armmysqlflexibleservers.FirewallRuleListResult{ + // Value: []*armmysqlflexibleservers.FirewallRule{ + // { + // Name: to.Ptr("rule1"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/firewallRules"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/firewallRules/rule1"), + // Properties: &armmysqlflexibleservers.FirewallRuleProperties{ + // EndIPAddress: to.Ptr("255.255.255.255"), + // StartIPAddress: to.Ptr("0.0.0.0"), + // }, // }, - // }, - // { - // Name: to.Ptr("rule2"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/firewallRules/rule2"), - // Properties: &armmysqlflexibleservers.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.0.0.0"), - // StartIPAddress: to.Ptr("1.0.0.0"), + // { + // Name: to.Ptr("rule2"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/firewallRules"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/firewallRules/rule2"), + // Properties: &armmysqlflexibleservers.FirewallRuleProperties{ + // EndIPAddress: to.Ptr("255.0.0.0"), + // StartIPAddress: to.Ptr("1.0.0.0"), + // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/getprivatednszonesuffix_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/getprivatednszonesuffix_client.go index 1f41bb375095..e05985fde21a 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/getprivatednszonesuffix_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/getprivatednszonesuffix_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -40,7 +36,7 @@ func NewGetPrivateDNSZoneSuffixClient(credential azcore.TokenCredential, options // Execute - Get private DNS zone suffix in the cloud. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - options - GetPrivateDNSZoneSuffixClientExecuteOptions contains the optional parameters for the GetPrivateDNSZoneSuffixClient.Execute // method. func (client *GetPrivateDNSZoneSuffixClient) Execute(ctx context.Context, options *GetPrivateDNSZoneSuffixClientExecuteOptions) (GetPrivateDNSZoneSuffixClientExecuteResponse, error) { @@ -66,14 +62,14 @@ func (client *GetPrivateDNSZoneSuffixClient) Execute(ctx context.Context, option } // executeCreateRequest creates the Execute request. -func (client *GetPrivateDNSZoneSuffixClient) executeCreateRequest(ctx context.Context, options *GetPrivateDNSZoneSuffixClientExecuteOptions) (*policy.Request, error) { +func (client *GetPrivateDNSZoneSuffixClient) executeCreateRequest(ctx context.Context, _ *GetPrivateDNSZoneSuffixClientExecuteOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.DBforMySQL/getPrivateDnsZoneSuffix" 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", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/getprivatednszonesuffix_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/getprivatednszonesuffix_client_example_test.go index 688c5738db1d..e7fefda7500d 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/getprivatednszonesuffix_client_example_test.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/getprivatednszonesuffix_client_example_test.go @@ -1,30 +1,24 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2024-10-01-preview/examples/GetPrivateDnsZoneSuffix.json +// Generated from example definition: 2024-12-30/GetPrivateDnsZoneSuffix.json func ExampleGetPrivateDNSZoneSuffixClient_Execute() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -35,7 +29,9 @@ func ExampleGetPrivateDNSZoneSuffixClient_Execute() { // 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.GetPrivateDNSZoneSuffixResponse = armmysqlflexibleservers.GetPrivateDNSZoneSuffixResponse{ - // PrivateDNSZoneSuffix: to.Ptr("suffix-example"), + // res = armmysqlflexibleservers.GetPrivateDNSZoneSuffixClientExecuteResponse{ + // GetPrivateDNSZoneSuffixResponse: &armmysqlflexibleservers.GetPrivateDNSZoneSuffixResponse{ + // PrivateDNSZoneSuffix: to.Ptr("suffix-example"), + // }, // } } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/go.mod b/sdk/resourcemanager/mysql/armmysqlflexibleservers/go.mod index afd8650b9792..6e5bc7cde54d 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/go.mod +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/go.mod @@ -1,21 +1,23 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2 -go 1.23.0 +go 1.24.0 + +toolchain go1.24.7 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.19.1 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.0 ) require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.2 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v1.5.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.40.0 // indirect - golang.org/x/net v0.42.0 // indirect - golang.org/x/sys v0.34.0 // indirect - golang.org/x/text v0.27.0 // indirect + golang.org/x/crypto v0.43.0 // indirect + golang.org/x/net v0.46.0 // indirect + golang.org/x/sys v0.37.0 // indirect + golang.org/x/text v0.30.0 // indirect ) diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/go.sum b/sdk/resourcemanager/mysql/armmysqlflexibleservers/go.sum index 49e874cd7954..c13e7f6cffad 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/go.sum +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/go.sum @@ -1,23 +1,19 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.1 h1:Wc1ml6QlJs2BHQ/9Bqu1jiyggbsSjramq2oUmp5WeIo= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.1/go.mod h1:Ot/6aikWnKWi4l9QB7qVSwa8iMphQNqkWALMoNT3rzM= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1 h1:B+blDbyVIG3WaikNxPnhPiJ1MThR03b3vKGtER95TP4= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1/go.mod h1:JdM5psgjfBf5fo2uWOZhflPWyDBZ/O/CNAH9CtsuZE4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.19.1 h1:5YTBM8QDVIBN3sxBil89WfdAAqDZbyJTgh688DSxX5w= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.19.1/go.mod h1:YD5h/ldMsG0XiIw7PdyNhLxaM317eFh5yNLccNfGdyw= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.0 h1:KpMC6LFL7mqpExyMC9jVOYRiVhLmamjeZfRsUpB7l4s= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.0/go.mod h1:J7MUC/wtRpfGVbQ5sIItY5/FuVWmvzlY21WAOfQnq/I= github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY= github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2/go.mod h1:Pa9ZNPuoNu/GztvBSKk9J1cDJW6vk/n0zLtV4mgd8N8= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 h1:FPKJS1T+clwv+OLGt13a8UjqeRuh0O4SJ3lUriThc+4= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1/go.mod h1:j2chePtV91HrC22tGoRX3sGY42uF13WzmmV80/OdVAA= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 h1:9iefClla7iYpfYWdzPCRDozdmndjTm8DXdpCzPajMgA= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2/go.mod h1:XtLgD3ZD34DAaVIIAyG3objl5DynM3CQ/vMcbBNJZGI= github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= -github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 h1:oygO0locgZJe7PpYPXT5A29ZkwJaPqcva7BVeemZOZs= -github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/AzureAD/microsoft-authentication-library-for-go v1.5.0 h1:XkkQbfMyuH2jTSjQjSoihryI8GINRcs4xp8lNawg0FI= +github.com/AzureAD/microsoft-authentication-library-for-go v1.5.0/go.mod h1:HKpQxkWaGLJ+D/5H8QRpyQXA1eKjxkFlOMwck5+33Jk= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= -github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo= +github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/keybase/go-keychain v0.0.1 h1:way+bWYa6lDppZoZcgMbYsvC7GxljxrskdNInRtuthU= @@ -28,18 +24,16 @@ github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmd github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/redis/go-redis/v9 v9.8.0 h1:q3nRvjrlge/6UD7eTu/DSg2uYiU2mCL0G/uzBWqhicI= -github.com/redis/go-redis/v9 v9.8.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw= -github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM= -golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY= -golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs= -golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +golang.org/x/crypto v0.43.0 h1:dduJYIi3A3KOfdGOHX8AVZ/jGiyPa3IbBozJ5kNuE04= +golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0= +golang.org/x/net v0.46.0 h1:giFlY12I07fugqwPuWJi68oOnpfqFnJIJzaIIm2JVV4= +golang.org/x/net v0.46.0/go.mod h1:Q9BGdFy1y4nkUwiLvT5qtyhAnEHgnQ/zd8PfU6nc210= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= -golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= -golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= +golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ= +golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/text v0.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k= +golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/interfaces.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/interfaces.go index 5b62cf9641d8..5294e50f2174 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/interfaces.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/interfaces.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilities_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilities_client.go index 47fb360ccd77..42e9afdef5c2 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilities_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilities_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -45,7 +41,7 @@ func NewLocationBasedCapabilitiesClient(subscriptionID string, credential azcore // NewListPager - Get capabilities at specified location in a given subscription. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - locationName - The name of the location. // - options - LocationBasedCapabilitiesClientListOptions contains the optional parameters for the LocationBasedCapabilitiesClient.NewListPager // method. @@ -73,7 +69,7 @@ func (client *LocationBasedCapabilitiesClient) NewListPager(locationName string, } // listCreateRequest creates the List request. -func (client *LocationBasedCapabilitiesClient) listCreateRequest(ctx context.Context, locationName string, options *LocationBasedCapabilitiesClientListOptions) (*policy.Request, error) { +func (client *LocationBasedCapabilitiesClient) listCreateRequest(ctx context.Context, locationName string, _ *LocationBasedCapabilitiesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/capabilities" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -88,7 +84,7 @@ func (client *LocationBasedCapabilitiesClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilities_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilities_client_example_test.go index 75282a8c3445..8cfe0583a068 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilities_client_example_test.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilities_client_example_test.go @@ -1,30 +1,24 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2024-10-01-preview/examples/CapabilitiesByLocationList.json +// Generated from example definition: 2024-12-30/CapabilitiesByLocationList.json func ExampleLocationBasedCapabilitiesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -39,281 +33,9 @@ func ExampleLocationBasedCapabilitiesClient_NewListPager() { _ = 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.CapabilitiesListResult = armmysqlflexibleservers.CapabilitiesListResult{ - // Value: []*armmysqlflexibleservers.CapabilityProperties{ - // { - // SupportedFlexibleServerEditions: []*armmysqlflexibleservers.ServerEditionCapability{ - // { - // Name: to.Ptr("Burstable"), - // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("5.7"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_B1s"), - // SupportedIops: to.Ptr[int64](400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B1ms"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }, - // { - // Name: to.Ptr("8.0.21"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_B1s"), - // SupportedIops: to.Ptr[int64](400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B1ms"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }, - // { - // Name: to.Ptr("GeneralPurpose"), - // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("5.7"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("8.0.21"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }, - // { - // Name: to.Ptr("MemoryOptimized"), - // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("5.7"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("8.0.21"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](64), - // }}, - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }}, - // SupportedGeoBackupRegions: []*string{ - // }, - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // Zone: to.Ptr("none"), - // }, + // page = armmysqlflexibleservers.LocationBasedCapabilitiesClientListResponse{ + // CapabilitiesListResult: armmysqlflexibleservers.CapabilitiesListResult{ + // Value: []*armmysqlflexibleservers.CapabilityProperties{ // { // SupportedFlexibleServerEditions: []*armmysqlflexibleservers.ServerEditionCapability{ // { @@ -339,7 +61,8 @@ func ExampleLocationBasedCapabilitiesClient_NewListPager() { // SupportedIops: to.Ptr[int64](1280), // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), // VCores: to.Ptr[int64](2), - // }}, + // }, + // }, // }, // { // Name: to.Ptr("8.0.21"), @@ -361,8 +84,10 @@ func ExampleLocationBasedCapabilitiesClient_NewListPager() { // SupportedIops: to.Ptr[int64](1280), // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), // VCores: to.Ptr[int64](2), - // }}, - // }}, + // }, + // }, + // }, + // }, // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ // { // Name: to.Ptr("Premium"), @@ -370,7 +95,8 @@ func ExampleLocationBasedCapabilitiesClient_NewListPager() { // MaxStorageSize: to.Ptr[int64](16777216), // MinBackupRetentionDays: to.Ptr[int64](7), // MinStorageSize: to.Ptr[int64](20480), - // }}, + // }, + // }, // }, // { // Name: to.Ptr("GeneralPurpose"), @@ -419,7 +145,8 @@ func ExampleLocationBasedCapabilitiesClient_NewListPager() { // SupportedIops: to.Ptr[int64](20000), // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), // VCores: to.Ptr[int64](64), - // }}, + // }, + // }, // }, // { // Name: to.Ptr("8.0.21"), @@ -465,8 +192,10 @@ func ExampleLocationBasedCapabilitiesClient_NewListPager() { // SupportedIops: to.Ptr[int64](20000), // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), // VCores: to.Ptr[int64](64), - // }}, - // }}, + // }, + // }, + // }, + // }, // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ // { // Name: to.Ptr("Premium"), @@ -474,7 +203,8 @@ func ExampleLocationBasedCapabilitiesClient_NewListPager() { // MaxStorageSize: to.Ptr[int64](16777216), // MinBackupRetentionDays: to.Ptr[int64](7), // MinStorageSize: to.Ptr[int64](20480), - // }}, + // }, + // }, // }, // { // Name: to.Ptr("MemoryOptimized"), @@ -523,7 +253,8 @@ func ExampleLocationBasedCapabilitiesClient_NewListPager() { // SupportedIops: to.Ptr[int64](20000), // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), // VCores: to.Ptr[int64](64), - // }}, + // }, + // }, // }, // { // Name: to.Ptr("8.0.21"), @@ -569,8 +300,10 @@ func ExampleLocationBasedCapabilitiesClient_NewListPager() { // SupportedIops: to.Ptr[int64](20000), // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), // VCores: to.Ptr[int64](64), - // }}, - // }}, + // }, + // }, + // }, + // }, // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ // { // Name: to.Ptr("Premium"), @@ -578,561 +311,881 @@ func ExampleLocationBasedCapabilitiesClient_NewListPager() { // MaxStorageSize: to.Ptr[int64](16777216), // MinBackupRetentionDays: to.Ptr[int64](7), // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }}, + // }, + // }, + // }, + // }, // SupportedGeoBackupRegions: []*string{ // }, // SupportedHAMode: []*string{ // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // Zone: to.Ptr("1"), + // to.Ptr("ZoneRedundant"), // }, - // { - // SupportedFlexibleServerEditions: []*armmysqlflexibleservers.ServerEditionCapability{ - // { - // Name: to.Ptr("Burstable"), - // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("5.7"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_B1s"), - // SupportedIops: to.Ptr[int64](400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B1ms"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, + // Zone: to.Ptr("none"), + // }, + // { + // SupportedFlexibleServerEditions: []*armmysqlflexibleservers.ServerEditionCapability{ + // { + // Name: to.Ptr("Burstable"), + // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ + // { + // Name: to.Ptr("5.7"), + // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ + // { + // Name: to.Ptr("Standard_B1s"), + // SupportedIops: to.Ptr[int64](400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), + // VCores: to.Ptr[int64](1), + // }, + // { + // Name: to.Ptr("Standard_B1ms"), + // SupportedIops: to.Ptr[int64](640), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), + // VCores: to.Ptr[int64](1), + // }, + // { + // Name: to.Ptr("Standard_B2s"), + // SupportedIops: to.Ptr[int64](1280), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), + // VCores: to.Ptr[int64](2), + // }, // }, - // { - // Name: to.Ptr("8.0.21"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_B1s"), - // SupportedIops: to.Ptr[int64](400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B1ms"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }, - // { - // Name: to.Ptr("GeneralPurpose"), - // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("5.7"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, + // }, + // { + // Name: to.Ptr("8.0.21"), + // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ + // { + // Name: to.Ptr("Standard_B1s"), + // SupportedIops: to.Ptr[int64](400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), + // VCores: to.Ptr[int64](1), + // }, + // { + // Name: to.Ptr("Standard_B1ms"), + // SupportedIops: to.Ptr[int64](640), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), + // VCores: to.Ptr[int64](1), + // }, + // { + // Name: to.Ptr("Standard_B2s"), + // SupportedIops: to.Ptr[int64](1280), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), + // VCores: to.Ptr[int64](2), + // }, // }, - // { - // Name: to.Ptr("8.0.21"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, + // }, + // }, + // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ + // { + // Name: to.Ptr("Premium"), + // MaxBackupRetentionDays: to.Ptr[int64](35), + // MaxStorageSize: to.Ptr[int64](16777216), + // MinBackupRetentionDays: to.Ptr[int64](7), + // MinStorageSize: to.Ptr[int64](20480), + // }, // }, - // { - // Name: to.Ptr("MemoryOptimized"), - // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("5.7"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("8.0.21"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](64), - // }}, - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }}, - // SupportedGeoBackupRegions: []*string{ - // }, - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // Zone: to.Ptr("2"), // }, // { - // SupportedFlexibleServerEditions: []*armmysqlflexibleservers.ServerEditionCapability{ + // Name: to.Ptr("GeneralPurpose"), + // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ // { - // Name: to.Ptr("Burstable"), - // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("5.7"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_B1s"), - // SupportedIops: to.Ptr[int64](400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B1ms"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }, - // { - // Name: to.Ptr("8.0.21"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_B1s"), - // SupportedIops: to.Ptr[int64](400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B1ms"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, + // Name: to.Ptr("5.7"), + // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ + // { + // Name: to.Ptr("Standard_D2ds_v4"), + // SupportedIops: to.Ptr[int64](3200), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_D4ds_v4"), + // SupportedIops: to.Ptr[int64](6400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_D8ds_v4"), + // SupportedIops: to.Ptr[int64](12800), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_D16ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_D32ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_D48ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_D64ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](64), + // }, + // }, // }, // { - // Name: to.Ptr("GeneralPurpose"), - // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("5.7"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("8.0.21"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, + // Name: to.Ptr("8.0.21"), + // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ + // { + // Name: to.Ptr("Standard_D2ds_v4"), + // SupportedIops: to.Ptr[int64](3200), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_D4ds_v4"), + // SupportedIops: to.Ptr[int64](6400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_D8ds_v4"), + // SupportedIops: to.Ptr[int64](12800), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_D16ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_D32ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_D48ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_D64ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](64), + // }, + // }, // }, + // }, + // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ // { - // Name: to.Ptr("MemoryOptimized"), - // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("5.7"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("8.0.21"), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](64), - // }}, - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }}, - // SupportedGeoBackupRegions: []*string{ + // Name: to.Ptr("Premium"), + // MaxBackupRetentionDays: to.Ptr[int64](35), + // MaxStorageSize: to.Ptr[int64](16777216), + // MinBackupRetentionDays: to.Ptr[int64](7), + // MinStorageSize: to.Ptr[int64](20480), + // }, // }, - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // Zone: to.Ptr("3"), - // }}, - // } + // }, + // { + // Name: to.Ptr("MemoryOptimized"), + // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ + // { + // Name: to.Ptr("5.7"), + // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ + // { + // Name: to.Ptr("Standard_E2ds_v4"), + // SupportedIops: to.Ptr[int64](3200), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_E4ds_v4"), + // SupportedIops: to.Ptr[int64](6400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_E8ds_v4"), + // SupportedIops: to.Ptr[int64](12800), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_E16ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_E32ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_E48ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_E64ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](64), + // }, + // }, + // }, + // { + // Name: to.Ptr("8.0.21"), + // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ + // { + // Name: to.Ptr("Standard_E2ds_v4"), + // SupportedIops: to.Ptr[int64](3200), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_E4ds_v4"), + // SupportedIops: to.Ptr[int64](6400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_E8ds_v4"), + // SupportedIops: to.Ptr[int64](12800), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_E16ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_E32ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_E48ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_E64ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](64), + // }, + // }, + // }, + // }, + // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ + // { + // Name: to.Ptr("Premium"), + // MaxBackupRetentionDays: to.Ptr[int64](35), + // MaxStorageSize: to.Ptr[int64](16777216), + // MinBackupRetentionDays: to.Ptr[int64](7), + // MinStorageSize: to.Ptr[int64](20480), + // }, + // }, + // }, + // }, + // SupportedGeoBackupRegions: []*string{ + // }, + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // Zone: to.Ptr("1"), + // }, + // { + // SupportedFlexibleServerEditions: []*armmysqlflexibleservers.ServerEditionCapability{ + // { + // Name: to.Ptr("Burstable"), + // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ + // { + // Name: to.Ptr("5.7"), + // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ + // { + // Name: to.Ptr("Standard_B1s"), + // SupportedIops: to.Ptr[int64](400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), + // VCores: to.Ptr[int64](1), + // }, + // { + // Name: to.Ptr("Standard_B1ms"), + // SupportedIops: to.Ptr[int64](640), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), + // VCores: to.Ptr[int64](1), + // }, + // { + // Name: to.Ptr("Standard_B2s"), + // SupportedIops: to.Ptr[int64](1280), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), + // VCores: to.Ptr[int64](2), + // }, + // }, + // }, + // { + // Name: to.Ptr("8.0.21"), + // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ + // { + // Name: to.Ptr("Standard_B1s"), + // SupportedIops: to.Ptr[int64](400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), + // VCores: to.Ptr[int64](1), + // }, + // { + // Name: to.Ptr("Standard_B1ms"), + // SupportedIops: to.Ptr[int64](640), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), + // VCores: to.Ptr[int64](1), + // }, + // { + // Name: to.Ptr("Standard_B2s"), + // SupportedIops: to.Ptr[int64](1280), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), + // VCores: to.Ptr[int64](2), + // }, + // }, + // }, + // }, + // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ + // { + // Name: to.Ptr("Premium"), + // MaxBackupRetentionDays: to.Ptr[int64](35), + // MaxStorageSize: to.Ptr[int64](16777216), + // MinBackupRetentionDays: to.Ptr[int64](7), + // MinStorageSize: to.Ptr[int64](20480), + // }, + // }, + // }, + // { + // Name: to.Ptr("GeneralPurpose"), + // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ + // { + // Name: to.Ptr("5.7"), + // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ + // { + // Name: to.Ptr("Standard_D2ds_v4"), + // SupportedIops: to.Ptr[int64](3200), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_D4ds_v4"), + // SupportedIops: to.Ptr[int64](6400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_D8ds_v4"), + // SupportedIops: to.Ptr[int64](12800), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_D16ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_D32ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_D48ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_D64ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](64), + // }, + // }, + // }, + // { + // Name: to.Ptr("8.0.21"), + // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ + // { + // Name: to.Ptr("Standard_D2ds_v4"), + // SupportedIops: to.Ptr[int64](3200), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_D4ds_v4"), + // SupportedIops: to.Ptr[int64](6400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_D8ds_v4"), + // SupportedIops: to.Ptr[int64](12800), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_D16ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_D32ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_D48ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_D64ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](64), + // }, + // }, + // }, + // }, + // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ + // { + // Name: to.Ptr("Premium"), + // MaxBackupRetentionDays: to.Ptr[int64](35), + // MaxStorageSize: to.Ptr[int64](16777216), + // MinBackupRetentionDays: to.Ptr[int64](7), + // MinStorageSize: to.Ptr[int64](20480), + // }, + // }, + // }, + // { + // Name: to.Ptr("MemoryOptimized"), + // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ + // { + // Name: to.Ptr("5.7"), + // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ + // { + // Name: to.Ptr("Standard_E2ds_v4"), + // SupportedIops: to.Ptr[int64](3200), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_E4ds_v4"), + // SupportedIops: to.Ptr[int64](6400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_E8ds_v4"), + // SupportedIops: to.Ptr[int64](12800), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_E16ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_E32ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_E48ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_E64ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](64), + // }, + // }, + // }, + // { + // Name: to.Ptr("8.0.21"), + // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ + // { + // Name: to.Ptr("Standard_E2ds_v4"), + // SupportedIops: to.Ptr[int64](3200), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_E4ds_v4"), + // SupportedIops: to.Ptr[int64](6400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_E8ds_v4"), + // SupportedIops: to.Ptr[int64](12800), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_E16ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_E32ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_E48ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_E64ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](64), + // }, + // }, + // }, + // }, + // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ + // { + // Name: to.Ptr("Premium"), + // MaxBackupRetentionDays: to.Ptr[int64](35), + // MaxStorageSize: to.Ptr[int64](16777216), + // MinBackupRetentionDays: to.Ptr[int64](7), + // MinStorageSize: to.Ptr[int64](20480), + // }, + // }, + // }, + // }, + // SupportedGeoBackupRegions: []*string{ + // }, + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // Zone: to.Ptr("2"), + // }, + // { + // SupportedFlexibleServerEditions: []*armmysqlflexibleservers.ServerEditionCapability{ + // { + // Name: to.Ptr("Burstable"), + // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ + // { + // Name: to.Ptr("5.7"), + // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ + // { + // Name: to.Ptr("Standard_B1s"), + // SupportedIops: to.Ptr[int64](400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), + // VCores: to.Ptr[int64](1), + // }, + // { + // Name: to.Ptr("Standard_B1ms"), + // SupportedIops: to.Ptr[int64](640), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), + // VCores: to.Ptr[int64](1), + // }, + // { + // Name: to.Ptr("Standard_B2s"), + // SupportedIops: to.Ptr[int64](1280), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), + // VCores: to.Ptr[int64](2), + // }, + // }, + // }, + // { + // Name: to.Ptr("8.0.21"), + // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ + // { + // Name: to.Ptr("Standard_B1s"), + // SupportedIops: to.Ptr[int64](400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), + // VCores: to.Ptr[int64](1), + // }, + // { + // Name: to.Ptr("Standard_B1ms"), + // SupportedIops: to.Ptr[int64](640), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), + // VCores: to.Ptr[int64](1), + // }, + // { + // Name: to.Ptr("Standard_B2s"), + // SupportedIops: to.Ptr[int64](1280), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), + // VCores: to.Ptr[int64](2), + // }, + // }, + // }, + // }, + // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ + // { + // Name: to.Ptr("Premium"), + // MaxBackupRetentionDays: to.Ptr[int64](35), + // MaxStorageSize: to.Ptr[int64](16777216), + // MinBackupRetentionDays: to.Ptr[int64](7), + // MinStorageSize: to.Ptr[int64](20480), + // }, + // }, + // }, + // { + // Name: to.Ptr("GeneralPurpose"), + // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ + // { + // Name: to.Ptr("5.7"), + // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ + // { + // Name: to.Ptr("Standard_D2ds_v4"), + // SupportedIops: to.Ptr[int64](3200), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_D4ds_v4"), + // SupportedIops: to.Ptr[int64](6400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_D8ds_v4"), + // SupportedIops: to.Ptr[int64](12800), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_D16ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_D32ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_D48ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_D64ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](64), + // }, + // }, + // }, + // { + // Name: to.Ptr("8.0.21"), + // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ + // { + // Name: to.Ptr("Standard_D2ds_v4"), + // SupportedIops: to.Ptr[int64](3200), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_D4ds_v4"), + // SupportedIops: to.Ptr[int64](6400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_D8ds_v4"), + // SupportedIops: to.Ptr[int64](12800), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_D16ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_D32ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_D48ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_D64ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // VCores: to.Ptr[int64](64), + // }, + // }, + // }, + // }, + // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ + // { + // Name: to.Ptr("Premium"), + // MaxBackupRetentionDays: to.Ptr[int64](35), + // MaxStorageSize: to.Ptr[int64](16777216), + // MinBackupRetentionDays: to.Ptr[int64](7), + // MinStorageSize: to.Ptr[int64](20480), + // }, + // }, + // }, + // { + // Name: to.Ptr("MemoryOptimized"), + // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapability{ + // { + // Name: to.Ptr("5.7"), + // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ + // { + // Name: to.Ptr("Standard_E2ds_v4"), + // SupportedIops: to.Ptr[int64](3200), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_E4ds_v4"), + // SupportedIops: to.Ptr[int64](6400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_E8ds_v4"), + // SupportedIops: to.Ptr[int64](12800), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_E16ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_E32ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_E48ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_E64ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](64), + // }, + // }, + // }, + // { + // Name: to.Ptr("8.0.21"), + // SupportedSKUs: []*armmysqlflexibleservers.SKUCapability{ + // { + // Name: to.Ptr("Standard_E2ds_v4"), + // SupportedIops: to.Ptr[int64](3200), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_E4ds_v4"), + // SupportedIops: to.Ptr[int64](6400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_E8ds_v4"), + // SupportedIops: to.Ptr[int64](12800), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_E16ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_E32ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_E48ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_E64ds_v4"), + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // VCores: to.Ptr[int64](64), + // }, + // }, + // }, + // }, + // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ + // { + // Name: to.Ptr("Premium"), + // MaxBackupRetentionDays: to.Ptr[int64](35), + // MaxStorageSize: to.Ptr[int64](16777216), + // MinBackupRetentionDays: to.Ptr[int64](7), + // MinStorageSize: to.Ptr[int64](20480), + // }, + // }, + // }, + // }, + // SupportedGeoBackupRegions: []*string{ + // }, + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // Zone: to.Ptr("3"), + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilityset_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilityset_client.go index 08126cb73e46..63bafa262d93 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilityset_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilityset_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -46,7 +42,7 @@ func NewLocationBasedCapabilitySetClient(subscriptionID string, credential azcor // Get - Get capabilities at specified location in a given subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - locationName - The name of the location. // - capabilitySetName - Name of capability set // - options - LocationBasedCapabilitySetClientGetOptions contains the optional parameters for the LocationBasedCapabilitySetClient.Get @@ -74,7 +70,7 @@ func (client *LocationBasedCapabilitySetClient) Get(ctx context.Context, locatio } // getCreateRequest creates the Get request. -func (client *LocationBasedCapabilitySetClient) getCreateRequest(ctx context.Context, locationName string, capabilitySetName string, options *LocationBasedCapabilitySetClientGetOptions) (*policy.Request, error) { +func (client *LocationBasedCapabilitySetClient) getCreateRequest(ctx context.Context, locationName string, capabilitySetName string, _ *LocationBasedCapabilitySetClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/capabilitySets/{capabilitySetName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -93,7 +89,7 @@ func (client *LocationBasedCapabilitySetClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -110,7 +106,7 @@ func (client *LocationBasedCapabilitySetClient) getHandleResponse(resp *http.Res // NewListPager - Get capabilities at specified location in a given subscription. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - locationName - The name of the location. // - options - LocationBasedCapabilitySetClientListOptions contains the optional parameters for the LocationBasedCapabilitySetClient.NewListPager // method. @@ -138,7 +134,7 @@ func (client *LocationBasedCapabilitySetClient) NewListPager(locationName string } // listCreateRequest creates the List request. -func (client *LocationBasedCapabilitySetClient) listCreateRequest(ctx context.Context, locationName string, options *LocationBasedCapabilitySetClientListOptions) (*policy.Request, error) { +func (client *LocationBasedCapabilitySetClient) listCreateRequest(ctx context.Context, locationName string, _ *LocationBasedCapabilitySetClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/capabilitySets" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -153,7 +149,7 @@ func (client *LocationBasedCapabilitySetClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilityset_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilityset_client_example_test.go index 65c5e262829c..65d3bd0e067f 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilityset_client_example_test.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/locationbasedcapabilityset_client_example_test.go @@ -1,1029 +1,24 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2024-10-01-preview/examples/CapabilitySetListByLocation.json -func ExampleLocationBasedCapabilitySetClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLocationBasedCapabilitySetClient().NewListPager("WestUS", 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.CapabilitySetsList = armmysqlflexibleservers.CapabilitySetsList{ - // Value: []*armmysqlflexibleservers.Capability{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.DBforMySQL/capacitysets"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforMySQL/locations/WestUS/capabilitySets/default"), - // Properties: &armmysqlflexibleservers.CapabilityPropertiesV2{ - // SupportedFeatures: []*armmysqlflexibleservers.FeatureProperty{ - // { - // FeatureName: to.Ptr("SupportAcceleratedLogs"), - // FeatureValue: to.Ptr("Enabled"), - // }}, - // SupportedFlexibleServerEditions: []*armmysqlflexibleservers.ServerEditionCapabilityV2{ - // { - // Name: to.Ptr("Burstable"), - // DefaultSKU: to.Ptr("Standard_B1s"), - // DefaultStorageSize: to.Ptr[int32](20480), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapabilityV2{ - // { - // Name: to.Ptr("Standard_B1s"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B1ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_B2ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](1700), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_B4ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](2400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_B8ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](3100), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_B12ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](3800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](12), - // }, - // { - // Name: to.Ptr("Standard_B16ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](4300), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_B20ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](5000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](20), - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupIntervalHours: to.Ptr[int64](24), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupIntervalHours: to.Ptr[int64](1), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }, - // { - // Name: to.Ptr("GeneralPurpose"), - // DefaultSKU: to.Ptr("Standard_D2ds_v4"), - // DefaultStorageSize: to.Ptr[int32](65536), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapabilityV2{ - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D96ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D96ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](96), - // }, - // { - // Name: to.Ptr("Standard_D2s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupIntervalHours: to.Ptr[int64](24), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupIntervalHours: to.Ptr[int64](1), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }, - // { - // Name: to.Ptr("MemoryOptimized"), - // DefaultSKU: to.Ptr("Standard_E2ds_v4"), - // DefaultStorageSize: to.Ptr[int32](131072), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapabilityV2{ - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](5000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](10000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](28000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](38000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](48000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](64000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E80ids_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](72000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](6451), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](80), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](5000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](10000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](28000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](38000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](48000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](64000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E96ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](80000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](7168), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](96), - // }, - // { - // Name: to.Ptr("Standard_E2ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](5000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](10000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](28000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](38000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](48000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](64000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E96ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](80000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](7168), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](96), - // }, - // { - // Name: to.Ptr("Standard_E2s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](5000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](10000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](28000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](38000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](64000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupIntervalHours: to.Ptr[int64](24), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupIntervalHours: to.Ptr[int64](1), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }}, - // SupportedGeoBackupRegions: []*string{ - // to.Ptr("southcentralus")}, - // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapabilityV2{ - // { - // Name: to.Ptr("5.7"), - // }, - // { - // Name: to.Ptr("8.0.21"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2024-10-01-preview/examples/CapabilitySetByLocation.json +// Generated from example definition: 2024-12-30/CapabilitySetByLocation.json func ExampleLocationBasedCapabilitySetClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -1034,32 +29,35 @@ func ExampleLocationBasedCapabilitySetClient_Get() { // 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.Capability = armmysqlflexibleservers.Capability{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.DBforMySQL/capabilities"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforMySQL/locations/WestUS/capabilitySets/default"), - // Properties: &armmysqlflexibleservers.CapabilityPropertiesV2{ - // SupportedFeatures: []*armmysqlflexibleservers.FeatureProperty{ - // { - // FeatureName: to.Ptr("SupportAcceleratedLogs"), - // FeatureValue: to.Ptr("Enabled"), - // }}, - // SupportedFlexibleServerEditions: []*armmysqlflexibleservers.ServerEditionCapabilityV2{ - // { - // Name: to.Ptr("Burstable"), - // DefaultSKU: to.Ptr("Standard_B1s"), - // DefaultStorageSize: to.Ptr[int32](20480), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapabilityV2{ - // { - // Name: to.Ptr("Standard_B1s"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, + // res = armmysqlflexibleservers.LocationBasedCapabilitySetClientGetResponse{ + // Capability: &armmysqlflexibleservers.Capability{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.DBforMySQL/capabilities"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforMySQL/locations/WestUS/capabilitySets/default"), + // Properties: &armmysqlflexibleservers.CapabilityPropertiesV2{ + // SupportedFeatures: []*armmysqlflexibleservers.FeatureProperty{ + // { + // FeatureName: to.Ptr("SupportAcceleratedLogs"), + // FeatureValue: to.Ptr("Enabled"), + // }, + // }, + // SupportedFlexibleServerEditions: []*armmysqlflexibleservers.ServerEditionCapabilityV2{ + // { + // Name: to.Ptr("Burstable"), + // DefaultSKU: to.Ptr("Standard_B1s"), + // DefaultStorageSize: to.Ptr[int32](20480), + // SupportedSKUs: []*armmysqlflexibleservers.SKUCapabilityV2{ + // { + // Name: to.Ptr("Standard_B1s"), + // SupportedHAMode: []*string{ + // }, + // SupportedIops: to.Ptr[int64](400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, // VCores: to.Ptr[int64](1), // }, // { @@ -1071,938 +69,2221 @@ func ExampleLocationBasedCapabilitySetClient_Get() { // SupportedZones: []*string{ // to.Ptr("1"), // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_B2ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](1700), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_B4ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](2400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_B8ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](3100), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_B12ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](3800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](12), - // }, - // { - // Name: to.Ptr("Standard_B16ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](4300), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_B20ms"), - // SupportedHAMode: []*string{ - // }, - // SupportedIops: to.Ptr[int64](5000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](20), - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupIntervalHours: to.Ptr[int64](24), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupIntervalHours: to.Ptr[int64](1), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }, - // { - // Name: to.Ptr("GeneralPurpose"), - // DefaultSKU: to.Ptr("Standard_D2ds_v4"), - // DefaultStorageSize: to.Ptr[int32](65536), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapabilityV2{ - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D96ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D96ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](96), - // }, - // { - // Name: to.Ptr("Standard_D2s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupIntervalHours: to.Ptr[int64](24), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupIntervalHours: to.Ptr[int64](1), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }, - // { - // Name: to.Ptr("MemoryOptimized"), - // DefaultSKU: to.Ptr("Standard_E2ds_v4"), - // DefaultStorageSize: to.Ptr[int32](131072), - // SupportedSKUs: []*armmysqlflexibleservers.SKUCapabilityV2{ - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](5000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](10000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](28000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](38000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](48000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](64000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E80ids_v4"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](72000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](6451), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](80), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](5000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](10000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](28000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](38000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](48000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](64000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E96ds_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](80000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](7168), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](96), - // }, - // { - // Name: to.Ptr("Standard_E2ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](5000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](10000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](28000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](38000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](48000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](64000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E96ads_v5"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](80000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](7168), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](96), - // }, - // { - // Name: to.Ptr("Standard_E2s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](5000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](10000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](28000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](38000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](20000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedIops: to.Ptr[int64](64000), - // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int64](64), - // }}, - // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("Premium"), - // MaxBackupIntervalHours: to.Ptr[int64](24), - // MaxBackupRetentionDays: to.Ptr[int64](35), - // MaxStorageSize: to.Ptr[int64](16777216), - // MinBackupIntervalHours: to.Ptr[int64](1), - // MinBackupRetentionDays: to.Ptr[int64](7), - // MinStorageSize: to.Ptr[int64](20480), - // }}, - // }}, - // SupportedGeoBackupRegions: []*string{ - // to.Ptr("southcentralus")}, - // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapabilityV2{ - // { - // Name: to.Ptr("5.7"), - // }, - // { - // Name: to.Ptr("8.0.21"), - // }}, - // }, - // } + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](1), + // }, + // { + // Name: to.Ptr("Standard_B2s"), + // SupportedHAMode: []*string{ + // }, + // SupportedIops: to.Ptr[int64](1280), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_B2ms"), + // SupportedHAMode: []*string{ + // }, + // SupportedIops: to.Ptr[int64](1700), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_B4ms"), + // SupportedHAMode: []*string{ + // }, + // SupportedIops: to.Ptr[int64](2400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_B8ms"), + // SupportedHAMode: []*string{ + // }, + // SupportedIops: to.Ptr[int64](3100), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_B12ms"), + // SupportedHAMode: []*string{ + // }, + // SupportedIops: to.Ptr[int64](3800), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](12), + // }, + // { + // Name: to.Ptr("Standard_B16ms"), + // SupportedHAMode: []*string{ + // }, + // SupportedIops: to.Ptr[int64](4300), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_B20ms"), + // SupportedHAMode: []*string{ + // }, + // SupportedIops: to.Ptr[int64](5000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](20), + // }, + // }, + // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ + // { + // Name: to.Ptr("Premium"), + // MaxBackupIntervalHours: to.Ptr[int64](24), + // MaxBackupRetentionDays: to.Ptr[int64](35), + // MaxStorageSize: to.Ptr[int64](16777216), + // MinBackupIntervalHours: to.Ptr[int64](1), + // MinBackupRetentionDays: to.Ptr[int64](7), + // MinStorageSize: to.Ptr[int64](20480), + // }, + // }, + // }, + // { + // Name: to.Ptr("GeneralPurpose"), + // DefaultSKU: to.Ptr("Standard_D2ds_v4"), + // DefaultStorageSize: to.Ptr[int32](65536), + // SupportedSKUs: []*armmysqlflexibleservers.SKUCapabilityV2{ + // { + // Name: to.Ptr("Standard_D2ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](3200), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_D4ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](6400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_D8ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](12800), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_D16ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_D32ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_D48ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_D64ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](64), + // }, + // { + // Name: to.Ptr("Standard_D2ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](3200), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_D4ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](6400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_D8ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](12800), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_D16ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_D32ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_D48ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_D64ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](64), + // }, + // { + // Name: to.Ptr("Standard_D96ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](64), + // }, + // { + // Name: to.Ptr("Standard_D2ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](3200), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_D4ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](6400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_D8ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](12800), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_D16ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_D32ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_D48ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_D64ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](64), + // }, + // { + // Name: to.Ptr("Standard_D96ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](96), + // }, + // { + // Name: to.Ptr("Standard_D2s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](3200), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_D4s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](6400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_D8s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](12800), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_D16s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_D32s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_D48s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_D64s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](64), + // }, + // }, + // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ + // { + // Name: to.Ptr("Premium"), + // MaxBackupIntervalHours: to.Ptr[int64](24), + // MaxBackupRetentionDays: to.Ptr[int64](35), + // MaxStorageSize: to.Ptr[int64](16777216), + // MinBackupIntervalHours: to.Ptr[int64](1), + // MinBackupRetentionDays: to.Ptr[int64](7), + // MinStorageSize: to.Ptr[int64](20480), + // }, + // }, + // }, + // { + // Name: to.Ptr("MemoryOptimized"), + // DefaultSKU: to.Ptr("Standard_E2ds_v4"), + // DefaultStorageSize: to.Ptr[int32](131072), + // SupportedSKUs: []*armmysqlflexibleservers.SKUCapabilityV2{ + // { + // Name: to.Ptr("Standard_E2ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](5000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_E4ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](10000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_E8ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](18000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_E16ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](28000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_E32ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](38000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_E48ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](48000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_E64ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](64000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](64), + // }, + // { + // Name: to.Ptr("Standard_E80ids_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](72000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](6451), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](80), + // }, + // { + // Name: to.Ptr("Standard_E2ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](5000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_E4ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](10000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_E8ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](18000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_E16ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](28000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_E32ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](38000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_E48ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](48000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_E64ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](64000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](64), + // }, + // { + // Name: to.Ptr("Standard_E96ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](80000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](7168), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](96), + // }, + // { + // Name: to.Ptr("Standard_E2ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](5000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_E4ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](10000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_E8ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](18000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_E16ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](28000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_E32ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](38000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_E48ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](48000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_E64ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](64000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](64), + // }, + // { + // Name: to.Ptr("Standard_E96ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](80000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](7168), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](96), + // }, + // { + // Name: to.Ptr("Standard_E2s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](5000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_E4s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](10000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_E8s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](18000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_E16s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](28000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_E32s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](38000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_E48s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_E64s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](64000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](64), + // }, + // }, + // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ + // { + // Name: to.Ptr("Premium"), + // MaxBackupIntervalHours: to.Ptr[int64](24), + // MaxBackupRetentionDays: to.Ptr[int64](35), + // MaxStorageSize: to.Ptr[int64](16777216), + // MinBackupIntervalHours: to.Ptr[int64](1), + // MinBackupRetentionDays: to.Ptr[int64](7), + // MinStorageSize: to.Ptr[int64](20480), + // }, + // }, + // }, + // }, + // SupportedGeoBackupRegions: []*string{ + // to.Ptr("southcentralus"), + // }, + // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapabilityV2{ + // { + // Name: to.Ptr("5.7"), + // }, + // { + // Name: to.Ptr("8.0.21"), + // }, + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2024-12-30/CapabilitySetListByLocation.json +func ExampleLocationBasedCapabilitySetClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewLocationBasedCapabilitySetClient().NewListPager("WestUS", 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 = armmysqlflexibleservers.LocationBasedCapabilitySetClientListResponse{ + // CapabilitySetsList: armmysqlflexibleservers.CapabilitySetsList{ + // Value: []*armmysqlflexibleservers.Capability{ + // { + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.DBforMySQL/capacitysets"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforMySQL/locations/WestUS/capabilitySets/default"), + // Properties: &armmysqlflexibleservers.CapabilityPropertiesV2{ + // SupportedFeatures: []*armmysqlflexibleservers.FeatureProperty{ + // { + // FeatureName: to.Ptr("SupportAcceleratedLogs"), + // FeatureValue: to.Ptr("Enabled"), + // }, + // }, + // SupportedFlexibleServerEditions: []*armmysqlflexibleservers.ServerEditionCapabilityV2{ + // { + // Name: to.Ptr("Burstable"), + // DefaultSKU: to.Ptr("Standard_B1s"), + // DefaultStorageSize: to.Ptr[int32](20480), + // SupportedSKUs: []*armmysqlflexibleservers.SKUCapabilityV2{ + // { + // Name: to.Ptr("Standard_B1s"), + // SupportedHAMode: []*string{ + // }, + // SupportedIops: to.Ptr[int64](400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](1024), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](1), + // }, + // { + // Name: to.Ptr("Standard_B1ms"), + // SupportedHAMode: []*string{ + // }, + // SupportedIops: to.Ptr[int64](640), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](1), + // }, + // { + // Name: to.Ptr("Standard_B2s"), + // SupportedHAMode: []*string{ + // }, + // SupportedIops: to.Ptr[int64](1280), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](2048), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_B2ms"), + // SupportedHAMode: []*string{ + // }, + // SupportedIops: to.Ptr[int64](1700), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_B4ms"), + // SupportedHAMode: []*string{ + // }, + // SupportedIops: to.Ptr[int64](2400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_B8ms"), + // SupportedHAMode: []*string{ + // }, + // SupportedIops: to.Ptr[int64](3100), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_B12ms"), + // SupportedHAMode: []*string{ + // }, + // SupportedIops: to.Ptr[int64](3800), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](12), + // }, + // { + // Name: to.Ptr("Standard_B16ms"), + // SupportedHAMode: []*string{ + // }, + // SupportedIops: to.Ptr[int64](4300), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_B20ms"), + // SupportedHAMode: []*string{ + // }, + // SupportedIops: to.Ptr[int64](5000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](20), + // }, + // }, + // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ + // { + // Name: to.Ptr("Premium"), + // MaxBackupIntervalHours: to.Ptr[int64](24), + // MaxBackupRetentionDays: to.Ptr[int64](35), + // MaxStorageSize: to.Ptr[int64](16777216), + // MinBackupIntervalHours: to.Ptr[int64](1), + // MinBackupRetentionDays: to.Ptr[int64](7), + // MinStorageSize: to.Ptr[int64](20480), + // }, + // }, + // }, + // { + // Name: to.Ptr("GeneralPurpose"), + // DefaultSKU: to.Ptr("Standard_D2ds_v4"), + // DefaultStorageSize: to.Ptr[int32](65536), + // SupportedSKUs: []*armmysqlflexibleservers.SKUCapabilityV2{ + // { + // Name: to.Ptr("Standard_D2ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](3200), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_D4ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](6400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_D8ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](12800), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_D16ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_D32ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_D48ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_D64ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](64), + // }, + // { + // Name: to.Ptr("Standard_D2ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](3200), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_D4ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](6400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_D8ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](12800), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_D16ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_D32ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_D48ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_D64ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](64), + // }, + // { + // Name: to.Ptr("Standard_D96ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](64), + // }, + // { + // Name: to.Ptr("Standard_D2ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](3200), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_D4ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](6400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_D8ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](12800), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_D16ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_D32ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_D48ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_D64ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](64), + // }, + // { + // Name: to.Ptr("Standard_D96ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](96), + // }, + // { + // Name: to.Ptr("Standard_D2s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](3200), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_D4s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](6400), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_D8s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](12800), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_D16s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_D32s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_D48s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_D64s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](64), + // }, + // }, + // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ + // { + // Name: to.Ptr("Premium"), + // MaxBackupIntervalHours: to.Ptr[int64](24), + // MaxBackupRetentionDays: to.Ptr[int64](35), + // MaxStorageSize: to.Ptr[int64](16777216), + // MinBackupIntervalHours: to.Ptr[int64](1), + // MinBackupRetentionDays: to.Ptr[int64](7), + // MinStorageSize: to.Ptr[int64](20480), + // }, + // }, + // }, + // { + // Name: to.Ptr("MemoryOptimized"), + // DefaultSKU: to.Ptr("Standard_E2ds_v4"), + // DefaultStorageSize: to.Ptr[int32](131072), + // SupportedSKUs: []*armmysqlflexibleservers.SKUCapabilityV2{ + // { + // Name: to.Ptr("Standard_E2ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](5000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_E4ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](10000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_E8ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](18000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_E16ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](28000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_E32ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](38000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_E48ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](48000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_E64ds_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](64000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](64), + // }, + // { + // Name: to.Ptr("Standard_E80ids_v4"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](72000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](6451), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](80), + // }, + // { + // Name: to.Ptr("Standard_E2ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](5000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_E4ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](10000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_E8ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](18000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_E16ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](28000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_E32ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](38000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_E48ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](48000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_E64ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](64000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](64), + // }, + // { + // Name: to.Ptr("Standard_E96ds_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](80000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](7168), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](96), + // }, + // { + // Name: to.Ptr("Standard_E2ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](5000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_E4ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](10000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_E8ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](18000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_E16ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](28000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_E32ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](38000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_E48ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](48000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_E64ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](64000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](64), + // }, + // { + // Name: to.Ptr("Standard_E96ads_v5"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](80000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](7168), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](96), + // }, + // { + // Name: to.Ptr("Standard_E2s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](5000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](2), + // }, + // { + // Name: to.Ptr("Standard_E4s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](10000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](4), + // }, + // { + // Name: to.Ptr("Standard_E8s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](18000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](8), + // }, + // { + // Name: to.Ptr("Standard_E16s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](28000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](16), + // }, + // { + // Name: to.Ptr("Standard_E32s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](38000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](32), + // }, + // { + // Name: to.Ptr("Standard_E48s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](20000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](48), + // }, + // { + // Name: to.Ptr("Standard_E64s_v3"), + // SupportedHAMode: []*string{ + // to.Ptr("SameZone"), + // to.Ptr("ZoneRedundant"), + // }, + // SupportedIops: to.Ptr[int64](64000), + // SupportedMemoryPerVCoreMB: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // VCores: to.Ptr[int64](64), + // }, + // }, + // SupportedStorageEditions: []*armmysqlflexibleservers.StorageEditionCapability{ + // { + // Name: to.Ptr("Premium"), + // MaxBackupIntervalHours: to.Ptr[int64](24), + // MaxBackupRetentionDays: to.Ptr[int64](35), + // MaxStorageSize: to.Ptr[int64](16777216), + // MinBackupIntervalHours: to.Ptr[int64](1), + // MinBackupRetentionDays: to.Ptr[int64](7), + // MinStorageSize: to.Ptr[int64](20480), + // }, + // }, + // }, + // }, + // SupportedGeoBackupRegions: []*string{ + // to.Ptr("southcentralus"), + // }, + // SupportedServerVersions: []*armmysqlflexibleservers.ServerVersionCapabilityV2{ + // { + // Name: to.Ptr("5.7"), + // }, + // { + // Name: to.Ptr("8.0.21"), + // }, + // }, + // }, + // }, + // }, + // }, + // } + } } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/logfiles_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/logfiles_client.go index 74caec33a62a..ed674b20db0e 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/logfiles_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/logfiles_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -45,7 +41,7 @@ func NewLogFilesClient(subscriptionID string, credential azcore.TokenCredential, // NewListByServerPager - List all the server log files in a given server. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - LogFilesClientListByServerOptions contains the optional parameters for the LogFilesClient.NewListByServerPager @@ -74,7 +70,7 @@ func (client *LogFilesClient) NewListByServerPager(resourceGroupName string, ser } // listByServerCreateRequest creates the ListByServer request. -func (client *LogFilesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *LogFilesClientListByServerOptions) (*policy.Request, error) { +func (client *LogFilesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *LogFilesClientListByServerOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/logFiles" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -93,7 +89,7 @@ func (client *LogFilesClient) listByServerCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/logfiles_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/logfiles_client_example_test.go index eb3f72773954..a49c38d35157 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/logfiles_client_example_test.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/logfiles_client_example_test.go @@ -1,30 +1,24 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/LogFiles/stable/2023-12-30/examples/LogFilesListByServer.json +// Generated from example definition: 2024-12-30/LogFilesListByServer.json func ExampleLogFilesClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -39,20 +33,23 @@ func ExampleLogFilesClient_NewListByServerPager() { _ = 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.LogFileListResult = armmysqlflexibleservers.LogFileListResult{ - // Value: []*armmysqlflexibleservers.LogFile{ - // { - // Name: to.Ptr("mysql-slow-mysqltestsvc1-2018022823.log"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/logFiles"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestsvc1/logFiles/mysql-slow-mysqltestsvc1-2018022823.log"), - // Properties: &armmysqlflexibleservers.LogFileProperties{ - // Type: to.Ptr("slowlog"), - // CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1-01-01T00:00:00.000Z"); return t}()), - // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-01T06:09:20.000Z"); return t}()), - // SizeInKB: to.Ptr[int64](1), - // URL: to.Ptr("https://wasd2prodwus1afse42.file.core.windows.net/833c99b2f36c47349e5554b903fe0440/serverlogs/mysql-slow-mysqltestsvc1-2018022823.log?sv=2015-04-05&sr=f&sig=XXXXXXX&se=X&sp=r"), + // page = armmysqlflexibleservers.LogFilesClientListByServerResponse{ + // LogFileListResult: armmysqlflexibleservers.LogFileListResult{ + // Value: []*armmysqlflexibleservers.LogFile{ + // { + // Name: to.Ptr("mysql-slow-mysqltestsvc1-2018022823.log"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/logFiles"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestsvc1/logFiles/mysql-slow-mysqltestsvc1-2018022823.log"), + // Properties: &armmysqlflexibleservers.LogFileProperties{ + // Type: to.Ptr("slowlog"), + // CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T00:00:00+00:00"); return t}()), + // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-01T06:09:20+00:00"); return t}()), + // SizeInKB: to.Ptr[int64](1), + // URL: to.Ptr("https://wasd2prodwus1afse42.file.core.windows.net/833c99b2f36c47349e5554b903fe0440/serverlogs/mysql-slow-mysqltestsvc1-2018022823.log?sv=2015-04-05&sr=f&sig=XXXXXXX&se=X&sp=r"), + // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackup_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackup_client.go index c042f33308be..c90548e71034 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackup_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackup_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -46,15 +42,16 @@ func NewLongRunningBackupClient(subscriptionID string, credential azcore.TokenCr // BeginCreate - Create backup for a given server with specified backup name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - backupName - The name of the backup. +// - parameters - The required parameters for creating and exporting backup of the given server. // - options - LongRunningBackupClientBeginCreateOptions contains the optional parameters for the LongRunningBackupClient.BeginCreate // method. -func (client *LongRunningBackupClient) BeginCreate(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *LongRunningBackupClientBeginCreateOptions) (*runtime.Poller[LongRunningBackupClientCreateResponse], error) { +func (client *LongRunningBackupClient) BeginCreate(ctx context.Context, resourceGroupName string, serverName string, backupName string, parameters ServerBackupV2, options *LongRunningBackupClientBeginCreateOptions) (*runtime.Poller[LongRunningBackupClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceGroupName, serverName, backupName, options) + resp, err := client.create(ctx, resourceGroupName, serverName, backupName, parameters, options) if err != nil { return nil, err } @@ -73,14 +70,14 @@ func (client *LongRunningBackupClient) BeginCreate(ctx context.Context, resource // Create - Create backup for a given server with specified backup name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 -func (client *LongRunningBackupClient) create(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *LongRunningBackupClientBeginCreateOptions) (*http.Response, error) { +// Generated from API version 2024-12-30 +func (client *LongRunningBackupClient) create(ctx context.Context, resourceGroupName string, serverName string, backupName string, parameters ServerBackupV2, options *LongRunningBackupClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "LongRunningBackupClient.BeginCreate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceGroupName, serverName, backupName, options) + req, err := client.createCreateRequest(ctx, resourceGroupName, serverName, backupName, parameters, options) if err != nil { return nil, err } @@ -96,7 +93,7 @@ func (client *LongRunningBackupClient) create(ctx context.Context, resourceGroup } // createCreateRequest creates the Create request. -func (client *LongRunningBackupClient) createCreateRequest(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *LongRunningBackupClientBeginCreateOptions) (*policy.Request, error) { +func (client *LongRunningBackupClient) createCreateRequest(ctx context.Context, resourceGroupName string, serverName string, backupName string, parameters ServerBackupV2, _ *LongRunningBackupClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backupsV2/{backupName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -119,14 +116,12 @@ func (client *LongRunningBackupClient) createCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { - return nil, err - } - return req, nil + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err } return req, nil } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackup_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackup_client_example_test.go index 0aafa87a2d27..f1c44cb41b39 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackup_client_example_test.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackup_client_example_test.go @@ -1,34 +1,28 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/stable/2023-12-30/examples/LongRunningBackup.json +// Generated from example definition: 2024-12-30/LongRunningBackup.json func ExampleLongRunningBackupClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewLongRunningBackupClient().BeginCreate(ctx, "TestGroup", "mysqltestserver", "testback", &armmysqlflexibleservers.LongRunningBackupClientBeginCreateOptions{Parameters: nil}) + poller, err := clientFactory.NewLongRunningBackupClient().BeginCreate(ctx, "TestGroup", "mysqltestserver", "testback", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -39,15 +33,17 @@ func ExampleLongRunningBackupClient_BeginCreate() { // 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.ServerBackupV2 = armmysqlflexibleservers.ServerBackupV2{ - // Name: to.Ptr("customer_20220507t073755_bb392c3b-17c6-4d3f-9742-8479ca87b3ac_mybackup"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backupsV2/customer_20220507t073755_bb392c3b-17c6-4d3f-9742-8479ca87b3ac_mybackup"), - // Properties: &armmysqlflexibleservers.ServerBackupPropertiesV2{ - // BackupType: to.Ptr(armmysqlflexibleservers.BackupTypeFULL), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-07T07:38:01.149Z"); return t}()), - // ProvisioningState: to.Ptr(armmysqlflexibleservers.ProvisioningStateSucceeded), - // Source: to.Ptr("Automatic"), + // res = armmysqlflexibleservers.LongRunningBackupClientCreateResponse{ + // ServerBackupV2: &armmysqlflexibleservers.ServerBackupV2{ + // Name: to.Ptr("customer_20220507t073755_bb392c3b-17c6-4d3f-9742-8479ca87b3ac_mybackup"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backups"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backupsV2/customer_20220507t073755_bb392c3b-17c6-4d3f-9742-8479ca87b3ac_mybackup"), + // Properties: &armmysqlflexibleservers.ServerBackupPropertiesV2{ + // BackupType: to.Ptr(armmysqlflexibleservers.BackupTypeFULL), + // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-07T07:38:01.1498043+00:00"); return t}()), + // ProvisioningState: to.Ptr(armmysqlflexibleservers.ProvisioningState("Ready")), + // Source: to.Ptr("Automatic"), + // }, // }, // } } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackups_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackups_client.go index 0220b2272ba3..d8fd6dd973c2 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackups_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackups_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -46,7 +42,7 @@ func NewLongRunningBackupsClient(subscriptionID string, credential azcore.TokenC // Get - Get backup for a given server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - backupName - The name of the backup. @@ -74,7 +70,7 @@ func (client *LongRunningBackupsClient) Get(ctx context.Context, resourceGroupNa } // getCreateRequest creates the Get request. -func (client *LongRunningBackupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *LongRunningBackupsClientGetOptions) (*policy.Request, error) { +func (client *LongRunningBackupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, backupName string, _ *LongRunningBackupsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backupsV2/{backupName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -97,7 +93,7 @@ func (client *LongRunningBackupsClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,7 +110,7 @@ func (client *LongRunningBackupsClient) getHandleResponse(resp *http.Response) ( // NewListPager - List all the backups for a given server. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - LongRunningBackupsClientListOptions contains the optional parameters for the LongRunningBackupsClient.NewListPager @@ -143,7 +139,7 @@ func (client *LongRunningBackupsClient) NewListPager(resourceGroupName string, s } // listCreateRequest creates the List request. -func (client *LongRunningBackupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *LongRunningBackupsClientListOptions) (*policy.Request, error) { +func (client *LongRunningBackupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *LongRunningBackupsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backupsV2" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -162,7 +158,7 @@ func (client *LongRunningBackupsClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackups_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackups_client_example_test.go index c9c5c4ac2f67..3b12c64d885f 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackups_client_example_test.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/longrunningbackups_client_example_test.go @@ -1,30 +1,24 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/stable/2023-12-30/examples/LongRunningBackupGet.json +// Generated from example definition: 2024-12-30/LongRunningBackupGet.json func ExampleLongRunningBackupsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -35,27 +29,29 @@ func ExampleLongRunningBackupsClient_Get() { // 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.ServerBackupV2 = armmysqlflexibleservers.ServerBackupV2{ - // Name: to.Ptr("daily_20210615T160516"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backupsV2"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backupsV2/daily_20210615T160516"), - // Properties: &armmysqlflexibleservers.ServerBackupPropertiesV2{ - // BackupType: to.Ptr(armmysqlflexibleservers.BackupTypeFULL), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T16:05:19.902Z"); return t}()), - // ProvisioningState: to.Ptr(armmysqlflexibleservers.ProvisioningStateSucceeded), - // Source: to.Ptr("Automatic"), + // res = armmysqlflexibleservers.LongRunningBackupsClientGetResponse{ + // ServerBackupV2: &armmysqlflexibleservers.ServerBackupV2{ + // Name: to.Ptr("daily_20210615T160516"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backupsV2"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backupsV2/daily_20210615T160516"), + // Properties: &armmysqlflexibleservers.ServerBackupPropertiesV2{ + // BackupType: to.Ptr(armmysqlflexibleservers.BackupTypeFULL), + // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T16:05:19.902522+00:00"); return t}()), + // ProvisioningState: to.Ptr(armmysqlflexibleservers.ProvisioningState("Ready")), + // Source: to.Ptr("Automatic"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/stable/2023-12-30/examples/LongRunningBackupsListByServer.json +// Generated from example definition: 2024-12-30/LongRunningBackupsListByServer.json func ExampleLongRunningBackupsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -70,19 +66,22 @@ func ExampleLongRunningBackupsClient_NewListPager() { _ = 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.ServerBackupV2ListResult = armmysqlflexibleservers.ServerBackupV2ListResult{ - // Value: []*armmysqlflexibleservers.ServerBackupV2{ - // { - // Name: to.Ptr("daily_20210615T160516"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backupsV2"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backupsV2/daily_20210615T160516"), - // Properties: &armmysqlflexibleservers.ServerBackupPropertiesV2{ - // BackupType: to.Ptr(armmysqlflexibleservers.BackupTypeFULL), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T16:05:19.902Z"); return t}()), - // ProvisioningState: to.Ptr(armmysqlflexibleservers.ProvisioningStateSucceeded), - // Source: to.Ptr("Automatic"), + // page = armmysqlflexibleservers.LongRunningBackupsClientListResponse{ + // ServerBackupV2ListResult: armmysqlflexibleservers.ServerBackupV2ListResult{ + // Value: []*armmysqlflexibleservers.ServerBackupV2{ + // { + // Name: to.Ptr("daily_20210615T160516"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/backupsV2"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver/backupsV2/daily_20210615T160516"), + // Properties: &armmysqlflexibleservers.ServerBackupPropertiesV2{ + // BackupType: to.Ptr(armmysqlflexibleservers.BackupTypeFULL), + // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T16:05:19.902522+00:00"); return t}()), + // ProvisioningState: to.Ptr(armmysqlflexibleservers.ProvisioningState("Ready")), + // Source: to.Ptr("Automatic"), + // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/maintenances_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/maintenances_client.go index a8f4c55228ef..5fe07dce7045 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/maintenances_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/maintenances_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -45,7 +41,7 @@ func NewMaintenancesClient(subscriptionID string, credential azcore.TokenCredent // NewListPager - List maintenances. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - MaintenancesClientListOptions contains the optional parameters for the MaintenancesClient.NewListPager method. @@ -73,7 +69,7 @@ func (client *MaintenancesClient) NewListPager(resourceGroupName string, serverN } // listCreateRequest creates the List request. -func (client *MaintenancesClient) listCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *MaintenancesClientListOptions) (*policy.Request, error) { +func (client *MaintenancesClient) listCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *MaintenancesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/maintenances" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -92,7 +88,7 @@ func (client *MaintenancesClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -110,7 +106,7 @@ func (client *MaintenancesClient) listHandleResponse(resp *http.Response) (Maint // Read - Read maintenance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - maintenanceName - The name of the maintenance. @@ -138,7 +134,7 @@ func (client *MaintenancesClient) Read(ctx context.Context, resourceGroupName st } // readCreateRequest creates the Read request. -func (client *MaintenancesClient) readCreateRequest(ctx context.Context, resourceGroupName string, serverName string, maintenanceName string, options *MaintenancesClientReadOptions) (*policy.Request, error) { +func (client *MaintenancesClient) readCreateRequest(ctx context.Context, resourceGroupName string, serverName string, maintenanceName string, _ *MaintenancesClientReadOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/maintenances/{maintenanceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -161,7 +157,7 @@ func (client *MaintenancesClient) readCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -179,15 +175,16 @@ func (client *MaintenancesClient) readHandleResponse(resp *http.Response) (Maint // BeginUpdate - Update maintenances. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - maintenanceName - The name of the maintenance. +// - parameters - The required parameters for update maintenance on a server. // - options - MaintenancesClientBeginUpdateOptions contains the optional parameters for the MaintenancesClient.BeginUpdate // method. -func (client *MaintenancesClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, maintenanceName string, options *MaintenancesClientBeginUpdateOptions) (*runtime.Poller[MaintenancesClientUpdateResponse], error) { +func (client *MaintenancesClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, maintenanceName string, parameters MaintenanceUpdate, options *MaintenancesClientBeginUpdateOptions) (*runtime.Poller[MaintenancesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, serverName, maintenanceName, options) + resp, err := client.update(ctx, resourceGroupName, serverName, maintenanceName, parameters, options) if err != nil { return nil, err } @@ -205,14 +202,14 @@ func (client *MaintenancesClient) BeginUpdate(ctx context.Context, resourceGroup // Update - Update maintenances. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-12-30 -func (client *MaintenancesClient) update(ctx context.Context, resourceGroupName string, serverName string, maintenanceName string, options *MaintenancesClientBeginUpdateOptions) (*http.Response, error) { +// Generated from API version 2024-12-30 +func (client *MaintenancesClient) update(ctx context.Context, resourceGroupName string, serverName string, maintenanceName string, parameters MaintenanceUpdate, options *MaintenancesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "MaintenancesClient.BeginUpdate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, maintenanceName, options) + req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, maintenanceName, parameters, options) if err != nil { return nil, err } @@ -228,7 +225,7 @@ func (client *MaintenancesClient) update(ctx context.Context, resourceGroupName } // updateCreateRequest creates the Update request. -func (client *MaintenancesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, maintenanceName string, options *MaintenancesClientBeginUpdateOptions) (*policy.Request, error) { +func (client *MaintenancesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, maintenanceName string, parameters MaintenanceUpdate, _ *MaintenancesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/maintenances/{maintenanceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -251,14 +248,12 @@ func (client *MaintenancesClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-30") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { - return nil, err - } - return req, nil + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err } return req, nil } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/maintenances_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/maintenances_client_example_test.go index cee5edab69ac..963b8551e89b 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/maintenances_client_example_test.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/maintenances_client_example_test.go @@ -1,33 +1,87 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers_test import ( "context" - "log" - - "time" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" + "log" + "time" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/Maintenance/stable/2023-12-30/examples/MaintenanceRead.json +// Generated from example definition: 2024-12-30/MaintenancesListByServer.json +func ExampleMaintenancesClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewMaintenancesClient().NewListPager("TestGroup", "testserver", 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 = armmysqlflexibleservers.MaintenancesClientListResponse{ + // MaintenanceListResult: armmysqlflexibleservers.MaintenanceListResult{ + // Value: []*armmysqlflexibleservers.Maintenance{ + // { + // Name: to.Ptr("YL4X-3CG"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/maintenances"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/maintenances/YL4X-3CG"), + // Properties: &armmysqlflexibleservers.MaintenanceProperties{ + // MaintenanceDescription: to.Ptr("Your Azure Database For MySQL routine maintenance has been successfully completed and your instance is running on the upgraded version. If you have any additional questions or concerns, please contact support."), + // MaintenanceEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-12-11T05:00:00"); return t}()), + // MaintenanceExecutionEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-12-11T04:22:38"); return t}()), + // MaintenanceExecutionStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-12-11T04:03:21"); return t}()), + // MaintenanceStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-12-11T04:00:00"); return t}()), + // MaintenanceState: to.Ptr(armmysqlflexibleservers.MaintenanceStateCompleted), + // MaintenanceTitle: to.Ptr("Routine Maintenance: Completed on Mon, 11 Dec 2023 04:22:38 GMT"), + // MaintenanceType: to.Ptr(armmysqlflexibleservers.MaintenanceTypeRoutineMaintenance), + // }, + // }, + // { + // Name: to.Ptr("_T9Q-TS8"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/maintenances"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/maintenances/_T9Q-TS8"), + // Properties: &armmysqlflexibleservers.MaintenanceProperties{ + // MaintenanceAvailableScheduleMaxTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-31T00:00:00"); return t}()), + // MaintenanceAvailableScheduleMinTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-05T01:23:45"); return t}()), + // MaintenanceDescription: to.Ptr("Your Azure Database For MySQL routine maintenance will be performed on the scheduled maintenance window between Mon, 15 Jan 2024 05:00:00 GMT and Mon, 15 Jan 2024 06:00:00 GMT. During the maintenance window, your instance may experience temporary service interruption. Our team will minimize any impact and ensure a smooth transition"), + // MaintenanceEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-15T06:00:00"); return t}()), + // MaintenanceStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-15T05:00:00"); return t}()), + // MaintenanceState: to.Ptr(armmysqlflexibleservers.MaintenanceStateScheduled), + // MaintenanceTitle: to.Ptr("Routine Maintenance: Scheduled on Mon, 15 Jan 2024 05:00:00 GMT - Mon, 15 Jan 2024 06:00:00 GMT"), + // MaintenanceType: to.Ptr(armmysqlflexibleservers.MaintenanceTypeRoutineMaintenance), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2024-12-30/MaintenanceRead.json func ExampleMaintenancesClient_Read() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -38,40 +92,41 @@ func ExampleMaintenancesClient_Read() { // 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.Maintenance = armmysqlflexibleservers.Maintenance{ - // Name: to.Ptr("_T9Q-TS8"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/maintenances"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/maintenances/_T9Q-TS8"), - // Properties: &armmysqlflexibleservers.MaintenanceProperties{ - // MaintenanceAvailableScheduleMaxTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-31T00:00:00.000Z"); return t}()), - // MaintenanceAvailableScheduleMinTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-05T01:23:45.000Z"); return t}()), - // MaintenanceDescription: to.Ptr("Your Azure Database For MySQL routine maintenance will be performed on the scheduled maintenance window between Mon, 15 Jan 2024 05:00:00 GMT and Mon, 15 Jan 2024 06:00:00 GMT. During the maintenance window, your instance may experience temporary service interruption. Our team will minimize any impact and ensure a smooth transition"), - // MaintenanceEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-15T06:00:00.000Z"); return t}()), - // MaintenanceStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-15T05:00:00.000Z"); return t}()), - // MaintenanceState: to.Ptr(armmysqlflexibleservers.MaintenanceStateScheduled), - // MaintenanceTitle: to.Ptr("Routine Maintenance: Scheduled on Mon, 15 Jan 2024 05:00:00 GMT - Mon, 15 Jan 2024 06:00:00 GMT"), - // MaintenanceType: to.Ptr(armmysqlflexibleservers.MaintenanceTypeRoutineMaintenance), + // res = armmysqlflexibleservers.MaintenancesClientReadResponse{ + // Maintenance: &armmysqlflexibleservers.Maintenance{ + // Name: to.Ptr("_T9Q-TS8"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/maintenances"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/maintenances/_T9Q-TS8"), + // Properties: &armmysqlflexibleservers.MaintenanceProperties{ + // MaintenanceAvailableScheduleMaxTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-31T00:00:00"); return t}()), + // MaintenanceAvailableScheduleMinTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-05T01:23:45"); return t}()), + // MaintenanceDescription: to.Ptr("Your Azure Database For MySQL routine maintenance will be performed on the scheduled maintenance window between Mon, 15 Jan 2024 05:00:00 GMT and Mon, 15 Jan 2024 06:00:00 GMT. During the maintenance window, your instance may experience temporary service interruption. Our team will minimize any impact and ensure a smooth transition"), + // MaintenanceEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-15T06:00:00"); return t}()), + // MaintenanceStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-15T05:00:00"); return t}()), + // MaintenanceState: to.Ptr(armmysqlflexibleservers.MaintenanceStateScheduled), + // MaintenanceTitle: to.Ptr("Routine Maintenance: Scheduled on Mon, 15 Jan 2024 05:00:00 GMT - Mon, 15 Jan 2024 06:00:00 GMT"), + // MaintenanceType: to.Ptr(armmysqlflexibleservers.MaintenanceTypeRoutineMaintenance), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/Maintenance/stable/2023-12-30/examples/MaintenanceUpdate.json +// Generated from example definition: 2024-12-30/MaintenanceUpdate.json func ExampleMaintenancesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewMaintenancesClient().BeginUpdate(ctx, "TestGroup", "testserver", "_T9Q-TS8", &armmysqlflexibleservers.MaintenancesClientBeginUpdateOptions{Parameters: &armmysqlflexibleservers.MaintenanceUpdate{ + poller, err := clientFactory.NewMaintenancesClient().BeginUpdate(ctx, "TestGroup", "testserver", "_T9Q-TS8", armmysqlflexibleservers.MaintenanceUpdate{ Properties: &armmysqlflexibleservers.MaintenancePropertiesForUpdate{ - MaintenanceStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-20T00:00:00.000Z"); return t }()), + MaintenanceStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-20T00:00:00"); return t }()), }, - }, - }) + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -82,77 +137,21 @@ func ExampleMaintenancesClient_BeginUpdate() { // 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.Maintenance = armmysqlflexibleservers.Maintenance{ - // Name: to.Ptr("_T9Q-TS8"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/maintenances"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/maintenances/_T9Q-TS8"), - // Properties: &armmysqlflexibleservers.MaintenanceProperties{ - // MaintenanceAvailableScheduleMaxTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-31T00:00:00.000Z"); return t}()), - // MaintenanceAvailableScheduleMinTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-05T01:23:45.000Z"); return t}()), - // MaintenanceDescription: to.Ptr("Your Azure Database For MySQL routine maintenance will be performed on the scheduled maintenance window between Sat, 20 Jan 2024 00:00:00 GMT and Sat, 20 Jan 2024 01:00:00 GMT. During the maintenance window, your instance may experience temporary service interruption. Our team will minimize any impact and ensure a smooth transition"), - // MaintenanceEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-20T01:00:00.000Z"); return t}()), - // MaintenanceStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-20T00:00:00.000Z"); return t}()), - // MaintenanceState: to.Ptr(armmysqlflexibleservers.MaintenanceStateReScheduled), - // MaintenanceTitle: to.Ptr("Routine Maintenance: Rescheduled to Sat, 20 Jan 2024 00:00:00 GMT"), - // MaintenanceType: to.Ptr(armmysqlflexibleservers.MaintenanceTypeRoutineMaintenance), + // res = armmysqlflexibleservers.MaintenancesClientUpdateResponse{ + // Maintenance: &armmysqlflexibleservers.Maintenance{ + // Name: to.Ptr("_T9Q-TS8"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/maintenances"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/maintenances/_T9Q-TS8"), + // Properties: &armmysqlflexibleservers.MaintenanceProperties{ + // MaintenanceAvailableScheduleMaxTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-31T00:00:00"); return t}()), + // MaintenanceAvailableScheduleMinTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-05T01:23:45"); return t}()), + // MaintenanceDescription: to.Ptr("Your Azure Database For MySQL routine maintenance will be performed on the scheduled maintenance window between Sat, 20 Jan 2024 00:00:00 GMT and Sat, 20 Jan 2024 01:00:00 GMT. During the maintenance window, your instance may experience temporary service interruption. Our team will minimize any impact and ensure a smooth transition"), + // MaintenanceEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-20T01:00:00"); return t}()), + // MaintenanceStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-20T00:00:00"); return t}()), + // MaintenanceState: to.Ptr(armmysqlflexibleservers.MaintenanceStateReScheduled), + // MaintenanceTitle: to.Ptr("Routine Maintenance: Rescheduled to Sat, 20 Jan 2024 00:00:00 GMT"), + // MaintenanceType: to.Ptr(armmysqlflexibleservers.MaintenanceTypeRoutineMaintenance), + // }, // }, // } } - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/Maintenance/stable/2023-12-30/examples/MaintenancesListByServer.json -func ExampleMaintenancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMaintenancesClient().NewListPager("TestGroup", "testserver", 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.MaintenanceListResult = armmysqlflexibleservers.MaintenanceListResult{ - // Value: []*armmysqlflexibleservers.Maintenance{ - // { - // Name: to.Ptr("YL4X-3CG"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/maintenances"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/maintenances/YL4X-3CG"), - // Properties: &armmysqlflexibleservers.MaintenanceProperties{ - // MaintenanceDescription: to.Ptr("Your Azure Database For MySQL routine maintenance has been successfully completed and your instance is running on the upgraded version. If you have any additional questions or concerns, please contact support."), - // MaintenanceEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-12-11T05:00:00.000Z"); return t}()), - // MaintenanceExecutionEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-12-11T04:22:38.000Z"); return t}()), - // MaintenanceExecutionStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-12-11T04:03:21.000Z"); return t}()), - // MaintenanceStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-12-11T04:00:00.000Z"); return t}()), - // MaintenanceState: to.Ptr(armmysqlflexibleservers.MaintenanceStateCompleted), - // MaintenanceTitle: to.Ptr("Routine Maintenance: Completed on Mon, 11 Dec 2023 04:22:38 GMT"), - // MaintenanceType: to.Ptr(armmysqlflexibleservers.MaintenanceTypeRoutineMaintenance), - // }, - // }, - // { - // Name: to.Ptr("_T9Q-TS8"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers/maintenances"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/testserver/maintenances/_T9Q-TS8"), - // Properties: &armmysqlflexibleservers.MaintenanceProperties{ - // MaintenanceAvailableScheduleMaxTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-31T00:00:00.000Z"); return t}()), - // MaintenanceAvailableScheduleMinTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-05T01:23:45.000Z"); return t}()), - // MaintenanceDescription: to.Ptr("Your Azure Database For MySQL routine maintenance will be performed on the scheduled maintenance window between Mon, 15 Jan 2024 05:00:00 GMT and Mon, 15 Jan 2024 06:00:00 GMT. During the maintenance window, your instance may experience temporary service interruption. Our team will minimize any impact and ensure a smooth transition"), - // MaintenanceEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-15T06:00:00.000Z"); return t}()), - // MaintenanceStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-15T05:00:00.000Z"); return t}()), - // MaintenanceState: to.Ptr(armmysqlflexibleservers.MaintenanceStateScheduled), - // MaintenanceTitle: to.Ptr("Routine Maintenance: Scheduled on Mon, 15 Jan 2024 05:00:00 GMT - Mon, 15 Jan 2024 06:00:00 GMT"), - // MaintenanceType: to.Ptr(armmysqlflexibleservers.MaintenanceTypeRoutineMaintenance), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/models.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/models.go index debc8c7d205c..acfbe6e43fba 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/models.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/models.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -15,7 +11,7 @@ type AdministratorListResult struct { // The link used to get the next page of operations. NextLink *string - // The list of azure ad administrator of a server + // The list of azure ad administrator of a server. Value []*AzureADAdministrator } @@ -42,7 +38,7 @@ type AdvancedThreatProtection struct { // Resource properties. Properties *AdvancedThreatProtectionProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string // READ-ONLY; The name of the resource @@ -61,12 +57,12 @@ type AdvancedThreatProtectionForUpdate struct { Properties *AdvancedThreatProtectionUpdateProperties } -// AdvancedThreatProtectionListResult - A list of the server's Advanced Threat Protection configurations. +// AdvancedThreatProtectionListResult - The response of a AdvancedThreatProtection list operation. type AdvancedThreatProtectionListResult struct { - // READ-ONLY; Link to retrieve next page of results. + // The link to the next page of items NextLink *string - // READ-ONLY; Array of results. + // READ-ONLY; The AdvancedThreatProtection items on this page Value []*AdvancedThreatProtection } @@ -95,7 +91,7 @@ type AzureADAdministrator struct { // The properties of an administrator. Properties *AdministratorProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string // READ-ONLY; The name of the resource @@ -132,8 +128,11 @@ type BackupAndExportRequest struct { TargetDetails BackupStoreDetailsClassification } -// BackupAndExportResponse - Represents BackupAndExport API Response +// BackupAndExportResponse - Represents BackupAndExportAPI Response type BackupAndExportResponse struct { + // READ-ONLY; The name of the backup and export response. + Name *string + // End time EndTime *time.Time @@ -143,7 +142,7 @@ type BackupAndExportResponse struct { // Operation progress (0-100). PercentComplete *float64 - // The response properties of a backup and export operation. + // The resource-specific properties for this resource. Properties *BackupAndExportResponseProperties // Start time @@ -152,12 +151,9 @@ type BackupAndExportResponse struct { // The operation status Status *OperationStatus - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; The name of the resource - Name *string - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData @@ -199,12 +195,6 @@ func (b *BackupAndExportResponseType) GetOperationProgressResponseType() *Operat } } -// BackupRequestBase is the base for all backup request. -type BackupRequestBase struct { - // REQUIRED; Backup Settings - BackupSettings *BackupSettings -} - // BackupSettings - Backup Settings type BackupSettings struct { // REQUIRED; The name of the backup. @@ -225,10 +215,10 @@ func (b *BackupStoreDetails) GetBackupStoreDetails() *BackupStoreDetails { retur // CapabilitiesListResult - location capability type CapabilitiesListResult struct { - // READ-ONLY; Link to retrieve next page of results. + // The link to the next page of items NextLink *string - // READ-ONLY; A list of supported capabilities. + // READ-ONLY; The CapabilityProperties items on this page Value []*CapabilityProperties } @@ -237,7 +227,7 @@ type Capability struct { // The properties of a location capability set. Properties *CapabilityPropertiesV2 - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string // READ-ONLY; The name of the resource @@ -282,10 +272,10 @@ type CapabilityPropertiesV2 struct { // CapabilitySetsList - location capability set type CapabilitySetsList struct { - // READ-ONLY; Link to retrieve next page of results. + // The link to the next page of items NextLink *string - // READ-ONLY; A list of supported capability sets. + // READ-ONLY; The CapabilitySetsList items on this page Value []*Capability } @@ -294,7 +284,7 @@ type Configuration struct { // The properties of a configuration. Properties *ConfigurationProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string // READ-ONLY; The name of the resource @@ -334,12 +324,12 @@ type ConfigurationListForBatchUpdate struct { Value []*ConfigurationForBatchUpdate } -// ConfigurationListResult - A list of server configurations. +// ConfigurationListResult - The response of a Configuration list operation. type ConfigurationListResult struct { - // The link used to get the next page of operations. + // The link to the next page of items NextLink *string - // The list of server configurations. + // The Configuration items on this page Value []*Configuration } @@ -402,7 +392,7 @@ type Database struct { // The properties of a database. Properties *DatabaseProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string // READ-ONLY; The name of the resource @@ -415,12 +405,12 @@ type Database struct { Type *string } -// DatabaseListResult - A List of databases. +// DatabaseListResult - The response of a Database list operation. type DatabaseListResult struct { - // The link used to get the next page of operations. + // The link to the next page of items NextLink *string - // The list of databases housed in a server + // The Database items on this page Value []*Database } @@ -469,13 +459,6 @@ type ErrorDetail struct { Target *string } -// ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. -// (This also follows the OData error response format.). -type ErrorResponse struct { - // The error object. - Error *ErrorDetail -} - // FeatureProperty - Server version capabilities. type FeatureProperty struct { // READ-ONLY; feature name @@ -490,7 +473,7 @@ type FirewallRule struct { // REQUIRED; The properties of a firewall rule. Properties *FirewallRuleProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string // READ-ONLY; The name of the resource @@ -503,12 +486,12 @@ type FirewallRule struct { Type *string } -// FirewallRuleListResult - A list of firewall rules. +// FirewallRuleListResult - The response of a FirewallRule list operation. type FirewallRuleListResult struct { - // The link used to get the next page of operations. + // The link to the next page of items NextLink *string - // The list of firewall rules in a server. + // The FirewallRule items on this page Value []*FirewallRule } @@ -523,7 +506,8 @@ type FirewallRuleProperties struct { // FullBackupStoreDetails is used for scenarios where backup data is streamed/copied over to a storage destination. type FullBackupStoreDetails struct { - // REQUIRED; Type of the specific object - used for deserializing + // CONSTANT; Type of the specific object - used for deserializing + // Field has constant value "FullBackupStoreDetails", any specified value is ignored. ObjectType *string // REQUIRED; SASUriList of storage containers where backup data is to be streamed/copied. @@ -603,7 +587,7 @@ type LogFile struct { // The properties of a logFile. Properties *LogFileProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string // READ-ONLY; The name of the resource @@ -616,12 +600,12 @@ type LogFile struct { Type *string } -// LogFileListResult - A List of logFiles. +// LogFileListResult - The response of a LogFile list operation. type LogFileListResult struct { - // The link used to get the next page of operations. + // The link to the next page of items NextLink *string - // The list of logFiles in a server + // The LogFile items on this page Value []*LogFile } @@ -648,7 +632,7 @@ type Maintenance struct { // REQUIRED; The properties of a maintenance Properties *MaintenanceProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string // READ-ONLY; The name of the resource @@ -661,12 +645,12 @@ type Maintenance struct { Type *string } -// MaintenanceListResult - A list of maintenances. +// MaintenanceListResult - The response of a Maintenance list operation. type MaintenanceListResult struct { - // The link used to get the next page of operations. + // The link to the next page of items NextLink *string - // The list of maintenances in a server. + // The Maintenance items on this page Value []*Maintenance } @@ -726,6 +710,9 @@ type MaintenanceUpdate struct { // MaintenanceWindow - Maintenance window of a server. type MaintenanceWindow struct { + // The batch of maintenance when enabled the custom managed maintenance window of a server. + BatchOfMaintenance *BatchOfMaintenance + // indicates whether custom window is enabled or disabled CustomWindow *string @@ -745,7 +732,7 @@ type MySQLServerIdentity struct { Type *ManagedServiceIdentityType // Metadata of user assigned identity. - UserAssignedIdentities map[string]any + UserAssignedIdentities map[string]*UserAssignedIdentity // READ-ONLY; ObjectId from the KeyVault PrincipalID *string @@ -756,7 +743,7 @@ type MySQLServerIdentity struct { // MySQLServerSKU - Billing information related properties of a server. type MySQLServerSKU struct { - // REQUIRED; The name of the sku, e.g. StandardD32sv3. + // REQUIRED; The name of the sku, e.g. Standard_D32s_v3. Name *string // REQUIRED; The tier of the particular SKU, e.g. GeneralPurpose. @@ -796,42 +783,47 @@ type Network struct { PublicNetworkAccess *EnableStatusEnum } -// Operation - REST API operation definition. +// Operation - Details of a REST API operation, returned from the Resource Provider Operations API type Operation struct { - // The localized display information for this particular operation or action. + // Localized display information for this particular operation. Display *OperationDisplay - // The name of the operation being performed on this particular object. - Name *string - - // The intended executor of the operation. - Origin *string - // Additional descriptions for the operation. Properties map[string]any + + // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", + // "Microsoft.Compute/virtualMachines/capture/action" + Name *string + + // READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + // value is "user,system" + Origin *Origin } // OperationDisplay - Display metadata associated with the operation. type OperationDisplay struct { - // Operation description. + // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. Description *string - // Localized friendly name for the operation. + // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual + // Machine", "Restart Virtual Machine". Operation *string - // Operation resource provider name. + // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + // Compute". Provider *string - // Resource on which the operation is performed. + // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + // Schedule Collections". Resource *string } -// OperationListResult - A list of resource provider operations. +// OperationListResult - The static parameters for a resource group based resource type OperationListResult struct { - // URL client should use to fetch the next page (per server side paging). + // The link to the next page of items NextLink *string - // Collection of available operation details + // The Operation items on this page Value []*Operation } @@ -867,7 +859,7 @@ type OperationProgressResult struct { Operations []*OperationStatusResult // Percent of the operation that is complete. - PercentComplete *float32 + PercentComplete *float64 // The response properties specific to the operation Properties OperationProgressResponseTypeClassification @@ -900,7 +892,7 @@ type OperationStatusExtendedResult struct { Operations []*OperationStatusResult // Percent of the operation that is complete. - PercentComplete *float32 + PercentComplete *float64 // The extended properties of Operation Results Properties map[string]any @@ -933,7 +925,7 @@ type OperationStatusResult struct { Operations []*OperationStatusResult // Percent of the operation that is complete. - PercentComplete *float32 + PercentComplete *float64 // The start time of the operation. StartTime *time.Time @@ -944,16 +936,16 @@ type OperationStatusResult struct { // PrivateEndpoint - The private endpoint resource. type PrivateEndpoint struct { - // READ-ONLY; The ARM identifier for private endpoint. + // READ-ONLY; The resource identifier of the private endpoint ID *string } -// PrivateEndpointConnection - The private endpoint connection resource. +// PrivateEndpointConnection - A private endpoint connection resource type PrivateEndpointConnection struct { // Resource properties. Properties *PrivateEndpointConnectionProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string // READ-ONLY; The name of the resource @@ -966,6 +958,15 @@ type PrivateEndpointConnection struct { Type *string } +// PrivateEndpointConnectionListResult - The response of a PrivateEndpointConnection list operation. +type PrivateEndpointConnectionListResult struct { + // REQUIRED; The PrivateEndpointConnection items on this page + Value []*PrivateEndpointConnection + + // The link to the next page of items + NextLink *string +} + // PrivateEndpointConnectionProperties - Properties of the private endpoint connection. type PrivateEndpointConnectionProperties struct { // REQUIRED; A collection of information about the state of the connection between service consumer and provider. @@ -981,25 +982,12 @@ type PrivateEndpointConnectionProperties struct { ProvisioningState *PrivateEndpointConnectionProvisioningState } -// PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer -// and provider. -type PrivateLinkServiceConnectionState struct { - // A message indicating if changes on the service provider require any updates on the consumer. - ActionsRequired *string - - // The reason for approval/rejection of the connection. - Description *string - - // Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. - Status *PrivateEndpointServiceConnectionStatus -} - -// Provisioning - Server backup properties -type Provisioning struct { - // The properties of provisioning. - Properties *ProvisioningStateProperties +// PrivateLinkResource - A private link resource. +type PrivateLinkResource struct { + // Resource properties. + Properties *PrivateLinkResourceProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string // READ-ONLY; The name of the resource @@ -1012,41 +1000,40 @@ type Provisioning struct { Type *string } -// ProvisioningStateProperties - The properties of a server backup. -type ProvisioningStateProperties struct { - // READ-ONLY; The provisioning state of backup resource. - ProvisioningState *ProvisioningState +// PrivateLinkResourceListResult - A list of private link resources for versions before v6. +// This model represents the standard `PrivateLinkResourceListResult` envelope for versions v3, v4, and v5. It has been deprecated +// for v6 and beyond. +// Note: This is only intended for use with versions before v6. Do not use this if you are already on CommonTypes.Version.v6 +// or beyond. +// If you are migrating to v6 or above, use `PrivateLinkResourceListResult` directly. +type PrivateLinkResourceListResult struct { + // Array of private link resources + Value []*PrivateLinkResource } -// ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a -// location -type ProxyResource struct { - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string +// PrivateLinkResourceProperties - Properties of a private link resource. +type PrivateLinkResourceProperties struct { + // The private link resource private link DNS zone name. + RequiredZoneNames []*string - // READ-ONLY; The name of the resource - Name *string + // READ-ONLY; The private link resource group id. + GroupID *string - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string + // READ-ONLY; The private link resource required member names. + RequiredMembers []*string } -// Resource - Common fields that are returned in the response for all Azure Resource Manager resources -type Resource struct { - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string +// PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer +// and provider. +type PrivateLinkServiceConnectionState struct { + // A message indicating if changes on the service provider require any updates on the consumer. + ActionsRequired *string - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData + // The reason for approval/rejection of the connection. + Description *string - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string + // Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + Status *PrivateEndpointServiceConnectionStatus } // SKUCapability - Sku capability @@ -1102,7 +1089,7 @@ type Server struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string // READ-ONLY; The name of the resource @@ -1120,7 +1107,7 @@ type ServerBackup struct { // The properties of a server backup. Properties *ServerBackupProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string // READ-ONLY; The name of the resource @@ -1133,12 +1120,12 @@ type ServerBackup struct { Type *string } -// ServerBackupListResult - A list of server backups. +// ServerBackupListResult - The response of a ServerBackup list operation. type ServerBackupListResult struct { - // The link used to get the next page of operations. + // The link to the next page of items NextLink *string - // The list of backups of a server. + // The ServerBackup items on this page Value []*ServerBackup } @@ -1175,7 +1162,7 @@ type ServerBackupV2 struct { // The properties of a server backup. Properties *ServerBackupPropertiesV2 - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string // READ-ONLY; The name of the resource @@ -1188,12 +1175,12 @@ type ServerBackupV2 struct { Type *string } -// ServerBackupV2ListResult - A list of server backups. +// ServerBackupV2ListResult - The response of a ServerBackupV2 list operation. type ServerBackupV2ListResult struct { - // The link used to get the next page of operations. + // The link to the next page of items NextLink *string - // The list of backups of a server. + // The ServerBackupV2 items on this page Value []*ServerBackupV2 } @@ -1254,12 +1241,12 @@ type ServerGtidSetParameter struct { GtidSet *string } -// ServerListResult - A list of servers. +// ServerListResult - The response of a Server list operation. type ServerListResult struct { - // The link used to get the next page of operations. + // The link to the next page of items NextLink *string - // The list of servers + // The Server items on this page Value []*Server } @@ -1287,9 +1274,6 @@ type ServerProperties struct { // The server database port. Can only be specified when the server is being created. DatabasePort *int32 - // Major version and actual engine version - FullVersion *string - // High availability related properties of a server. HighAvailability *HighAvailability @@ -1321,6 +1305,9 @@ type ServerProperties struct { // Major version of MySQL. 8.0.21 stands for MySQL 8.0, 5.7.44 stands for MySQL 5.7 Version *ServerVersion + // READ-ONLY; Major version and actual engine version + FullVersion *string + // READ-ONLY; The fully qualified domain name of a server. FullyQualifiedDomainName *string @@ -1460,28 +1447,6 @@ type SystemData struct { LastModifiedByType *CreatedByType } -// TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' -// and a 'location' -type TrackedResource struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - // UserAssignedIdentity - Metadata of user assigned identity. type UserAssignedIdentity struct { // READ-ONLY; Client Id of user assigned identity diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/models_serde.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/models_serde.go index 848437df3806..4b4daa70c8be 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/models_serde.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/models_serde.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -502,33 +498,6 @@ func (b *BackupAndExportResponseType) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type BackupRequestBase. -func (b BackupRequestBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "backupSettings", b.BackupSettings) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupRequestBase. -func (b *BackupRequestBase) UnmarshalJSON(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 "backupSettings": - err = unpopulate(val, "BackupSettings", &b.BackupSettings) - 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 BackupSettings. func (b BackupSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -563,7 +532,7 @@ func (b *BackupSettings) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type BackupStoreDetails. func (b BackupStoreDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["objectType"] = b.ObjectType + populate(objectMap, "objectType", b.ObjectType) return json.Marshal(objectMap) } @@ -1257,33 +1226,6 @@ func (e *ErrorDetail) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. -func (e ErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "error", e.Error) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. -func (e *ErrorResponse) UnmarshalJSON(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 "error": - err = unpopulate(val, "Error", &e.Error) - 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 FeatureProperty. func (f FeatureProperty) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1960,6 +1902,7 @@ func (m *MaintenanceUpdate) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MaintenanceWindow. func (m MaintenanceWindow) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "batchOfMaintenance", m.BatchOfMaintenance) populate(objectMap, "customWindow", m.CustomWindow) populate(objectMap, "dayOfWeek", m.DayOfWeek) populate(objectMap, "startHour", m.StartHour) @@ -1976,6 +1919,9 @@ func (m *MaintenanceWindow) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "batchOfMaintenance": + err = unpopulate(val, "BatchOfMaintenance", &m.BatchOfMaintenance) + delete(rawMsg, key) case "customWindow": err = unpopulate(val, "CustomWindow", &m.CustomWindow) delete(rawMsg, key) @@ -2279,7 +2225,7 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationProgressResponseType. func (o OperationProgressResponseType) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["objectType"] = o.ObjectType + populate(objectMap, "objectType", o.ObjectType) return json.Marshal(objectMap) } @@ -2558,18 +2504,16 @@ func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { 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 PrivateEndpointConnectionListResult. +func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "groupIds", p.GroupIDs) - populate(objectMap, "privateEndpoint", p.PrivateEndpoint) - populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) - populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.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 PrivateEndpointConnectionListResult. +func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -2577,17 +2521,11 @@ func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "groupIds": - err = unpopulate(val, "GroupIDs", &p.GroupIDs) - delete(rawMsg, key) - case "privateEndpoint": - err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) - delete(rawMsg, key) - case "privateLinkServiceConnectionState": - err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { @@ -2597,17 +2535,18 @@ func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState. -func (p PrivateLinkServiceConnectionState) 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, "actionsRequired", p.ActionsRequired) - populate(objectMap, "description", p.Description) - populate(objectMap, "status", p.Status) + 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 PrivateLinkServiceConnectionState. -func (p *PrivateLinkServiceConnectionState) 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", p, err) @@ -2615,14 +2554,17 @@ func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "actionsRequired": - err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) + case "groupIds": + err = unpopulate(val, "GroupIDs", &p.GroupIDs) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &p.Description) + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &p.Status) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) delete(rawMsg, key) } if err != nil { @@ -2632,8 +2574,8 @@ func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Provisioning. -func (p Provisioning) 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, "id", p.ID) populate(objectMap, "name", p.Name) @@ -2643,8 +2585,8 @@ func (p Provisioning) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Provisioning. -func (p *Provisioning) 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", p, err) @@ -2675,15 +2617,15 @@ func (p *Provisioning) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ProvisioningStateProperties. -func (p ProvisioningStateProperties) 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, "provisioningState", p.ProvisioningState) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisioningStateProperties. -func (p *ProvisioningStateProperties) 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", p, err) @@ -2691,8 +2633,8 @@ func (p *ProvisioningStateProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { @@ -2702,18 +2644,17 @@ func (p *ProvisioningStateProperties) UnmarshalJSON(data []byte) error { 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 PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "systemData", p.SystemData) - populate(objectMap, "type", p.Type) + 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 ProxyResource. -func (p *ProxyResource) 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", p, err) @@ -2721,17 +2662,14 @@ func (p *ProxyResource) UnmarshalJSON(data []byte) error { 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 "groupId": + err = unpopulate(val, "GroupID", &p.GroupID) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &p.SystemData) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) delete(rawMsg, key) } if err != nil { @@ -2741,40 +2679,36 @@ func (p *ProxyResource) UnmarshalJSON(data []byte) error { 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 PrivateLinkServiceConnectionState. +func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "systemData", r.SystemData) - populate(objectMap, "type", r.Type) + 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 Resource. -func (r *Resource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState. +func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(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", p, 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 "actionsRequired": + err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &r.SystemData) + case "description": + err = unpopulate(val, "Description", &p.Description) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "status": + err = unpopulate(val, "Status", &p.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil @@ -3765,53 +3699,6 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type TrackedResource. -func (t TrackedResource) 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, "systemData", t.SystemData) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. -func (t *TrackedResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &t.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &t.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &t.Name) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &t.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &t.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &t.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity. func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationprogress_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationprogress_client.go index af9f12ebcf3f..7c7f691482b5 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationprogress_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationprogress_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -44,9 +40,11 @@ func NewOperationProgressClient(subscriptionID string, credential azcore.TokenCr } // Get - Get the operation result for a long running operation. +// +// Get the operation result for a long running operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - locationName - The name of the location. // - operationID - The ID of an ongoing async operation. // - options - OperationProgressClientGetOptions contains the optional parameters for the OperationProgressClient.Get method. @@ -73,7 +71,7 @@ func (client *OperationProgressClient) Get(ctx context.Context, locationName str } // getCreateRequest creates the Get request. -func (client *OperationProgressClient) getCreateRequest(ctx context.Context, locationName string, operationID string, options *OperationProgressClientGetOptions) (*policy.Request, error) { +func (client *OperationProgressClient) getCreateRequest(ctx context.Context, locationName string, operationID string, _ *OperationProgressClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/operationProgress/{operationId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -92,7 +90,7 @@ func (client *OperationProgressClient) getCreateRequest(ctx context.Context, loc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationprogress_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationprogress_client_example_test.go index 0bbebb029504..d1de04cfe385 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationprogress_client_example_test.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationprogress_client_example_test.go @@ -1,30 +1,24 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2024-10-01-preview/examples/OperationProgress_Get_BackupAndExport.json +// Generated from example definition: 2024-12-30/OperationProgress_Get_BackupAndExport.json func ExampleOperationProgressClient_Get_operationProgressGetBackupAndExport() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -35,29 +29,31 @@ func ExampleOperationProgressClient_Get_operationProgressGetBackupAndExport() { // 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.OperationProgressResult = armmysqlflexibleservers.OperationProgressResult{ - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforMySQL/locations/westus/operationProgress/00000000-0000-0000-0000-000000000000"), - // PercentComplete: to.Ptr[float32](10), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-29T07:34:02.328Z"); return t}()), - // Status: to.Ptr("InProgress"), - // Properties: &armmysqlflexibleservers.BackupAndExportResponseType{ - // ObjectType: to.Ptr(armmysqlflexibleservers.ObjectTypeBackupAndExportResponse), - // BackupMetadata: to.Ptr("{\"key1\":\"value1\",\"key2\":\"value2\"}"), - // DataTransferredInBytes: to.Ptr[int64](102), - // DatasourceSizeInBytes: to.Ptr[int64](1024), + // res = armmysqlflexibleservers.OperationProgressClientGetResponse{ + // OperationProgressResult: &armmysqlflexibleservers.OperationProgressResult{ + // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforMySQL/locations/westus/operationProgress/00000000-0000-0000-0000-000000000000"), + // PercentComplete: to.Ptr[float64](10), + // Properties: &armmysqlflexibleservers.BackupAndExportResponseType{ + // BackupMetadata: to.Ptr("{\"key1\":\"value1\",\"key2\":\"value2\"}"), + // DataTransferredInBytes: to.Ptr[int64](102), + // DatasourceSizeInBytes: to.Ptr[int64](1024), + // ObjectType: to.Ptr(armmysqlflexibleservers.ObjectTypeBackupAndExportResponse), + // }, + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-29T07:34:02.328326Z"); return t}()), + // Status: to.Ptr("InProgress"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2024-10-01-preview/examples/OperationProgress_Get_ImportFromStorage.json +// Generated from example definition: 2024-12-30/OperationProgress_Get_ImportFromStorage.json func ExampleOperationProgressClient_Get_operationProgressGetImportFromStorage() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -68,15 +64,17 @@ func ExampleOperationProgressClient_Get_operationProgressGetImportFromStorage() // 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.OperationProgressResult = armmysqlflexibleservers.OperationProgressResult{ - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforMySQL/locations/westus/operationProgress/00000000-0000-0000-0000-000000000000"), - // PercentComplete: to.Ptr[float32](10), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-29T07:34:02.328Z"); return t}()), - // Status: to.Ptr("InProgress"), - // Properties: &armmysqlflexibleservers.ImportFromStorageResponseType{ - // ObjectType: to.Ptr(armmysqlflexibleservers.ObjectTypeImportFromStorageResponse), - // EstimatedCompletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-29T08:34:02.328Z"); return t}()), + // res = armmysqlflexibleservers.OperationProgressClientGetResponse{ + // OperationProgressResult: &armmysqlflexibleservers.OperationProgressResult{ + // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforMySQL/locations/westus/operationProgress/00000000-0000-0000-0000-000000000000"), + // PercentComplete: to.Ptr[float64](10), + // Properties: &armmysqlflexibleservers.ImportFromStorageResponseType{ + // EstimatedCompletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-29T08:34:02.328326Z"); return t}()), + // ObjectType: to.Ptr(armmysqlflexibleservers.ObjectTypeImportFromStorageResponse), + // }, + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-29T07:34:02.328326Z"); return t}()), + // Status: to.Ptr("InProgress"), // }, // } } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationresults_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationresults_client.go index ff7f789a39c2..7854e2df5df3 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationresults_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationresults_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -44,11 +40,13 @@ func NewOperationResultsClient(subscriptionID string, credential azcore.TokenCre } // Get - Get the operation result for a long running operation. +// +// Get the operation result for a long running operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - locationName - The name of the location. -// - operationID - The operation Id. +// - operationID - The ID of an ongoing async operation. // - options - OperationResultsClientGetOptions contains the optional parameters for the OperationResultsClient.Get method. func (client *OperationResultsClient) Get(ctx context.Context, locationName string, operationID string, options *OperationResultsClientGetOptions) (OperationResultsClientGetResponse, error) { var err error @@ -73,7 +71,7 @@ func (client *OperationResultsClient) Get(ctx context.Context, locationName stri } // getCreateRequest creates the Get request. -func (client *OperationResultsClient) getCreateRequest(ctx context.Context, locationName string, operationID string, options *OperationResultsClientGetOptions) (*policy.Request, error) { +func (client *OperationResultsClient) getCreateRequest(ctx context.Context, locationName string, operationID string, _ *OperationResultsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/operationResults/{operationId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -92,7 +90,7 @@ func (client *OperationResultsClient) getCreateRequest(ctx context.Context, loca return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationresults_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationresults_client_example_test.go index bb9367fe500c..bf2cfe792b14 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationresults_client_example_test.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/operationresults_client_example_test.go @@ -1,30 +1,24 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2024-10-01-preview/examples/OperationResults_Get.json +// Generated from example definition: 2024-12-30/OperationResults_Get.json func ExampleOperationResultsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -35,21 +29,23 @@ func ExampleOperationResultsClient_Get() { // 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.OperationStatusExtendedResult = armmysqlflexibleservers.OperationStatusExtendedResult{ - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-29T07:37:05.640Z"); return t}()), - // Error: &armmysqlflexibleservers.ErrorDetail{ - // Code: to.Ptr("AggregateException"), - // Message: to.Ptr("System.AggregateException: One or more errors occurred. (Mismatch in count of number of Commited-Blocks from service.)"), - // }, - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforMySQL/locations/westus/operationResults/00000000-0000-0000-0000-000000000000"), - // PercentComplete: to.Ptr[float32](0), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-29T07:34:02.328Z"); return t}()), - // Status: to.Ptr("Failed"), - // Properties: map[string]any{ - // "backupMetadata": "{\"key1\":\"value1\",\"key2\":\"value2\"}", - // "dataTransferredInBytes": float64(0), - // "datasourceSizeInBytes": float64(1024), + // res = armmysqlflexibleservers.OperationResultsClientGetResponse{ + // OperationStatusExtendedResult: &armmysqlflexibleservers.OperationStatusExtendedResult{ + // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-29T07:37:05.6406008Z"); return t}()), + // Error: &armmysqlflexibleservers.ErrorDetail{ + // Code: to.Ptr("AggregateException"), + // Message: to.Ptr("System.AggregateException: One or more errors occurred. (Mismatch in count of number of Commited-Blocks from service.)"), + // }, + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforMySQL/locations/westus/operationResults/00000000-0000-0000-0000-000000000000"), + // PercentComplete: to.Ptr[float64](0), + // Properties: map[string]any{ + // "backupMetadata": "{"key1":"value1","key2":"value2"}", + // "dataTransferredInBytes": 0, + // "datasourceSizeInBytes": 1024, + // }, + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-29T07:34:02.328326Z"); return t}()), + // Status: to.Ptr("Failed"), // }, // } } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/operations_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/operations_client.go index 9de7519a03dc..497516219d47 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/operations_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/operations_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -37,9 +33,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO return client, nil } -// NewListPager - Lists all of the available REST API operations. +// NewListPager - List the operations for the provider // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -65,14 +61,14 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption } // listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { +func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *OperationsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.DBforMySQL/operations" 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", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/operations_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/operations_client_example_test.go index 38c5def33409..4f6840f4a8e6 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/operations_client_example_test.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/operations_client_example_test.go @@ -1,30 +1,24 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2024-10-01-preview/examples/OperationsList.json +// Generated from example definition: 2024-12-30/OperationsList.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -39,185 +33,188 @@ func ExampleOperationsClient_NewListPager() { _ = 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.OperationListResult = armmysqlflexibleservers.OperationListResult{ - // Value: []*armmysqlflexibleservers.Operation{ - // { - // Name: to.Ptr("Microsoft.DBforMySQL/flexibleServers/firewallRules/read"), - // Display: &armmysqlflexibleservers.OperationDisplay{ - // Description: to.Ptr("Return the list of firewall rules for a server or gets the properties for the specified firewall rule."), - // Operation: to.Ptr("List/Get Firewall Rules"), - // Provider: to.Ptr("Microsoft DB for MySQL"), - // Resource: to.Ptr("Firewall Rules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforMySQL/flexibleServers/firewallRules/write"), - // Display: &armmysqlflexibleservers.OperationDisplay{ - // Description: to.Ptr("Creates a firewall rule with the specified parameters or update an existing rule."), - // Operation: to.Ptr("Create/Update Firewall Rule"), - // Provider: to.Ptr("Microsoft DB for MySQL"), - // Resource: to.Ptr("Firewall Rules"), + // page = armmysqlflexibleservers.OperationsClientListResponse{ + // OperationListResult: armmysqlflexibleservers.OperationListResult{ + // Value: []*armmysqlflexibleservers.Operation{ + // { + // Name: to.Ptr("Microsoft.DBforMySQL/flexibleServers/firewallRules/read"), + // Display: &armmysqlflexibleservers.OperationDisplay{ + // Description: to.Ptr("Return the list of firewall rules for a server or gets the properties for the specified firewall rule."), + // Operation: to.Ptr("List/Get Firewall Rules"), + // Provider: to.Ptr("Microsoft DB for MySQL"), + // Resource: to.Ptr("Firewall Rules"), + // }, // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforMySQL/flexibleServers/firewallRules/delete"), - // Display: &armmysqlflexibleservers.OperationDisplay{ - // Description: to.Ptr("Deletes an existing firewall rule."), - // Operation: to.Ptr("Delete Firewall Rule"), - // Provider: to.Ptr("Microsoft DB for MySQL"), - // Resource: to.Ptr("Firewall Rules"), + // { + // Name: to.Ptr("Microsoft.DBforMySQL/flexibleServers/firewallRules/write"), + // Display: &armmysqlflexibleservers.OperationDisplay{ + // Description: to.Ptr("Creates a firewall rule with the specified parameters or update an existing rule."), + // Operation: to.Ptr("Create/Update Firewall Rule"), + // Provider: to.Ptr("Microsoft DB for MySQL"), + // Resource: to.Ptr("Firewall Rules"), + // }, // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforMySQL/flexibleServers/read"), - // Display: &armmysqlflexibleservers.OperationDisplay{ - // Description: to.Ptr("Return the list of servers or gets the properties for the specified server."), - // Operation: to.Ptr("List/Get MySQL Servers"), - // Provider: to.Ptr("Microsoft DB for MySQL"), - // Resource: to.Ptr("MySQL Server"), + // { + // Name: to.Ptr("Microsoft.DBforMySQL/flexibleServers/firewallRules/delete"), + // Display: &armmysqlflexibleservers.OperationDisplay{ + // Description: to.Ptr("Deletes an existing firewall rule."), + // Operation: to.Ptr("Delete Firewall Rule"), + // Provider: to.Ptr("Microsoft DB for MySQL"), + // Resource: to.Ptr("Firewall Rules"), + // }, // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforMySQL/flexibleServers/write"), - // Display: &armmysqlflexibleservers.OperationDisplay{ - // Description: to.Ptr("Creates a server with the specified parameters or update the properties or tags for the specified server."), - // Operation: to.Ptr("Create/Update MySQL Server"), - // Provider: to.Ptr("Microsoft DB for MySQL"), - // Resource: to.Ptr("MySQL Server"), + // { + // Name: to.Ptr("Microsoft.DBforMySQL/flexibleServers/read"), + // Display: &armmysqlflexibleservers.OperationDisplay{ + // Description: to.Ptr("Return the list of servers or gets the properties for the specified server."), + // Operation: to.Ptr("List/Get MySQL Servers"), + // Provider: to.Ptr("Microsoft DB for MySQL"), + // Resource: to.Ptr("MySQL Server"), + // }, // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforMySQL/flexibleServers/delete"), - // Display: &armmysqlflexibleservers.OperationDisplay{ - // Description: to.Ptr("Deletes an existing server."), - // Operation: to.Ptr("Delete MySQL Server"), - // Provider: to.Ptr("Microsoft DB for MySQL"), - // Resource: to.Ptr("MySQL Server"), + // { + // Name: to.Ptr("Microsoft.DBforMySQL/flexibleServers/write"), + // Display: &armmysqlflexibleservers.OperationDisplay{ + // Description: to.Ptr("Creates a server with the specified parameters or update the properties or tags for the specified server."), + // Operation: to.Ptr("Create/Update MySQL Server"), + // Provider: to.Ptr("Microsoft DB for MySQL"), + // Resource: to.Ptr("MySQL Server"), + // }, // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforMySQL/flexibleServers/providers/Microsoft.Insights/metricDefinitions/read"), - // Display: &armmysqlflexibleservers.OperationDisplay{ - // Description: to.Ptr("Return types of metrics that are available for databases"), - // Operation: to.Ptr("Get database metric definitions"), - // Provider: to.Ptr("Microsoft DB for MySQL"), - // Resource: to.Ptr("Database Metric Definition"), + // { + // Name: to.Ptr("Microsoft.DBforMySQL/flexibleServers/delete"), + // Display: &armmysqlflexibleservers.OperationDisplay{ + // Description: to.Ptr("Deletes an existing server."), + // Operation: to.Ptr("Delete MySQL Server"), + // Provider: to.Ptr("Microsoft DB for MySQL"), + // Resource: to.Ptr("MySQL Server"), + // }, // }, - // Properties: map[string]any{ - // "serviceSpecification": map[string]any{ - // "metricSpecifications":[]any{ - // map[string]any{ - // "name": "cpu_percent", - // "aggregationType": "Average", - // "displayDescription": "CPU percent", - // "displayName": "CPU percent", - // "fillGapWithZero": true, - // "unit": "Percent", - // }, - // map[string]any{ - // "name": "memory_percent", - // "aggregationType": "Average", - // "displayDescription": "Memory percent", - // "displayName": "Memory percent", - // "fillGapWithZero": true, - // "unit": "Percent", - // }, - // map[string]any{ - // "name": "io_consumption_percent", - // "aggregationType": "Average", - // "displayDescription": "IO percent", - // "displayName": "IO percent", - // "fillGapWithZero": true, - // "unit": "Percent", - // }, - // map[string]any{ - // "name": "storage_percent", - // "aggregationType": "Average", - // "displayDescription": "Storage percentage", - // "displayName": "Storage percentage", - // "unit": "Percent", - // }, - // map[string]any{ - // "name": "storage_used", - // "aggregationType": "Average", - // "displayDescription": "Storage used", - // "displayName": "Storage used", - // "unit": "Bytes", - // }, - // map[string]any{ - // "name": "storage_limit", - // "aggregationType": "Average", - // "displayDescription": "Storage limit", - // "displayName": "Storage limit", - // "unit": "Bytes", - // }, - // map[string]any{ - // "name": "serverlog_storage_percent", - // "aggregationType": "Average", - // "displayDescription": "Server Log storage percent", - // "displayName": "Server Log storage percent", - // "unit": "Percent", - // }, - // map[string]any{ - // "name": "serverlog_storage_usage", - // "aggregationType": "Average", - // "displayDescription": "Server Log storage used", - // "displayName": "Server Log storage used", - // "unit": "Bytes", - // }, - // map[string]any{ - // "name": "serverlog_storage_limit", - // "aggregationType": "Average", - // "displayDescription": "Server Log storage limit", - // "displayName": "Server Log storage limit", - // "unit": "Bytes", - // }, - // map[string]any{ - // "name": "active_connections", - // "aggregationType": "Average", - // "displayDescription": "Total active connections", - // "displayName": "Total active connections", - // "fillGapWithZero": true, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "connections_failed", - // "aggregationType": "Average", - // "displayDescription": "Total failed connections", - // "displayName": "Total failed connections", - // "fillGapWithZero": true, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "seconds_behind_master", - // "aggregationType": "Average", - // "displayDescription": "Replication lag in seconds", - // "displayName": "Replication lag in seconds", - // "fillGapWithZero": true, - // "unit": "Count", + // { + // Name: to.Ptr("Microsoft.DBforMySQL/flexibleServers/providers/Microsoft.Insights/metricDefinitions/read"), + // Display: &armmysqlflexibleservers.OperationDisplay{ + // Description: to.Ptr("Return types of metrics that are available for databases"), + // Operation: to.Ptr("Get database metric definitions"), + // Provider: to.Ptr("Microsoft DB for MySQL"), + // Resource: to.Ptr("Database Metric Definition"), + // }, + // Properties: map[string]any{ + // "serviceSpecification": map[string]any{ + // "metricSpecifications": []any{ + // map[string]any{ + // "name": "cpu_percent", + // "aggregationType": "Average", + // "displayDescription": "CPU percent", + // "displayName": "CPU percent", + // "fillGapWithZero": true, + // "unit": "Percent", + // }, + // map[string]any{ + // "name": "memory_percent", + // "aggregationType": "Average", + // "displayDescription": "Memory percent", + // "displayName": "Memory percent", + // "fillGapWithZero": true, + // "unit": "Percent", + // }, + // map[string]any{ + // "name": "io_consumption_percent", + // "aggregationType": "Average", + // "displayDescription": "IO percent", + // "displayName": "IO percent", + // "fillGapWithZero": true, + // "unit": "Percent", + // }, + // map[string]any{ + // "name": "storage_percent", + // "aggregationType": "Average", + // "displayDescription": "Storage percentage", + // "displayName": "Storage percentage", + // "unit": "Percent", + // }, + // map[string]any{ + // "name": "storage_used", + // "aggregationType": "Average", + // "displayDescription": "Storage used", + // "displayName": "Storage used", + // "unit": "Bytes", + // }, + // map[string]any{ + // "name": "storage_limit", + // "aggregationType": "Average", + // "displayDescription": "Storage limit", + // "displayName": "Storage limit", + // "unit": "Bytes", + // }, + // map[string]any{ + // "name": "serverlog_storage_percent", + // "aggregationType": "Average", + // "displayDescription": "Server Log storage percent", + // "displayName": "Server Log storage percent", + // "unit": "Percent", + // }, + // map[string]any{ + // "name": "serverlog_storage_usage", + // "aggregationType": "Average", + // "displayDescription": "Server Log storage used", + // "displayName": "Server Log storage used", + // "unit": "Bytes", + // }, + // map[string]any{ + // "name": "serverlog_storage_limit", + // "aggregationType": "Average", + // "displayDescription": "Server Log storage limit", + // "displayName": "Server Log storage limit", + // "unit": "Bytes", + // }, + // map[string]any{ + // "name": "active_connections", + // "aggregationType": "Average", + // "displayDescription": "Total active connections", + // "displayName": "Total active connections", + // "fillGapWithZero": true, + // "unit": "Count", + // }, + // map[string]any{ + // "name": "connections_failed", + // "aggregationType": "Average", + // "displayDescription": "Total failed connections", + // "displayName": "Total failed connections", + // "fillGapWithZero": true, + // "unit": "Count", + // }, + // map[string]any{ + // "name": "seconds_behind_master", + // "aggregationType": "Average", + // "displayDescription": "Replication lag in seconds", + // "displayName": "Replication lag in seconds", + // "fillGapWithZero": true, + // "unit": "Count", + // }, // }, // }, // }, // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforMySQL/flexibleServers/providers/Microsoft.Insights/diagnosticSettings/read"), - // Display: &armmysqlflexibleservers.OperationDisplay{ - // Description: to.Ptr("Gets the disagnostic setting for the resource"), - // Operation: to.Ptr("Read diagnostic setting"), - // Provider: to.Ptr("Microsoft DB for MySQL"), - // Resource: to.Ptr("Database Metric Definition"), + // { + // Name: to.Ptr("Microsoft.DBforMySQL/flexibleServers/providers/Microsoft.Insights/diagnosticSettings/read"), + // Display: &armmysqlflexibleservers.OperationDisplay{ + // Description: to.Ptr("Gets the disagnostic setting for the resource"), + // Operation: to.Ptr("Read diagnostic setting"), + // Provider: to.Ptr("Microsoft DB for MySQL"), + // Resource: to.Ptr("Database Metric Definition"), + // }, // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforMySQL/flexibleServers/providers/Microsoft.Insights/diagnosticSettings/write"), - // Display: &armmysqlflexibleservers.OperationDisplay{ - // Description: to.Ptr("Creates or updates the diagnostic setting for the resource"), - // Operation: to.Ptr("Write diagnostic setting"), - // Provider: to.Ptr("Microsoft DB for MySQL"), - // Resource: to.Ptr("Database Metric Definition"), + // { + // Name: to.Ptr("Microsoft.DBforMySQL/flexibleServers/providers/Microsoft.Insights/diagnosticSettings/write"), + // Display: &armmysqlflexibleservers.OperationDisplay{ + // Description: to.Ptr("Creates or updates the diagnostic setting for the resource"), + // Operation: to.Ptr("Write diagnostic setting"), + // Provider: to.Ptr("Microsoft DB for MySQL"), + // Resource: to.Ptr("Database Metric Definition"), + // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/options.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/options.go index ee16b28d4c7f..71d42afdeb3b 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/options.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/options.go @@ -1,24 +1,20 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers // AdvancedThreatProtectionSettingsClientBeginUpdateOptions contains the optional parameters for the AdvancedThreatProtectionSettingsClient.BeginUpdate // method. type AdvancedThreatProtectionSettingsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AdvancedThreatProtectionSettingsClientBeginUpdatePutOptions contains the optional parameters for the AdvancedThreatProtectionSettingsClient.BeginUpdatePut // method. type AdvancedThreatProtectionSettingsClientBeginUpdatePutOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -37,14 +33,14 @@ type AdvancedThreatProtectionSettingsClientListOptions struct { // AzureADAdministratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the AzureADAdministratorsClient.BeginCreateOrUpdate // method. type AzureADAdministratorsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AzureADAdministratorsClientBeginDeleteOptions contains the optional parameters for the AzureADAdministratorsClient.BeginDelete // method. type AzureADAdministratorsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -61,7 +57,7 @@ type AzureADAdministratorsClientListByServerOptions struct { // BackupAndExportClientBeginCreateOptions contains the optional parameters for the BackupAndExportClient.BeginCreate method. type BackupAndExportClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -107,20 +103,20 @@ type CheckVirtualNetworkSubnetUsageClientExecuteOptions struct { // ConfigurationsClientBeginBatchUpdateOptions contains the optional parameters for the ConfigurationsClient.BeginBatchUpdate // method. type ConfigurationsClientBeginBatchUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ConfigurationsClient.BeginCreateOrUpdate // method. type ConfigurationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ConfigurationsClientBeginUpdateOptions contains the optional parameters for the ConfigurationsClient.BeginUpdate method. type ConfigurationsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -148,13 +144,13 @@ type ConfigurationsClientListByServerOptions struct { // DatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabasesClient.BeginCreateOrUpdate // method. type DatabasesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation 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. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -171,13 +167,13 @@ type DatabasesClientListByServerOptions struct { // FirewallRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the FirewallRulesClient.BeginCreateOrUpdate // method. type FirewallRulesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // FirewallRulesClientBeginDeleteOptions contains the optional parameters for the FirewallRulesClient.BeginDelete method. type FirewallRulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -224,10 +220,7 @@ type LogFilesClientListByServerOptions struct { // LongRunningBackupClientBeginCreateOptions contains the optional parameters for the LongRunningBackupClient.BeginCreate // method. type LongRunningBackupClientBeginCreateOptions struct { - // The required parameters for creating and exporting backup of the given server. - Parameters *ServerBackupV2 - - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -243,10 +236,7 @@ type LongRunningBackupsClientListOptions struct { // MaintenancesClientBeginUpdateOptions contains the optional parameters for the MaintenancesClient.BeginUpdate method. type MaintenancesClientBeginUpdateOptions struct { - // The required parameters for update maintenance on a server. - Parameters *MaintenanceUpdate - - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -275,6 +265,43 @@ type OperationsClientListOptions struct { // placeholder for future optional parameters } +// PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate +// method. +type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete +// method. +type PrivateEndpointConnectionsClientBeginDeleteOptions struct { + // Resumes the long-running operation 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.ListByServer +// 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 +} + // ReplicasClientListByServerOptions contains the optional parameters for the ReplicasClient.NewListByServerPager method. type ReplicasClientListByServerOptions struct { // placeholder for future optional parameters @@ -282,55 +309,55 @@ type ReplicasClientListByServerOptions struct { // ServersClientBeginCreateOptions contains the optional parameters for the ServersClient.BeginCreate method. type ServersClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation 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. + // Resumes the long-running operation from the provided token. ResumeToken string } // ServersClientBeginDetachVNetOptions contains the optional parameters for the ServersClient.BeginDetachVNet method. type ServersClientBeginDetachVNetOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ServersClientBeginFailoverOptions contains the optional parameters for the ServersClient.BeginFailover method. type ServersClientBeginFailoverOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ServersClientBeginResetGtidOptions contains the optional parameters for the ServersClient.BeginResetGtid method. type ServersClientBeginResetGtidOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ServersClientBeginRestartOptions contains the optional parameters for the ServersClient.BeginRestart method. type ServersClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ServersClientBeginStartOptions contains the optional parameters for the ServersClient.BeginStart method. type ServersClientBeginStartOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ServersClientBeginStopOptions contains the optional parameters for the ServersClient.BeginStop method. type ServersClientBeginStopOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation 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. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -359,6 +386,6 @@ type ServersClientValidateEstimateHighAvailabilityOptions struct { // ServersMigrationClientBeginCutoverMigrationOptions contains the optional parameters for the ServersMigrationClient.BeginCutoverMigration // method. type ServersMigrationClientBeginCutoverMigrationOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/polymorphic_helpers.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/polymorphic_helpers.go index f9d140e3d26a..ea8051d8b11b 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/polymorphic_helpers.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/polymorphic_helpers.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/privateendpointconnections_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/privateendpointconnections_client.go new file mode 100644 index 000000000000..cdea15ad0cef --- /dev/null +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/privateendpointconnections_client.go @@ -0,0 +1,342 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. + +package armmysqlflexibleservers + +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" +) + +// PrivateEndpointConnectionsClient contains the methods for the PrivateEndpointConnections group. +// Don't use this type directly, use NewPrivateEndpointConnectionsClient() instead. +type PrivateEndpointConnectionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PrivateEndpointConnectionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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 2024-12-30 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. +// - parameters - Resource create parameters. +// - options - PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate +// method. +func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PrivateEndpointConnectionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, privateEndpointConnectionName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointConnectionsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[PrivateEndpointConnectionsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// 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 2024-12-30 +func (client *PrivateEndpointConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "PrivateEndpointConnectionsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, privateEndpointConnectionName, 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 *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, _ *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + 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") + } + 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 privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + 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", "2024-12-30") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + 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 2024-12-30 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. +// - options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete +// method. +func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, privateEndpointConnectionName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointConnectionsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[PrivateEndpointConnectionsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes a private endpoint connection with a given name. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-12-30 +func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "PrivateEndpointConnectionsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, privateEndpointConnectionName, 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 *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, _ *PrivateEndpointConnectionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + 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") + } + 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 privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + 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", "2024-12-30") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// Get - Gets a private endpoint connection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-12-30 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. +// - 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 + const operationName = "PrivateEndpointConnectionsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, privateEndpointConnectionName, options) + if err != nil { + return PrivateEndpointConnectionsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateEndpointConnectionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateEndpointConnectionsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, _ *PrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + 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") + } + 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 privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + 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", "2024-12-30") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientGetResponse, error) { + result := PrivateEndpointConnectionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnection); err != nil { + return PrivateEndpointConnectionsClientGetResponse{}, err + } + return result, nil +} + +// ListByServer - Gets all private endpoint connections on a server. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-12-30 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - options - PrivateEndpointConnectionsClientListByServerOptions contains the optional parameters for the PrivateEndpointConnectionsClient.ListByServer +// method. +func (client *PrivateEndpointConnectionsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string, options *PrivateEndpointConnectionsClientListByServerOptions) (PrivateEndpointConnectionsClientListByServerResponse, error) { + var err error + const operationName = "PrivateEndpointConnectionsClient.ListByServer" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) + if err != nil { + return PrivateEndpointConnectionsClientListByServerResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateEndpointConnectionsClientListByServerResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateEndpointConnectionsClientListByServerResponse{}, err + } + resp, err := client.listByServerHandleResponse(httpResp) + return resp, err +} + +// listByServerCreateRequest creates the ListByServer request. +func (client *PrivateEndpointConnectionsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *PrivateEndpointConnectionsClientListByServerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/privateEndpointConnections" + 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") + } + 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)) + 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", "2024-12-30") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByServerHandleResponse handles the ListByServer response. +func (client *PrivateEndpointConnectionsClient) listByServerHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientListByServerResponse, error) { + result := PrivateEndpointConnectionsClientListByServerResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionListResult); err != nil { + return PrivateEndpointConnectionsClientListByServerResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/privateendpointconnections_client_example_test.go new file mode 100644 index 000000000000..8f53d96686fe --- /dev/null +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/privateendpointconnections_client_example_test.go @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. + +package armmysqlflexibleservers_test + +import ( + "context" + "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/mysql/armmysqlflexibleservers/v2" + "log" +) + +// Generated from example definition: 2024-12-30/PrivateEndpointConnectionUpdate.json +func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmysqlflexibleservers.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginCreateOrUpdate(ctx, "Default", "test-svr", "private-endpoint-connection-name", armmysqlflexibleservers.PrivateEndpointConnection{ + Properties: &armmysqlflexibleservers.PrivateEndpointConnectionProperties{ + PrivateLinkServiceConnectionState: &armmysqlflexibleservers.PrivateLinkServiceConnectionState{ + Description: to.Ptr("Approved by johndoe@contoso.com"), + Status: to.Ptr(armmysqlflexibleservers.PrivateEndpointServiceConnectionStatusApproved), + }, + }, + }, 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 = armmysqlflexibleservers.PrivateEndpointConnectionsClientCreateOrUpdateResponse{ + // PrivateEndpointConnection: &armmysqlflexibleservers.PrivateEndpointConnection{ + // Name: to.Ptr("private-endpoint-connection-name"), + // Type: to.Ptr("Microsoft.DBforMySQL/servers/privateEndpointConnections"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforMySQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name"), + // Properties: &armmysqlflexibleservers.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armmysqlflexibleservers.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), + // }, + // PrivateLinkServiceConnectionState: &armmysqlflexibleservers.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Approved by johndoe@contoso.com"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr(armmysqlflexibleservers.PrivateEndpointServiceConnectionStatusApproved), + // }, + // ProvisioningState: to.Ptr(armmysqlflexibleservers.PrivateEndpointConnectionProvisioningState("Ready")), + // }, + // }, + // } +} + +// Generated from example definition: 2024-12-30/PrivateEndpointConnectionDelete.json +func ExamplePrivateEndpointConnectionsClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmysqlflexibleservers.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "Default", "test-svr", "private-endpoint-connection-name", 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 = armmysqlflexibleservers.PrivateEndpointConnectionsClientDeleteResponse{ + // } +} + +// Generated from example definition: 2024-12-30/PrivateEndpointConnectionGet.json +func ExamplePrivateEndpointConnectionsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmysqlflexibleservers.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "Default", "test-svr", "private-endpoint-connection-name", 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 = armmysqlflexibleservers.PrivateEndpointConnectionsClientGetResponse{ + // PrivateEndpointConnection: &armmysqlflexibleservers.PrivateEndpointConnection{ + // Name: to.Ptr("private-endpoint-connection-name"), + // Type: to.Ptr("Microsoft.DBforMySQL/servers/privateEndpointConnections"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforMySQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name"), + // Properties: &armmysqlflexibleservers.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armmysqlflexibleservers.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), + // }, + // PrivateLinkServiceConnectionState: &armmysqlflexibleservers.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr(armmysqlflexibleservers.PrivateEndpointServiceConnectionStatusApproved), + // }, + // ProvisioningState: to.Ptr(armmysqlflexibleservers.PrivateEndpointConnectionProvisioningState("Ready")), + // }, + // }, + // } +} + +// Generated from example definition: 2024-12-30/PrivateEndpointConnectionList.json +func ExamplePrivateEndpointConnectionsClient_ListByServer() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmysqlflexibleservers.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewPrivateEndpointConnectionsClient().ListByServer(ctx, "Default", "test-svr", 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 = armmysqlflexibleservers.PrivateEndpointConnectionsClientListByServerResponse{ + // PrivateEndpointConnectionListResult: &armmysqlflexibleservers.PrivateEndpointConnectionListResult{ + // Value: []*armmysqlflexibleservers.PrivateEndpointConnection{ + // { + // Name: to.Ptr("private-endpoint-connection-name"), + // Type: to.Ptr("Microsoft.DBforMySQL/servers/privateEndpointConnections"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforMySQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name-2"), + // Properties: &armmysqlflexibleservers.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armmysqlflexibleservers.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), + // }, + // PrivateLinkServiceConnectionState: &armmysqlflexibleservers.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr(armmysqlflexibleservers.PrivateEndpointServiceConnectionStatusApproved), + // }, + // ProvisioningState: to.Ptr(armmysqlflexibleservers.PrivateEndpointConnectionProvisioningState("Ready")), + // }, + // }, + // { + // Name: to.Ptr("private-endpoint-connection-name-2"), + // Type: to.Ptr("Microsoft.DBforMySQL/servers/privateEndpointConnections"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforMySQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name-2"), + // Properties: &armmysqlflexibleservers.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armmysqlflexibleservers.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name-2"), + // }, + // PrivateLinkServiceConnectionState: &armmysqlflexibleservers.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr(armmysqlflexibleservers.PrivateEndpointServiceConnectionStatusApproved), + // }, + // ProvisioningState: to.Ptr(armmysqlflexibleservers.PrivateEndpointConnectionProvisioningState("Ready")), + // }, + // }, + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/privatelinkresources_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/privatelinkresources_client.go new file mode 100644 index 000000000000..e49cbe76a969 --- /dev/null +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/privatelinkresources_client.go @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. + +package armmysqlflexibleservers + +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" +) + +// PrivateLinkResourcesClient contains the methods for the PrivateLinkResources group. +// Don't use this type directly, use NewPrivateLinkResourcesClient() instead. +type PrivateLinkResourcesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PrivateLinkResourcesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Gets a private link resource for MySQL server. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-12-30 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - groupName - The name of the private link resource. +// - 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 + const operationName = "PrivateLinkResourcesClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, groupName, options) + if err != nil { + return PrivateLinkResourcesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateLinkResourcesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateLinkResourcesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, groupName string, _ *PrivateLinkResourcesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/privateLinkResources/{groupName}" + 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") + } + 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 groupName == "" { + return nil, errors.New("parameter groupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{groupName}", url.PathEscape(groupName)) + 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", "2024-12-30") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) (PrivateLinkResourcesClientGetResponse, error) { + result := PrivateLinkResourcesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResource); err != nil { + return PrivateLinkResourcesClientGetResponse{}, err + } + return result, nil +} + +// NewListByServerPager - Lists the private link resources for MySQL server. +// +// Generated from API version 2024-12-30 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - options - PrivateLinkResourcesClientListByServerOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByServerPager +// method. +func (client *PrivateLinkResourcesClient) NewListByServerPager(resourceGroupName string, serverName string, options *PrivateLinkResourcesClientListByServerOptions) *runtime.Pager[PrivateLinkResourcesClientListByServerResponse] { + return runtime.NewPager(runtime.PagingHandler[PrivateLinkResourcesClientListByServerResponse]{ + More: func(page PrivateLinkResourcesClientListByServerResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *PrivateLinkResourcesClientListByServerResponse) (PrivateLinkResourcesClientListByServerResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "PrivateLinkResourcesClient.NewListByServerPager") + req, err := client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) + if err != nil { + return PrivateLinkResourcesClientListByServerResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateLinkResourcesClientListByServerResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateLinkResourcesClientListByServerResponse{}, runtime.NewResponseError(resp) + } + return client.listByServerHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByServerCreateRequest creates the ListByServer request. +func (client *PrivateLinkResourcesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *PrivateLinkResourcesClientListByServerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/privateLinkResources" + 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") + } + 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)) + 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", "2024-12-30") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByServerHandleResponse handles the ListByServer response. +func (client *PrivateLinkResourcesClient) listByServerHandleResponse(resp *http.Response) (PrivateLinkResourcesClientListByServerResponse, error) { + result := PrivateLinkResourcesClientListByServerResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourceListResult); err != nil { + return PrivateLinkResourcesClientListByServerResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/privatelinkresources_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/privatelinkresources_client_example_test.go new file mode 100644 index 000000000000..11c03f97bba1 --- /dev/null +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/privatelinkresources_client_example_test.go @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. + +package armmysqlflexibleservers_test + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" + "log" +) + +// Generated from example definition: 2024-12-30/PrivateLinkResourcesGet.json +func ExamplePrivateLinkResourcesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmysqlflexibleservers.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewPrivateLinkResourcesClient().Get(ctx, "Default", "test-svr", "plr", 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 = armmysqlflexibleservers.PrivateLinkResourcesClientGetResponse{ + // PrivateLinkResource: &armmysqlflexibleservers.PrivateLinkResource{ + // Name: to.Ptr("plr"), + // Type: to.Ptr("Microsoft.DBforMySQL/servers/privateLinkResources"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforMySQL/servers/test-svr/privateLinkResources/plr"), + // Properties: &armmysqlflexibleservers.PrivateLinkResourceProperties{ + // GroupID: to.Ptr("mysqlServer"), + // RequiredMembers: []*string{ + // to.Ptr("mysqlServer"), + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2024-12-30/PrivateLinkResourcesList.json +func ExamplePrivateLinkResourcesClient_NewListByServerPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmysqlflexibleservers.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewPrivateLinkResourcesClient().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 = armmysqlflexibleservers.PrivateLinkResourcesClientListByServerResponse{ + // PrivateLinkResourceListResult: armmysqlflexibleservers.PrivateLinkResourceListResult{ + // Value: []*armmysqlflexibleservers.PrivateLinkResource{ + // { + // Name: to.Ptr("plr"), + // Type: to.Ptr("Microsoft.DBforMySQL/servers/privateLinkResources"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforMySQL/servers/test-svr/privateLinkResources/plr"), + // Properties: &armmysqlflexibleservers.PrivateLinkResourceProperties{ + // GroupID: to.Ptr("mysqlServer"), + // RequiredMembers: []*string{ + // to.Ptr("mysqlServer"), + // }, + // }, + // }, + // }, + // }, + // } + } +} diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/replicas_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/replicas_client.go index f91c71229f13..0a08fe264f32 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/replicas_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/replicas_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -45,7 +41,7 @@ func NewReplicasClient(subscriptionID string, credential azcore.TokenCredential, // NewListByServerPager - List all the replicas for a given server. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ReplicasClientListByServerOptions contains the optional parameters for the ReplicasClient.NewListByServerPager @@ -74,7 +70,7 @@ func (client *ReplicasClient) NewListByServerPager(resourceGroupName string, ser } // listByServerCreateRequest creates the ListByServer request. -func (client *ReplicasClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ReplicasClientListByServerOptions) (*policy.Request, error) { +func (client *ReplicasClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ReplicasClientListByServerOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/replicas" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -93,7 +89,7 @@ func (client *ReplicasClient) listByServerCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/replicas_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/replicas_client_example_test.go index d3ee8150e593..32b21846cf90 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/replicas_client_example_test.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/replicas_client_example_test.go @@ -1,30 +1,24 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/ReplicasListByServer.json +// Generated from example definition: 2024-12-30/ReplicasListByServer.json func ExampleReplicasClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -39,112 +33,116 @@ func ExampleReplicasClient_NewListByServerPager() { _ = 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 = armmysqlflexibleservers.ServerListResult{ - // Value: []*armmysqlflexibleservers.Server{ - // { - // Name: to.Ptr("mysqltestserver-repl"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver-repl"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("1"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-24T08:19:18.000Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // FullVersion: to.Ptr("5.7.44"), - // FullyQualifiedDomainName: to.Ptr("mysqltestserver-repl.orcabrci-seas1-a.mscds.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ - // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyRegular), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), + // page = armmysqlflexibleservers.ReplicasClientListByServerResponse{ + // ServerListResult: armmysqlflexibleservers.ServerListResult{ + // Value: []*armmysqlflexibleservers.Server{ + // { + // Name: to.Ptr("mysqltestserver-repl"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver-repl"), + // Location: to.Ptr("Southeast Asia"), + // Properties: &armmysqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AvailabilityZone: to.Ptr("1"), + // Backup: &armmysqlflexibleservers.Backup{ + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-24T08:19:18.00+00:00"); return t}()), + // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // FullVersion: to.Ptr("5.7.44"), + // FullyQualifiedDomainName: to.Ptr("mysqltestserver-repl.orcabrci-seas1-a.mscds.com"), + // HighAvailability: &armmysqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), + // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), + // }, + // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ + // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyRegular), + // }, + // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // Network: &armmysqlflexibleservers.Network{ + // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // }, + // ReplicaCapacity: to.Ptr[int32](0), + // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleReplica), + // SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), + // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), + // Storage: &armmysqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // Iops: to.Ptr[int32](360), + // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), + // StorageSizeGB: to.Ptr[int32](20), + // StorageSKU: to.Ptr("Premium_LRS"), + // }, + // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // SKU: &armmysqlflexibleservers.MySQLServerSKU{ + // Name: to.Ptr("Standard_D2ds_v4"), + // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), // }, - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleReplica), - // SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](360), - // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), - // StorageSizeGB: to.Ptr[int32](20), - // StorageSKU: to.Ptr("Premium_LRS"), + // Tags: map[string]*string{ + // "num": to.Ptr("1"), // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("mysqltestserver-repl"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver-repl2"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("1"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-23T08:19:18.000Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // FullVersion: to.Ptr("5.7.44"), - // FullyQualifiedDomainName: to.Ptr("mysqltestserver-repl2.orcabrci-seas1-a.mscds.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), + // { + // Name: to.Ptr("mysqltestserver-repl"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver-repl2"), + // Location: to.Ptr("Southeast Asia"), + // Properties: &armmysqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AvailabilityZone: to.Ptr("1"), + // Backup: &armmysqlflexibleservers.Backup{ + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-23T08:19:18.00+00:00"); return t}()), + // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // FullVersion: to.Ptr("5.7.44"), + // FullyQualifiedDomainName: to.Ptr("mysqltestserver-repl2.orcabrci-seas1-a.mscds.com"), + // HighAvailability: &armmysqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), + // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), + // }, + // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ + // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategy("Default")), + // }, + // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ + // BatchOfMaintenance: to.Ptr(armmysqlflexibleservers.BatchOfMaintenanceDefault), + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // Network: &armmysqlflexibleservers.Network{ + // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // }, + // ReplicaCapacity: to.Ptr[int32](0), + // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleReplica), + // SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), + // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), + // Storage: &armmysqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // Iops: to.Ptr[int32](360), + // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumZoneRedundancy), + // StorageSizeGB: to.Ptr[int32](20), + // StorageSKU: to.Ptr("Premium_ZRS"), + // }, + // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), // }, - // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ - // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategy("Default")), + // SKU: &armmysqlflexibleservers.MySQLServerSKU{ + // Name: to.Ptr("Standard_D2ds_v4"), + // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), + // Tags: map[string]*string{ + // "num": to.Ptr("1"), // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleReplica), - // SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](360), - // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumZoneRedundancy), - // StorageSizeGB: to.Ptr[int32](20), - // StorageSKU: to.Ptr("Premium_ZRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), - // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/responses.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/responses.go index 44004a72f442..c1490236c6ff 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/responses.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/responses.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -16,7 +12,7 @@ type AdvancedThreatProtectionSettingsClientGetResponse struct { // AdvancedThreatProtectionSettingsClientListResponse contains the response from method AdvancedThreatProtectionSettingsClient.NewListPager. type AdvancedThreatProtectionSettingsClientListResponse struct { - // A list of the server's Advanced Threat Protection configurations. + // The response of a AdvancedThreatProtection list operation. AdvancedThreatProtectionListResult } @@ -57,7 +53,7 @@ type AzureADAdministratorsClientListByServerResponse struct { // BackupAndExportClientCreateResponse contains the response from method BackupAndExportClient.BeginCreate. type BackupAndExportClientCreateResponse struct { - // Represents BackupAndExport API Response + // Represents BackupAndExportAPI Response BackupAndExportResponse } @@ -75,7 +71,7 @@ type BackupsClientGetResponse struct { // BackupsClientListByServerResponse contains the response from method BackupsClient.NewListByServerPager. type BackupsClientListByServerResponse struct { - // A list of server backups. + // The response of a ServerBackup list operation. ServerBackupListResult } @@ -105,7 +101,7 @@ type CheckVirtualNetworkSubnetUsageClientExecuteResponse struct { // ConfigurationsClientBatchUpdateResponse contains the response from method ConfigurationsClient.BeginBatchUpdate. type ConfigurationsClientBatchUpdateResponse struct { - // A list of server configurations. + // The response of a Configuration list operation. ConfigurationListResult } @@ -123,7 +119,7 @@ type ConfigurationsClientGetResponse struct { // ConfigurationsClientListByServerResponse contains the response from method ConfigurationsClient.NewListByServerPager. type ConfigurationsClientListByServerResponse struct { - // A list of server configurations. + // The response of a Configuration list operation. ConfigurationListResult } @@ -152,7 +148,7 @@ type DatabasesClientGetResponse struct { // DatabasesClientListByServerResponse contains the response from method DatabasesClient.NewListByServerPager. type DatabasesClientListByServerResponse struct { - // A List of databases. + // The response of a Database list operation. DatabaseListResult } @@ -175,7 +171,7 @@ type FirewallRulesClientGetResponse struct { // FirewallRulesClientListByServerResponse contains the response from method FirewallRulesClient.NewListByServerPager. type FirewallRulesClientListByServerResponse struct { - // A list of firewall rules. + // The response of a FirewallRule list operation. FirewallRuleListResult } @@ -205,7 +201,7 @@ type LocationBasedCapabilitySetClientListResponse struct { // LogFilesClientListByServerResponse contains the response from method LogFilesClient.NewListByServerPager. type LogFilesClientListByServerResponse struct { - // A List of logFiles. + // The response of a LogFile list operation. LogFileListResult } @@ -223,13 +219,13 @@ type LongRunningBackupsClientGetResponse struct { // LongRunningBackupsClientListResponse contains the response from method LongRunningBackupsClient.NewListPager. type LongRunningBackupsClientListResponse struct { - // A list of server backups. + // The response of a ServerBackupV2 list operation. ServerBackupV2ListResult } // MaintenancesClientListResponse contains the response from method MaintenancesClient.NewListPager. type MaintenancesClientListResponse struct { - // A list of maintenances. + // The response of a Maintenance list operation. MaintenanceListResult } @@ -259,13 +255,53 @@ type OperationResultsClientGetResponse struct { // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { - // A list of resource provider operations. + // The static parameters for a resource group based resource OperationListResult } +// PrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionsClient.BeginCreateOrUpdate. +type PrivateEndpointConnectionsClientCreateOrUpdateResponse struct { + // A private endpoint connection resource + PrivateEndpointConnection +} + +// PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.BeginDelete. +type PrivateEndpointConnectionsClientDeleteResponse struct { + // placeholder for future response values +} + +// PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get. +type PrivateEndpointConnectionsClientGetResponse struct { + // A private endpoint connection resource + PrivateEndpointConnection +} + +// PrivateEndpointConnectionsClientListByServerResponse contains the response from method PrivateEndpointConnectionsClient.ListByServer. +type PrivateEndpointConnectionsClientListByServerResponse struct { + // The response of a PrivateEndpointConnection list operation. + 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 for versions before v6. + // This model represents the standard `PrivateLinkResourceListResult` envelope for versions v3, v4, and v5. It has been deprecated + // for v6 and beyond. + // Note: This is only intended for use with versions before v6. Do not use this if you are already on CommonTypes.Version.v6 + // or beyond. + // If you are migrating to v6 or above, use `PrivateLinkResourceListResult` directly. + PrivateLinkResourceListResult +} + // ReplicasClientListByServerResponse contains the response from method ReplicasClient.NewListByServerPager. type ReplicasClientListByServerResponse struct { - // A list of servers. + // The response of a Server list operation. ServerListResult } @@ -299,13 +335,13 @@ type ServersClientGetResponse struct { // ServersClientListByResourceGroupResponse contains the response from method ServersClient.NewListByResourceGroupPager. type ServersClientListByResourceGroupResponse struct { - // A list of servers. + // The response of a Server list operation. ServerListResult } // ServersClientListResponse contains the response from method ServersClient.NewListPager. type ServersClientListResponse struct { - // A list of servers. + // The response of a Server list operation. ServerListResult } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/servers_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/servers_client.go index 924246e0a48e..c9be61116284 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/servers_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/servers_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -46,7 +42,7 @@ func NewServersClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreate - Creates a new server or updates an existing server. The update action will overwrite the existing server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - parameters - The required parameters for creating or updating a server. @@ -71,7 +67,7 @@ func (client *ServersClient) BeginCreate(ctx context.Context, resourceGroupName // Create - Creates a new server or updates an existing server. The update action will overwrite the existing server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 func (client *ServersClient) create(ctx context.Context, resourceGroupName string, serverName string, parameters Server, options *ServersClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginCreate" @@ -94,7 +90,7 @@ func (client *ServersClient) create(ctx context.Context, resourceGroupName strin } // createCreateRequest creates the Create request. -func (client *ServersClient) createCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters Server, options *ServersClientBeginCreateOptions) (*policy.Request, error) { +func (client *ServersClient) createCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters Server, _ *ServersClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -113,9 +109,10 @@ func (client *ServersClient) createCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -125,7 +122,7 @@ func (client *ServersClient) createCreateRequest(ctx context.Context, resourceGr // BeginDelete - Deletes a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ServersClientBeginDeleteOptions contains the optional parameters for the ServersClient.BeginDelete method. @@ -136,8 +133,7 @@ func (client *ServersClient) BeginDelete(ctx context.Context, resourceGroupName return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServersClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -150,7 +146,7 @@ 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 2024-10-01-preview +// Generated from API version 2024-12-30 func (client *ServersClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginDelete" @@ -173,7 +169,7 @@ func (client *ServersClient) deleteOperation(ctx context.Context, resourceGroupN } // deleteCreateRequest creates the Delete request. -func (client *ServersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ServersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ServersClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -192,16 +188,15 @@ func (client *ServersClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // BeginDetachVNet - Detach VNet on a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - parameters - The required parameters for detach vnet on a server. @@ -227,7 +222,7 @@ func (client *ServersClient) BeginDetachVNet(ctx context.Context, resourceGroupN // DetachVNet - Detach VNet on a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 func (client *ServersClient) detachVNet(ctx context.Context, resourceGroupName string, serverName string, parameters ServerDetachVNetParameter, options *ServersClientBeginDetachVNetOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginDetachVNet" @@ -250,7 +245,7 @@ func (client *ServersClient) detachVNet(ctx context.Context, resourceGroupName s } // detachVNetCreateRequest creates the DetachVNet request. -func (client *ServersClient) detachVNetCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters ServerDetachVNetParameter, options *ServersClientBeginDetachVNetOptions) (*policy.Request, error) { +func (client *ServersClient) detachVNetCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters ServerDetachVNetParameter, _ *ServersClientBeginDetachVNetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/detachVNet" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -269,9 +264,10 @@ func (client *ServersClient) detachVNetCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -281,7 +277,7 @@ func (client *ServersClient) detachVNetCreateRequest(ctx context.Context, resour // BeginFailover - Manual failover a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ServersClientBeginFailoverOptions contains the optional parameters for the ServersClient.BeginFailover method. @@ -305,7 +301,7 @@ func (client *ServersClient) BeginFailover(ctx context.Context, resourceGroupNam // Failover - Manual failover a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 func (client *ServersClient) failover(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginFailoverOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginFailover" @@ -328,7 +324,7 @@ func (client *ServersClient) failover(ctx context.Context, resourceGroupName str } // failoverCreateRequest creates the Failover request. -func (client *ServersClient) failoverCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginFailoverOptions) (*policy.Request, error) { +func (client *ServersClient) failoverCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ServersClientBeginFailoverOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/failover" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -347,16 +343,15 @@ func (client *ServersClient) failoverCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Gets information about a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ServersClientGetOptions contains the optional parameters for the ServersClient.Get method. @@ -383,7 +378,7 @@ func (client *ServersClient) Get(ctx context.Context, resourceGroupName string, } // getCreateRequest creates the Get request. -func (client *ServersClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientGetOptions) (*policy.Request, error) { +func (client *ServersClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ServersClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -402,7 +397,7 @@ func (client *ServersClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -419,7 +414,7 @@ func (client *ServersClient) getHandleResponse(resp *http.Response) (ServersClie // NewListPager - List all the servers in a given subscription. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - 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]{ @@ -445,7 +440,7 @@ func (client *ServersClient) NewListPager(options *ServersClientListOptions) *ru } // listCreateRequest creates the List request. -func (client *ServersClient) listCreateRequest(ctx context.Context, options *ServersClientListOptions) (*policy.Request, error) { +func (client *ServersClient) listCreateRequest(ctx context.Context, _ *ServersClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/flexibleServers" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -456,7 +451,7 @@ func (client *ServersClient) listCreateRequest(ctx context.Context, options *Ser return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -473,7 +468,7 @@ func (client *ServersClient) listHandleResponse(resp *http.Response) (ServersCli // NewListByResourceGroupPager - List all the servers in a given resource group. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ServersClientListByResourceGroupOptions contains the optional parameters for the ServersClient.NewListByResourceGroupPager // method. @@ -501,7 +496,7 @@ func (client *ServersClient) NewListByResourceGroupPager(resourceGroupName strin } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ServersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ServersClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *ServersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *ServersClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -516,7 +511,7 @@ func (client *ServersClient) listByResourceGroupCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -534,7 +529,7 @@ func (client *ServersClient) listByResourceGroupHandleResponse(resp *http.Respon // BeginResetGtid - Resets GTID on a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - parameters - The required parameters for resetting GTID on a server. @@ -560,7 +555,7 @@ func (client *ServersClient) BeginResetGtid(ctx context.Context, resourceGroupNa // ResetGtid - Resets GTID on a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 func (client *ServersClient) resetGtid(ctx context.Context, resourceGroupName string, serverName string, parameters ServerGtidSetParameter, options *ServersClientBeginResetGtidOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginResetGtid" @@ -583,7 +578,7 @@ func (client *ServersClient) resetGtid(ctx context.Context, resourceGroupName st } // resetGtidCreateRequest creates the ResetGtid request. -func (client *ServersClient) resetGtidCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters ServerGtidSetParameter, options *ServersClientBeginResetGtidOptions) (*policy.Request, error) { +func (client *ServersClient) resetGtidCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters ServerGtidSetParameter, _ *ServersClientBeginResetGtidOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/resetGtid" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -602,9 +597,9 @@ func (client *ServersClient) resetGtidCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -614,7 +609,7 @@ func (client *ServersClient) resetGtidCreateRequest(ctx context.Context, resourc // BeginRestart - Restarts a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - parameters - The required parameters for restarting a server. @@ -639,7 +634,7 @@ func (client *ServersClient) BeginRestart(ctx context.Context, resourceGroupName // Restart - Restarts a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 func (client *ServersClient) restart(ctx context.Context, resourceGroupName string, serverName string, parameters ServerRestartParameter, options *ServersClientBeginRestartOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginRestart" @@ -662,7 +657,7 @@ func (client *ServersClient) restart(ctx context.Context, resourceGroupName stri } // restartCreateRequest creates the Restart request. -func (client *ServersClient) restartCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters ServerRestartParameter, options *ServersClientBeginRestartOptions) (*policy.Request, error) { +func (client *ServersClient) restartCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters ServerRestartParameter, _ *ServersClientBeginRestartOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/restart" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -681,9 +676,9 @@ func (client *ServersClient) restartCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -693,7 +688,7 @@ func (client *ServersClient) restartCreateRequest(ctx context.Context, resourceG // BeginStart - Starts a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ServersClientBeginStartOptions contains the optional parameters for the ServersClient.BeginStart method. @@ -717,7 +712,7 @@ func (client *ServersClient) BeginStart(ctx context.Context, resourceGroupName s // Start - Starts a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 func (client *ServersClient) start(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginStart" @@ -740,7 +735,7 @@ func (client *ServersClient) start(ctx context.Context, resourceGroupName string } // startCreateRequest creates the Start request. -func (client *ServersClient) startCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginStartOptions) (*policy.Request, error) { +func (client *ServersClient) startCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ServersClientBeginStartOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/start" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -759,16 +754,15 @@ func (client *ServersClient) startCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // BeginStop - Stops a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ServersClientBeginStopOptions contains the optional parameters for the ServersClient.BeginStop method. @@ -792,7 +786,7 @@ func (client *ServersClient) BeginStop(ctx context.Context, resourceGroupName st // Stop - Stops a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 func (client *ServersClient) stop(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginStop" @@ -815,7 +809,7 @@ func (client *ServersClient) stop(ctx context.Context, resourceGroupName string, } // stopCreateRequest creates the Stop request. -func (client *ServersClient) stopCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginStopOptions) (*policy.Request, error) { +func (client *ServersClient) stopCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ServersClientBeginStopOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/stop" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -834,9 +828,8 @@ func (client *ServersClient) stopCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -844,7 +837,7 @@ func (client *ServersClient) stopCreateRequest(ctx context.Context, resourceGrou // server definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - parameters - The required parameters for updating a server. @@ -870,7 +863,7 @@ func (client *ServersClient) BeginUpdate(ctx context.Context, resourceGroupName // definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 func (client *ServersClient) update(ctx context.Context, resourceGroupName string, serverName string, parameters ServerForUpdate, options *ServersClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginUpdate" @@ -893,7 +886,7 @@ func (client *ServersClient) update(ctx context.Context, resourceGroupName strin } // updateCreateRequest creates the Update request. -func (client *ServersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters ServerForUpdate, options *ServersClientBeginUpdateOptions) (*policy.Request, error) { +func (client *ServersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters ServerForUpdate, _ *ServersClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -912,9 +905,10 @@ func (client *ServersClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -924,7 +918,7 @@ func (client *ServersClient) updateCreateRequest(ctx context.Context, resourceGr // ValidateEstimateHighAvailability - Validate a deployment of high availability. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - parameters - The required parameters for validation of high availability deployment. @@ -953,7 +947,7 @@ func (client *ServersClient) ValidateEstimateHighAvailability(ctx context.Contex } // validateEstimateHighAvailabilityCreateRequest creates the ValidateEstimateHighAvailability request. -func (client *ServersClient) validateEstimateHighAvailabilityCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters HighAvailabilityValidationEstimation, options *ServersClientValidateEstimateHighAvailabilityOptions) (*policy.Request, error) { +func (client *ServersClient) validateEstimateHighAvailabilityCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters HighAvailabilityValidationEstimation, _ *ServersClientValidateEstimateHighAvailabilityOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/validateEstimateHighAvailability" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -972,9 +966,10 @@ func (client *ServersClient) validateEstimateHighAvailabilityCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/servers_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/servers_client_example_test.go index 8c23270c444d..3116496deeb8 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/servers_client_example_test.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/servers_client_example_test.go @@ -1,41 +1,31 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers_test import ( "context" - "log" - - "time" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" + "log" + "time" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/ServerCreate.json +// Generated from example definition: 2024-12-30/ServerCreate.json func ExampleServersClient_BeginCreate_createANewServer() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "mysqltestserver", armmysqlflexibleservers.Server{ Location: to.Ptr("southeastasia"), - Tags: map[string]*string{ - "num": to.Ptr("1"), - }, Properties: &armmysqlflexibleservers.ServerProperties{ AdministratorLogin: to.Ptr("cloudsa"), AdministratorLoginPassword: to.Ptr("your_password"), @@ -62,6 +52,9 @@ func ExampleServersClient_BeginCreate_createANewServer() { Name: to.Ptr("Standard_D2ds_v4"), Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), }, + Tags: map[string]*string{ + "num": to.Ptr("1"), + }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -73,66 +66,69 @@ func ExampleServersClient_BeginCreate_createANewServer() { // 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.Server = armmysqlflexibleservers.Server{ - // Name: to.Ptr("mysqltestserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("1"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.415Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // DatabasePort: to.Ptr[int32](3306), - // FullVersion: to.Ptr("5.7.44"), - // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("3"), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateHealthy), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), + // res = armmysqlflexibleservers.ServersClientCreateResponse{ + // Server: &armmysqlflexibleservers.Server{ + // Name: to.Ptr("mysqltestserver"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), + // Location: to.Ptr("Southeast Asia"), + // Properties: &armmysqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AvailabilityZone: to.Ptr("1"), + // Backup: &armmysqlflexibleservers.Backup{ + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.4150019+00:00"); return t}()), + // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // DatabasePort: to.Ptr[int32](3306), + // FullVersion: to.Ptr("5.7.44"), + // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), + // HighAvailability: &armmysqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeZoneRedundant), + // StandbyAvailabilityZone: to.Ptr("3"), + // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateHealthy), + // }, + // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ + // BatchOfMaintenance: to.Ptr(armmysqlflexibleservers.BatchOfMaintenanceDefault), + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // Network: &armmysqlflexibleservers.Network{ + // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // }, + // ReplicaCapacity: to.Ptr[int32](10), + // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), + // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), + // Storage: &armmysqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // Iops: to.Ptr[int32](600), + // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumZoneRedundancy), + // StorageSizeGB: to.Ptr[int32](100), + // StorageSKU: to.Ptr("Premium_ZRS"), + // }, + // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), + // }, + // SKU: &armmysqlflexibleservers.MySQLServerSKU{ + // Name: to.Ptr("Standard_D2ds_v4"), + // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), + // }, + // Tags: map[string]*string{ + // "num": to.Ptr("1"), // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](600), - // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumZoneRedundancy), - // StorageSizeGB: to.Ptr[int32](100), - // StorageSKU: to.Ptr("Premium_ZRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/ServerCreateReplica.json +// Generated from example definition: 2024-12-30/ServerCreateReplica.json func ExampleServersClient_BeginCreate_createAReplicaServer() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -153,168 +149,80 @@ func ExampleServersClient_BeginCreate_createAReplicaServer() { // 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.Server = armmysqlflexibleservers.Server{ - // Name: to.Ptr("replica-server"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/replica-server"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("3"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-24T08:19:18.572Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // DatabasePort: to.Ptr[int32](3306), - // FullVersion: to.Ptr("5.7.44"), - // FullyQualifiedDomainName: to.Ptr("replica-server.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleReplica), - // SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/source-server"), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](360), - // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), - // StorageSizeGB: to.Ptr[int32](20), - // StorageSKU: to.Ptr("Premium_LRS"), + // res = armmysqlflexibleservers.ServersClientCreateResponse{ + // Server: &armmysqlflexibleservers.Server{ + // Name: to.Ptr("replica-server"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/replica-server"), + // Location: to.Ptr("Southeast Asia"), + // Properties: &armmysqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AvailabilityZone: to.Ptr("3"), + // Backup: &armmysqlflexibleservers.Backup{ + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-24T08:19:18.5729164+00:00"); return t}()), + // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // DatabasePort: to.Ptr[int32](3306), + // FullVersion: to.Ptr("5.7.44"), + // FullyQualifiedDomainName: to.Ptr("replica-server.database.mysql.azure.com"), + // HighAvailability: &armmysqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), + // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), + // }, + // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ + // BatchOfMaintenance: to.Ptr(armmysqlflexibleservers.BatchOfMaintenanceDefault), + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // Network: &armmysqlflexibleservers.Network{ + // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // }, + // ReplicaCapacity: to.Ptr[int32](0), + // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleReplica), + // SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/source-server"), + // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), + // Storage: &armmysqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // Iops: to.Ptr[int32](360), + // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), + // StorageSizeGB: to.Ptr[int32](20), + // StorageSKU: to.Ptr("Premium_LRS"), + // }, + // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), + // }, + // SKU: &armmysqlflexibleservers.MySQLServerSKU{ + // Name: to.Ptr("Standard_D2ds_v4"), + // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), + // }, + // Tags: map[string]*string{ + // "ElasticServer": to.Ptr("1"), // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/ServerCreateWithPointInTimeRestore.json -func ExampleServersClient_BeginCreate_createAServerAsAPointInTimeRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TargetResourceGroup", "targetserver", armmysqlflexibleservers.Server{ - Location: to.Ptr("SoutheastAsia"), - Tags: map[string]*string{ - "num": to.Ptr("1"), - }, - Properties: &armmysqlflexibleservers.ServerProperties{ - CreateMode: to.Ptr(armmysqlflexibleservers.CreateModePointInTimeRestore), - RestorePointInTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-24T00:00:37.467Z"); return t }()), - SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/sourceserver"), - }, - SKU: &armmysqlflexibleservers.MySQLServerSKU{ - Name: to.Ptr("Standard_D14_v2"), - Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), - }, - }, 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.Server = armmysqlflexibleservers.Server{ - // Name: to.Ptr("targetserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TargetResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/targetserver"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("adminuser"), - // AvailabilityZone: to.Ptr("1"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-24T00:15:24.000Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // DatabasePort: to.Ptr[int32](3306), - // FullVersion: to.Ptr("5.7.44"), - // FullyQualifiedDomainName: to.Ptr("targetserver.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](360), - // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), - // StorageSizeGB: to.Ptr[int32](20), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/ServerCreateWithBYOK.json +// Generated from example definition: 2024-12-30/ServerCreateWithBYOK.json func ExampleServersClient_BeginCreate_createAServerWithByok() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "mysqltestserver", armmysqlflexibleservers.Server{ - Location: to.Ptr("southeastasia"), - Tags: map[string]*string{ - "num": to.Ptr("1"), - }, Identity: &armmysqlflexibleservers.MySQLServerIdentity{ Type: to.Ptr(armmysqlflexibleservers.ManagedServiceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]any{ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": map[string]any{}, + UserAssignedIdentities: map[string]*armmysqlflexibleservers.UserAssignedIdentity{ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": {}, }, }, + Location: to.Ptr("southeastasia"), Properties: &armmysqlflexibleservers.ServerProperties{ AdministratorLogin: to.Ptr("cloudsa"), AdministratorLoginPassword: to.Ptr("your_password"), @@ -348,6 +256,9 @@ func ExampleServersClient_BeginCreate_createAServerWithByok() { Name: to.Ptr("Standard_D2ds_v4"), Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), }, + Tags: map[string]*string{ + "num": to.Ptr("1"), + }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -359,74 +270,74 @@ func ExampleServersClient_BeginCreate_createAServerWithByok() { // 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.Server = armmysqlflexibleservers.Server{ - // Name: to.Ptr("mysqltestserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("1"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.415Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // DatabasePort: to.Ptr[int32](3306), - // FullVersion: to.Ptr("5.7.44"), - // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("3"), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateHealthy), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // res = armmysqlflexibleservers.ServersClientCreateResponse{ + // Server: &armmysqlflexibleservers.Server{ + // Name: to.Ptr("mysqltestserver"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), + // Location: to.Ptr("Southeast Asia"), + // Properties: &armmysqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AvailabilityZone: to.Ptr("1"), + // Backup: &armmysqlflexibleservers.Backup{ + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.4150019+00:00"); return t}()), + // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // DatabasePort: to.Ptr[int32](3306), + // FullVersion: to.Ptr("5.7.44"), + // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), + // HighAvailability: &armmysqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeZoneRedundant), + // StandbyAvailabilityZone: to.Ptr("3"), + // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateHealthy), + // }, + // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ + // BatchOfMaintenance: to.Ptr(armmysqlflexibleservers.BatchOfMaintenanceDefault), + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // Network: &armmysqlflexibleservers.Network{ + // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // }, + // ReplicaCapacity: to.Ptr[int32](10), + // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), + // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), + // Storage: &armmysqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // Iops: to.Ptr[int32](600), + // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumZoneRedundancy), + // StorageSizeGB: to.Ptr[int32](100), + // StorageSKU: to.Ptr("Premium_ZRS"), + // }, + // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), + // }, + // SKU: &armmysqlflexibleservers.MySQLServerSKU{ + // Name: to.Ptr("Standard_D2ds_v4"), + // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), + // }, + // Tags: map[string]*string{ + // "num": to.Ptr("1"), // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](600), - // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumZoneRedundancy), - // StorageSizeGB: to.Ptr[int32](100), - // StorageSKU: to.Ptr("Premium_ZRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/ServerCreateWithDatabasePort.json +// Generated from example definition: 2024-12-30/ServerCreateWithDatabasePort.json func ExampleServersClient_BeginCreate_createAServerWithNonDefaultDatabasePort() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "mysqltestserver", armmysqlflexibleservers.Server{ Location: to.Ptr("southeastasia"), - Tags: map[string]*string{ - "num": to.Ptr("1"), - }, Properties: &armmysqlflexibleservers.ServerProperties{ AdministratorLogin: to.Ptr("cloudsa"), AdministratorLoginPassword: to.Ptr("your_password"), @@ -454,92 +365,8 @@ func ExampleServersClient_BeginCreate_createAServerWithNonDefaultDatabasePort() Name: to.Ptr("Standard_D2ds_v4"), Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), }, - }, 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.Server = armmysqlflexibleservers.Server{ - // Name: to.Ptr("mysqltestserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("1"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.415Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // DatabasePort: to.Ptr[int32](8888), - // FullVersion: to.Ptr("5.7.44"), - // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("3"), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateHealthy), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](600), - // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumZoneRedundancy), - // StorageSizeGB: to.Ptr[int32](100), - // StorageSKU: to.Ptr("Premium_ZRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/ServerUpdate.json -func ExampleServersClient_BeginUpdate_updateAServer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testrg", "mysqltestserver", armmysqlflexibleservers.ServerForUpdate{ - Properties: &armmysqlflexibleservers.ServerPropertiesForUpdate{ - Network: &armmysqlflexibleservers.Network{ - PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - }, - Storage: &armmysqlflexibleservers.Storage{ - AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - AutoIoScaling: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - Iops: to.Ptr[int32](200), - StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), - StorageSizeGB: to.Ptr[int32](30), - }, + Tags: map[string]*string{ + "num": to.Ptr("1"), }, }, nil) if err != nil { @@ -552,81 +379,85 @@ func ExampleServersClient_BeginUpdate_updateAServer() { // 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.Server = armmysqlflexibleservers.Server{ - // Name: to.Ptr("mysqltestserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("3"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.415Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // DatabasePort: to.Ptr[int32](3306), - // FullVersion: to.Ptr("5.7.44"), - // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ - // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyRegular), + // res = armmysqlflexibleservers.ServersClientCreateResponse{ + // Server: &armmysqlflexibleservers.Server{ + // Name: to.Ptr("mysqltestserver"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), + // Location: to.Ptr("Southeast Asia"), + // Properties: &armmysqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AvailabilityZone: to.Ptr("1"), + // Backup: &armmysqlflexibleservers.Backup{ + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.4150019+00:00"); return t}()), + // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // DatabasePort: to.Ptr[int32](8888), + // FullVersion: to.Ptr("5.7.44"), + // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), + // HighAvailability: &armmysqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeZoneRedundant), + // StandbyAvailabilityZone: to.Ptr("3"), + // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateHealthy), + // }, + // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ + // BatchOfMaintenance: to.Ptr(armmysqlflexibleservers.BatchOfMaintenanceDefault), + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // Network: &armmysqlflexibleservers.Network{ + // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // }, + // ReplicaCapacity: to.Ptr[int32](10), + // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), + // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), + // Storage: &armmysqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // Iops: to.Ptr[int32](600), + // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumZoneRedundancy), + // StorageSizeGB: to.Ptr[int32](100), + // StorageSKU: to.Ptr("Premium_ZRS"), + // }, + // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), + // }, + // SKU: &armmysqlflexibleservers.MySQLServerSKU{ + // Name: to.Ptr("Standard_D2ds_v4"), + // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), + // }, + // Tags: map[string]*string{ + // "num": to.Ptr("1"), // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Enabled"), - // DayOfWeek: to.Ptr[int32](1), - // StartHour: to.Ptr[int32](1), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // AutoIoScaling: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // Iops: to.Ptr[int32](200), - // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), - // StorageSizeGB: to.Ptr[int32](30), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json -func ExampleServersClient_BeginUpdate_updateServerCustomerMaintenanceWindow() { +// Generated from example definition: 2024-12-30/ServerCreateWithPointInTimeRestore.json +func ExampleServersClient_BeginCreate_createAServerAsAPointInTimeRestore() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testrg", "mysqltestserver", armmysqlflexibleservers.ServerForUpdate{ - Properties: &armmysqlflexibleservers.ServerPropertiesForUpdate{ - MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - CustomWindow: to.Ptr("Enabled"), - DayOfWeek: to.Ptr[int32](1), - StartHour: to.Ptr[int32](8), - StartMinute: to.Ptr[int32](0), - }, + poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TargetResourceGroup", "targetserver", armmysqlflexibleservers.Server{ + Location: to.Ptr("SoutheastAsia"), + Properties: &armmysqlflexibleservers.ServerProperties{ + CreateMode: to.Ptr(armmysqlflexibleservers.CreateModePointInTimeRestore), + RestorePointInTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-24T00:00:37.467Z"); return t }()), + SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/sourceserver"), + }, + SKU: &armmysqlflexibleservers.MySQLServerSKU{ + Name: to.Ptr("Standard_D14_v2"), + Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), + }, + Tags: map[string]*string{ + "num": to.Ptr("1"), }, }, nil) if err != nil { @@ -639,79 +470,73 @@ func ExampleServersClient_BeginUpdate_updateServerCustomerMaintenanceWindow() { // 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.Server = armmysqlflexibleservers.Server{ - // Name: to.Ptr("mysqltestserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("3"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.415Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // DatabasePort: to.Ptr[int32](3306), - // FullVersion: to.Ptr("5.7.44"), - // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ - // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyRegular), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Enabled"), - // DayOfWeek: to.Ptr[int32](1), - // StartHour: to.Ptr[int32](8), - // StartMinute: to.Ptr[int32](0), + // res = armmysqlflexibleservers.ServersClientCreateResponse{ + // Server: &armmysqlflexibleservers.Server{ + // Name: to.Ptr("targetserver"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TargetResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/targetserver"), + // Location: to.Ptr("Southeast Asia"), + // Properties: &armmysqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("adminuser"), + // AvailabilityZone: to.Ptr("1"), + // Backup: &armmysqlflexibleservers.Backup{ + // BackupIntervalHours: to.Ptr[int32](24), + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-24T00:15:24.00+00:00"); return t}()), + // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // DatabasePort: to.Ptr[int32](3306), + // FullVersion: to.Ptr("5.7.44"), + // FullyQualifiedDomainName: to.Ptr("targetserver.database.mysql.azure.com"), + // HighAvailability: &armmysqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), + // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), + // }, + // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ + // BatchOfMaintenance: to.Ptr(armmysqlflexibleservers.BatchOfMaintenanceDefault), + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // Network: &armmysqlflexibleservers.Network{ + // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // }, + // ReplicaCapacity: to.Ptr[int32](10), + // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), + // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), + // Storage: &armmysqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // Iops: to.Ptr[int32](360), + // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), + // StorageSizeGB: to.Ptr[int32](20), + // StorageSKU: to.Ptr("Premium_LRS"), + // }, + // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), + // }, + // SKU: &armmysqlflexibleservers.MySQLServerSKU{ + // Name: to.Ptr("Standard_D2ds_v4"), + // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), + // }, + // Tags: map[string]*string{ + // "num": to.Ptr("1"), // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](600), - // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), - // StorageSizeGB: to.Ptr[int32](100), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/MaintenancePolicyPatchOptInVirtualCanary.json -func ExampleServersClient_BeginUpdate_updateServerToOptInVirtualCanary() { +// Generated from example definition: 2024-12-30/ServerDelete.json +func ExampleServersClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testrg", "mysqltestserver", armmysqlflexibleservers.ServerForUpdate{ - Properties: &armmysqlflexibleservers.ServerPropertiesForUpdate{ - MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ - PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyVirtualCanary), - }, - }, - }, nil) + poller, err := clientFactory.NewServersClient().BeginDelete(ctx, "TestGroup", "testserver", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -722,74 +547,23 @@ func ExampleServersClient_BeginUpdate_updateServerToOptInVirtualCanary() { // 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.Server = armmysqlflexibleservers.Server{ - // Name: to.Ptr("mysqltestserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("3"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.415Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // DatabasePort: to.Ptr[int32](3306), - // FullVersion: to.Ptr("5.7.44"), - // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ - // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyVirtualCanary), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](600), - // StorageSizeGB: to.Ptr[int32](100), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), - // }, + // res = armmysqlflexibleservers.ServersClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/MaintenancePolicyPatchOptOutVirtualCanary.json -func ExampleServersClient_BeginUpdate_updateServerToOptOutVirtualCanary() { +// Generated from example definition: 2024-12-30/ServerDetachVNet.json +func ExampleServersClient_BeginDetachVNet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testrg", "mysqltestserver", armmysqlflexibleservers.ServerForUpdate{ - Properties: &armmysqlflexibleservers.ServerPropertiesForUpdate{ - MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ - PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategy("Default")), - }, - }, + poller, err := clientFactory.NewServersClient().BeginDetachVNet(ctx, "TestGroup", "testserver", armmysqlflexibleservers.ServerDetachVNetParameter{ + PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -801,85 +575,76 @@ func ExampleServersClient_BeginUpdate_updateServerToOptOutVirtualCanary() { // 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.Server = armmysqlflexibleservers.Server{ - // Name: to.Ptr("mysqltestserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("3"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.415Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // DatabasePort: to.Ptr[int32](3306), - // FullVersion: to.Ptr("5.7.44"), - // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ - // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyRegular), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](600), - // StorageSizeGB: to.Ptr[int32](100), - // StorageSKU: to.Ptr("Premium_LRS"), + // res = armmysqlflexibleservers.ServersClientDetachVNetResponse{ + // Server: &armmysqlflexibleservers.Server{ + // Name: to.Ptr("mysqltestserver"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), + // Location: to.Ptr("Southeast Asia"), + // Properties: &armmysqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AvailabilityZone: to.Ptr("3"), + // Backup: &armmysqlflexibleservers.Backup{ + // BackupIntervalHours: to.Ptr[int32](24), + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.4150019+00:00"); return t}()), + // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // DatabasePort: to.Ptr[int32](3306), + // FullVersion: to.Ptr("5.7.44"), + // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), + // HighAvailability: &armmysqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), + // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), + // }, + // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ + // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyRegular), + // }, + // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ + // BatchOfMaintenance: to.Ptr(armmysqlflexibleservers.BatchOfMaintenanceDefault), + // CustomWindow: to.Ptr("Enabled"), + // DayOfWeek: to.Ptr[int32](1), + // StartHour: to.Ptr[int32](1), + // StartMinute: to.Ptr[int32](0), + // }, + // Network: &armmysqlflexibleservers.Network{ + // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // ReplicaCapacity: to.Ptr[int32](10), + // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), + // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), + // Storage: &armmysqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // AutoIoScaling: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // Iops: to.Ptr[int32](200), + // StorageSizeGB: to.Ptr[int32](30), + // StorageSKU: to.Ptr("Premium_LRS"), + // }, + // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), + // }, + // SKU: &armmysqlflexibleservers.MySQLServerSKU{ + // Name: to.Ptr("Standard_D2ds_v4"), + // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), + // }, + // Tags: map[string]*string{ + // "num": to.Ptr("1"), // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/ServerUpdateWithBYOK.json -func ExampleServersClient_BeginUpdate_updateServerWithByok() { +// Generated from example definition: 2024-12-30/ServerFailover.json +func ExampleServersClient_BeginFailover() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testrg", "mysqltestserver", armmysqlflexibleservers.ServerForUpdate{ - Identity: &armmysqlflexibleservers.MySQLServerIdentity{ - Type: to.Ptr(armmysqlflexibleservers.ManagedServiceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]any{ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": map[string]any{}, - }, - }, - Properties: &armmysqlflexibleservers.ServerPropertiesForUpdate{ - DataEncryption: &armmysqlflexibleservers.DataEncryption{ - Type: to.Ptr(armmysqlflexibleservers.DataEncryptionTypeAzureKeyVault), - GeoBackupKeyURI: to.Ptr("https://test-geo.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a"), - GeoBackupUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-identity"), - PrimaryKeyURI: to.Ptr("https://test.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a"), - PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity"), - }, - }, - }, nil) + poller, err := clientFactory.NewServersClient().BeginFailover(ctx, "TestGroup", "testserver", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -890,91 +655,18 @@ func ExampleServersClient_BeginUpdate_updateServerWithByok() { // 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.Server = armmysqlflexibleservers.Server{ - // Name: to.Ptr("mysqltestserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("1"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.415Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // DatabasePort: to.Ptr[int32](3306), - // FullVersion: to.Ptr("5.7.44"), - // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("3"), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateHealthy), - // }, - // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ - // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyRegular), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](600), - // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), - // StorageSizeGB: to.Ptr[int32](100), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), - // }, + // res = armmysqlflexibleservers.ServersClientFailoverResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/ServerDelete.json -func ExampleServersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginDelete(ctx, "TestGroup", "testserver", 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/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/ServerGet.json +// Generated from example definition: 2024-12-30/ServerGet.json func ExampleServersClient_Get_getAServer() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -985,70 +677,73 @@ func ExampleServersClient_Get_getAServer() { // 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.Server = armmysqlflexibleservers.Server{ - // Name: to.Ptr("mysqltestserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("3"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.415Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // DatabasePort: to.Ptr[int32](3306), - // FullVersion: to.Ptr("5.7.44"), - // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ - // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyRegular), + // res = armmysqlflexibleservers.ServersClientGetResponse{ + // Server: &armmysqlflexibleservers.Server{ + // Name: to.Ptr("mysqltestserver"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), + // Location: to.Ptr("Southeast Asia"), + // Properties: &armmysqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AvailabilityZone: to.Ptr("3"), + // Backup: &armmysqlflexibleservers.Backup{ + // BackupIntervalHours: to.Ptr[int32](24), + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.4150019+00:00"); return t}()), + // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // DatabasePort: to.Ptr[int32](3306), + // FullVersion: to.Ptr("5.7.44"), + // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), + // HighAvailability: &armmysqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), + // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), + // }, + // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ + // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyRegular), + // }, + // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ + // BatchOfMaintenance: to.Ptr(armmysqlflexibleservers.BatchOfMaintenanceDefault), + // CustomWindow: to.Ptr("Enabled"), + // DayOfWeek: to.Ptr[int32](1), + // StartHour: to.Ptr[int32](1), + // StartMinute: to.Ptr[int32](0), + // }, + // Network: &armmysqlflexibleservers.Network{ + // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // }, + // ReplicaCapacity: to.Ptr[int32](10), + // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), + // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), + // Storage: &armmysqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // AutoIoScaling: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // Iops: to.Ptr[int32](600), + // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), + // StorageSizeGB: to.Ptr[int32](100), + // StorageSKU: to.Ptr("Premium_LRS"), + // }, + // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), + // }, + // SKU: &armmysqlflexibleservers.MySQLServerSKU{ + // Name: to.Ptr("Standard_D2ds_v4"), + // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), + // }, + // Tags: map[string]*string{ + // "num": to.Ptr("1"), // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Enabled"), - // DayOfWeek: to.Ptr[int32](1), - // StartHour: to.Ptr[int32](1), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // AutoIoScaling: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](600), - // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), - // StorageSizeGB: to.Ptr[int32](100), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/ServerGetWithVnet.json +// Generated from example definition: 2024-12-30/ServerGetWithVnet.json func ExampleServersClient_Get_getAServerWithVnet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -1059,74 +754,77 @@ func ExampleServersClient_Get_getAServerWithVnet() { // 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.Server = armmysqlflexibleservers.Server{ - // Name: to.Ptr("mysqltestserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("3"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.415Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // DatabasePort: to.Ptr[int32](3306), - // FullVersion: to.Ptr("5.7.44"), - // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ - // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyRegular), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), + // res = armmysqlflexibleservers.ServersClientGetResponse{ + // Server: &armmysqlflexibleservers.Server{ + // Name: to.Ptr("mysqltestserver"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), + // Location: to.Ptr("Southeast Asia"), + // Properties: &armmysqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AvailabilityZone: to.Ptr("3"), + // Backup: &armmysqlflexibleservers.Backup{ + // BackupIntervalHours: to.Ptr[int32](24), + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.4150019+00:00"); return t}()), + // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // DatabasePort: to.Ptr[int32](3306), + // FullVersion: to.Ptr("5.7.44"), + // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), + // HighAvailability: &armmysqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), + // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), + // }, + // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ + // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyRegular), + // }, + // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ + // BatchOfMaintenance: to.Ptr(armmysqlflexibleservers.BatchOfMaintenanceDefault), + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // Network: &armmysqlflexibleservers.Network{ + // DelegatedSubnetResourceID: to.Ptr("/subscriptions/2941a09d-7bcf-42fe-91ca-1765f521c829/resourceGroups/OrcabrCI-Vnet-Resource-Group/providers/Microsoft.Network/virtualNetworks/OrcabrCI-Vnet/subnets/mysql-subnet"), + // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // ReplicaCapacity: to.Ptr[int32](10), + // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), + // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), + // Storage: &armmysqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // Iops: to.Ptr[int32](600), + // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), + // StorageSizeGB: to.Ptr[int32](100), + // StorageSKU: to.Ptr("Premium_LRS"), + // }, + // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), + // }, + // SKU: &armmysqlflexibleservers.MySQLServerSKU{ + // Name: to.Ptr("Standard_D2ds_v4"), + // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), + // }, + // Tags: map[string]*string{ + // "num": to.Ptr("1"), // }, - // Network: &armmysqlflexibleservers.Network{ - // DelegatedSubnetResourceID: to.Ptr("/subscriptions/2941a09d-7bcf-42fe-91ca-1765f521c829/resourceGroups/OrcabrCI-Vnet-Resource-Group/providers/Microsoft.Network/virtualNetworks/OrcabrCI-Vnet/subnets/mysql-subnet"), - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](600), - // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), - // StorageSizeGB: to.Ptr[int32](100), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/ServersListByResourceGroup.json -func ExampleServersClient_NewListByResourceGroupPager() { +// Generated from example definition: 2024-12-30/ServersList.json +func ExampleServersClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewServersClient().NewListByResourceGroupPager("TestGroup", nil) + pager := clientFactory.NewServersClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -1137,180 +835,189 @@ func ExampleServersClient_NewListByResourceGroupPager() { _ = 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 = armmysqlflexibleservers.ServerListResult{ - // Value: []*armmysqlflexibleservers.Server{ - // { - // Name: to.Ptr("mysqltestserver1"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver1"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("1"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T07:08:17.425Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // page = armmysqlflexibleservers.ServersClientListResponse{ + // ServerListResult: armmysqlflexibleservers.ServerListResult{ + // Value: []*armmysqlflexibleservers.Server{ + // { + // Name: to.Ptr("mysqltestserver1"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver1"), + // Location: to.Ptr("Southeast Asia"), + // Properties: &armmysqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AvailabilityZone: to.Ptr("1"), + // Backup: &armmysqlflexibleservers.Backup{ + // BackupIntervalHours: to.Ptr[int32](24), + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T07:08:17.4259886+00:00"); return t}()), + // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // DatabasePort: to.Ptr[int32](3306), + // FullVersion: to.Ptr("5.7.44"), + // FullyQualifiedDomainName: to.Ptr("mysqltestserver1.database.mysql.azure.com"), + // HighAvailability: &armmysqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), + // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), + // }, + // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ + // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyRegular), + // }, + // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ + // BatchOfMaintenance: to.Ptr(armmysqlflexibleservers.BatchOfMaintenanceDefault), + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // Network: &armmysqlflexibleservers.Network{ + // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // }, + // ReplicaCapacity: to.Ptr[int32](10), + // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), + // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), + // Storage: &armmysqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // Iops: to.Ptr[int32](369), + // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), + // StorageSizeGB: to.Ptr[int32](23), + // StorageSKU: to.Ptr("Premium_LRS"), + // }, + // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), // }, - // DatabasePort: to.Ptr[int32](3306), - // FullVersion: to.Ptr("5.7.44"), - // FullyQualifiedDomainName: to.Ptr("mysqltestserver1.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), + // SKU: &armmysqlflexibleservers.MySQLServerSKU{ + // Name: to.Ptr("Standard_B1ms"), + // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierBurstable), // }, - // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ - // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyRegular), + // Tags: map[string]*string{ + // "num": to.Ptr("1"), // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](369), - // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), - // StorageSizeGB: to.Ptr[int32](23), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_B1ms"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierBurstable), // }, - // }, - // { - // Name: to.Ptr("mysqltestserver2"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver2"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("2"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T07:08:17.425Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // DatabasePort: to.Ptr[int32](3306), - // FullVersion: to.Ptr("5.7.44"), - // FullyQualifiedDomainName: to.Ptr("mysqltestserver2.mysql.database.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ - // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategy("Default")), + // { + // Name: to.Ptr("mysqltestserver2"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup2/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver2"), + // Location: to.Ptr("Southeast Asia"), + // Properties: &armmysqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AvailabilityZone: to.Ptr("2"), + // Backup: &armmysqlflexibleservers.Backup{ + // BackupIntervalHours: to.Ptr[int32](24), + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T07:08:17.4259886+00:00"); return t}()), + // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // DatabasePort: to.Ptr[int32](3306), + // FullVersion: to.Ptr("5.7.44"), + // FullyQualifiedDomainName: to.Ptr("mysqltestserver2.mysql.database.azure.com"), + // HighAvailability: &armmysqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), + // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), + // }, + // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ + // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategy("Default")), + // }, + // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ + // BatchOfMaintenance: to.Ptr(armmysqlflexibleservers.BatchOfMaintenanceDefault), + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // Network: &armmysqlflexibleservers.Network{ + // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // }, + // ReplicaCapacity: to.Ptr[int32](10), + // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), + // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), + // Storage: &armmysqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // Iops: to.Ptr[int32](369), + // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), + // StorageSizeGB: to.Ptr[int32](23), + // StorageSKU: to.Ptr("Premium_LRS"), + // }, + // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), + // SKU: &armmysqlflexibleservers.MySQLServerSKU{ + // Name: to.Ptr("Standard_D2ds_v4"), + // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // Tags: map[string]*string{ + // "num": to.Ptr("1"), // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](369), - // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), - // StorageSizeGB: to.Ptr[int32](23), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), // }, - // }, - // { - // Name: to.Ptr("mysqltestserver3"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver3"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("1"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-24T06:28:19.061Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // DatabasePort: to.Ptr[int32](3306), - // FullVersion: to.Ptr("5.7.44"), - // FullyQualifiedDomainName: to.Ptr("mysqltestserver3.mysql.database.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), + // { + // Name: to.Ptr("mysqltestserver3"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup3/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver3"), + // Location: to.Ptr("Southeast Asia"), + // Properties: &armmysqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AvailabilityZone: to.Ptr("1"), + // Backup: &armmysqlflexibleservers.Backup{ + // BackupIntervalHours: to.Ptr[int32](24), + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-24T06:28:19.0611667+00:00"); return t}()), + // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // DatabasePort: to.Ptr[int32](3306), + // FullVersion: to.Ptr("5.7.44"), + // FullyQualifiedDomainName: to.Ptr("mysqltestserver3.mysql.database.azure.com"), + // HighAvailability: &armmysqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), + // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), + // }, + // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ + // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategy("Default")), + // }, + // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ + // BatchOfMaintenance: to.Ptr(armmysqlflexibleservers.BatchOfMaintenanceDefault), + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // Network: &armmysqlflexibleservers.Network{ + // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // }, + // ReplicaCapacity: to.Ptr[int32](10), + // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), + // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), + // Storage: &armmysqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // Iops: to.Ptr[int32](600), + // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumZoneRedundancy), + // StorageSizeGB: to.Ptr[int32](100), + // StorageSKU: to.Ptr("Premium_ZRS"), + // }, + // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), + // SKU: &armmysqlflexibleservers.MySQLServerSKU{ + // Name: to.Ptr("Standard_E2ds_v4"), + // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierMemoryOptimized), // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // Tags: map[string]*string{ + // "num": to.Ptr("1"), // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](600), - // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumZoneRedundancy), - // StorageSizeGB: to.Ptr[int32](100), - // StorageSKU: to.Ptr("Premium_ZRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_E2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierMemoryOptimized), // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/ServersList.json -func ExampleServersClient_NewListPager() { +// Generated from example definition: 2024-12-30/ServersListByResourceGroup.json +func ExampleServersClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewServersClient().NewListPager(nil) + pager := clientFactory.NewServersClient().NewListByResourceGroupPager("TestGroup", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -1321,321 +1028,477 @@ func ExampleServersClient_NewListPager() { _ = 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 = armmysqlflexibleservers.ServerListResult{ - // Value: []*armmysqlflexibleservers.Server{ - // { - // Name: to.Ptr("mysqltestserver1"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver1"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("1"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T07:08:17.425Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // DatabasePort: to.Ptr[int32](3306), - // FullVersion: to.Ptr("5.7.44"), - // FullyQualifiedDomainName: to.Ptr("mysqltestserver1.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ - // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyRegular), + // page = armmysqlflexibleservers.ServersClientListByResourceGroupResponse{ + // ServerListResult: armmysqlflexibleservers.ServerListResult{ + // Value: []*armmysqlflexibleservers.Server{ + // { + // Name: to.Ptr("mysqltestserver1"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver1"), + // Location: to.Ptr("Southeast Asia"), + // Properties: &armmysqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AvailabilityZone: to.Ptr("1"), + // Backup: &armmysqlflexibleservers.Backup{ + // BackupIntervalHours: to.Ptr[int32](24), + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T07:08:17.4259886+00:00"); return t}()), + // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // DatabasePort: to.Ptr[int32](3306), + // FullVersion: to.Ptr("5.7.44"), + // FullyQualifiedDomainName: to.Ptr("mysqltestserver1.database.mysql.azure.com"), + // HighAvailability: &armmysqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), + // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), + // }, + // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ + // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyRegular), + // }, + // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ + // BatchOfMaintenance: to.Ptr(armmysqlflexibleservers.BatchOfMaintenanceDefault), + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // Network: &armmysqlflexibleservers.Network{ + // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // }, + // ReplicaCapacity: to.Ptr[int32](10), + // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), + // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), + // Storage: &armmysqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // Iops: to.Ptr[int32](369), + // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), + // StorageSizeGB: to.Ptr[int32](23), + // StorageSKU: to.Ptr("Premium_LRS"), + // }, + // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), + // SKU: &armmysqlflexibleservers.MySQLServerSKU{ + // Name: to.Ptr("Standard_B1ms"), + // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierBurstable), // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // Tags: map[string]*string{ + // "num": to.Ptr("1"), // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](369), - // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), - // StorageSizeGB: to.Ptr[int32](23), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_B1ms"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierBurstable), - // }, - // }, - // { - // Name: to.Ptr("mysqltestserver2"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup2/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver2"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("2"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T07:08:17.425Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // DatabasePort: to.Ptr[int32](3306), - // FullVersion: to.Ptr("5.7.44"), - // FullyQualifiedDomainName: to.Ptr("mysqltestserver2.mysql.database.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ - // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategy("Default")), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), + // { + // Name: to.Ptr("mysqltestserver2"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver2"), + // Location: to.Ptr("Southeast Asia"), + // Properties: &armmysqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AvailabilityZone: to.Ptr("2"), + // Backup: &armmysqlflexibleservers.Backup{ + // BackupIntervalHours: to.Ptr[int32](24), + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T07:08:17.4259886+00:00"); return t}()), + // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // DatabasePort: to.Ptr[int32](3306), + // FullVersion: to.Ptr("5.7.44"), + // FullyQualifiedDomainName: to.Ptr("mysqltestserver2.mysql.database.azure.com"), + // HighAvailability: &armmysqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), + // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), + // }, + // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ + // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategy("Default")), + // }, + // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ + // BatchOfMaintenance: to.Ptr(armmysqlflexibleservers.BatchOfMaintenanceDefault), + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // Network: &armmysqlflexibleservers.Network{ + // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // }, + // ReplicaCapacity: to.Ptr[int32](10), + // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), + // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), + // Storage: &armmysqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // Iops: to.Ptr[int32](369), + // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), + // StorageSizeGB: to.Ptr[int32](23), + // StorageSKU: to.Ptr("Premium_LRS"), + // }, + // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // SKU: &armmysqlflexibleservers.MySQLServerSKU{ + // Name: to.Ptr("Standard_D2ds_v4"), + // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](369), - // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), - // StorageSizeGB: to.Ptr[int32](23), - // StorageSKU: to.Ptr("Premium_LRS"), + // Tags: map[string]*string{ + // "num": to.Ptr("1"), // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("mysqltestserver3"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup3/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver3"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("1"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-24T06:28:19.061Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // DatabasePort: to.Ptr[int32](3306), - // FullVersion: to.Ptr("5.7.44"), - // FullyQualifiedDomainName: to.Ptr("mysqltestserver3.mysql.database.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), + // { + // Name: to.Ptr("mysqltestserver3"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver3"), + // Location: to.Ptr("Southeast Asia"), + // Properties: &armmysqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AvailabilityZone: to.Ptr("1"), + // Backup: &armmysqlflexibleservers.Backup{ + // BackupIntervalHours: to.Ptr[int32](24), + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-24T06:28:19.0611667+00:00"); return t}()), + // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // DatabasePort: to.Ptr[int32](3306), + // FullVersion: to.Ptr("5.7.44"), + // FullyQualifiedDomainName: to.Ptr("mysqltestserver3.mysql.database.azure.com"), + // HighAvailability: &armmysqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), + // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), + // }, + // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ + // BatchOfMaintenance: to.Ptr(armmysqlflexibleservers.BatchOfMaintenanceDefault), + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // Network: &armmysqlflexibleservers.Network{ + // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // }, + // ReplicaCapacity: to.Ptr[int32](10), + // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), + // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), + // Storage: &armmysqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // Iops: to.Ptr[int32](600), + // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumZoneRedundancy), + // StorageSizeGB: to.Ptr[int32](100), + // StorageSKU: to.Ptr("Premium_ZRS"), + // }, + // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), // }, - // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ - // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategy("Default")), + // SKU: &armmysqlflexibleservers.MySQLServerSKU{ + // Name: to.Ptr("Standard_E2ds_v4"), + // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierMemoryOptimized), // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Disabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](0), - // StartMinute: to.Ptr[int32](0), + // Tags: map[string]*string{ + // "num": to.Ptr("1"), // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - // Iops: to.Ptr[int32](600), - // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumZoneRedundancy), - // StorageSizeGB: to.Ptr[int32](100), - // StorageSKU: to.Ptr("Premium_ZRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_E2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierMemoryOptimized), - // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/ServerFailover.json -func ExampleServersClient_BeginFailover() { +// Generated from example definition: 2024-12-30/ServerResetGtid.json +func ExampleServersClient_BeginResetGtid() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginFailover(ctx, "TestGroup", "testserver", nil) + poller, err := clientFactory.NewServersClient().BeginResetGtid(ctx, "TestGroup", "testserver", armmysqlflexibleservers.ServerGtidSetParameter{ + GtidSet: to.Ptr("4aff5b51-97ba-11ed-a955-002248036acc:1-16"), + }, 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 = armmysqlflexibleservers.ServersClientResetGtidResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/ServerValidateEstimateHighAvailability.json -func ExampleServersClient_ValidateEstimateHighAvailability() { +// Generated from example definition: 2024-12-30/ServerRestart.json +func ExampleServersClient_BeginRestart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewServersClient().ValidateEstimateHighAvailability(ctx, "TestGroup", "testserver", armmysqlflexibleservers.HighAvailabilityValidationEstimation{ - ExpectedStandbyAvailabilityZone: to.Ptr("1"), + poller, err := clientFactory.NewServersClient().BeginRestart(ctx, "TestGroup", "testserver", armmysqlflexibleservers.ServerRestartParameter{ + MaxFailoverSeconds: to.Ptr[int32](60), + RestartWithFailover: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), }, 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.HighAvailabilityValidationEstimation = armmysqlflexibleservers.HighAvailabilityValidationEstimation{ - // EstimatedDowntime: to.Ptr[int32](0), - // ExpectedStandbyAvailabilityZone: to.Ptr("1"), - // ScheduledStandbyAvailabilityZone: to.Ptr("1"), + // res = armmysqlflexibleservers.ServersClientRestartResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/ServerRestart.json -func ExampleServersClient_BeginRestart() { +// Generated from example definition: 2024-12-30/ServerStart.json +func ExampleServersClient_BeginStart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginRestart(ctx, "TestGroup", "testserver", armmysqlflexibleservers.ServerRestartParameter{ - MaxFailoverSeconds: to.Ptr[int32](60), - RestartWithFailover: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), - }, nil) + poller, err := clientFactory.NewServersClient().BeginStart(ctx, "TestGroup", "testserver", 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 = armmysqlflexibleservers.ServersClientStartResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/ServerStart.json -func ExampleServersClient_BeginStart() { +// Generated from example definition: 2024-12-30/ServerStop.json +func ExampleServersClient_BeginStop() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginStart(ctx, "TestGroup", "testserver", nil) + poller, err := clientFactory.NewServersClient().BeginStop(ctx, "TestGroup", "testserver", 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 = armmysqlflexibleservers.ServersClientStopResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/ServerStop.json -func ExampleServersClient_BeginStop() { +// Generated from example definition: 2024-12-30/MaintenancePolicyPatchOptInVirtualCanary.json +func ExampleServersClient_BeginUpdate_updateServerToOptInVirtualCanary() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginStop(ctx, "TestGroup", "testserver", nil) + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testrg", "mysqltestserver", armmysqlflexibleservers.ServerForUpdate{ + Properties: &armmysqlflexibleservers.ServerPropertiesForUpdate{ + MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ + PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyVirtualCanary), + }, + }, + }, 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 = armmysqlflexibleservers.ServersClientUpdateResponse{ + // Server: &armmysqlflexibleservers.Server{ + // Name: to.Ptr("mysqltestserver"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), + // Location: to.Ptr("Southeast Asia"), + // Properties: &armmysqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AvailabilityZone: to.Ptr("3"), + // Backup: &armmysqlflexibleservers.Backup{ + // BackupIntervalHours: to.Ptr[int32](24), + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.4150019+00:00"); return t}()), + // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // DatabasePort: to.Ptr[int32](3306), + // FullVersion: to.Ptr("5.7.44"), + // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), + // HighAvailability: &armmysqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), + // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), + // }, + // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ + // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyVirtualCanary), + // }, + // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ + // BatchOfMaintenance: to.Ptr(armmysqlflexibleservers.BatchOfMaintenanceDefault), + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // Network: &armmysqlflexibleservers.Network{ + // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // }, + // ReplicaCapacity: to.Ptr[int32](10), + // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), + // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), + // Storage: &armmysqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // Iops: to.Ptr[int32](600), + // StorageSizeGB: to.Ptr[int32](100), + // StorageSKU: to.Ptr("Premium_LRS"), + // }, + // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), + // }, + // SKU: &armmysqlflexibleservers.MySQLServerSKU{ + // Name: to.Ptr("Standard_D2ds_v4"), + // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), + // }, + // Tags: map[string]*string{ + // "num": to.Ptr("1"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/ServerResetGtid.json -func ExampleServersClient_BeginResetGtid() { +// Generated from example definition: 2024-12-30/MaintenancePolicyPatchOptOutVirtualCanary.json +func ExampleServersClient_BeginUpdate_updateServerToOptOutVirtualCanary() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginResetGtid(ctx, "TestGroup", "testserver", armmysqlflexibleservers.ServerGtidSetParameter{ - GtidSet: to.Ptr("4aff5b51-97ba-11ed-a955-002248036acc:1-16"), + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testrg", "mysqltestserver", armmysqlflexibleservers.ServerForUpdate{ + Properties: &armmysqlflexibleservers.ServerPropertiesForUpdate{ + MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ + PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategy("Default")), + }, + }, }, 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 = armmysqlflexibleservers.ServersClientUpdateResponse{ + // Server: &armmysqlflexibleservers.Server{ + // Name: to.Ptr("mysqltestserver"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), + // Location: to.Ptr("Southeast Asia"), + // Properties: &armmysqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AvailabilityZone: to.Ptr("3"), + // Backup: &armmysqlflexibleservers.Backup{ + // BackupIntervalHours: to.Ptr[int32](24), + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.4150019+00:00"); return t}()), + // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // DatabasePort: to.Ptr[int32](3306), + // FullVersion: to.Ptr("5.7.44"), + // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), + // HighAvailability: &armmysqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), + // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), + // }, + // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ + // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyRegular), + // }, + // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ + // BatchOfMaintenance: to.Ptr(armmysqlflexibleservers.BatchOfMaintenanceDefault), + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // Network: &armmysqlflexibleservers.Network{ + // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // }, + // ReplicaCapacity: to.Ptr[int32](10), + // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), + // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), + // Storage: &armmysqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // Iops: to.Ptr[int32](600), + // StorageSizeGB: to.Ptr[int32](100), + // StorageSKU: to.Ptr("Premium_LRS"), + // }, + // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), + // }, + // SKU: &armmysqlflexibleservers.MySQLServerSKU{ + // Name: to.Ptr("Standard_D2ds_v4"), + // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), + // }, + // Tags: map[string]*string{ + // "num": to.Ptr("1"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/ServerDetachVNet.json -func ExampleServersClient_BeginDetachVNet() { +// Generated from example definition: 2024-12-30/ServerUpdate.json +func ExampleServersClient_BeginUpdate_updateAServer() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServersClient().BeginDetachVNet(ctx, "TestGroup", "testserver", armmysqlflexibleservers.ServerDetachVNetParameter{ - PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testrg", "mysqltestserver", armmysqlflexibleservers.ServerForUpdate{ + Properties: &armmysqlflexibleservers.ServerPropertiesForUpdate{ + Network: &armmysqlflexibleservers.Network{ + PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + }, + Storage: &armmysqlflexibleservers.Storage{ + AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + AutoIoScaling: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + Iops: to.Ptr[int32](200), + StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), + StorageSizeGB: to.Ptr[int32](30), + }, + }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -1647,56 +1510,277 @@ func ExampleServersClient_BeginDetachVNet() { // 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.Server = armmysqlflexibleservers.Server{ - // Name: to.Ptr("mysqltestserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("3"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupIntervalHours: to.Ptr[int32](24), - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.415Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // res = armmysqlflexibleservers.ServersClientUpdateResponse{ + // Server: &armmysqlflexibleservers.Server{ + // Name: to.Ptr("mysqltestserver"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), + // Location: to.Ptr("Southeast Asia"), + // Properties: &armmysqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AvailabilityZone: to.Ptr("3"), + // Backup: &armmysqlflexibleservers.Backup{ + // BackupIntervalHours: to.Ptr[int32](24), + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.4150019+00:00"); return t}()), + // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // DatabasePort: to.Ptr[int32](3306), + // FullVersion: to.Ptr("5.7.44"), + // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), + // HighAvailability: &armmysqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), + // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), + // }, + // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ + // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyRegular), + // }, + // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ + // BatchOfMaintenance: to.Ptr(armmysqlflexibleservers.BatchOfMaintenanceDefault), + // CustomWindow: to.Ptr("Enabled"), + // DayOfWeek: to.Ptr[int32](1), + // StartHour: to.Ptr[int32](1), + // StartMinute: to.Ptr[int32](0), + // }, + // Network: &armmysqlflexibleservers.Network{ + // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // ReplicaCapacity: to.Ptr[int32](10), + // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), + // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), + // Storage: &armmysqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // AutoIoScaling: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // Iops: to.Ptr[int32](200), + // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), + // StorageSizeGB: to.Ptr[int32](30), + // StorageSKU: to.Ptr("Premium_LRS"), + // }, + // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), + // }, + // SKU: &armmysqlflexibleservers.MySQLServerSKU{ + // Name: to.Ptr("Standard_D2ds_v4"), + // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), + // }, + // Tags: map[string]*string{ + // "num": to.Ptr("1"), // }, - // DatabasePort: to.Ptr[int32](3306), - // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), - // }, - // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ - // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyRegular), - // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Enabled"), - // DayOfWeek: to.Ptr[int32](1), - // StartHour: to.Ptr[int32](1), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // } +} + +// Generated from example definition: 2024-12-30/ServerUpdateWithBYOK.json +func ExampleServersClient_BeginUpdate_updateServerWithByok() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testrg", "mysqltestserver", armmysqlflexibleservers.ServerForUpdate{ + Identity: &armmysqlflexibleservers.MySQLServerIdentity{ + Type: to.Ptr(armmysqlflexibleservers.ManagedServiceIdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armmysqlflexibleservers.UserAssignedIdentity{ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": {}, + }, + }, + Properties: &armmysqlflexibleservers.ServerPropertiesForUpdate{ + DataEncryption: &armmysqlflexibleservers.DataEncryption{ + Type: to.Ptr(armmysqlflexibleservers.DataEncryptionTypeAzureKeyVault), + GeoBackupKeyURI: to.Ptr("https://test-geo.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a"), + GeoBackupUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-identity"), + PrimaryKeyURI: to.Ptr("https://test.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a"), + PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity"), + }, + }, + }, 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 = armmysqlflexibleservers.ServersClientUpdateResponse{ + // Server: &armmysqlflexibleservers.Server{ + // Name: to.Ptr("mysqltestserver"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), + // Location: to.Ptr("Southeast Asia"), + // Properties: &armmysqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AvailabilityZone: to.Ptr("1"), + // Backup: &armmysqlflexibleservers.Backup{ + // BackupIntervalHours: to.Ptr[int32](24), + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.4150019+00:00"); return t}()), + // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // DatabasePort: to.Ptr[int32](3306), + // FullVersion: to.Ptr("5.7.44"), + // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), + // HighAvailability: &armmysqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeZoneRedundant), + // StandbyAvailabilityZone: to.Ptr("3"), + // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateHealthy), + // }, + // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ + // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyRegular), + // }, + // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ + // BatchOfMaintenance: to.Ptr(armmysqlflexibleservers.BatchOfMaintenanceDefault), + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // Network: &armmysqlflexibleservers.Network{ + // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // }, + // ReplicaCapacity: to.Ptr[int32](10), + // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), + // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), + // Storage: &armmysqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // Iops: to.Ptr[int32](600), + // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), + // StorageSizeGB: to.Ptr[int32](100), + // StorageSKU: to.Ptr("Premium_LRS"), + // }, + // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), + // }, + // SKU: &armmysqlflexibleservers.MySQLServerSKU{ + // Name: to.Ptr("Standard_D2ds_v4"), + // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), + // }, + // Tags: map[string]*string{ + // "num": to.Ptr("1"), // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // AutoIoScaling: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // Iops: to.Ptr[int32](200), - // StorageSizeGB: to.Ptr[int32](30), - // StorageSKU: to.Ptr("Premium_LRS"), + // }, + // } +} + +// Generated from example definition: 2024-12-30/ServerUpdateWithCustomerMaintenanceWindow.json +func ExampleServersClient_BeginUpdate_updateServerCustomerMaintenanceWindow() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testrg", "mysqltestserver", armmysqlflexibleservers.ServerForUpdate{ + Properties: &armmysqlflexibleservers.ServerPropertiesForUpdate{ + MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ + BatchOfMaintenance: to.Ptr(armmysqlflexibleservers.BatchOfMaintenanceBatch1), + CustomWindow: to.Ptr("Enabled"), + DayOfWeek: to.Ptr[int32](1), + StartHour: to.Ptr[int32](8), + StartMinute: to.Ptr[int32](0), + }, + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // 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 = armmysqlflexibleservers.ServersClientUpdateResponse{ + // Server: &armmysqlflexibleservers.Server{ + // Name: to.Ptr("mysqltestserver"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), + // Location: to.Ptr("Southeast Asia"), + // Properties: &armmysqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AvailabilityZone: to.Ptr("3"), + // Backup: &armmysqlflexibleservers.Backup{ + // BackupIntervalHours: to.Ptr[int32](24), + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.4150019+00:00"); return t}()), + // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // DatabasePort: to.Ptr[int32](3306), + // FullVersion: to.Ptr("5.7.44"), + // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), + // HighAvailability: &armmysqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), + // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), + // }, + // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ + // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyRegular), + // }, + // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ + // BatchOfMaintenance: to.Ptr(armmysqlflexibleservers.BatchOfMaintenanceBatch1), + // CustomWindow: to.Ptr("Enabled"), + // DayOfWeek: to.Ptr[int32](1), + // StartHour: to.Ptr[int32](8), + // StartMinute: to.Ptr[int32](0), + // }, + // Network: &armmysqlflexibleservers.Network{ + // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // }, + // ReplicaCapacity: to.Ptr[int32](10), + // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), + // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), + // Storage: &armmysqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumEnabled), + // Iops: to.Ptr[int32](600), + // StorageRedundancy: to.Ptr(armmysqlflexibleservers.StorageRedundancyEnumLocalRedundancy), + // StorageSizeGB: to.Ptr[int32](100), + // StorageSKU: to.Ptr("Premium_LRS"), + // }, + // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), + // }, + // SKU: &armmysqlflexibleservers.MySQLServerSKU{ + // Name: to.Ptr("Standard_D2ds_v4"), + // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), + // }, + // Tags: map[string]*string{ + // "num": to.Ptr("1"), // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), + // } +} + +// Generated from example definition: 2024-12-30/ServerValidateEstimateHighAvailability.json +func ExampleServersClient_ValidateEstimateHighAvailability() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewServersClient().ValidateEstimateHighAvailability(ctx, "TestGroup", "testserver", armmysqlflexibleservers.HighAvailabilityValidationEstimation{ + ExpectedStandbyAvailabilityZone: to.Ptr("1"), + }, 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 = armmysqlflexibleservers.ServersClientValidateEstimateHighAvailabilityResponse{ + // HighAvailabilityValidationEstimation: &armmysqlflexibleservers.HighAvailabilityValidationEstimation{ + // EstimatedDowntime: to.Ptr[int32](0), + // ExpectedStandbyAvailabilityZone: to.Ptr("1"), + // ScheduledStandbyAvailabilityZone: to.Ptr("1"), // }, // } } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/serversmigration_client.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/serversmigration_client.go index d64cdfa12154..1e27c570c5ef 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/serversmigration_client.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/serversmigration_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -46,7 +42,7 @@ func NewServersMigrationClient(subscriptionID string, credential azcore.TokenCre // BeginCutoverMigration - Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ServersMigrationClientBeginCutoverMigrationOptions contains the optional parameters for the ServersMigrationClient.BeginCutoverMigration @@ -72,7 +68,7 @@ func (client *ServersMigrationClient) BeginCutoverMigration(ctx context.Context, // CutoverMigration - Cutover migration for MySQL import, it will switch source elastic server DNS to flexible server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-10-01-preview +// Generated from API version 2024-12-30 func (client *ServersMigrationClient) cutoverMigration(ctx context.Context, resourceGroupName string, serverName string, options *ServersMigrationClientBeginCutoverMigrationOptions) (*http.Response, error) { var err error const operationName = "ServersMigrationClient.BeginCutoverMigration" @@ -95,7 +91,7 @@ func (client *ServersMigrationClient) cutoverMigration(ctx context.Context, reso } // cutoverMigrationCreateRequest creates the CutoverMigration request. -func (client *ServersMigrationClient) cutoverMigrationCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServersMigrationClientBeginCutoverMigrationOptions) (*policy.Request, error) { +func (client *ServersMigrationClient) cutoverMigrationCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ServersMigrationClientBeginCutoverMigrationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/cutoverMigration" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -114,7 +110,7 @@ func (client *ServersMigrationClient) cutoverMigrationCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-10-01-preview") + reqQP.Set("api-version", "2024-12-30") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/serversmigration_client_example_test.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/serversmigration_client_example_test.go index b25f8b83db2f..3d1e0ccb3611 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/serversmigration_client_example_test.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/serversmigration_client_example_test.go @@ -1,30 +1,24 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e26b89bcbec9eed5026c01416e481408b2a1ca1a/specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2024-10-01-preview/examples/CutoverMigration.json +// Generated from example definition: 2024-12-30/CutoverMigration.json func ExampleServersMigrationClient_BeginCutoverMigration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armmysqlflexibleservers.NewClientFactory("", cred, nil) + clientFactory, err := armmysqlflexibleservers.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -39,55 +33,58 @@ func ExampleServersMigrationClient_BeginCutoverMigration() { // 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.Server = armmysqlflexibleservers.Server{ - // Name: to.Ptr("mysqltestserver"), - // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), - // Location: to.Ptr("Southeast Asia"), - // Tags: map[string]*string{ - // "num": to.Ptr("1"), - // }, - // Properties: &armmysqlflexibleservers.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // AvailabilityZone: to.Ptr("3"), - // Backup: &armmysqlflexibleservers.Backup{ - // BackupRetentionDays: to.Ptr[int32](7), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.415Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // res = armmysqlflexibleservers.ServersMigrationClientCutoverMigrationResponse{ + // Server: &armmysqlflexibleservers.Server{ + // Name: to.Ptr("mysqltestserver"), + // Type: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestserver"), + // Location: to.Ptr("Southeast Asia"), + // Properties: &armmysqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AvailabilityZone: to.Ptr("3"), + // Backup: &armmysqlflexibleservers.Backup{ + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T06:11:38.4150019+00:00"); return t}()), + // GeoRedundantBackup: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // FullVersion: to.Ptr("5.7.44"), + // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), + // HighAvailability: &armmysqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), + // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), + // }, + // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ + // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyRegular), + // }, + // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ + // BatchOfMaintenance: to.Ptr(armmysqlflexibleservers.BatchOfMaintenanceDefault), + // CustomWindow: to.Ptr("Enabled"), + // DayOfWeek: to.Ptr[int32](1), + // StartHour: to.Ptr[int32](1), + // StartMinute: to.Ptr[int32](0), + // }, + // Network: &armmysqlflexibleservers.Network{ + // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // }, + // ReplicaCapacity: to.Ptr[int32](10), + // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), + // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), + // Storage: &armmysqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // AutoIoScaling: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), + // Iops: to.Ptr[int32](200), + // StorageSizeGB: to.Ptr[int32](30), + // StorageSKU: to.Ptr("Premium_LRS"), + // }, + // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), // }, - // FullVersion: to.Ptr("5.7.44"), - // FullyQualifiedDomainName: to.Ptr("mysqltestserver.database.mysql.azure.com"), - // HighAvailability: &armmysqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armmysqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armmysqlflexibleservers.HighAvailabilityStateNotEnabled), + // SKU: &armmysqlflexibleservers.MySQLServerSKU{ + // Name: to.Ptr("Standard_D2ds_v4"), + // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), // }, - // MaintenancePolicy: &armmysqlflexibleservers.MaintenancePolicy{ - // PatchStrategy: to.Ptr(armmysqlflexibleservers.PatchStrategyRegular), + // Tags: map[string]*string{ + // "num": to.Ptr("1"), // }, - // MaintenanceWindow: &armmysqlflexibleservers.MaintenanceWindow{ - // CustomWindow: to.Ptr("Enabled"), - // DayOfWeek: to.Ptr[int32](1), - // StartHour: to.Ptr[int32](1), - // StartMinute: to.Ptr[int32](0), - // }, - // Network: &armmysqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // }, - // ReplicaCapacity: to.Ptr[int32](10), - // ReplicationRole: to.Ptr(armmysqlflexibleservers.ReplicationRoleNone), - // State: to.Ptr(armmysqlflexibleservers.ServerStateReady), - // Storage: &armmysqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // AutoIoScaling: to.Ptr(armmysqlflexibleservers.EnableStatusEnumDisabled), - // Iops: to.Ptr[int32](200), - // StorageSizeGB: to.Ptr[int32](30), - // StorageSKU: to.Ptr("Premium_LRS"), - // }, - // Version: to.Ptr(armmysqlflexibleservers.ServerVersionFive7), - // }, - // SKU: &armmysqlflexibleservers.MySQLServerSKU{ - // Name: to.Ptr("Standard_D2ds_v4"), - // Tier: to.Ptr(armmysqlflexibleservers.ServerSKUTierGeneralPurpose), // }, // } } diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/testdata/_metadata.json b/sdk/resourcemanager/mysql/armmysqlflexibleservers/testdata/_metadata.json new file mode 100644 index 000000000000..e880b02917d6 --- /dev/null +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/testdata/_metadata.json @@ -0,0 +1,4 @@ +{ + "apiVersion": "2024-12-30", + "emitterVersion": "0.8.2" +} \ No newline at end of file diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/time_rfc3339.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/time_rfc3339.go index 2b15d2d1e8c8..635564ef02f9 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/time_rfc3339.go +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/time_rfc3339.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armmysqlflexibleservers @@ -60,6 +56,9 @@ func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + if len(data) == 0 { + return nil + } tzOffset := tzOffsetRegex.Match(data) hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") var layout string diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/tsp-location.yaml b/sdk/resourcemanager/mysql/armmysqlflexibleservers/tsp-location.yaml new file mode 100644 index 000000000000..abc5eb790e96 --- /dev/null +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers +commit: 91e3aca0bfa4b59a9f578959d0b214a26b90df40 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/version.go b/sdk/resourcemanager/mysql/armmysqlflexibleservers/version.go new file mode 100644 index 000000000000..ac13b0930e70 --- /dev/null +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/version.go @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Go Code Generator. + +package armmysqlflexibleservers + +const ( + moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysqlflexibleservers" + moduleVersion = "v2.0.0" +) From 010716282853f4ecdde07195eac0dd14267577dc Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Mon, 13 Oct 2025 07:55:29 +0000 Subject: [PATCH 2/2] Configurations: 'specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/tspconfig.yaml', API Version: 2024-12-30, SDK Release Type: stable, and CommitSHA: '91e3aca0bfa4b59a9f578959d0b214a26b90df40' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5445941 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../armmysqlflexibleservers/CHANGELOG.md | 174 ++++++++++++++++++ 1 file changed, 174 insertions(+) diff --git a/sdk/resourcemanager/mysql/armmysqlflexibleservers/CHANGELOG.md b/sdk/resourcemanager/mysql/armmysqlflexibleservers/CHANGELOG.md index 255327fbdecf..563361470f8c 100644 --- a/sdk/resourcemanager/mysql/armmysqlflexibleservers/CHANGELOG.md +++ b/sdk/resourcemanager/mysql/armmysqlflexibleservers/CHANGELOG.md @@ -174,6 +174,180 @@ - New field `Location`, `SubscriptionID` in struct `VirtualNetworkSubnetUsageResult` +## 2.0.0 (2025-10-13) +### Breaking Changes + +- Type of `Operation.Origin` has been changed from `*string` to `*Origin` +- Type of `Server.Identity` has been changed from `*Identity` to `*MySQLServerIdentity` +- Type of `Server.SKU` has been changed from `*SKU` to `*MySQLServerSKU` +- Type of `ServerForUpdate.Identity` has been changed from `*Identity` to `*MySQLServerIdentity` +- Type of `ServerForUpdate.SKU` has been changed from `*SKU` to `*MySQLServerSKU` +- Enum `SKUTier` has been removed +- Struct `ErrorResponse` has been removed +- Struct `Identity` has been removed +- Struct `ProxyResource` has been removed +- Struct `Resource` has been removed +- Struct `SKU` has been removed +- Struct `TrackedResource` has been removed + +### Features Added + +- New enum type `AdministratorName` with values `AdministratorNameActiveDirectory` +- New enum type `AdministratorType` with values `AdministratorTypeActiveDirectory` +- New enum type `AdvancedThreatProtectionName` with values `AdvancedThreatProtectionNameDefault` +- New enum type `AdvancedThreatProtectionProvisioningState` with values `AdvancedThreatProtectionProvisioningStateCanceled`, `AdvancedThreatProtectionProvisioningStateFailed`, `AdvancedThreatProtectionProvisioningStateSucceeded`, `AdvancedThreatProtectionProvisioningStateUpdating` +- New enum type `AdvancedThreatProtectionState` with values `AdvancedThreatProtectionStateDisabled`, `AdvancedThreatProtectionStateEnabled` +- New enum type `BackupFormat` with values `BackupFormatCollatedFormat`, `BackupFormatRaw` +- New enum type `BackupType` with values `BackupTypeFULL` +- New enum type `BatchOfMaintenance` with values `BatchOfMaintenanceBatch1`, `BatchOfMaintenanceBatch2`, `BatchOfMaintenanceDefault` +- New enum type `ImportSourceStorageType` with values `ImportSourceStorageTypeAzureBlob` +- New enum type `MaintenanceProvisioningState` with values `MaintenanceProvisioningStateCreating`, `MaintenanceProvisioningStateDeleting`, `MaintenanceProvisioningStateFailed`, `MaintenanceProvisioningStateSucceeded` +- New enum type `MaintenanceState` with values `MaintenanceStateCanceled`, `MaintenanceStateCompleted`, `MaintenanceStateInPreparation`, `MaintenanceStateProcessing`, `MaintenanceStateReScheduled`, `MaintenanceStateScheduled` +- New enum type `MaintenanceType` with values `MaintenanceTypeHotFixes`, `MaintenanceTypeMinorVersionUpgrade`, `MaintenanceTypeRoutineMaintenance`, `MaintenanceTypeSecurityPatches` +- New enum type `ManagedServiceIdentityType` with values `ManagedServiceIdentityTypeUserAssigned` +- New enum type `ObjectType` with values `ObjectTypeBackupAndExportResponse`, `ObjectTypeImportFromStorageResponse` +- New enum type `OperationStatus` with values `OperationStatusCancelInProgress`, `OperationStatusCanceled`, `OperationStatusFailed`, `OperationStatusInProgress`, `OperationStatusPending`, `OperationStatusSucceeded` +- New enum type `Origin` with values `OriginSystem`, `OriginUser`, `OriginUserSystem` +- New enum type `PatchStrategy` with values `PatchStrategyRegular`, `PatchStrategyVirtualCanary` +- New enum type `PrivateEndpointConnectionProvisioningState` with values `PrivateEndpointConnectionProvisioningStateCreating`, `PrivateEndpointConnectionProvisioningStateDeleting`, `PrivateEndpointConnectionProvisioningStateFailed`, `PrivateEndpointConnectionProvisioningStateSucceeded` +- New enum type `PrivateEndpointServiceConnectionStatus` with values `PrivateEndpointServiceConnectionStatusApproved`, `PrivateEndpointServiceConnectionStatusPending`, `PrivateEndpointServiceConnectionStatusRejected` +- New enum type `ProvisioningState` with values `ProvisioningStateCanceled`, `ProvisioningStateCreating`, `ProvisioningStateDeleting`, `ProvisioningStateFailed`, `ProvisioningStateSucceeded` +- New enum type `ResetAllToDefault` with values `ResetAllToDefaultFalse`, `ResetAllToDefaultTrue` +- New enum type `ServerSKUTier` with values `ServerSKUTierBurstable`, `ServerSKUTierGeneralPurpose`, `ServerSKUTierMemoryOptimized` +- New enum type `StorageRedundancyEnum` with values `StorageRedundancyEnumLocalRedundancy`, `StorageRedundancyEnumZoneRedundancy` +- New function `NewAdvancedThreatProtectionSettingsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AdvancedThreatProtectionSettingsClient, error)` +- New function `*AdvancedThreatProtectionSettingsClient.Get(context.Context, string, string, AdvancedThreatProtectionName, *AdvancedThreatProtectionSettingsClientGetOptions) (AdvancedThreatProtectionSettingsClientGetResponse, error)` +- New function `*AdvancedThreatProtectionSettingsClient.NewListPager(string, string, *AdvancedThreatProtectionSettingsClientListOptions) *runtime.Pager[AdvancedThreatProtectionSettingsClientListResponse]` +- New function `*AdvancedThreatProtectionSettingsClient.BeginUpdate(context.Context, string, string, AdvancedThreatProtectionName, AdvancedThreatProtectionForUpdate, *AdvancedThreatProtectionSettingsClientBeginUpdateOptions) (*runtime.Poller[AdvancedThreatProtectionSettingsClientUpdateResponse], error)` +- New function `*AdvancedThreatProtectionSettingsClient.BeginUpdatePut(context.Context, string, string, AdvancedThreatProtectionName, AdvancedThreatProtection, *AdvancedThreatProtectionSettingsClientBeginUpdatePutOptions) (*runtime.Poller[AdvancedThreatProtectionSettingsClientUpdatePutResponse], error)` +- New function `NewAzureADAdministratorsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AzureADAdministratorsClient, error)` +- New function `*AzureADAdministratorsClient.BeginCreateOrUpdate(context.Context, string, string, AdministratorName, AzureADAdministrator, *AzureADAdministratorsClientBeginCreateOrUpdateOptions) (*runtime.Poller[AzureADAdministratorsClientCreateOrUpdateResponse], error)` +- New function `*AzureADAdministratorsClient.BeginDelete(context.Context, string, string, AdministratorName, *AzureADAdministratorsClientBeginDeleteOptions) (*runtime.Poller[AzureADAdministratorsClientDeleteResponse], error)` +- New function `*AzureADAdministratorsClient.Get(context.Context, string, string, AdministratorName, *AzureADAdministratorsClientGetOptions) (AzureADAdministratorsClientGetResponse, error)` +- New function `*AzureADAdministratorsClient.NewListByServerPager(string, string, *AzureADAdministratorsClientListByServerOptions) *runtime.Pager[AzureADAdministratorsClientListByServerResponse]` +- New function `NewBackupAndExportClient(string, azcore.TokenCredential, *arm.ClientOptions) (*BackupAndExportClient, error)` +- New function `*BackupAndExportClient.BeginCreate(context.Context, string, string, BackupAndExportRequest, *BackupAndExportClientBeginCreateOptions) (*runtime.Poller[BackupAndExportClientCreateResponse], error)` +- New function `*BackupAndExportClient.ValidateBackup(context.Context, string, string, *BackupAndExportClientValidateBackupOptions) (BackupAndExportClientValidateBackupResponse, error)` +- New function `*BackupAndExportResponseType.GetOperationProgressResponseType() *OperationProgressResponseType` +- New function `*BackupStoreDetails.GetBackupStoreDetails() *BackupStoreDetails` +- New function `*BackupsClient.Put(context.Context, string, string, string, *BackupsClientPutOptions) (BackupsClientPutResponse, error)` +- New function `NewCheckNameAvailabilityWithoutLocationClient(string, azcore.TokenCredential, *arm.ClientOptions) (*CheckNameAvailabilityWithoutLocationClient, error)` +- New function `*CheckNameAvailabilityWithoutLocationClient.Execute(context.Context, NameAvailabilityRequest, *CheckNameAvailabilityWithoutLocationClientExecuteOptions) (CheckNameAvailabilityWithoutLocationClientExecuteResponse, error)` +- New function `*ClientFactory.NewAdvancedThreatProtectionSettingsClient() *AdvancedThreatProtectionSettingsClient` +- New function `*ClientFactory.NewAzureADAdministratorsClient() *AzureADAdministratorsClient` +- New function `*ClientFactory.NewBackupAndExportClient() *BackupAndExportClient` +- New function `*ClientFactory.NewCheckNameAvailabilityWithoutLocationClient() *CheckNameAvailabilityWithoutLocationClient` +- New function `*ClientFactory.NewLocationBasedCapabilitySetClient() *LocationBasedCapabilitySetClient` +- New function `*ClientFactory.NewLogFilesClient() *LogFilesClient` +- New function `*ClientFactory.NewLongRunningBackupClient() *LongRunningBackupClient` +- New function `*ClientFactory.NewLongRunningBackupsClient() *LongRunningBackupsClient` +- New function `*ClientFactory.NewMaintenancesClient() *MaintenancesClient` +- New function `*ClientFactory.NewOperationProgressClient() *OperationProgressClient` +- New function `*ClientFactory.NewOperationResultsClient() *OperationResultsClient` +- New function `*ClientFactory.NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient` +- New function `*ClientFactory.NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient` +- New function `*ClientFactory.NewServersMigrationClient() *ServersMigrationClient` +- New function `*ConfigurationsClient.BeginCreateOrUpdate(context.Context, string, string, string, Configuration, *ConfigurationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ConfigurationsClientCreateOrUpdateResponse], error)` +- New function `*FullBackupStoreDetails.GetBackupStoreDetails() *BackupStoreDetails` +- New function `*ImportFromStorageResponseType.GetOperationProgressResponseType() *OperationProgressResponseType` +- New function `NewLocationBasedCapabilitySetClient(string, azcore.TokenCredential, *arm.ClientOptions) (*LocationBasedCapabilitySetClient, error)` +- New function `*LocationBasedCapabilitySetClient.Get(context.Context, string, string, *LocationBasedCapabilitySetClientGetOptions) (LocationBasedCapabilitySetClientGetResponse, error)` +- New function `*LocationBasedCapabilitySetClient.NewListPager(string, *LocationBasedCapabilitySetClientListOptions) *runtime.Pager[LocationBasedCapabilitySetClientListResponse]` +- New function `NewLogFilesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*LogFilesClient, error)` +- New function `*LogFilesClient.NewListByServerPager(string, string, *LogFilesClientListByServerOptions) *runtime.Pager[LogFilesClientListByServerResponse]` +- New function `NewLongRunningBackupClient(string, azcore.TokenCredential, *arm.ClientOptions) (*LongRunningBackupClient, error)` +- New function `*LongRunningBackupClient.BeginCreate(context.Context, string, string, string, ServerBackupV2, *LongRunningBackupClientBeginCreateOptions) (*runtime.Poller[LongRunningBackupClientCreateResponse], error)` +- New function `NewLongRunningBackupsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*LongRunningBackupsClient, error)` +- New function `*LongRunningBackupsClient.Get(context.Context, string, string, string, *LongRunningBackupsClientGetOptions) (LongRunningBackupsClientGetResponse, error)` +- New function `*LongRunningBackupsClient.NewListPager(string, string, *LongRunningBackupsClientListOptions) *runtime.Pager[LongRunningBackupsClientListResponse]` +- New function `NewMaintenancesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*MaintenancesClient, error)` +- New function `*MaintenancesClient.NewListPager(string, string, *MaintenancesClientListOptions) *runtime.Pager[MaintenancesClientListResponse]` +- New function `*MaintenancesClient.Read(context.Context, string, string, string, *MaintenancesClientReadOptions) (MaintenancesClientReadResponse, error)` +- New function `*MaintenancesClient.BeginUpdate(context.Context, string, string, string, MaintenanceUpdate, *MaintenancesClientBeginUpdateOptions) (*runtime.Poller[MaintenancesClientUpdateResponse], error)` +- New function `NewOperationProgressClient(string, azcore.TokenCredential, *arm.ClientOptions) (*OperationProgressClient, error)` +- New function `*OperationProgressClient.Get(context.Context, string, string, *OperationProgressClientGetOptions) (OperationProgressClientGetResponse, error)` +- New function `*OperationProgressResponseType.GetOperationProgressResponseType() *OperationProgressResponseType` +- New function `NewOperationResultsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*OperationResultsClient, error)` +- New function `*OperationResultsClient.Get(context.Context, string, string, *OperationResultsClientGetOptions) (OperationResultsClientGetResponse, error)` +- New function `NewPrivateEndpointConnectionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error)` +- New function `*PrivateEndpointConnectionsClient.BeginCreateOrUpdate(context.Context, string, string, string, PrivateEndpointConnection, *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PrivateEndpointConnectionsClientCreateOrUpdateResponse], error)` +- New function `*PrivateEndpointConnectionsClient.BeginDelete(context.Context, string, string, string, *PrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error)` +- New function `*PrivateEndpointConnectionsClient.Get(context.Context, string, string, string, *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error)` +- New function `*PrivateEndpointConnectionsClient.ListByServer(context.Context, string, string, *PrivateEndpointConnectionsClientListByServerOptions) (PrivateEndpointConnectionsClientListByServerResponse, error)` +- New function `NewPrivateLinkResourcesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*PrivateLinkResourcesClient, error)` +- New function `*PrivateLinkResourcesClient.Get(context.Context, string, string, string, *PrivateLinkResourcesClientGetOptions) (PrivateLinkResourcesClientGetResponse, error)` +- New function `*PrivateLinkResourcesClient.NewListByServerPager(string, string, *PrivateLinkResourcesClientListByServerOptions) *runtime.Pager[PrivateLinkResourcesClientListByServerResponse]` +- New function `*ServersClient.BeginDetachVNet(context.Context, string, string, ServerDetachVNetParameter, *ServersClientBeginDetachVNetOptions) (*runtime.Poller[ServersClientDetachVNetResponse], error)` +- New function `*ServersClient.BeginResetGtid(context.Context, string, string, ServerGtidSetParameter, *ServersClientBeginResetGtidOptions) (*runtime.Poller[ServersClientResetGtidResponse], error)` +- New function `*ServersClient.ValidateEstimateHighAvailability(context.Context, string, string, HighAvailabilityValidationEstimation, *ServersClientValidateEstimateHighAvailabilityOptions) (ServersClientValidateEstimateHighAvailabilityResponse, error)` +- New function `NewServersMigrationClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ServersMigrationClient, error)` +- New function `*ServersMigrationClient.BeginCutoverMigration(context.Context, string, string, *ServersMigrationClientBeginCutoverMigrationOptions) (*runtime.Poller[ServersMigrationClientCutoverMigrationResponse], error)` +- New struct `AdministratorListResult` +- New struct `AdministratorProperties` +- New struct `AdvancedThreatProtection` +- New struct `AdvancedThreatProtectionForUpdate` +- New struct `AdvancedThreatProtectionListResult` +- New struct `AdvancedThreatProtectionProperties` +- New struct `AdvancedThreatProtectionUpdateProperties` +- New struct `AzureADAdministrator` +- New struct `BackupAndExportRequest` +- New struct `BackupAndExportResponse` +- New struct `BackupAndExportResponseProperties` +- New struct `BackupAndExportResponseType` +- New struct `BackupSettings` +- New struct `Capability` +- New struct `CapabilityPropertiesV2` +- New struct `CapabilitySetsList` +- New struct `ErrorDetail` +- New struct `FeatureProperty` +- New struct `FullBackupStoreDetails` +- New struct `HighAvailabilityValidationEstimation` +- New struct `ImportFromStorageResponseType` +- New struct `ImportSourceProperties` +- New struct `LogFile` +- New struct `LogFileListResult` +- New struct `LogFileProperties` +- New struct `Maintenance` +- New struct `MaintenanceListResult` +- New struct `MaintenancePolicy` +- New struct `MaintenanceProperties` +- New struct `MaintenancePropertiesForUpdate` +- New struct `MaintenanceUpdate` +- New struct `MySQLServerIdentity` +- New struct `MySQLServerSKU` +- New struct `OperationProgressResult` +- New struct `OperationStatusExtendedResult` +- New struct `OperationStatusResult` +- New struct `PrivateEndpoint` +- New struct `PrivateEndpointConnection` +- New struct `PrivateEndpointConnectionListResult` +- New struct `PrivateEndpointConnectionProperties` +- New struct `PrivateLinkResource` +- New struct `PrivateLinkResourceListResult` +- New struct `PrivateLinkResourceProperties` +- New struct `PrivateLinkServiceConnectionState` +- New struct `SKUCapabilityV2` +- New struct `ServerBackupPropertiesV2` +- New struct `ServerBackupV2` +- New struct `ServerBackupV2ListResult` +- New struct `ServerDetachVNetParameter` +- New struct `ServerEditionCapabilityV2` +- New struct `ServerGtidSetParameter` +- New struct `ServerVersionCapabilityV2` +- New struct `ValidateBackupResponse` +- New struct `ValidateBackupResponseProperties` +- New field `BackupIntervalHours` in struct `Backup` +- New field `ResetAllToDefault` in struct `ConfigurationListForBatchUpdate` +- New field `CurrentValue`, `DocumentationLink` in struct `ConfigurationProperties` +- New field `Keyword`, `Page`, `PageSize`, `Tags` in struct `ConfigurationsClientListByServerOptions` +- New field `BatchOfMaintenance` in struct `MaintenanceWindow` +- New field `DatabasePort`, `FullVersion`, `ImportSourceProperties`, `MaintenancePolicy`, `PrivateEndpointConnections` in struct `ServerProperties` +- New field `MaintenancePolicy`, `Network`, `Version` in struct `ServerPropertiesForUpdate` +- New field `AutoIoScaling`, `LogOnDisk`, `StorageRedundancy` in struct `Storage` +- New field `MaxBackupIntervalHours`, `MinBackupIntervalHours` in struct `StorageEditionCapability` +- New field `Location`, `SubscriptionID` in struct `VirtualNetworkSubnetUsageResult` + + ## 2.0.0-beta.4 (2025-02-27) ### Features Added