From cd8f6b589deabd75575ac20258834414a0803d05 Mon Sep 17 00:00:00 2001 From: Peng Jiahui <46921893+Alancere@users.noreply.github.com> Date: Thu, 23 Nov 2023 11:25:13 +0800 Subject: [PATCH] [Release] sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/4.0.0-beta.3 (#22012) * [Release] sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/4.0.0-beta.3 generation from spec commit: bf204aab860f2eb58a9d346b00d44760f2a9b0a2 * fix --- .../armpostgresqlflexibleservers/CHANGELOG.md | 79 + .../administrators_client.go | 22 +- .../administrators_client_example_test.go | 10 +- .../armpostgresqlflexibleservers/autorest.md | 8 +- .../backups_client.go | 10 +- .../backups_client_example_test.go | 6 +- .../checknameavailability_client.go | 6 +- ...ecknameavailability_client_example_test.go | 4 +- ...hecknameavailabilitywithlocation_client.go | 6 +- ...abilitywithlocation_client_example_test.go | 4 +- .../client_factory.go | 74 +- .../configurations_client.go | 22 +- .../configurations_client_example_test.go | 8 +- .../armpostgresqlflexibleservers/constants.go | 715 +- .../databases_client.go | 22 +- .../databases_client_example_test.go | 10 +- .../fake/administrators_server.go | 2 +- .../fake/backups_server.go | 2 +- .../fake/checknameavailability_server.go | 2 +- ...hecknameavailabilitywithlocation_server.go | 2 +- .../fake/configurations_server.go | 2 +- .../fake/databases_server.go | 2 +- .../fake/firewallrules_server.go | 2 +- .../fake/flexibleserver_server.go | 165 + .../fake/getprivatednszonesuffix_server.go | 2 +- .../fake/internal.go | 16 + .../fake/locationbasedcapabilities_server.go | 2 +- .../fake/logfiles_server.go | 112 + .../fake/ltrbackupoperations_server.go | 156 + .../fake/migrations_server.go | 325 + .../fake/operations_server.go | 2 +- .../fake/postgresqlmanagement_server.go | 108 + .../fake/privateendpointconnection_server.go | 179 + .../fake/privateendpointconnections_server.go | 156 + .../fake/privatelinkresources_server.go | 156 + .../fake/quotausages_server.go | 108 + .../fake/replicas_server.go | 2 +- .../fake/server_factory.go | 78 + .../fake/servercapabilities_server.go | 112 + .../fake/servers_server.go | 2 +- .../serverthreatprotectionsettings_server.go | 228 + .../fake/virtualendpoints_server.go | 332 + .../fake/virtualnetworksubnetusage_server.go | 2 +- .../firewallrules_client.go | 22 +- .../firewallrules_client_example_test.go | 10 +- .../flexibleserver_client.go | 198 + .../flexibleserver_client_example_test.go | 91 + .../getprivatednszonesuffix_client.go | 4 +- ...rivatednszonesuffix_client_example_test.go | 4 +- .../armpostgresqlflexibleservers/go.mod | 2 +- .../locationbasedcapabilities_client.go | 6 +- ...onbasedcapabilities_client_example_test.go | 9632 +++-------------- .../logfiles_client.go | 109 + .../logfiles_client_example_test.go | 58 + .../ltrbackupoperations_client.go | 178 + ...ltrbackupoperations_client_example_test.go | 96 + .../migrations_client.go | 389 + .../migrations_client_example_test.go | 1073 ++ .../armpostgresqlflexibleservers/models.go | 1080 +- .../models_serde.go | 2521 ++++- .../operations_client.go | 4 +- .../operations_client_example_test.go | 4 +- .../armpostgresqlflexibleservers/options.go | 157 + .../postgresqlmanagement_client.go | 111 + ...ostgresqlmanagement_client_example_test.go | 47 + .../privateendpointconnection_client.go | 211 + ...eendpointconnection_client_example_test.go | 89 + .../privateendpointconnections_client.go | 179 + ...endpointconnections_client_example_test.go | 120 + .../privatelinkresources_client.go | 179 + ...rivatelinkresources_client_example_test.go | 90 + .../quotausages_client.go | 103 + .../quotausages_client_example_test.go | 66 + .../replicas_client.go | 6 +- .../replicas_client_example_test.go | 12 +- .../response_types.go | 164 +- .../servercapabilities_client.go | 109 + .../servercapabilities_client_example_test.go | 1706 +++ .../servers_client.go | 50 +- .../servers_client_example_test.go | 737 +- .../serverthreatprotectionsettings_client.go | 265 + ...tprotectionsettings_client_example_test.go | 122 + .../virtualendpoints_client.go | 434 + .../virtualendpoints_client_example_test.go | 200 + .../virtualnetworksubnetusage_client.go | 6 +- ...lnetworksubnetusage_client_example_test.go | 4 +- 86 files changed, 15314 insertions(+), 8597 deletions(-) create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/flexibleserver_server.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/logfiles_server.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/ltrbackupoperations_server.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/migrations_server.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/postgresqlmanagement_server.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privateendpointconnection_server.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privateendpointconnections_server.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privatelinkresources_server.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/quotausages_server.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/servercapabilities_server.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/serverthreatprotectionsettings_server.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/virtualendpoints_server.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client_example_test.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/logfiles_client.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/logfiles_client_example_test.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_client.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_client_example_test.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client_example_test.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlmanagement_client.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlmanagement_client_example_test.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnection_client.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnection_client_example_test.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client_example_test.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client_example_test.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/quotausages_client.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/quotausages_client_example_test.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client_example_test.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client_example_test.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client.go create mode 100644 sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client_example_test.go diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/CHANGELOG.md b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/CHANGELOG.md index 36494ac492b3..33d2f211a803 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/CHANGELOG.md +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/CHANGELOG.md @@ -1,5 +1,84 @@ # Release History +## 4.0.0-beta.3 (2023-11-24) +### Features Added + +- New value `MigrationStateCleaningUp`, `MigrationStateValidationFailed` added to enum type `MigrationState` +- New value `MigrationSubStateCancelingRequestedDBMigrations`, `MigrationSubStateValidationInProgress` added to enum type `MigrationSubState` +- New value `ServerVersionSixteen` added to enum type `ServerVersion` +- New enum type `MigrationDbState` with values `MigrationDbStateCanceled`, `MigrationDbStateCanceling`, `MigrationDbStateFailed`, `MigrationDbStateInProgress`, `MigrationDbStateSucceeded`, `MigrationDbStateWaitingForCutoverTrigger` +- New enum type `MigrationOption` with values `MigrationOptionMigrate`, `MigrationOptionValidate`, `MigrationOptionValidateAndMigrate` +- New enum type `PrivateEndpointConnectionProvisioningState` with values `PrivateEndpointConnectionProvisioningStateCreating`, `PrivateEndpointConnectionProvisioningStateDeleting`, `PrivateEndpointConnectionProvisioningStateFailed`, `PrivateEndpointConnectionProvisioningStateSucceeded` +- New enum type `PrivateEndpointServiceConnectionStatus` with values `PrivateEndpointServiceConnectionStatusApproved`, `PrivateEndpointServiceConnectionStatusPending`, `PrivateEndpointServiceConnectionStatusRejected` +- New enum type `ReadReplicaPromoteMode` with values `ReadReplicaPromoteModeStandalone`, `ReadReplicaPromoteModeSwitchover` +- New enum type `ReplicationPromoteOption` with values `ReplicationPromoteOptionForced`, `ReplicationPromoteOptionPlanned` +- New enum type `ReplicationState` with values `ReplicationStateActive`, `ReplicationStateBroken`, `ReplicationStateCatchup`, `ReplicationStateProvisioning`, `ReplicationStateReconfiguring`, `ReplicationStateUpdating` +- New enum type `SSLMode` with values `SSLModePrefer`, `SSLModeRequire`, `SSLModeVerifyCA`, `SSLModeVerifyFull` +- New enum type `SourceType` with values `SourceTypeAWS`, `SourceTypeAzureVM`, `SourceTypeGCP`, `SourceTypeOnPremises`, `SourceTypePostgreSQLSingleServer` +- New enum type `StorageType` with values `StorageTypePremiumLRS`, `StorageTypePremiumV2LRS` +- New enum type `ThreatProtectionName` with values `ThreatProtectionNameDefault` +- New enum type `ThreatProtectionState` with values `ThreatProtectionStateDisabled`, `ThreatProtectionStateEnabled` +- New enum type `ValidationState` with values `ValidationStateFailed`, `ValidationStateSucceeded`, `ValidationStateWarning` +- New enum type `VirtualEndpointType` with values `VirtualEndpointTypeReadWrite` +- New function `*ClientFactory.NewPrivateEndpointConnectionClient() *PrivateEndpointConnectionClient` +- New function `*ClientFactory.NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient` +- New function `*ClientFactory.NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient` +- New function `*ClientFactory.NewQuotaUsagesClient() *QuotaUsagesClient` +- New function `*ClientFactory.NewServerThreatProtectionSettingsClient() *ServerThreatProtectionSettingsClient` +- New function `*ClientFactory.NewVirtualEndpointsClient() *VirtualEndpointsClient` +- New function `NewPrivateEndpointConnectionClient(string, azcore.TokenCredential, *arm.ClientOptions) (*PrivateEndpointConnectionClient, error)` +- New function `*PrivateEndpointConnectionClient.BeginDelete(context.Context, string, string, string, *PrivateEndpointConnectionClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionClientDeleteResponse], error)` +- New function `*PrivateEndpointConnectionClient.BeginUpdate(context.Context, string, string, string, PrivateEndpointConnection, *PrivateEndpointConnectionClientBeginUpdateOptions) (*runtime.Poller[PrivateEndpointConnectionClientUpdateResponse], error)` +- New function `NewPrivateEndpointConnectionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error)` +- New function `*PrivateEndpointConnectionsClient.Get(context.Context, string, string, string, *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error)` +- New function `*PrivateEndpointConnectionsClient.NewListByServerPager(string, string, *PrivateEndpointConnectionsClientListByServerOptions) *runtime.Pager[PrivateEndpointConnectionsClientListByServerResponse]` +- 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 `NewQuotaUsagesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*QuotaUsagesClient, error)` +- New function `*QuotaUsagesClient.NewListPager(string, *QuotaUsagesClientListOptions) *runtime.Pager[QuotaUsagesClientListResponse]` +- New function `NewServerThreatProtectionSettingsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ServerThreatProtectionSettingsClient, error)` +- New function `*ServerThreatProtectionSettingsClient.BeginCreateOrUpdate(context.Context, string, string, ThreatProtectionName, ServerThreatProtectionSettingsModel, *ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerThreatProtectionSettingsClientCreateOrUpdateResponse], error)` +- New function `*ServerThreatProtectionSettingsClient.Get(context.Context, string, string, ThreatProtectionName, *ServerThreatProtectionSettingsClientGetOptions) (ServerThreatProtectionSettingsClientGetResponse, error)` +- New function `*ServerThreatProtectionSettingsClient.NewListByServerPager(string, string, *ServerThreatProtectionSettingsClientListByServerOptions) *runtime.Pager[ServerThreatProtectionSettingsClientListByServerResponse]` +- New function `NewVirtualEndpointsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*VirtualEndpointsClient, error)` +- New function `*VirtualEndpointsClient.BeginCreate(context.Context, string, string, string, VirtualEndpointResource, *VirtualEndpointsClientBeginCreateOptions) (*runtime.Poller[VirtualEndpointsClientCreateResponse], error)` +- New function `*VirtualEndpointsClient.BeginDelete(context.Context, string, string, string, *VirtualEndpointsClientBeginDeleteOptions) (*runtime.Poller[VirtualEndpointsClientDeleteResponse], error)` +- New function `*VirtualEndpointsClient.Get(context.Context, string, string, string, *VirtualEndpointsClientGetOptions) (VirtualEndpointsClientGetResponse, error)` +- New function `*VirtualEndpointsClient.NewListByServerPager(string, string, *VirtualEndpointsClientListByServerOptions) *runtime.Pager[VirtualEndpointsClientListByServerResponse]` +- New function `*VirtualEndpointsClient.BeginUpdate(context.Context, string, string, string, VirtualEndpointResourceForPatch, *VirtualEndpointsClientBeginUpdateOptions) (*runtime.Poller[VirtualEndpointsClientUpdateResponse], error)` +- New struct `DbLevelValidationStatus` +- New struct `DbMigrationStatus` +- New struct `NameProperty` +- 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 `QuotaUsage` +- New struct `QuotaUsagesListResult` +- New struct `Replica` +- New struct `ServerThreatProtectionListResult` +- New struct `ServerThreatProtectionProperties` +- New struct `ServerThreatProtectionSettingsModel` +- New struct `ValidationDetails` +- New struct `ValidationMessage` +- New struct `ValidationSummaryItem` +- New struct `VirtualEndpointResource` +- New struct `VirtualEndpointResourceForPatch` +- New struct `VirtualEndpointResourceProperties` +- New struct `VirtualEndpointsListResult` +- New field `MigrationOption`, `SSLMode`, `SourceType` in struct `MigrationResourceProperties` +- New field `DbDetails`, `ValidationDetails` in struct `MigrationSubStateDetails` +- New field `PrivateEndpointConnections`, `Replica` in struct `ServerProperties` +- New field `Replica` in struct `ServerPropertiesForUpdate` +- New field `Throughput`, `Type` in struct `Storage` +- New field `MaximumStorageSizeMb`, `SupportedMaximumIops`, `SupportedMaximumThroughput`, `SupportedThroughput` in struct `StorageMbCapability` + + ## 3.1.0 (2023-11-24) ### Features Added diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administrators_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administrators_client.go index 22c5c93f99a3..7669b282920e 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administrators_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administrators_client.go @@ -28,7 +28,7 @@ type AdministratorsClient struct { } // NewAdministratorsClient creates a new instance of AdministratorsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - 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 NewAdministratorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AdministratorsClient, error) { @@ -46,7 +46,7 @@ func NewAdministratorsClient(subscriptionID string, credential azcore.TokenCrede // BeginCreate - Creates a new server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - objectID - Guid of the objectId for the administrator. @@ -74,7 +74,7 @@ func (client *AdministratorsClient) BeginCreate(ctx context.Context, resourceGro // Create - Creates a new server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview func (client *AdministratorsClient) create(ctx context.Context, resourceGroupName string, serverName string, objectID string, parameters ActiveDirectoryAdministratorAdd, options *AdministratorsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "AdministratorsClient.BeginCreate" @@ -120,7 +120,7 @@ func (client *AdministratorsClient) createCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -132,7 +132,7 @@ func (client *AdministratorsClient) createCreateRequest(ctx context.Context, res // BeginDelete - Deletes an Active Directory Administrator associated with the server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - objectID - Guid of the objectId for the administrator. @@ -159,7 +159,7 @@ func (client *AdministratorsClient) BeginDelete(ctx context.Context, resourceGro // Delete - Deletes an Active Directory Administrator associated with the server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview func (client *AdministratorsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, objectID string, options *AdministratorsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AdministratorsClient.BeginDelete" @@ -205,7 +205,7 @@ func (client *AdministratorsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,7 @@ func (client *AdministratorsClient) deleteCreateRequest(ctx context.Context, res // Get - Gets information about a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - objectID - Guid of the objectId for the administrator. @@ -265,7 +265,7 @@ func (client *AdministratorsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +282,7 @@ func (client *AdministratorsClient) getHandleResponse(resp *http.Response) (Admi // NewListByServerPager - List all the AAD administrators for a given server. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - AdministratorsClientListByServerOptions contains the optional parameters for the AdministratorsClient.NewListByServerPager @@ -330,7 +330,7 @@ func (client *AdministratorsClient) listByServerCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administrators_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administrators_client_example_test.go index b10e5b87f471..e90601f15ac7 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administrators_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administrators_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/AdministratorAdd.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorAdd.json func ExampleAdministratorsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -58,7 +58,7 @@ func ExampleAdministratorsClient_BeginCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/AdministratorDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorDelete.json func ExampleAdministratorsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -79,7 +79,7 @@ func ExampleAdministratorsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/AdministratorGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorGet.json func ExampleAdministratorsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -110,7 +110,7 @@ func ExampleAdministratorsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/AdministratorsListByServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorsListByServer.json func ExampleAdministratorsClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/autorest.md b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/autorest.md index 6b0dbb13511d..68800d8ec8c1 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/autorest.md +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/autorest.md @@ -5,10 +5,10 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 3.1.0 +module-version: 4.0.0-beta.3 package-flexibleservers: true -tag: package-flexibleserver-2022-12-01 +tag: package-flexibleserver-2023-06-01-preview ``` \ No newline at end of file diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backups_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backups_client.go index a83ae732e42c..e96c10c6314f 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backups_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backups_client.go @@ -28,7 +28,7 @@ type BackupsClient struct { } // NewBackupsClient creates a new instance of BackupsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - 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 NewBackupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupsClient, error) { @@ -46,7 +46,7 @@ func NewBackupsClient(subscriptionID string, credential azcore.TokenCredential, // Get - Get specific backup for a given server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - backupName - The name of the backup. @@ -97,7 +97,7 @@ func (client *BackupsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,7 +114,7 @@ func (client *BackupsClient) getHandleResponse(resp *http.Response) (BackupsClie // NewListByServerPager - List all the backups for a given server. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - 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 @@ -162,7 +162,7 @@ func (client *BackupsClient) listByServerCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backups_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backups_client_example_test.go index 9bcc4769681b..61b13b76270d 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backups_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backups_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/BackupGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/BackupGet.json func ExampleBackupsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -47,7 +47,7 @@ func ExampleBackupsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/BackupListByServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/BackupListByServer.json func ExampleBackupsClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailability_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailability_client.go index f8e4378721ee..00a44a5a1930 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailability_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailability_client.go @@ -28,7 +28,7 @@ type CheckNameAvailabilityClient struct { } // NewCheckNameAvailabilityClient creates a new instance of CheckNameAvailabilityClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - 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 NewCheckNameAvailabilityClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CheckNameAvailabilityClient, error) { @@ -46,7 +46,7 @@ func NewCheckNameAvailabilityClient(subscriptionID string, credential azcore.Tok // Execute - Check the availability of name for resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - nameAvailabilityRequest - The required parameters for checking if resource name is available. // - options - CheckNameAvailabilityClientExecuteOptions contains the optional parameters for the CheckNameAvailabilityClient.Execute // method. @@ -84,7 +84,7 @@ func (client *CheckNameAvailabilityClient) executeCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, nameAvailabilityRequest); err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailability_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailability_client_example_test.go index 1973bfd79235..b34788d0a9c8 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailability_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailability_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/CheckNameAvailability.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CheckNameAvailability.json func ExampleCheckNameAvailabilityClient_Execute() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client.go index 2a7cfc19fc62..cdee7f0ae139 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client.go @@ -28,7 +28,7 @@ type CheckNameAvailabilityWithLocationClient struct { } // NewCheckNameAvailabilityWithLocationClient creates a new instance of CheckNameAvailabilityWithLocationClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - 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 NewCheckNameAvailabilityWithLocationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CheckNameAvailabilityWithLocationClient, error) { @@ -46,7 +46,7 @@ func NewCheckNameAvailabilityWithLocationClient(subscriptionID string, credentia // Execute - Check the availability of name for resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - locationName - The name of the location. // - nameAvailabilityRequest - The required parameters for checking if resource name is available. // - options - CheckNameAvailabilityWithLocationClientExecuteOptions contains the optional parameters for the CheckNameAvailabilityWithLocationClient.Execute @@ -89,7 +89,7 @@ func (client *CheckNameAvailabilityWithLocationClient) executeCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, nameAvailabilityRequest); err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client_example_test.go index 9df7ef73a914..d6523cbc9dad 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/CheckNameAvailabilityLocationBased.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CheckNameAvailabilityLocationBased.json func ExampleCheckNameAvailabilityWithLocationClient_Execute() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/client_factory.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/client_factory.go index fcf719a22772..fe7dd79b970a 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/client_factory.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/client_factory.go @@ -23,7 +23,7 @@ type ClientFactory struct { // NewClientFactory creates a new instance of ClientFactory with the specified values. // The parameter values will be propagated to any client created from this factory. -// - subscriptionID - The ID of the target subscription. +// - 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 NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { @@ -79,6 +79,12 @@ func (c *ClientFactory) NewFirewallRulesClient() *FirewallRulesClient { return subClient } +// NewFlexibleServerClient creates a new instance of FlexibleServerClient. +func (c *ClientFactory) NewFlexibleServerClient() *FlexibleServerClient { + subClient, _ := NewFlexibleServerClient(c.subscriptionID, c.credential, c.options) + return subClient +} + // NewGetPrivateDNSZoneSuffixClient creates a new instance of GetPrivateDNSZoneSuffixClient. func (c *ClientFactory) NewGetPrivateDNSZoneSuffixClient() *GetPrivateDNSZoneSuffixClient { subClient, _ := NewGetPrivateDNSZoneSuffixClient(c.credential, c.options) @@ -91,24 +97,90 @@ func (c *ClientFactory) NewLocationBasedCapabilitiesClient() *LocationBasedCapab return subClient } +// NewLogFilesClient creates a new instance of LogFilesClient. +func (c *ClientFactory) NewLogFilesClient() *LogFilesClient { + subClient, _ := NewLogFilesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewLtrBackupOperationsClient creates a new instance of LtrBackupOperationsClient. +func (c *ClientFactory) NewLtrBackupOperationsClient() *LtrBackupOperationsClient { + subClient, _ := NewLtrBackupOperationsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewMigrationsClient creates a new instance of MigrationsClient. +func (c *ClientFactory) NewMigrationsClient() *MigrationsClient { + subClient, _ := NewMigrationsClient(c.credential, c.options) + return subClient +} + // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { subClient, _ := NewOperationsClient(c.credential, c.options) return subClient } +// NewPostgreSQLManagementClient creates a new instance of PostgreSQLManagementClient. +func (c *ClientFactory) NewPostgreSQLManagementClient() *PostgreSQLManagementClient { + subClient, _ := NewPostgreSQLManagementClient(c.credential, c.options) + return subClient +} + +// NewPrivateEndpointConnectionClient creates a new instance of PrivateEndpointConnectionClient. +func (c *ClientFactory) NewPrivateEndpointConnectionClient() *PrivateEndpointConnectionClient { + subClient, _ := NewPrivateEndpointConnectionClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient. +func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { + subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient. +func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient { + subClient, _ := NewPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewQuotaUsagesClient creates a new instance of QuotaUsagesClient. +func (c *ClientFactory) NewQuotaUsagesClient() *QuotaUsagesClient { + subClient, _ := NewQuotaUsagesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + // NewReplicasClient creates a new instance of ReplicasClient. func (c *ClientFactory) NewReplicasClient() *ReplicasClient { subClient, _ := NewReplicasClient(c.subscriptionID, c.credential, c.options) return subClient } +// NewServerCapabilitiesClient creates a new instance of ServerCapabilitiesClient. +func (c *ClientFactory) NewServerCapabilitiesClient() *ServerCapabilitiesClient { + subClient, _ := NewServerCapabilitiesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewServerThreatProtectionSettingsClient creates a new instance of ServerThreatProtectionSettingsClient. +func (c *ClientFactory) NewServerThreatProtectionSettingsClient() *ServerThreatProtectionSettingsClient { + subClient, _ := NewServerThreatProtectionSettingsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + // NewServersClient creates a new instance of ServersClient. func (c *ClientFactory) NewServersClient() *ServersClient { subClient, _ := NewServersClient(c.subscriptionID, c.credential, c.options) return subClient } +// NewVirtualEndpointsClient creates a new instance of VirtualEndpointsClient. +func (c *ClientFactory) NewVirtualEndpointsClient() *VirtualEndpointsClient { + subClient, _ := NewVirtualEndpointsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + // NewVirtualNetworkSubnetUsageClient creates a new instance of VirtualNetworkSubnetUsageClient. func (c *ClientFactory) NewVirtualNetworkSubnetUsageClient() *VirtualNetworkSubnetUsageClient { subClient, _ := NewVirtualNetworkSubnetUsageClient(c.subscriptionID, c.credential, c.options) diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client.go index 83c41b289b3b..6548a7dd11b4 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client.go @@ -28,7 +28,7 @@ type ConfigurationsClient struct { } // NewConfigurationsClient creates a new instance of ConfigurationsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - 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 NewConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationsClient, error) { @@ -46,7 +46,7 @@ func NewConfigurationsClient(subscriptionID string, credential azcore.TokenCrede // Get - Gets information about a configuration of server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - 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. @@ -97,7 +97,7 @@ func (client *ConfigurationsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,7 +114,7 @@ func (client *ConfigurationsClient) getHandleResponse(resp *http.Response) (Conf // NewListByServerPager - List all the configurations in a given server. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - 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 @@ -162,7 +162,7 @@ func (client *ConfigurationsClient) listByServerCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +180,7 @@ func (client *ConfigurationsClient) listByServerHandleResponse(resp *http.Respon // BeginPut - Updates a configuration of a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - 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. @@ -207,7 +207,7 @@ func (client *ConfigurationsClient) BeginPut(ctx context.Context, resourceGroupN // Put - Updates a configuration of a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview func (client *ConfigurationsClient) put(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration, options *ConfigurationsClientBeginPutOptions) (*http.Response, error) { var err error const operationName = "ConfigurationsClient.BeginPut" @@ -253,7 +253,7 @@ func (client *ConfigurationsClient) putCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -265,7 +265,7 @@ func (client *ConfigurationsClient) putCreateRequest(ctx context.Context, resour // BeginUpdate - Updates a configuration of a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - 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. @@ -293,7 +293,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 2022-12-01 +// Generated from API version 2023-06-01-preview func (client *ConfigurationsClient) update(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters ConfigurationForUpdate, options *ConfigurationsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ConfigurationsClient.BeginUpdate" @@ -339,7 +339,7 @@ func (client *ConfigurationsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client_example_test.go index 008eb514c18e..ee3e0f7c0622 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ConfigurationListByServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationListByServer.json func ExampleConfigurationsClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1931,7 +1931,7 @@ func ExampleConfigurationsClient_NewListByServerPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ConfigurationGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationGet.json func ExampleConfigurationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1964,7 +1964,7 @@ func ExampleConfigurationsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ConfigurationUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationUpdate.json func ExampleConfigurationsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/constants.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/constants.go index 6e35a92c1718..cc6fc716eac5 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/constants.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/constants.go @@ -10,7 +10,7 @@ package armpostgresqlflexibleservers const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers" - moduleVersion = "v3.1.0" + moduleVersion = "v4.0.0-beta.3" ) // ActiveDirectoryAuthEnum - If Enabled, Azure Active Directory authentication is enabled. @@ -45,6 +45,82 @@ func PossibleArmServerKeyTypeValues() []ArmServerKeyType { } } +// AzureManagedDiskPerformanceTiers - Name of storage tier for IOPS. +type AzureManagedDiskPerformanceTiers string + +const ( + AzureManagedDiskPerformanceTiersP1 AzureManagedDiskPerformanceTiers = "P1" + AzureManagedDiskPerformanceTiersP10 AzureManagedDiskPerformanceTiers = "P10" + AzureManagedDiskPerformanceTiersP15 AzureManagedDiskPerformanceTiers = "P15" + AzureManagedDiskPerformanceTiersP2 AzureManagedDiskPerformanceTiers = "P2" + AzureManagedDiskPerformanceTiersP20 AzureManagedDiskPerformanceTiers = "P20" + AzureManagedDiskPerformanceTiersP3 AzureManagedDiskPerformanceTiers = "P3" + AzureManagedDiskPerformanceTiersP30 AzureManagedDiskPerformanceTiers = "P30" + AzureManagedDiskPerformanceTiersP4 AzureManagedDiskPerformanceTiers = "P4" + AzureManagedDiskPerformanceTiersP40 AzureManagedDiskPerformanceTiers = "P40" + AzureManagedDiskPerformanceTiersP50 AzureManagedDiskPerformanceTiers = "P50" + AzureManagedDiskPerformanceTiersP6 AzureManagedDiskPerformanceTiers = "P6" + AzureManagedDiskPerformanceTiersP60 AzureManagedDiskPerformanceTiers = "P60" + AzureManagedDiskPerformanceTiersP70 AzureManagedDiskPerformanceTiers = "P70" + AzureManagedDiskPerformanceTiersP80 AzureManagedDiskPerformanceTiers = "P80" +) + +// PossibleAzureManagedDiskPerformanceTiersValues returns the possible values for the AzureManagedDiskPerformanceTiers const type. +func PossibleAzureManagedDiskPerformanceTiersValues() []AzureManagedDiskPerformanceTiers { + return []AzureManagedDiskPerformanceTiers{ + AzureManagedDiskPerformanceTiersP1, + AzureManagedDiskPerformanceTiersP10, + AzureManagedDiskPerformanceTiersP15, + AzureManagedDiskPerformanceTiersP2, + AzureManagedDiskPerformanceTiersP20, + AzureManagedDiskPerformanceTiersP3, + AzureManagedDiskPerformanceTiersP30, + AzureManagedDiskPerformanceTiersP4, + AzureManagedDiskPerformanceTiersP40, + AzureManagedDiskPerformanceTiersP50, + AzureManagedDiskPerformanceTiersP6, + AzureManagedDiskPerformanceTiersP60, + AzureManagedDiskPerformanceTiersP70, + AzureManagedDiskPerformanceTiersP80, + } +} + +// CancelEnum - To trigger cancel for entire migration we need to send this flag as True +type CancelEnum string + +const ( + CancelEnumFalse CancelEnum = "False" + CancelEnumTrue CancelEnum = "True" +) + +// PossibleCancelEnumValues returns the possible values for the CancelEnum const type. +func PossibleCancelEnumValues() []CancelEnum { + return []CancelEnum{ + CancelEnumFalse, + CancelEnumTrue, + } +} + +// CapabilityStatus - The status of the capability. +type CapabilityStatus string + +const ( + CapabilityStatusAvailable CapabilityStatus = "Available" + CapabilityStatusDefault CapabilityStatus = "Default" + CapabilityStatusDisabled CapabilityStatus = "Disabled" + CapabilityStatusVisible CapabilityStatus = "Visible" +) + +// PossibleCapabilityStatusValues returns the possible values for the CapabilityStatus const type. +func PossibleCapabilityStatusValues() []CapabilityStatus { + return []CapabilityStatus{ + CapabilityStatusAvailable, + CapabilityStatusDefault, + CapabilityStatusDisabled, + CapabilityStatusVisible, + } +} + // CheckNameAvailabilityReason - The reason why the given name is not available. type CheckNameAvailabilityReason string @@ -90,6 +166,7 @@ const ( CreateModeGeoRestore CreateMode = "GeoRestore" CreateModePointInTimeRestore CreateMode = "PointInTimeRestore" CreateModeReplica CreateMode = "Replica" + CreateModeReviveDropped CreateMode = "ReviveDropped" CreateModeUpdate CreateMode = "Update" ) @@ -101,6 +178,7 @@ func PossibleCreateModeValues() []CreateMode { CreateModeGeoRestore, CreateModePointInTimeRestore, CreateModeReplica, + CreateModeReviveDropped, CreateModeUpdate, } } @@ -141,6 +219,26 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } +// ExecutionStatus - Service-set extensible enum indicating the status of operation +type ExecutionStatus string + +const ( + ExecutionStatusCancelled ExecutionStatus = "Cancelled" + ExecutionStatusFailed ExecutionStatus = "Failed" + ExecutionStatusRunning ExecutionStatus = "Running" + ExecutionStatusSucceeded ExecutionStatus = "Succeeded" +) + +// PossibleExecutionStatusValues returns the possible values for the ExecutionStatus const type. +func PossibleExecutionStatusValues() []ExecutionStatus { + return []ExecutionStatus{ + ExecutionStatusCancelled, + ExecutionStatusFailed, + ExecutionStatusRunning, + ExecutionStatusSucceeded, + } +} + // FailoverMode - Failover mode. type FailoverMode string @@ -161,6 +259,40 @@ func PossibleFailoverModeValues() []FailoverMode { } } +// FastProvisioningSupportedEnum - Gets a value indicating whether fast provisioning is supported. "Enabled" means fast provisioning +// is supported. "Disabled" stands for fast provisioning is not supported. +type FastProvisioningSupportedEnum string + +const ( + FastProvisioningSupportedEnumDisabled FastProvisioningSupportedEnum = "Disabled" + FastProvisioningSupportedEnumEnabled FastProvisioningSupportedEnum = "Enabled" +) + +// PossibleFastProvisioningSupportedEnumValues returns the possible values for the FastProvisioningSupportedEnum const type. +func PossibleFastProvisioningSupportedEnumValues() []FastProvisioningSupportedEnum { + return []FastProvisioningSupportedEnum{ + FastProvisioningSupportedEnumDisabled, + FastProvisioningSupportedEnumEnabled, + } +} + +// GeoBackupSupportedEnum - Determines if geo-backup is supported in this region. "Enabled" means geo-backup is supported. +// "Disabled" stands for geo-back is not supported. +type GeoBackupSupportedEnum string + +const ( + GeoBackupSupportedEnumDisabled GeoBackupSupportedEnum = "Disabled" + GeoBackupSupportedEnumEnabled GeoBackupSupportedEnum = "Enabled" +) + +// PossibleGeoBackupSupportedEnumValues returns the possible values for the GeoBackupSupportedEnum const type. +func PossibleGeoBackupSupportedEnumValues() []GeoBackupSupportedEnum { + return []GeoBackupSupportedEnum{ + GeoBackupSupportedEnumDisabled, + GeoBackupSupportedEnumEnabled, + } +} + // GeoRedundantBackupEnum - A value indicating whether Geo-Redundant backup is enabled on the server. type GeoRedundantBackupEnum string @@ -177,6 +309,22 @@ func PossibleGeoRedundantBackupEnumValues() []GeoRedundantBackupEnum { } } +// HaMode - HA mode supported for a server. +type HaMode string + +const ( + HaModeSameZone HaMode = "SameZone" + HaModeZoneRedundant HaMode = "ZoneRedundant" +) + +// PossibleHaModeValues returns the possible values for the HaMode const type. +func PossibleHaModeValues() []HaMode { + return []HaMode{ + HaModeSameZone, + HaModeZoneRedundant, + } +} + // HighAvailabilityMode - The HA mode for the server. type HighAvailabilityMode string @@ -195,24 +343,223 @@ func PossibleHighAvailabilityModeValues() []HighAvailabilityMode { } } -// IdentityType - the types of identities associated with this resource; currently restricted to 'SystemAssigned and UserAssigned' +// IdentityType - the types of identities associated with this resource; currently restricted to 'None and UserAssigned' type IdentityType string const ( - IdentityTypeNone IdentityType = "None" - IdentityTypeSystemAssigned IdentityType = "SystemAssigned" - IdentityTypeUserAssigned IdentityType = "UserAssigned" + IdentityTypeNone IdentityType = "None" + IdentityTypeUserAssigned IdentityType = "UserAssigned" ) // PossibleIdentityTypeValues returns the possible values for the IdentityType const type. func PossibleIdentityTypeValues() []IdentityType { return []IdentityType{ IdentityTypeNone, - IdentityTypeSystemAssigned, IdentityTypeUserAssigned, } } +// KeyStatusEnum - Primary encryption key status for Data encryption enabled server. +type KeyStatusEnum string + +const ( + KeyStatusEnumInvalid KeyStatusEnum = "Invalid" + KeyStatusEnumValid KeyStatusEnum = "Valid" +) + +// PossibleKeyStatusEnumValues returns the possible values for the KeyStatusEnum const type. +func PossibleKeyStatusEnumValues() []KeyStatusEnum { + return []KeyStatusEnum{ + KeyStatusEnumInvalid, + KeyStatusEnumValid, + } +} + +// LogicalReplicationOnSourceDbEnum - Indicates whether to setup LogicalReplicationOnSourceDb, if needed +type LogicalReplicationOnSourceDbEnum string + +const ( + LogicalReplicationOnSourceDbEnumFalse LogicalReplicationOnSourceDbEnum = "False" + LogicalReplicationOnSourceDbEnumTrue LogicalReplicationOnSourceDbEnum = "True" +) + +// PossibleLogicalReplicationOnSourceDbEnumValues returns the possible values for the LogicalReplicationOnSourceDbEnum const type. +func PossibleLogicalReplicationOnSourceDbEnumValues() []LogicalReplicationOnSourceDbEnum { + return []LogicalReplicationOnSourceDbEnum{ + LogicalReplicationOnSourceDbEnumFalse, + LogicalReplicationOnSourceDbEnumTrue, + } +} + +// MigrationDbState - Migration db state of an individual database +type MigrationDbState string + +const ( + MigrationDbStateCanceled MigrationDbState = "Canceled" + MigrationDbStateCanceling MigrationDbState = "Canceling" + MigrationDbStateFailed MigrationDbState = "Failed" + MigrationDbStateInProgress MigrationDbState = "InProgress" + MigrationDbStateSucceeded MigrationDbState = "Succeeded" + MigrationDbStateWaitingForCutoverTrigger MigrationDbState = "WaitingForCutoverTrigger" +) + +// PossibleMigrationDbStateValues returns the possible values for the MigrationDbState const type. +func PossibleMigrationDbStateValues() []MigrationDbState { + return []MigrationDbState{ + MigrationDbStateCanceled, + MigrationDbStateCanceling, + MigrationDbStateFailed, + MigrationDbStateInProgress, + MigrationDbStateSucceeded, + MigrationDbStateWaitingForCutoverTrigger, + } +} + +type MigrationListFilter string + +const ( + MigrationListFilterActive MigrationListFilter = "Active" + MigrationListFilterAll MigrationListFilter = "All" +) + +// PossibleMigrationListFilterValues returns the possible values for the MigrationListFilter const type. +func PossibleMigrationListFilterValues() []MigrationListFilter { + return []MigrationListFilter{ + MigrationListFilterActive, + MigrationListFilterAll, + } +} + +// MigrationMode - There are two types of migration modes Online and Offline +type MigrationMode string + +const ( + MigrationModeOffline MigrationMode = "Offline" + MigrationModeOnline MigrationMode = "Online" +) + +// PossibleMigrationModeValues returns the possible values for the MigrationMode const type. +func PossibleMigrationModeValues() []MigrationMode { + return []MigrationMode{ + MigrationModeOffline, + MigrationModeOnline, + } +} + +// MigrationNameAvailabilityReason - Migration name availability reason. +type MigrationNameAvailabilityReason string + +const ( + MigrationNameAvailabilityReasonAlreadyExists MigrationNameAvailabilityReason = "AlreadyExists" + MigrationNameAvailabilityReasonInvalid MigrationNameAvailabilityReason = "Invalid" +) + +// PossibleMigrationNameAvailabilityReasonValues returns the possible values for the MigrationNameAvailabilityReason const type. +func PossibleMigrationNameAvailabilityReasonValues() []MigrationNameAvailabilityReason { + return []MigrationNameAvailabilityReason{ + MigrationNameAvailabilityReasonAlreadyExists, + MigrationNameAvailabilityReasonInvalid, + } +} + +// MigrationOption - Supported types of migration request include Validate, Migrate and ValidateAndMigrate +type MigrationOption string + +const ( + MigrationOptionMigrate MigrationOption = "Migrate" + MigrationOptionValidate MigrationOption = "Validate" + MigrationOptionValidateAndMigrate MigrationOption = "ValidateAndMigrate" +) + +// PossibleMigrationOptionValues returns the possible values for the MigrationOption const type. +func PossibleMigrationOptionValues() []MigrationOption { + return []MigrationOption{ + MigrationOptionMigrate, + MigrationOptionValidate, + MigrationOptionValidateAndMigrate, + } +} + +// MigrationState - Migration state. +type MigrationState string + +const ( + MigrationStateCanceled MigrationState = "Canceled" + MigrationStateCleaningUp MigrationState = "CleaningUp" + MigrationStateFailed MigrationState = "Failed" + MigrationStateInProgress MigrationState = "InProgress" + MigrationStateSucceeded MigrationState = "Succeeded" + MigrationStateValidationFailed MigrationState = "ValidationFailed" + MigrationStateWaitingForUserAction MigrationState = "WaitingForUserAction" +) + +// PossibleMigrationStateValues returns the possible values for the MigrationState const type. +func PossibleMigrationStateValues() []MigrationState { + return []MigrationState{ + MigrationStateCanceled, + MigrationStateCleaningUp, + MigrationStateFailed, + MigrationStateInProgress, + MigrationStateSucceeded, + MigrationStateValidationFailed, + MigrationStateWaitingForUserAction, + } +} + +// MigrationSubState - Migration sub state. +type MigrationSubState string + +const ( + MigrationSubStateCancelingRequestedDBMigrations MigrationSubState = "CancelingRequestedDBMigrations" + MigrationSubStateCompleted MigrationSubState = "Completed" + MigrationSubStateCompletingMigration MigrationSubState = "CompletingMigration" + MigrationSubStateMigratingData MigrationSubState = "MigratingData" + MigrationSubStatePerformingPreRequisiteSteps MigrationSubState = "PerformingPreRequisiteSteps" + MigrationSubStateValidationInProgress MigrationSubState = "ValidationInProgress" + MigrationSubStateWaitingForCutoverTrigger MigrationSubState = "WaitingForCutoverTrigger" + MigrationSubStateWaitingForDBsToMigrateSpecification MigrationSubState = "WaitingForDBsToMigrateSpecification" + MigrationSubStateWaitingForDataMigrationScheduling MigrationSubState = "WaitingForDataMigrationScheduling" + MigrationSubStateWaitingForDataMigrationWindow MigrationSubState = "WaitingForDataMigrationWindow" + MigrationSubStateWaitingForLogicalReplicationSetupRequestOnSourceDB MigrationSubState = "WaitingForLogicalReplicationSetupRequestOnSourceDB" + MigrationSubStateWaitingForTargetDBOverwriteConfirmation MigrationSubState = "WaitingForTargetDBOverwriteConfirmation" +) + +// PossibleMigrationSubStateValues returns the possible values for the MigrationSubState const type. +func PossibleMigrationSubStateValues() []MigrationSubState { + return []MigrationSubState{ + MigrationSubStateCancelingRequestedDBMigrations, + MigrationSubStateCompleted, + MigrationSubStateCompletingMigration, + MigrationSubStateMigratingData, + MigrationSubStatePerformingPreRequisiteSteps, + MigrationSubStateValidationInProgress, + MigrationSubStateWaitingForCutoverTrigger, + MigrationSubStateWaitingForDBsToMigrateSpecification, + MigrationSubStateWaitingForDataMigrationScheduling, + MigrationSubStateWaitingForDataMigrationWindow, + MigrationSubStateWaitingForLogicalReplicationSetupRequestOnSourceDB, + MigrationSubStateWaitingForTargetDBOverwriteConfirmation, + } +} + +// OnlineResizeSupportedEnum - A value indicating whether online resize is supported in this region for the given subscription. +// "Enabled" means storage online resize is supported. "Disabled" means storage online resize is not +// supported. +type OnlineResizeSupportedEnum string + +const ( + OnlineResizeSupportedEnumDisabled OnlineResizeSupportedEnum = "Disabled" + OnlineResizeSupportedEnumEnabled OnlineResizeSupportedEnum = "Enabled" +) + +// PossibleOnlineResizeSupportedEnumValues returns the possible values for the OnlineResizeSupportedEnum const type. +func PossibleOnlineResizeSupportedEnumValues() []OnlineResizeSupportedEnum { + return []OnlineResizeSupportedEnum{ + OnlineResizeSupportedEnumDisabled, + OnlineResizeSupportedEnumEnabled, + } +} + // OperationOrigin - The intended executor of the operation. type OperationOrigin string @@ -245,6 +592,24 @@ func PossibleOriginValues() []Origin { } } +// OverwriteDbsInTargetEnum - Indicates whether the databases on the target server can be overwritten, if already present. +// If set to False, the migration workflow will wait for a confirmation, if it detects that the database +// already exists. +type OverwriteDbsInTargetEnum string + +const ( + OverwriteDbsInTargetEnumFalse OverwriteDbsInTargetEnum = "False" + OverwriteDbsInTargetEnumTrue OverwriteDbsInTargetEnum = "True" +) + +// PossibleOverwriteDbsInTargetEnumValues returns the possible values for the OverwriteDbsInTargetEnum const type. +func PossibleOverwriteDbsInTargetEnumValues() []OverwriteDbsInTargetEnum { + return []OverwriteDbsInTargetEnum{ + OverwriteDbsInTargetEnumFalse, + OverwriteDbsInTargetEnumTrue, + } +} + // PasswordAuthEnum - If Enabled, Password authentication is enabled. type PasswordAuthEnum string @@ -281,6 +646,76 @@ func PossiblePrincipalTypeValues() []PrincipalType { } } +// PrivateEndpointConnectionProvisioningState - The current provisioning state. +type PrivateEndpointConnectionProvisioningState string + +const ( + PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" + PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" + PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" + PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" +) + +// PossiblePrivateEndpointConnectionProvisioningStateValues returns the possible values for the PrivateEndpointConnectionProvisioningState const type. +func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { + return []PrivateEndpointConnectionProvisioningState{ + PrivateEndpointConnectionProvisioningStateCreating, + PrivateEndpointConnectionProvisioningStateDeleting, + PrivateEndpointConnectionProvisioningStateFailed, + PrivateEndpointConnectionProvisioningStateSucceeded, + } +} + +// PrivateEndpointServiceConnectionStatus - The private endpoint connection status. +type PrivateEndpointServiceConnectionStatus string + +const ( + PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" + PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" + PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected" +) + +// PossiblePrivateEndpointServiceConnectionStatusValues returns the possible values for the PrivateEndpointServiceConnectionStatus const type. +func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { + return []PrivateEndpointServiceConnectionStatus{ + PrivateEndpointServiceConnectionStatusApproved, + PrivateEndpointServiceConnectionStatusPending, + PrivateEndpointServiceConnectionStatusRejected, + } +} + +// ReadReplicaPromoteMode - Sets the promote mode for a replica server. This is a write only property. +type ReadReplicaPromoteMode string + +const ( + ReadReplicaPromoteModeStandalone ReadReplicaPromoteMode = "standalone" + ReadReplicaPromoteModeSwitchover ReadReplicaPromoteMode = "switchover" +) + +// PossibleReadReplicaPromoteModeValues returns the possible values for the ReadReplicaPromoteMode const type. +func PossibleReadReplicaPromoteModeValues() []ReadReplicaPromoteMode { + return []ReadReplicaPromoteMode{ + ReadReplicaPromoteModeStandalone, + ReadReplicaPromoteModeSwitchover, + } +} + +// ReplicationPromoteOption - Sets the promote options for a replica server. This is a write only property. +type ReplicationPromoteOption string + +const ( + ReplicationPromoteOptionForced ReplicationPromoteOption = "forced" + ReplicationPromoteOptionPlanned ReplicationPromoteOption = "planned" +) + +// PossibleReplicationPromoteOptionValues returns the possible values for the ReplicationPromoteOption const type. +func PossibleReplicationPromoteOptionValues() []ReplicationPromoteOption { + return []ReplicationPromoteOption{ + ReplicationPromoteOptionForced, + ReplicationPromoteOptionPlanned, + } +} + // ReplicationRole - Used to indicate role of the server in replication set. type ReplicationRole string @@ -301,6 +736,48 @@ func PossibleReplicationRoleValues() []ReplicationRole { } } +// ReplicationState - Gets the replication state of a replica server. This property is returned only for replicas api call. +// Supported values are Active, Catchup, Provisioning, Updating, Broken, Reconfiguring +type ReplicationState string + +const ( + ReplicationStateActive ReplicationState = "Active" + ReplicationStateBroken ReplicationState = "Broken" + ReplicationStateCatchup ReplicationState = "Catchup" + ReplicationStateProvisioning ReplicationState = "Provisioning" + ReplicationStateReconfiguring ReplicationState = "Reconfiguring" + ReplicationStateUpdating ReplicationState = "Updating" +) + +// PossibleReplicationStateValues returns the possible values for the ReplicationState const type. +func PossibleReplicationStateValues() []ReplicationState { + return []ReplicationState{ + ReplicationStateActive, + ReplicationStateBroken, + ReplicationStateCatchup, + ReplicationStateProvisioning, + ReplicationStateReconfiguring, + ReplicationStateUpdating, + } +} + +// RestrictedEnum - A value indicating whether this region is restricted. "Enabled" means region is restricted. "Disabled" +// stands for region is not restricted. +type RestrictedEnum string + +const ( + RestrictedEnumDisabled RestrictedEnum = "Disabled" + RestrictedEnumEnabled RestrictedEnum = "Enabled" +) + +// PossibleRestrictedEnumValues returns the possible values for the RestrictedEnum const type. +func PossibleRestrictedEnumValues() []RestrictedEnum { + return []RestrictedEnum{ + RestrictedEnumDisabled, + RestrictedEnumEnabled, + } +} + // SKUTier - The tier of the particular SKU, e.g. Burstable. type SKUTier string @@ -319,6 +796,27 @@ func PossibleSKUTierValues() []SKUTier { } } +// SSLMode - Supported SSL modes for migration. VerifyFull is the recommended SSL mode for Single server migration. Prefer, +// Require are recommended SSL modes for other source types +type SSLMode string + +const ( + SSLModePrefer SSLMode = "Prefer" + SSLModeRequire SSLMode = "Require" + SSLModeVerifyCA SSLMode = "VerifyCA" + SSLModeVerifyFull SSLMode = "VerifyFull" +) + +// PossibleSSLModeValues returns the possible values for the SSLMode const type. +func PossibleSSLModeValues() []SSLMode { + return []SSLMode{ + SSLModePrefer, + SSLModeRequire, + SSLModeVerifyCA, + SSLModeVerifyFull, + } +} + // ServerHAState - A state of a HA server that is visible to user. type ServerHAState string @@ -390,7 +888,9 @@ type ServerVersion string const ( ServerVersionEleven ServerVersion = "11" + ServerVersionFifteen ServerVersion = "15" ServerVersionFourteen ServerVersion = "14" + ServerVersionSixteen ServerVersion = "16" ServerVersionThirteen ServerVersion = "13" ServerVersionTwelve ServerVersion = "12" ) @@ -399,8 +899,211 @@ const ( func PossibleServerVersionValues() []ServerVersion { return []ServerVersion{ ServerVersionEleven, + ServerVersionFifteen, ServerVersionFourteen, + ServerVersionSixteen, ServerVersionThirteen, ServerVersionTwelve, } } + +// SourceType - Migration source server type : OnPremises, AWS, GCP, AzureVM or PostgreSQLSingleServer +type SourceType string + +const ( + SourceTypeAWS SourceType = "AWS" + SourceTypeAzureVM SourceType = "AzureVM" + SourceTypeGCP SourceType = "GCP" + SourceTypeOnPremises SourceType = "OnPremises" + SourceTypePostgreSQLSingleServer SourceType = "PostgreSQLSingleServer" +) + +// PossibleSourceTypeValues returns the possible values for the SourceType const type. +func PossibleSourceTypeValues() []SourceType { + return []SourceType{ + SourceTypeAWS, + SourceTypeAzureVM, + SourceTypeGCP, + SourceTypeOnPremises, + SourceTypePostgreSQLSingleServer, + } +} + +// StartDataMigrationEnum - Indicates whether the data migration should start right away +type StartDataMigrationEnum string + +const ( + StartDataMigrationEnumFalse StartDataMigrationEnum = "False" + StartDataMigrationEnumTrue StartDataMigrationEnum = "True" +) + +// PossibleStartDataMigrationEnumValues returns the possible values for the StartDataMigrationEnum const type. +func PossibleStartDataMigrationEnumValues() []StartDataMigrationEnum { + return []StartDataMigrationEnum{ + StartDataMigrationEnumFalse, + StartDataMigrationEnumTrue, + } +} + +// StorageAutoGrow - Flag to enable / disable Storage Auto grow for flexible server. +type StorageAutoGrow string + +const ( + StorageAutoGrowDisabled StorageAutoGrow = "Disabled" + StorageAutoGrowEnabled StorageAutoGrow = "Enabled" +) + +// PossibleStorageAutoGrowValues returns the possible values for the StorageAutoGrow const type. +func PossibleStorageAutoGrowValues() []StorageAutoGrow { + return []StorageAutoGrow{ + StorageAutoGrowDisabled, + StorageAutoGrowEnabled, + } +} + +// StorageAutoGrowthSupportedEnum - A value indicating whether storage auto-grow is supported in this region. "Enabled" means +// storage auto-grow is supported. "Disabled" stands for storage auto-grow is not supported. +type StorageAutoGrowthSupportedEnum string + +const ( + StorageAutoGrowthSupportedEnumDisabled StorageAutoGrowthSupportedEnum = "Disabled" + StorageAutoGrowthSupportedEnumEnabled StorageAutoGrowthSupportedEnum = "Enabled" +) + +// PossibleStorageAutoGrowthSupportedEnumValues returns the possible values for the StorageAutoGrowthSupportedEnum const type. +func PossibleStorageAutoGrowthSupportedEnumValues() []StorageAutoGrowthSupportedEnum { + return []StorageAutoGrowthSupportedEnum{ + StorageAutoGrowthSupportedEnumDisabled, + StorageAutoGrowthSupportedEnumEnabled, + } +} + +// StorageType - Storage type for the server. Allowed values are PremiumLRS and PremiumV2LRS, and default is Premium_LRS if +// not specified +type StorageType string + +const ( + StorageTypePremiumLRS StorageType = "Premium_LRS" + StorageTypePremiumV2LRS StorageType = "PremiumV2_LRS" +) + +// PossibleStorageTypeValues returns the possible values for the StorageType const type. +func PossibleStorageTypeValues() []StorageType { + return []StorageType{ + StorageTypePremiumLRS, + StorageTypePremiumV2LRS, + } +} + +type ThreatProtectionName string + +const ( + ThreatProtectionNameDefault ThreatProtectionName = "Default" +) + +// PossibleThreatProtectionNameValues returns the possible values for the ThreatProtectionName const type. +func PossibleThreatProtectionNameValues() []ThreatProtectionName { + return []ThreatProtectionName{ + ThreatProtectionNameDefault, + } +} + +// ThreatProtectionState - Specifies the state of the Threat Protection, whether it is enabled or disabled or a state has +// not been applied yet on the specific server. +type ThreatProtectionState string + +const ( + ThreatProtectionStateDisabled ThreatProtectionState = "Disabled" + ThreatProtectionStateEnabled ThreatProtectionState = "Enabled" +) + +// PossibleThreatProtectionStateValues returns the possible values for the ThreatProtectionState const type. +func PossibleThreatProtectionStateValues() []ThreatProtectionState { + return []ThreatProtectionState{ + ThreatProtectionStateDisabled, + ThreatProtectionStateEnabled, + } +} + +// TriggerCutoverEnum - To trigger cutover for entire migration we need to send this flag as True +type TriggerCutoverEnum string + +const ( + TriggerCutoverEnumFalse TriggerCutoverEnum = "False" + TriggerCutoverEnumTrue TriggerCutoverEnum = "True" +) + +// PossibleTriggerCutoverEnumValues returns the possible values for the TriggerCutoverEnum const type. +func PossibleTriggerCutoverEnumValues() []TriggerCutoverEnum { + return []TriggerCutoverEnum{ + TriggerCutoverEnumFalse, + TriggerCutoverEnumTrue, + } +} + +// ValidationState - Validation status for migration +type ValidationState string + +const ( + ValidationStateFailed ValidationState = "Failed" + ValidationStateSucceeded ValidationState = "Succeeded" + ValidationStateWarning ValidationState = "Warning" +) + +// PossibleValidationStateValues returns the possible values for the ValidationState const type. +func PossibleValidationStateValues() []ValidationState { + return []ValidationState{ + ValidationStateFailed, + ValidationStateSucceeded, + ValidationStateWarning, + } +} + +// VirtualEndpointType - The endpoint type for the virtual endpoint. +type VirtualEndpointType string + +const ( + VirtualEndpointTypeReadWrite VirtualEndpointType = "ReadWrite" +) + +// PossibleVirtualEndpointTypeValues returns the possible values for the VirtualEndpointType const type. +func PossibleVirtualEndpointTypeValues() []VirtualEndpointType { + return []VirtualEndpointType{ + VirtualEndpointTypeReadWrite, + } +} + +// ZoneRedundantHaAndGeoBackupSupportedEnum - A value indicating whether Zone Redundant HA and Geo-backup is supported in +// this region. "Enabled" means zone redundant HA and geo-backup is supported. "Disabled" stands for zone redundant HA and +// geo-backup is not supported. +type ZoneRedundantHaAndGeoBackupSupportedEnum string + +const ( + ZoneRedundantHaAndGeoBackupSupportedEnumDisabled ZoneRedundantHaAndGeoBackupSupportedEnum = "Disabled" + ZoneRedundantHaAndGeoBackupSupportedEnumEnabled ZoneRedundantHaAndGeoBackupSupportedEnum = "Enabled" +) + +// PossibleZoneRedundantHaAndGeoBackupSupportedEnumValues returns the possible values for the ZoneRedundantHaAndGeoBackupSupportedEnum const type. +func PossibleZoneRedundantHaAndGeoBackupSupportedEnumValues() []ZoneRedundantHaAndGeoBackupSupportedEnum { + return []ZoneRedundantHaAndGeoBackupSupportedEnum{ + ZoneRedundantHaAndGeoBackupSupportedEnumDisabled, + ZoneRedundantHaAndGeoBackupSupportedEnumEnabled, + } +} + +// ZoneRedundantHaSupportedEnum - A value indicating whether Zone Redundant HA is supported in this region. "Enabled" means +// zone redundant HA is supported. "Disabled" stands for zone redundant HA is not supported. +type ZoneRedundantHaSupportedEnum string + +const ( + ZoneRedundantHaSupportedEnumDisabled ZoneRedundantHaSupportedEnum = "Disabled" + ZoneRedundantHaSupportedEnumEnabled ZoneRedundantHaSupportedEnum = "Enabled" +) + +// PossibleZoneRedundantHaSupportedEnumValues returns the possible values for the ZoneRedundantHaSupportedEnum const type. +func PossibleZoneRedundantHaSupportedEnumValues() []ZoneRedundantHaSupportedEnum { + return []ZoneRedundantHaSupportedEnum{ + ZoneRedundantHaSupportedEnumDisabled, + ZoneRedundantHaSupportedEnumEnabled, + } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client.go index d2b159f650aa..2f6e9f4dfa89 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client.go @@ -28,7 +28,7 @@ type DatabasesClient struct { } // NewDatabasesClient creates a new instance of DatabasesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - 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 NewDatabasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabasesClient, error) { @@ -46,7 +46,7 @@ func NewDatabasesClient(subscriptionID string, credential azcore.TokenCredential // BeginCreate - Creates a new database or updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - 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 +73,7 @@ func (client *DatabasesClient) BeginCreate(ctx context.Context, resourceGroupNam // Create - Creates a new database or updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview func (client *DatabasesClient) create(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database, options *DatabasesClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "DatabasesClient.BeginCreate" @@ -119,7 +119,7 @@ func (client *DatabasesClient) createCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -131,7 +131,7 @@ func (client *DatabasesClient) createCreateRequest(ctx context.Context, resource // BeginDelete - Deletes a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - databaseName - The name of the database. @@ -157,7 +157,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 2022-12-01 +// Generated from API version 2023-06-01-preview 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" @@ -203,7 +203,7 @@ func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -212,7 +212,7 @@ func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resource // Get - Gets information about a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - databaseName - The name of the database. @@ -263,7 +263,7 @@ func (client *DatabasesClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,7 +280,7 @@ func (client *DatabasesClient) getHandleResponse(resp *http.Response) (Databases // NewListByServerPager - List all the databases in a given server. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - 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 @@ -328,7 +328,7 @@ func (client *DatabasesClient) listByServerCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client_example_test.go index dce86e13dd64..2d39b5e5a8a2 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/DatabaseCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabaseCreate.json func ExampleDatabasesClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -56,7 +56,7 @@ func ExampleDatabasesClient_BeginCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/DatabaseDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabaseDelete.json func ExampleDatabasesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -77,7 +77,7 @@ func ExampleDatabasesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/DatabaseGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabaseGet.json func ExampleDatabasesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -106,7 +106,7 @@ func ExampleDatabasesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/DatabasesListByServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabasesListByServer.json func ExampleDatabasesClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/administrators_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/administrators_server.go index b94f8a0aa78f..af2effa67408 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/administrators_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/administrators_server.go @@ -16,7 +16,7 @@ import ( "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/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/backups_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/backups_server.go index 3cfb1de618b2..ffc1de34f60b 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/backups_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/backups_server.go @@ -16,7 +16,7 @@ import ( "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/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/checknameavailability_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/checknameavailability_server.go index 36e58f6b937b..61d32d52af96 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/checknameavailability_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/checknameavailability_server.go @@ -15,7 +15,7 @@ import ( 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/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" "net/http" "regexp" ) diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/checknameavailabilitywithlocation_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/checknameavailabilitywithlocation_server.go index 9e5c316b3095..2afd4cd35fe3 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/checknameavailabilitywithlocation_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/checknameavailabilitywithlocation_server.go @@ -15,7 +15,7 @@ import ( 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/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/configurations_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/configurations_server.go index e6ad0aae6bb5..7190e8ed0503 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/configurations_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/configurations_server.go @@ -16,7 +16,7 @@ import ( "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/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/databases_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/databases_server.go index 450a9de89dbd..296a8e3486f3 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/databases_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/databases_server.go @@ -16,7 +16,7 @@ import ( "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/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/firewallrules_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/firewallrules_server.go index 33551f12f7e7..724a40be6151 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/firewallrules_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/firewallrules_server.go @@ -16,7 +16,7 @@ import ( "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/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/flexibleserver_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/flexibleserver_server.go new file mode 100644 index 000000000000..fdba73b4990c --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/flexibleserver_server.go @@ -0,0 +1,165 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 ( + "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/postgresql/armpostgresqlflexibleservers/v4" + "net/http" + "net/url" + "regexp" +) + +// FlexibleServerServer is a fake server for instances of the armpostgresqlflexibleservers.FlexibleServerClient type. +type FlexibleServerServer struct { + // BeginStartLtrBackup is the fake for method FlexibleServerClient.BeginStartLtrBackup + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginStartLtrBackup func(ctx context.Context, resourceGroupName string, serverName string, parameters armpostgresqlflexibleservers.LtrBackupRequest, options *armpostgresqlflexibleservers.FlexibleServerClientBeginStartLtrBackupOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.FlexibleServerClientStartLtrBackupResponse], errResp azfake.ErrorResponder) + + // TriggerLtrPreBackup is the fake for method FlexibleServerClient.TriggerLtrPreBackup + // HTTP status codes to indicate success: http.StatusOK + TriggerLtrPreBackup func(ctx context.Context, resourceGroupName string, serverName string, parameters armpostgresqlflexibleservers.LtrPreBackupRequest, options *armpostgresqlflexibleservers.FlexibleServerClientTriggerLtrPreBackupOptions) (resp azfake.Responder[armpostgresqlflexibleservers.FlexibleServerClientTriggerLtrPreBackupResponse], errResp azfake.ErrorResponder) +} + +// NewFlexibleServerServerTransport creates a new instance of FlexibleServerServerTransport with the provided implementation. +// The returned FlexibleServerServerTransport instance is connected to an instance of armpostgresqlflexibleservers.FlexibleServerClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewFlexibleServerServerTransport(srv *FlexibleServerServer) *FlexibleServerServerTransport { + return &FlexibleServerServerTransport{ + srv: srv, + beginStartLtrBackup: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.FlexibleServerClientStartLtrBackupResponse]](), + } +} + +// FlexibleServerServerTransport connects instances of armpostgresqlflexibleservers.FlexibleServerClient to instances of FlexibleServerServer. +// Don't use this type directly, use NewFlexibleServerServerTransport instead. +type FlexibleServerServerTransport struct { + srv *FlexibleServerServer + beginStartLtrBackup *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.FlexibleServerClientStartLtrBackupResponse]] +} + +// Do implements the policy.Transporter interface for FlexibleServerServerTransport. +func (f *FlexibleServerServerTransport) 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")} + } + + var resp *http.Response + var err error + + switch method { + case "FlexibleServerClient.BeginStartLtrBackup": + resp, err = f.dispatchBeginStartLtrBackup(req) + case "FlexibleServerClient.TriggerLtrPreBackup": + resp, err = f.dispatchTriggerLtrPreBackup(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (f *FlexibleServerServerTransport) dispatchBeginStartLtrBackup(req *http.Request) (*http.Response, error) { + if f.srv.BeginStartLtrBackup == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginStartLtrBackup not implemented")} + } + beginStartLtrBackup := f.beginStartLtrBackup.get(req) + if beginStartLtrBackup == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/startLtrBackup` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.LtrBackupRequest](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 + } + respr, errRespr := f.srv.BeginStartLtrBackup(req.Context(), resourceGroupNameParam, serverNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginStartLtrBackup = &respr + f.beginStartLtrBackup.add(req, beginStartLtrBackup) + } + + resp, err := server.PollerResponderNext(beginStartLtrBackup, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + f.beginStartLtrBackup.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginStartLtrBackup) { + f.beginStartLtrBackup.remove(req) + } + + return resp, nil +} + +func (f *FlexibleServerServerTransport) dispatchTriggerLtrPreBackup(req *http.Request) (*http.Response, error) { + if f.srv.TriggerLtrPreBackup == nil { + return nil, &nonRetriableError{errors.New("fake for method TriggerLtrPreBackup not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ltrPreBackup` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.LtrPreBackupRequest](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 + } + respr, errRespr := f.srv.TriggerLtrPreBackup(req.Context(), resourceGroupNameParam, serverNameParam, body, 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).LtrPreBackupResponse, req) + if err != nil { + return nil, err + } + if val := server.GetResponse(respr).XMSRequestID; val != nil { + resp.Header.Set("x-ms-request-id", *val) + } + return resp, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/getprivatednszonesuffix_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/getprivatednszonesuffix_server.go index cd9c5e131fc2..11041e65758c 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/getprivatednszonesuffix_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/getprivatednszonesuffix_server.go @@ -15,7 +15,7 @@ import ( 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/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" "net/http" ) diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/internal.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/internal.go index 5f75802a569e..55ac7c4dc64f 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/internal.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/internal.go @@ -11,6 +11,7 @@ package fake import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "net/http" + "reflect" "sync" ) @@ -31,6 +32,21 @@ func contains[T comparable](s []T, v T) bool { return false } +func getOptional[T any](v T) *T { + if reflect.ValueOf(v).IsZero() { + return nil + } + return &v +} + +func parseWithCast[T any](v string, parse func(v string) (T, error)) (T, error) { + t, err := parse(v) + if err != nil { + return *new(T), err + } + return t, err +} + func newTracker[T any]() *tracker[T] { return &tracker[T]{ items: map[string]*T{}, diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/locationbasedcapabilities_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/locationbasedcapabilities_server.go index 9a2eea834b9e..3d2578bb3756 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/locationbasedcapabilities_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/locationbasedcapabilities_server.go @@ -15,7 +15,7 @@ import ( "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/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/logfiles_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/logfiles_server.go new file mode 100644 index 000000000000..f3c5f2515129 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/logfiles_server.go @@ -0,0 +1,112 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 ( + "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/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" + "net/http" + "net/url" + "regexp" +) + +// LogFilesServer is a fake server for instances of the armpostgresqlflexibleservers.LogFilesClient type. +type LogFilesServer struct { + // NewListByServerPager is the fake for method LogFilesClient.NewListByServerPager + // HTTP status codes to indicate success: http.StatusOK + NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.LogFilesClientListByServerOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.LogFilesClientListByServerResponse]) +} + +// NewLogFilesServerTransport creates a new instance of LogFilesServerTransport with the provided implementation. +// The returned LogFilesServerTransport instance is connected to an instance of armpostgresqlflexibleservers.LogFilesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewLogFilesServerTransport(srv *LogFilesServer) *LogFilesServerTransport { + return &LogFilesServerTransport{ + srv: srv, + newListByServerPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.LogFilesClientListByServerResponse]](), + } +} + +// LogFilesServerTransport connects instances of armpostgresqlflexibleservers.LogFilesClient to instances of LogFilesServer. +// Don't use this type directly, use NewLogFilesServerTransport instead. +type LogFilesServerTransport struct { + srv *LogFilesServer + newListByServerPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.LogFilesClientListByServerResponse]] +} + +// Do implements the policy.Transporter interface for LogFilesServerTransport. +func (l *LogFilesServerTransport) 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")} + } + + var resp *http.Response + var err error + + switch method { + case "LogFilesClient.NewListByServerPager": + resp, err = l.dispatchNewListByServerPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (l *LogFilesServerTransport) dispatchNewListByServerPager(req *http.Request) (*http.Response, error) { + if l.srv.NewListByServerPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByServerPager not implemented")} + } + newListByServerPager := l.newListByServerPager.get(req) + if newListByServerPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/logFiles` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + 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 := l.srv.NewListByServerPager(resourceGroupNameParam, serverNameParam, nil) + newListByServerPager = &resp + l.newListByServerPager.add(req, newListByServerPager) + server.PagerResponderInjectNextLinks(newListByServerPager, req, func(page *armpostgresqlflexibleservers.LogFilesClientListByServerResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByServerPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + l.newListByServerPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByServerPager) { + l.newListByServerPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/ltrbackupoperations_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/ltrbackupoperations_server.go new file mode 100644 index 000000000000..51313e3599fb --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/ltrbackupoperations_server.go @@ -0,0 +1,156 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 ( + "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/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" + "net/http" + "net/url" + "regexp" +) + +// LtrBackupOperationsServer is a fake server for instances of the armpostgresqlflexibleservers.LtrBackupOperationsClient type. +type LtrBackupOperationsServer struct { + // Get is the fake for method LtrBackupOperationsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *armpostgresqlflexibleservers.LtrBackupOperationsClientGetOptions) (resp azfake.Responder[armpostgresqlflexibleservers.LtrBackupOperationsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByServerPager is the fake for method LtrBackupOperationsClient.NewListByServerPager + // HTTP status codes to indicate success: http.StatusOK + NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.LtrBackupOperationsClientListByServerOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.LtrBackupOperationsClientListByServerResponse]) +} + +// NewLtrBackupOperationsServerTransport creates a new instance of LtrBackupOperationsServerTransport with the provided implementation. +// The returned LtrBackupOperationsServerTransport instance is connected to an instance of armpostgresqlflexibleservers.LtrBackupOperationsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewLtrBackupOperationsServerTransport(srv *LtrBackupOperationsServer) *LtrBackupOperationsServerTransport { + return &LtrBackupOperationsServerTransport{ + srv: srv, + newListByServerPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.LtrBackupOperationsClientListByServerResponse]](), + } +} + +// LtrBackupOperationsServerTransport connects instances of armpostgresqlflexibleservers.LtrBackupOperationsClient to instances of LtrBackupOperationsServer. +// Don't use this type directly, use NewLtrBackupOperationsServerTransport instead. +type LtrBackupOperationsServerTransport struct { + srv *LtrBackupOperationsServer + newListByServerPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.LtrBackupOperationsClientListByServerResponse]] +} + +// Do implements the policy.Transporter interface for LtrBackupOperationsServerTransport. +func (l *LtrBackupOperationsServerTransport) 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")} + } + + var resp *http.Response + var err error + + switch method { + case "LtrBackupOperationsClient.Get": + resp, err = l.dispatchGet(req) + case "LtrBackupOperationsClient.NewListByServerPager": + resp, err = l.dispatchNewListByServerPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (l *LtrBackupOperationsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if l.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\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ltrBackupOperations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + backupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("backupName")]) + if err != nil { + return nil, err + } + respr, errRespr := l.srv.Get(req.Context(), resourceGroupNameParam, serverNameParam, backupNameParam, 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).LtrServerBackupOperation, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (l *LtrBackupOperationsServerTransport) dispatchNewListByServerPager(req *http.Request) (*http.Response, error) { + if l.srv.NewListByServerPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByServerPager not implemented")} + } + newListByServerPager := l.newListByServerPager.get(req) + if newListByServerPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ltrBackupOperations` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + 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 := l.srv.NewListByServerPager(resourceGroupNameParam, serverNameParam, nil) + newListByServerPager = &resp + l.newListByServerPager.add(req, newListByServerPager) + server.PagerResponderInjectNextLinks(newListByServerPager, req, func(page *armpostgresqlflexibleservers.LtrBackupOperationsClientListByServerResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByServerPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + l.newListByServerPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByServerPager) { + l.newListByServerPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/migrations_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/migrations_server.go new file mode 100644 index 000000000000..71ee6b490923 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/migrations_server.go @@ -0,0 +1,325 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 ( + "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/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" + "net/http" + "net/url" + "regexp" +) + +// MigrationsServer is a fake server for instances of the armpostgresqlflexibleservers.MigrationsClient type. +type MigrationsServer struct { + // Create is the fake for method MigrationsClient.Create + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + Create func(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, migrationName string, parameters armpostgresqlflexibleservers.MigrationResource, options *armpostgresqlflexibleservers.MigrationsClientCreateOptions) (resp azfake.Responder[armpostgresqlflexibleservers.MigrationsClientCreateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method MigrationsClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, migrationName string, options *armpostgresqlflexibleservers.MigrationsClientDeleteOptions) (resp azfake.Responder[armpostgresqlflexibleservers.MigrationsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method MigrationsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, migrationName string, options *armpostgresqlflexibleservers.MigrationsClientGetOptions) (resp azfake.Responder[armpostgresqlflexibleservers.MigrationsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByTargetServerPager is the fake for method MigrationsClient.NewListByTargetServerPager + // HTTP status codes to indicate success: http.StatusOK + NewListByTargetServerPager func(subscriptionID string, resourceGroupName string, targetDbServerName string, options *armpostgresqlflexibleservers.MigrationsClientListByTargetServerOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.MigrationsClientListByTargetServerResponse]) + + // Update is the fake for method MigrationsClient.Update + // HTTP status codes to indicate success: http.StatusOK + Update func(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, migrationName string, parameters armpostgresqlflexibleservers.MigrationResourceForPatch, options *armpostgresqlflexibleservers.MigrationsClientUpdateOptions) (resp azfake.Responder[armpostgresqlflexibleservers.MigrationsClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewMigrationsServerTransport creates a new instance of MigrationsServerTransport with the provided implementation. +// The returned MigrationsServerTransport instance is connected to an instance of armpostgresqlflexibleservers.MigrationsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewMigrationsServerTransport(srv *MigrationsServer) *MigrationsServerTransport { + return &MigrationsServerTransport{ + srv: srv, + newListByTargetServerPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.MigrationsClientListByTargetServerResponse]](), + } +} + +// MigrationsServerTransport connects instances of armpostgresqlflexibleservers.MigrationsClient to instances of MigrationsServer. +// Don't use this type directly, use NewMigrationsServerTransport instead. +type MigrationsServerTransport struct { + srv *MigrationsServer + newListByTargetServerPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.MigrationsClientListByTargetServerResponse]] +} + +// Do implements the policy.Transporter interface for MigrationsServerTransport. +func (m *MigrationsServerTransport) 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")} + } + + var resp *http.Response + var err error + + switch method { + case "MigrationsClient.Create": + resp, err = m.dispatchCreate(req) + case "MigrationsClient.Delete": + resp, err = m.dispatchDelete(req) + case "MigrationsClient.Get": + resp, err = m.dispatchGet(req) + case "MigrationsClient.NewListByTargetServerPager": + resp, err = m.dispatchNewListByTargetServerPager(req) + case "MigrationsClient.Update": + resp, err = m.dispatchUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (m *MigrationsServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { + if m.srv.Create == nil { + return nil, &nonRetriableError{errors.New("fake for method Create not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.MigrationResource](req) + if err != nil { + return nil, err + } + subscriptionIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("subscriptionId")]) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + targetDbServerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetDbServerName")]) + if err != nil { + return nil, err + } + migrationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("migrationName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.Create(req.Context(), subscriptionIDParam, resourceGroupNameParam, targetDbServerNameParam, migrationNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).MigrationResource, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (m *MigrationsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if m.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + subscriptionIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("subscriptionId")]) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + targetDbServerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetDbServerName")]) + if err != nil { + return nil, err + } + migrationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("migrationName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.Delete(req.Context(), subscriptionIDParam, resourceGroupNameParam, targetDbServerNameParam, migrationNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (m *MigrationsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if m.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\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + subscriptionIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("subscriptionId")]) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + targetDbServerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetDbServerName")]) + if err != nil { + return nil, err + } + migrationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("migrationName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.Get(req.Context(), subscriptionIDParam, resourceGroupNameParam, targetDbServerNameParam, migrationNameParam, 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).MigrationResource, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (m *MigrationsServerTransport) dispatchNewListByTargetServerPager(req *http.Request) (*http.Response, error) { + if m.srv.NewListByTargetServerPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByTargetServerPager not implemented")} + } + newListByTargetServerPager := m.newListByTargetServerPager.get(req) + if newListByTargetServerPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrations` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + subscriptionIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("subscriptionId")]) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + targetDbServerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetDbServerName")]) + if err != nil { + return nil, err + } + migrationListFilterUnescaped, err := url.QueryUnescape(qp.Get("migrationListFilter")) + if err != nil { + return nil, err + } + migrationListFilterParam := getOptional(armpostgresqlflexibleservers.MigrationListFilter(migrationListFilterUnescaped)) + var options *armpostgresqlflexibleservers.MigrationsClientListByTargetServerOptions + if migrationListFilterParam != nil { + options = &armpostgresqlflexibleservers.MigrationsClientListByTargetServerOptions{ + MigrationListFilter: migrationListFilterParam, + } + } + resp := m.srv.NewListByTargetServerPager(subscriptionIDParam, resourceGroupNameParam, targetDbServerNameParam, options) + newListByTargetServerPager = &resp + m.newListByTargetServerPager.add(req, newListByTargetServerPager) + server.PagerResponderInjectNextLinks(newListByTargetServerPager, req, func(page *armpostgresqlflexibleservers.MigrationsClientListByTargetServerResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByTargetServerPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + m.newListByTargetServerPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByTargetServerPager) { + m.newListByTargetServerPager.remove(req) + } + return resp, nil +} + +func (m *MigrationsServerTransport) dispatchUpdate(req *http.Request) (*http.Response, error) { + if m.srv.Update == nil { + return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.MigrationResourceForPatch](req) + if err != nil { + return nil, err + } + subscriptionIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("subscriptionId")]) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + targetDbServerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetDbServerName")]) + if err != nil { + return nil, err + } + migrationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("migrationName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.Update(req.Context(), subscriptionIDParam, resourceGroupNameParam, targetDbServerNameParam, migrationNameParam, body, 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).MigrationResource, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/operations_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/operations_server.go index 5908a76e7445..16464638a02d 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/operations_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/operations_server.go @@ -15,7 +15,7 @@ import ( 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/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" "net/http" ) diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/postgresqlmanagement_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/postgresqlmanagement_server.go new file mode 100644 index 000000000000..bdb33a1752a8 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/postgresqlmanagement_server.go @@ -0,0 +1,108 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 ( + "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/postgresql/armpostgresqlflexibleservers/v4" + "net/http" + "net/url" + "regexp" +) + +// PostgreSQLManagementServer is a fake server for instances of the armpostgresqlflexibleservers.PostgreSQLManagementClient type. +type PostgreSQLManagementServer struct { + // CheckMigrationNameAvailability is the fake for method PostgreSQLManagementClient.CheckMigrationNameAvailability + // HTTP status codes to indicate success: http.StatusOK + CheckMigrationNameAvailability func(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, parameters armpostgresqlflexibleservers.MigrationNameAvailabilityResource, options *armpostgresqlflexibleservers.PostgreSQLManagementClientCheckMigrationNameAvailabilityOptions) (resp azfake.Responder[armpostgresqlflexibleservers.PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse], errResp azfake.ErrorResponder) +} + +// NewPostgreSQLManagementServerTransport creates a new instance of PostgreSQLManagementServerTransport with the provided implementation. +// The returned PostgreSQLManagementServerTransport instance is connected to an instance of armpostgresqlflexibleservers.PostgreSQLManagementClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewPostgreSQLManagementServerTransport(srv *PostgreSQLManagementServer) *PostgreSQLManagementServerTransport { + return &PostgreSQLManagementServerTransport{srv: srv} +} + +// PostgreSQLManagementServerTransport connects instances of armpostgresqlflexibleservers.PostgreSQLManagementClient to instances of PostgreSQLManagementServer. +// Don't use this type directly, use NewPostgreSQLManagementServerTransport instead. +type PostgreSQLManagementServerTransport struct { + srv *PostgreSQLManagementServer +} + +// Do implements the policy.Transporter interface for PostgreSQLManagementServerTransport. +func (p *PostgreSQLManagementServerTransport) 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")} + } + + var resp *http.Response + var err error + + switch method { + case "PostgreSQLManagementClient.CheckMigrationNameAvailability": + resp, err = p.dispatchCheckMigrationNameAvailability(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (p *PostgreSQLManagementServerTransport) dispatchCheckMigrationNameAvailability(req *http.Request) (*http.Response, error) { + if p.srv.CheckMigrationNameAvailability == nil { + return nil, &nonRetriableError{errors.New("fake for method CheckMigrationNameAvailability not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/checkMigrationNameAvailability` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.MigrationNameAvailabilityResource](req) + if err != nil { + return nil, err + } + subscriptionIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("subscriptionId")]) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + targetDbServerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("targetDbServerName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.CheckMigrationNameAvailability(req.Context(), subscriptionIDParam, resourceGroupNameParam, targetDbServerNameParam, body, 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).MigrationNameAvailabilityResource, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privateendpointconnection_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privateendpointconnection_server.go new file mode 100644 index 000000000000..c7ebf21b5222 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privateendpointconnection_server.go @@ -0,0 +1,179 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 ( + "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/postgresql/armpostgresqlflexibleservers/v4" + "net/http" + "net/url" + "regexp" +) + +// PrivateEndpointConnectionServer is a fake server for instances of the armpostgresqlflexibleservers.PrivateEndpointConnectionClient type. +type PrivateEndpointConnectionServer struct { + // BeginDelete is the fake for method PrivateEndpointConnectionClient.BeginDelete + // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *armpostgresqlflexibleservers.PrivateEndpointConnectionClientBeginDeleteOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.PrivateEndpointConnectionClientDeleteResponse], errResp azfake.ErrorResponder) + + // BeginUpdate is the fake for method PrivateEndpointConnectionClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated, http.StatusAccepted + BeginUpdate func(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters armpostgresqlflexibleservers.PrivateEndpointConnection, options *armpostgresqlflexibleservers.PrivateEndpointConnectionClientBeginUpdateOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.PrivateEndpointConnectionClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewPrivateEndpointConnectionServerTransport creates a new instance of PrivateEndpointConnectionServerTransport with the provided implementation. +// The returned PrivateEndpointConnectionServerTransport instance is connected to an instance of armpostgresqlflexibleservers.PrivateEndpointConnectionClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewPrivateEndpointConnectionServerTransport(srv *PrivateEndpointConnectionServer) *PrivateEndpointConnectionServerTransport { + return &PrivateEndpointConnectionServerTransport{ + srv: srv, + beginDelete: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.PrivateEndpointConnectionClientDeleteResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.PrivateEndpointConnectionClientUpdateResponse]](), + } +} + +// PrivateEndpointConnectionServerTransport connects instances of armpostgresqlflexibleservers.PrivateEndpointConnectionClient to instances of PrivateEndpointConnectionServer. +// Don't use this type directly, use NewPrivateEndpointConnectionServerTransport instead. +type PrivateEndpointConnectionServerTransport struct { + srv *PrivateEndpointConnectionServer + beginDelete *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.PrivateEndpointConnectionClientDeleteResponse]] + beginUpdate *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.PrivateEndpointConnectionClientUpdateResponse]] +} + +// Do implements the policy.Transporter interface for PrivateEndpointConnectionServerTransport. +func (p *PrivateEndpointConnectionServerTransport) 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")} + } + + var resp *http.Response + var err error + + switch method { + case "PrivateEndpointConnectionClient.BeginDelete": + resp, err = p.dispatchBeginDelete(req) + case "PrivateEndpointConnectionClient.BeginUpdate": + resp, err = p.dispatchBeginUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (p *PrivateEndpointConnectionServerTransport) 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\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + 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.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + p.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + p.beginDelete.remove(req) + } + + return resp, nil +} + +func (p *PrivateEndpointConnectionServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if p.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} + } + beginUpdate := p.beginUpdate.get(req) + if beginUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.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.BeginUpdate(req.Context(), resourceGroupNameParam, serverNameParam, privateEndpointConnectionNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + p.beginUpdate.add(req, beginUpdate) + } + + resp, err := server.PollerResponderNext(beginUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { + p.beginUpdate.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(beginUpdate) { + p.beginUpdate.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privateendpointconnections_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privateendpointconnections_server.go new file mode 100644 index 000000000000..b542d350f264 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privateendpointconnections_server.go @@ -0,0 +1,156 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 ( + "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/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" + "net/http" + "net/url" + "regexp" +) + +// PrivateEndpointConnectionsServer is a fake server for instances of the armpostgresqlflexibleservers.PrivateEndpointConnectionsClient type. +type PrivateEndpointConnectionsServer struct { + // 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 *armpostgresqlflexibleservers.PrivateEndpointConnectionsClientGetOptions) (resp azfake.Responder[armpostgresqlflexibleservers.PrivateEndpointConnectionsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByServerPager is the fake for method PrivateEndpointConnectionsClient.NewListByServerPager + // HTTP status codes to indicate success: http.StatusOK + NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.PrivateEndpointConnectionsClientListByServerOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.PrivateEndpointConnectionsClientListByServerResponse]) +} + +// NewPrivateEndpointConnectionsServerTransport creates a new instance of PrivateEndpointConnectionsServerTransport with the provided implementation. +// The returned PrivateEndpointConnectionsServerTransport instance is connected to an instance of armpostgresqlflexibleservers.PrivateEndpointConnectionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewPrivateEndpointConnectionsServerTransport(srv *PrivateEndpointConnectionsServer) *PrivateEndpointConnectionsServerTransport { + return &PrivateEndpointConnectionsServerTransport{ + srv: srv, + newListByServerPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.PrivateEndpointConnectionsClientListByServerResponse]](), + } +} + +// PrivateEndpointConnectionsServerTransport connects instances of armpostgresqlflexibleservers.PrivateEndpointConnectionsClient to instances of PrivateEndpointConnectionsServer. +// Don't use this type directly, use NewPrivateEndpointConnectionsServerTransport instead. +type PrivateEndpointConnectionsServerTransport struct { + srv *PrivateEndpointConnectionsServer + newListByServerPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.PrivateEndpointConnectionsClientListByServerResponse]] +} + +// 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")} + } + + var resp *http.Response + var err error + + switch method { + case "PrivateEndpointConnectionsClient.Get": + resp, err = p.dispatchGet(req) + case "PrivateEndpointConnectionsClient.NewListByServerPager": + resp, err = p.dispatchNewListByServerPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + 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\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + 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) 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\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + 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) + server.PagerResponderInjectNextLinks(newListByServerPager, req, func(page *armpostgresqlflexibleservers.PrivateEndpointConnectionsClientListByServerResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + 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 +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privatelinkresources_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privatelinkresources_server.go new file mode 100644 index 000000000000..c361bcfce75c --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privatelinkresources_server.go @@ -0,0 +1,156 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 ( + "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/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" + "net/http" + "net/url" + "regexp" +) + +// PrivateLinkResourcesServer is a fake server for instances of the armpostgresqlflexibleservers.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 *armpostgresqlflexibleservers.PrivateLinkResourcesClientGetOptions) (resp azfake.Responder[armpostgresqlflexibleservers.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 *armpostgresqlflexibleservers.PrivateLinkResourcesClientListByServerOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.PrivateLinkResourcesClientListByServerResponse]) +} + +// NewPrivateLinkResourcesServerTransport creates a new instance of PrivateLinkResourcesServerTransport with the provided implementation. +// The returned PrivateLinkResourcesServerTransport instance is connected to an instance of armpostgresqlflexibleservers.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[armpostgresqlflexibleservers.PrivateLinkResourcesClientListByServerResponse]](), + } +} + +// PrivateLinkResourcesServerTransport connects instances of armpostgresqlflexibleservers.PrivateLinkResourcesClient to instances of PrivateLinkResourcesServer. +// Don't use this type directly, use NewPrivateLinkResourcesServerTransport instead. +type PrivateLinkResourcesServerTransport struct { + srv *PrivateLinkResourcesServer + newListByServerPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.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")} + } + + var resp *http.Response + var err error + + switch method { + case "PrivateLinkResourcesClient.Get": + resp, err = p.dispatchGet(req) + case "PrivateLinkResourcesClient.NewListByServerPager": + resp, err = p.dispatchNewListByServerPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +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\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateLinkResources/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + 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\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateLinkResources` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + 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) + server.PagerResponderInjectNextLinks(newListByServerPager, req, func(page *armpostgresqlflexibleservers.PrivateLinkResourcesClientListByServerResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + 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 +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/quotausages_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/quotausages_server.go new file mode 100644 index 000000000000..67c9e3810b25 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/quotausages_server.go @@ -0,0 +1,108 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 ( + "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/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" + "net/http" + "net/url" + "regexp" +) + +// QuotaUsagesServer is a fake server for instances of the armpostgresqlflexibleservers.QuotaUsagesClient type. +type QuotaUsagesServer struct { + // NewListPager is the fake for method QuotaUsagesClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(locationName string, options *armpostgresqlflexibleservers.QuotaUsagesClientListOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.QuotaUsagesClientListResponse]) +} + +// NewQuotaUsagesServerTransport creates a new instance of QuotaUsagesServerTransport with the provided implementation. +// The returned QuotaUsagesServerTransport instance is connected to an instance of armpostgresqlflexibleservers.QuotaUsagesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewQuotaUsagesServerTransport(srv *QuotaUsagesServer) *QuotaUsagesServerTransport { + return &QuotaUsagesServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.QuotaUsagesClientListResponse]](), + } +} + +// QuotaUsagesServerTransport connects instances of armpostgresqlflexibleservers.QuotaUsagesClient to instances of QuotaUsagesServer. +// Don't use this type directly, use NewQuotaUsagesServerTransport instead. +type QuotaUsagesServerTransport struct { + srv *QuotaUsagesServer + newListPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.QuotaUsagesClientListResponse]] +} + +// Do implements the policy.Transporter interface for QuotaUsagesServerTransport. +func (q *QuotaUsagesServerTransport) 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")} + } + + var resp *http.Response + var err error + + switch method { + case "QuotaUsagesClient.NewListPager": + resp, err = q.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (q *QuotaUsagesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if q.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := q.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceType/flexibleServers/usages` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + locationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("locationName")]) + if err != nil { + return nil, err + } + resp := q.srv.NewListPager(locationNameParam, nil) + newListPager = &resp + q.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armpostgresqlflexibleservers.QuotaUsagesClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + q.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + q.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/replicas_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/replicas_server.go index 4c0091119855..0f064a37f33b 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/replicas_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/replicas_server.go @@ -14,7 +14,7 @@ import ( 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/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/server_factory.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/server_factory.go index 97c0ff2cac69..d2aac137a47a 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/server_factory.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/server_factory.go @@ -26,11 +26,23 @@ type ServerFactory struct { ConfigurationsServer ConfigurationsServer DatabasesServer DatabasesServer FirewallRulesServer FirewallRulesServer + FlexibleServerServer FlexibleServerServer GetPrivateDNSZoneSuffixServer GetPrivateDNSZoneSuffixServer LocationBasedCapabilitiesServer LocationBasedCapabilitiesServer + LogFilesServer LogFilesServer + LtrBackupOperationsServer LtrBackupOperationsServer + MigrationsServer MigrationsServer OperationsServer OperationsServer + PostgreSQLManagementServer PostgreSQLManagementServer + PrivateEndpointConnectionServer PrivateEndpointConnectionServer + PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer + PrivateLinkResourcesServer PrivateLinkResourcesServer + QuotaUsagesServer QuotaUsagesServer ReplicasServer ReplicasServer + ServerCapabilitiesServer ServerCapabilitiesServer + ServerThreatProtectionSettingsServer ServerThreatProtectionSettingsServer ServersServer ServersServer + VirtualEndpointsServer VirtualEndpointsServer VirtualNetworkSubnetUsageServer VirtualNetworkSubnetUsageServer } @@ -55,11 +67,23 @@ type ServerFactoryTransport struct { trConfigurationsServer *ConfigurationsServerTransport trDatabasesServer *DatabasesServerTransport trFirewallRulesServer *FirewallRulesServerTransport + trFlexibleServerServer *FlexibleServerServerTransport trGetPrivateDNSZoneSuffixServer *GetPrivateDNSZoneSuffixServerTransport trLocationBasedCapabilitiesServer *LocationBasedCapabilitiesServerTransport + trLogFilesServer *LogFilesServerTransport + trLtrBackupOperationsServer *LtrBackupOperationsServerTransport + trMigrationsServer *MigrationsServerTransport trOperationsServer *OperationsServerTransport + trPostgreSQLManagementServer *PostgreSQLManagementServerTransport + trPrivateEndpointConnectionServer *PrivateEndpointConnectionServerTransport + trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport + trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport + trQuotaUsagesServer *QuotaUsagesServerTransport trReplicasServer *ReplicasServerTransport + trServerCapabilitiesServer *ServerCapabilitiesServerTransport + trServerThreatProtectionSettingsServer *ServerThreatProtectionSettingsServerTransport trServersServer *ServersServerTransport + trVirtualEndpointsServer *VirtualEndpointsServerTransport trVirtualNetworkSubnetUsageServer *VirtualNetworkSubnetUsageServerTransport } @@ -107,6 +131,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewFirewallRulesServerTransport(&s.srv.FirewallRulesServer) }) resp, err = s.trFirewallRulesServer.Do(req) + case "FlexibleServerClient": + initServer(s, &s.trFlexibleServerServer, func() *FlexibleServerServerTransport { + return NewFlexibleServerServerTransport(&s.srv.FlexibleServerServer) + }) + resp, err = s.trFlexibleServerServer.Do(req) case "GetPrivateDNSZoneSuffixClient": initServer(s, &s.trGetPrivateDNSZoneSuffixServer, func() *GetPrivateDNSZoneSuffixServerTransport { return NewGetPrivateDNSZoneSuffixServerTransport(&s.srv.GetPrivateDNSZoneSuffixServer) @@ -117,15 +146,64 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewLocationBasedCapabilitiesServerTransport(&s.srv.LocationBasedCapabilitiesServer) }) resp, err = s.trLocationBasedCapabilitiesServer.Do(req) + case "LogFilesClient": + initServer(s, &s.trLogFilesServer, func() *LogFilesServerTransport { return NewLogFilesServerTransport(&s.srv.LogFilesServer) }) + resp, err = s.trLogFilesServer.Do(req) + case "LtrBackupOperationsClient": + initServer(s, &s.trLtrBackupOperationsServer, func() *LtrBackupOperationsServerTransport { + return NewLtrBackupOperationsServerTransport(&s.srv.LtrBackupOperationsServer) + }) + resp, err = s.trLtrBackupOperationsServer.Do(req) + case "MigrationsClient": + initServer(s, &s.trMigrationsServer, func() *MigrationsServerTransport { return NewMigrationsServerTransport(&s.srv.MigrationsServer) }) + resp, err = s.trMigrationsServer.Do(req) case "OperationsClient": initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) resp, err = s.trOperationsServer.Do(req) + case "PostgreSQLManagementClient": + initServer(s, &s.trPostgreSQLManagementServer, func() *PostgreSQLManagementServerTransport { + return NewPostgreSQLManagementServerTransport(&s.srv.PostgreSQLManagementServer) + }) + resp, err = s.trPostgreSQLManagementServer.Do(req) + case "PrivateEndpointConnectionClient": + initServer(s, &s.trPrivateEndpointConnectionServer, func() *PrivateEndpointConnectionServerTransport { + return NewPrivateEndpointConnectionServerTransport(&s.srv.PrivateEndpointConnectionServer) + }) + resp, err = s.trPrivateEndpointConnectionServer.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 "QuotaUsagesClient": + initServer(s, &s.trQuotaUsagesServer, func() *QuotaUsagesServerTransport { return NewQuotaUsagesServerTransport(&s.srv.QuotaUsagesServer) }) + resp, err = s.trQuotaUsagesServer.Do(req) case "ReplicasClient": initServer(s, &s.trReplicasServer, func() *ReplicasServerTransport { return NewReplicasServerTransport(&s.srv.ReplicasServer) }) resp, err = s.trReplicasServer.Do(req) + case "ServerCapabilitiesClient": + initServer(s, &s.trServerCapabilitiesServer, func() *ServerCapabilitiesServerTransport { + return NewServerCapabilitiesServerTransport(&s.srv.ServerCapabilitiesServer) + }) + resp, err = s.trServerCapabilitiesServer.Do(req) + case "ServerThreatProtectionSettingsClient": + initServer(s, &s.trServerThreatProtectionSettingsServer, func() *ServerThreatProtectionSettingsServerTransport { + return NewServerThreatProtectionSettingsServerTransport(&s.srv.ServerThreatProtectionSettingsServer) + }) + resp, err = s.trServerThreatProtectionSettingsServer.Do(req) case "ServersClient": initServer(s, &s.trServersServer, func() *ServersServerTransport { return NewServersServerTransport(&s.srv.ServersServer) }) resp, err = s.trServersServer.Do(req) + case "VirtualEndpointsClient": + initServer(s, &s.trVirtualEndpointsServer, func() *VirtualEndpointsServerTransport { + return NewVirtualEndpointsServerTransport(&s.srv.VirtualEndpointsServer) + }) + resp, err = s.trVirtualEndpointsServer.Do(req) case "VirtualNetworkSubnetUsageClient": initServer(s, &s.trVirtualNetworkSubnetUsageServer, func() *VirtualNetworkSubnetUsageServerTransport { return NewVirtualNetworkSubnetUsageServerTransport(&s.srv.VirtualNetworkSubnetUsageServer) diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/servercapabilities_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/servercapabilities_server.go new file mode 100644 index 000000000000..2f24b0fecbc6 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/servercapabilities_server.go @@ -0,0 +1,112 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 ( + "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/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" + "net/http" + "net/url" + "regexp" +) + +// ServerCapabilitiesServer is a fake server for instances of the armpostgresqlflexibleservers.ServerCapabilitiesClient type. +type ServerCapabilitiesServer struct { + // NewListPager is the fake for method ServerCapabilitiesClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.ServerCapabilitiesClientListOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.ServerCapabilitiesClientListResponse]) +} + +// NewServerCapabilitiesServerTransport creates a new instance of ServerCapabilitiesServerTransport with the provided implementation. +// The returned ServerCapabilitiesServerTransport instance is connected to an instance of armpostgresqlflexibleservers.ServerCapabilitiesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewServerCapabilitiesServerTransport(srv *ServerCapabilitiesServer) *ServerCapabilitiesServerTransport { + return &ServerCapabilitiesServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.ServerCapabilitiesClientListResponse]](), + } +} + +// ServerCapabilitiesServerTransport connects instances of armpostgresqlflexibleservers.ServerCapabilitiesClient to instances of ServerCapabilitiesServer. +// Don't use this type directly, use NewServerCapabilitiesServerTransport instead. +type ServerCapabilitiesServerTransport struct { + srv *ServerCapabilitiesServer + newListPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.ServerCapabilitiesClientListResponse]] +} + +// Do implements the policy.Transporter interface for ServerCapabilitiesServerTransport. +func (s *ServerCapabilitiesServerTransport) 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")} + } + + var resp *http.Response + var err error + + switch method { + case "ServerCapabilitiesClient.NewListPager": + resp, err = s.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (s *ServerCapabilitiesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if s.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := s.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/capabilities` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + 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 := s.srv.NewListPager(resourceGroupNameParam, serverNameParam, nil) + newListPager = &resp + s.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armpostgresqlflexibleservers.ServerCapabilitiesClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + s.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + s.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/servers_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/servers_server.go index 4b8b1337fd51..f39393d83faf 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/servers_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/servers_server.go @@ -16,7 +16,7 @@ import ( "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/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/serverthreatprotectionsettings_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/serverthreatprotectionsettings_server.go new file mode 100644 index 000000000000..2f9627845ff6 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/serverthreatprotectionsettings_server.go @@ -0,0 +1,228 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 ( + "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/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" + "net/http" + "net/url" + "regexp" +) + +// ServerThreatProtectionSettingsServer is a fake server for instances of the armpostgresqlflexibleservers.ServerThreatProtectionSettingsClient type. +type ServerThreatProtectionSettingsServer struct { + // BeginCreateOrUpdate is the fake for method ServerThreatProtectionSettingsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, serverName string, threatProtectionName armpostgresqlflexibleservers.ThreatProtectionName, parameters armpostgresqlflexibleservers.ServerThreatProtectionSettingsModel, options *armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ServerThreatProtectionSettingsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, serverName string, threatProtectionName armpostgresqlflexibleservers.ThreatProtectionName, options *armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientGetOptions) (resp azfake.Responder[armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByServerPager is the fake for method ServerThreatProtectionSettingsClient.NewListByServerPager + // HTTP status codes to indicate success: http.StatusOK + NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientListByServerOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientListByServerResponse]) +} + +// NewServerThreatProtectionSettingsServerTransport creates a new instance of ServerThreatProtectionSettingsServerTransport with the provided implementation. +// The returned ServerThreatProtectionSettingsServerTransport instance is connected to an instance of armpostgresqlflexibleservers.ServerThreatProtectionSettingsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewServerThreatProtectionSettingsServerTransport(srv *ServerThreatProtectionSettingsServer) *ServerThreatProtectionSettingsServerTransport { + return &ServerThreatProtectionSettingsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientCreateOrUpdateResponse]](), + newListByServerPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientListByServerResponse]](), + } +} + +// ServerThreatProtectionSettingsServerTransport connects instances of armpostgresqlflexibleservers.ServerThreatProtectionSettingsClient to instances of ServerThreatProtectionSettingsServer. +// Don't use this type directly, use NewServerThreatProtectionSettingsServerTransport instead. +type ServerThreatProtectionSettingsServerTransport struct { + srv *ServerThreatProtectionSettingsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientCreateOrUpdateResponse]] + newListByServerPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientListByServerResponse]] +} + +// Do implements the policy.Transporter interface for ServerThreatProtectionSettingsServerTransport. +func (s *ServerThreatProtectionSettingsServerTransport) 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")} + } + + var resp *http.Response + var err error + + switch method { + case "ServerThreatProtectionSettingsClient.BeginCreateOrUpdate": + resp, err = s.dispatchBeginCreateOrUpdate(req) + case "ServerThreatProtectionSettingsClient.Get": + resp, err = s.dispatchGet(req) + case "ServerThreatProtectionSettingsClient.NewListByServerPager": + resp, err = s.dispatchNewListByServerPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (s *ServerThreatProtectionSettingsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if s.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := s.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/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 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.ServerThreatProtectionSettingsModel](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 + } + threatProtectionNameParam, err := parseWithCast(matches[regex.SubexpIndex("threatProtectionName")], func(v string) (armpostgresqlflexibleservers.ThreatProtectionName, error) { + p, unescapeErr := url.PathUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armpostgresqlflexibleservers.ThreatProtectionName(p), nil + }) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, serverNameParam, threatProtectionNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + s.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + s.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + s.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (s *ServerThreatProtectionSettingsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if s.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\.DBforPostgreSQL/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 { + 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 + } + threatProtectionNameParam, err := parseWithCast(matches[regex.SubexpIndex("threatProtectionName")], func(v string) (armpostgresqlflexibleservers.ThreatProtectionName, error) { + p, unescapeErr := url.PathUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armpostgresqlflexibleservers.ThreatProtectionName(p), nil + }) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, serverNameParam, threatProtectionNameParam, 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).ServerThreatProtectionSettingsModel, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *ServerThreatProtectionSettingsServerTransport) dispatchNewListByServerPager(req *http.Request) (*http.Response, error) { + if s.srv.NewListByServerPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByServerPager not implemented")} + } + newListByServerPager := s.newListByServerPager.get(req) + if newListByServerPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/advancedThreatProtectionSettings` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + 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 := s.srv.NewListByServerPager(resourceGroupNameParam, serverNameParam, nil) + newListByServerPager = &resp + s.newListByServerPager.add(req, newListByServerPager) + server.PagerResponderInjectNextLinks(newListByServerPager, req, func(page *armpostgresqlflexibleservers.ServerThreatProtectionSettingsClientListByServerResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByServerPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + s.newListByServerPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByServerPager) { + s.newListByServerPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/virtualendpoints_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/virtualendpoints_server.go new file mode 100644 index 000000000000..13775f1849b9 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/virtualendpoints_server.go @@ -0,0 +1,332 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 ( + "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/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" + "net/http" + "net/url" + "regexp" +) + +// VirtualEndpointsServer is a fake server for instances of the armpostgresqlflexibleservers.VirtualEndpointsClient type. +type VirtualEndpointsServer struct { + // BeginCreate is the fake for method VirtualEndpointsClient.BeginCreate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated, http.StatusAccepted + BeginCreate func(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters armpostgresqlflexibleservers.VirtualEndpointResource, options *armpostgresqlflexibleservers.VirtualEndpointsClientBeginCreateOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.VirtualEndpointsClientCreateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method VirtualEndpointsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, options *armpostgresqlflexibleservers.VirtualEndpointsClientBeginDeleteOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.VirtualEndpointsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method VirtualEndpointsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, options *armpostgresqlflexibleservers.VirtualEndpointsClientGetOptions) (resp azfake.Responder[armpostgresqlflexibleservers.VirtualEndpointsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByServerPager is the fake for method VirtualEndpointsClient.NewListByServerPager + // HTTP status codes to indicate success: http.StatusOK + NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.VirtualEndpointsClientListByServerOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.VirtualEndpointsClientListByServerResponse]) + + // BeginUpdate is the fake for method VirtualEndpointsClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginUpdate func(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters armpostgresqlflexibleservers.VirtualEndpointResourceForPatch, options *armpostgresqlflexibleservers.VirtualEndpointsClientBeginUpdateOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.VirtualEndpointsClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewVirtualEndpointsServerTransport creates a new instance of VirtualEndpointsServerTransport with the provided implementation. +// The returned VirtualEndpointsServerTransport instance is connected to an instance of armpostgresqlflexibleservers.VirtualEndpointsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewVirtualEndpointsServerTransport(srv *VirtualEndpointsServer) *VirtualEndpointsServerTransport { + return &VirtualEndpointsServerTransport{ + srv: srv, + beginCreate: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.VirtualEndpointsClientCreateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.VirtualEndpointsClientDeleteResponse]](), + newListByServerPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.VirtualEndpointsClientListByServerResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.VirtualEndpointsClientUpdateResponse]](), + } +} + +// VirtualEndpointsServerTransport connects instances of armpostgresqlflexibleservers.VirtualEndpointsClient to instances of VirtualEndpointsServer. +// Don't use this type directly, use NewVirtualEndpointsServerTransport instead. +type VirtualEndpointsServerTransport struct { + srv *VirtualEndpointsServer + beginCreate *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.VirtualEndpointsClientCreateResponse]] + beginDelete *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.VirtualEndpointsClientDeleteResponse]] + newListByServerPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.VirtualEndpointsClientListByServerResponse]] + beginUpdate *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.VirtualEndpointsClientUpdateResponse]] +} + +// Do implements the policy.Transporter interface for VirtualEndpointsServerTransport. +func (v *VirtualEndpointsServerTransport) 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")} + } + + var resp *http.Response + var err error + + switch method { + case "VirtualEndpointsClient.BeginCreate": + resp, err = v.dispatchBeginCreate(req) + case "VirtualEndpointsClient.BeginDelete": + resp, err = v.dispatchBeginDelete(req) + case "VirtualEndpointsClient.Get": + resp, err = v.dispatchGet(req) + case "VirtualEndpointsClient.NewListByServerPager": + resp, err = v.dispatchNewListByServerPager(req) + case "VirtualEndpointsClient.BeginUpdate": + resp, err = v.dispatchBeginUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (v *VirtualEndpointsServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { + if v.srv.BeginCreate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreate not implemented")} + } + beginCreate := v.beginCreate.get(req) + if beginCreate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualendpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.VirtualEndpointResource](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 + } + virtualEndpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualEndpointName")]) + if err != nil { + return nil, err + } + respr, errRespr := v.srv.BeginCreate(req.Context(), resourceGroupNameParam, serverNameParam, virtualEndpointNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreate = &respr + v.beginCreate.add(req, beginCreate) + } + + resp, err := server.PollerResponderNext(beginCreate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { + v.beginCreate.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(beginCreate) { + v.beginCreate.remove(req) + } + + return resp, nil +} + +func (v *VirtualEndpointsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if v.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := v.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualendpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + virtualEndpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualEndpointName")]) + if err != nil { + return nil, err + } + respr, errRespr := v.srv.BeginDelete(req.Context(), resourceGroupNameParam, serverNameParam, virtualEndpointNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + v.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + v.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + v.beginDelete.remove(req) + } + + return resp, nil +} + +func (v *VirtualEndpointsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if v.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\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualendpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + virtualEndpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualEndpointName")]) + if err != nil { + return nil, err + } + respr, errRespr := v.srv.Get(req.Context(), resourceGroupNameParam, serverNameParam, virtualEndpointNameParam, 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).VirtualEndpointResource, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (v *VirtualEndpointsServerTransport) dispatchNewListByServerPager(req *http.Request) (*http.Response, error) { + if v.srv.NewListByServerPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByServerPager not implemented")} + } + newListByServerPager := v.newListByServerPager.get(req) + if newListByServerPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualendpoints` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + 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 := v.srv.NewListByServerPager(resourceGroupNameParam, serverNameParam, nil) + newListByServerPager = &resp + v.newListByServerPager.add(req, newListByServerPager) + server.PagerResponderInjectNextLinks(newListByServerPager, req, func(page *armpostgresqlflexibleservers.VirtualEndpointsClientListByServerResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByServerPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + v.newListByServerPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByServerPager) { + v.newListByServerPager.remove(req) + } + return resp, nil +} + +func (v *VirtualEndpointsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if v.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} + } + beginUpdate := v.beginUpdate.get(req) + if beginUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualendpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armpostgresqlflexibleservers.VirtualEndpointResourceForPatch](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 + } + virtualEndpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualEndpointName")]) + if err != nil { + return nil, err + } + respr, errRespr := v.srv.BeginUpdate(req.Context(), resourceGroupNameParam, serverNameParam, virtualEndpointNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + v.beginUpdate.add(req, beginUpdate) + } + + resp, err := server.PollerResponderNext(beginUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpdate) { + v.beginUpdate.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/virtualnetworksubnetusage_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/virtualnetworksubnetusage_server.go index 86cce7fb79ca..618a28f7e1f5 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/virtualnetworksubnetusage_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/virtualnetworksubnetusage_server.go @@ -15,7 +15,7 @@ import ( 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/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client.go index 43195cbfbbe5..73c547f770da 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client.go @@ -28,7 +28,7 @@ type FirewallRulesClient struct { } // NewFirewallRulesClient creates a new instance of FirewallRulesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - 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 NewFirewallRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallRulesClient, error) { @@ -46,7 +46,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 2022-12-01 +// Generated from API version 2023-06-01-preview // - 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. @@ -74,7 +74,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 2022-12-01 +// Generated from API version 2023-06-01-preview 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" @@ -120,7 +120,7 @@ func (client *FirewallRulesClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -132,7 +132,7 @@ func (client *FirewallRulesClient) createOrUpdateCreateRequest(ctx context.Conte // BeginDelete - Deletes a PostgreSQL server firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - 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. @@ -159,7 +159,7 @@ func (client *FirewallRulesClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Deletes a PostgreSQL server firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview 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" @@ -205,7 +205,7 @@ func (client *FirewallRulesClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,7 @@ func (client *FirewallRulesClient) deleteCreateRequest(ctx context.Context, reso // Get - List all the firewall rules in a given server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - 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. @@ -265,7 +265,7 @@ func (client *FirewallRulesClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +282,7 @@ func (client *FirewallRulesClient) getHandleResponse(resp *http.Response) (Firew // NewListByServerPager - List all the firewall rules in a given PostgreSQL server. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - 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 @@ -330,7 +330,7 @@ func (client *FirewallRulesClient) listByServerCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client_example_test.go index bcfb3df8a20f..19d4f3949c66 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/FirewallRuleCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleCreate.json func ExampleFirewallRulesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -56,7 +56,7 @@ func ExampleFirewallRulesClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/FirewallRuleDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleDelete.json func ExampleFirewallRulesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -77,7 +77,7 @@ func ExampleFirewallRulesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/FirewallRuleGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleGet.json func ExampleFirewallRulesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -106,7 +106,7 @@ func ExampleFirewallRulesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/FirewallRuleListByServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleListByServer.json func ExampleFirewallRulesClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client.go new file mode 100644 index 000000000000..6bf0d0860c4d --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client.go @@ -0,0 +1,198 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 armpostgresqlflexibleservers + +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" +) + +// FlexibleServerClient contains the methods for the FlexibleServer group. +// Don't use this type directly, use NewFlexibleServerClient() instead. +type FlexibleServerClient struct { + internal *arm.Client + subscriptionID string +} + +// NewFlexibleServerClient creates a new instance of FlexibleServerClient 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 NewFlexibleServerClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FlexibleServerClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &FlexibleServerClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginStartLtrBackup - Start the Long Term Retention Backup operation +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - parameters - Request body for operation +// - options - FlexibleServerClientBeginStartLtrBackupOptions contains the optional parameters for the FlexibleServerClient.BeginStartLtrBackup +// method. +func (client *FlexibleServerClient) BeginStartLtrBackup(ctx context.Context, resourceGroupName string, serverName string, parameters LtrBackupRequest, options *FlexibleServerClientBeginStartLtrBackupOptions) (*runtime.Poller[FlexibleServerClientStartLtrBackupResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.startLtrBackup(ctx, resourceGroupName, serverName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FlexibleServerClientStartLtrBackupResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FlexibleServerClientStartLtrBackupResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// StartLtrBackup - Start the Long Term Retention Backup operation +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +func (client *FlexibleServerClient) startLtrBackup(ctx context.Context, resourceGroupName string, serverName string, parameters LtrBackupRequest, options *FlexibleServerClientBeginStartLtrBackupOptions) (*http.Response, error) { + var err error + const operationName = "FlexibleServerClient.BeginStartLtrBackup" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.startLtrBackupCreateRequest(ctx, resourceGroupName, serverName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// startLtrBackupCreateRequest creates the StartLtrBackup request. +func (client *FlexibleServerClient) startLtrBackupCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters LtrBackupRequest, options *FlexibleServerClientBeginStartLtrBackupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/startLtrBackup" + 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.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// TriggerLtrPreBackup - PreBackup operation performs all the checks that are needed for the subsequent long term retention +// backup operation to succeed. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - parameters - Request body for operation +// - options - FlexibleServerClientTriggerLtrPreBackupOptions contains the optional parameters for the FlexibleServerClient.TriggerLtrPreBackup +// method. +func (client *FlexibleServerClient) TriggerLtrPreBackup(ctx context.Context, resourceGroupName string, serverName string, parameters LtrPreBackupRequest, options *FlexibleServerClientTriggerLtrPreBackupOptions) (FlexibleServerClientTriggerLtrPreBackupResponse, error) { + var err error + const operationName = "FlexibleServerClient.TriggerLtrPreBackup" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.triggerLtrPreBackupCreateRequest(ctx, resourceGroupName, serverName, parameters, options) + if err != nil { + return FlexibleServerClientTriggerLtrPreBackupResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FlexibleServerClientTriggerLtrPreBackupResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return FlexibleServerClientTriggerLtrPreBackupResponse{}, err + } + resp, err := client.triggerLtrPreBackupHandleResponse(httpResp) + return resp, err +} + +// triggerLtrPreBackupCreateRequest creates the TriggerLtrPreBackup request. +func (client *FlexibleServerClient) triggerLtrPreBackupCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters LtrPreBackupRequest, options *FlexibleServerClientTriggerLtrPreBackupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/ltrPreBackup" + 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.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// triggerLtrPreBackupHandleResponse handles the TriggerLtrPreBackup response. +func (client *FlexibleServerClient) triggerLtrPreBackupHandleResponse(resp *http.Response) (FlexibleServerClientTriggerLtrPreBackupResponse, error) { + result := FlexibleServerClientTriggerLtrPreBackupResponse{} + if val := resp.Header.Get("x-ms-request-id"); val != "" { + result.XMSRequestID = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.LtrPreBackupResponse); err != nil { + return FlexibleServerClientTriggerLtrPreBackupResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client_example_test.go new file mode 100644 index 000000000000..54c797338906 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client_example_test.go @@ -0,0 +1,91 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armpostgresqlflexibleservers_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/postgresql/armpostgresqlflexibleservers/v4" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionPreBackup.json +func ExampleFlexibleServerClient_TriggerLtrPreBackup() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewFlexibleServerClient().TriggerLtrPreBackup(ctx, "rgLongTermRetention", "pgsqlltrtestserver", armpostgresqlflexibleservers.LtrPreBackupRequest{ + BackupSettings: &armpostgresqlflexibleservers.BackupSettings{ + BackupName: to.Ptr("backup1"), + }, + }, 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.LtrPreBackupResponse = armpostgresqlflexibleservers.LtrPreBackupResponse{ + // Properties: &armpostgresqlflexibleservers.LtrPreBackupResponseProperties{ + // NumberOfContainers: to.Ptr[int32](1), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionBackup.json +func ExampleFlexibleServerClient_BeginStartLtrBackup() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewFlexibleServerClient().BeginStartLtrBackup(ctx, "rgLongTermRetention", "pgsqlltrtestserver", armpostgresqlflexibleservers.LtrBackupRequest{ + BackupSettings: &armpostgresqlflexibleservers.BackupSettings{ + BackupName: to.Ptr("backup1"), + }, + TargetDetails: &armpostgresqlflexibleservers.BackupStoreDetails{ + SasURIList: []*string{ + to.Ptr("sasuri")}, + }, + }, 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.LtrBackupResponse = armpostgresqlflexibleservers.LtrBackupResponse{ + // Properties: &armpostgresqlflexibleservers.LtrBackupOperationResponseProperties{ + // BackupMetadata: to.Ptr("backupmetadata"), + // DataTransferredInBytes: to.Ptr[int64](23), + // DatasourceSizeInBytes: to.Ptr[int64](23), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-13T01:32:30.128Z"); return t}()), + // PercentComplete: to.Ptr[float64](100), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-13T01:32:30.128Z"); return t}()), + // Status: to.Ptr(armpostgresqlflexibleservers.ExecutionStatusRunning), + // }, + // } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/getprivatednszonesuffix_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/getprivatednszonesuffix_client.go index 53e35761adfb..e9438a6ef472 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/getprivatednszonesuffix_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/getprivatednszonesuffix_client.go @@ -40,7 +40,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 2022-12-01 +// Generated from API version 2023-06-01-preview // - options - GetPrivateDNSZoneSuffixClientExecuteOptions contains the optional parameters for the GetPrivateDNSZoneSuffixClient.Execute // method. func (client *GetPrivateDNSZoneSuffixClient) Execute(ctx context.Context, options *GetPrivateDNSZoneSuffixClientExecuteOptions) (GetPrivateDNSZoneSuffixClientExecuteResponse, error) { @@ -73,7 +73,7 @@ func (client *GetPrivateDNSZoneSuffixClient) executeCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/getprivatednszonesuffix_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/getprivatednszonesuffix_client_example_test.go index 562f790e9696..857dc96d35f1 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/getprivatednszonesuffix_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/getprivatednszonesuffix_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/GetPrivateDnsZoneSuffix.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/GetPrivateDnsZoneSuffix.json func ExampleGetPrivateDNSZoneSuffixClient_Execute() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/go.mod b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/go.mod index 5293af6edaec..70e1003a8833 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/go.mod +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/go.mod @@ -1,4 +1,4 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v3 +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4 go 1.18 diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client.go index 2e21d37bb3dd..46d98c790d80 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client.go @@ -28,7 +28,7 @@ type LocationBasedCapabilitiesClient struct { } // NewLocationBasedCapabilitiesClient creates a new instance of LocationBasedCapabilitiesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - 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 NewLocationBasedCapabilitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LocationBasedCapabilitiesClient, error) { @@ -45,7 +45,7 @@ func NewLocationBasedCapabilitiesClient(subscriptionID string, credential azcore // NewExecutePager - Get capabilities at specified location in a given subscription. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - locationName - The name of the location. // - options - LocationBasedCapabilitiesClientExecuteOptions contains the optional parameters for the LocationBasedCapabilitiesClient.NewExecutePager // method. @@ -88,7 +88,7 @@ func (client *LocationBasedCapabilitiesClient) executeCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client_example_test.go index 86691275d2d1..dd829da70408 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/CapabilitiesByLocation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CapabilitiesByLocation.json func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -40,8041 +40,1667 @@ func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { } // 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 = armpostgresqlflexibleservers.CapabilitiesListResult{ - // Value: []*armpostgresqlflexibleservers.CapabilityProperties{ + // Value: []*armpostgresqlflexibleservers.FlexibleServerCapability{ // { - // GeoBackupSupported: to.Ptr(true), - // Status: to.Ptr("Default"), - // SupportedFlexibleServerEditions: []*armpostgresqlflexibleservers.FlexibleServerEditionCapability{ + // Name: to.Ptr("FlexibleServerCapabilities"), + // FastProvisioningSupported: to.Ptr(armpostgresqlflexibleservers.FastProvisioningSupportedEnumEnabled), + // GeoBackupSupported: to.Ptr(armpostgresqlflexibleservers.GeoBackupSupportedEnumEnabled), + // OnlineResizeSupported: to.Ptr(armpostgresqlflexibleservers.OnlineResizeSupportedEnumDisabled), + // Restricted: to.Ptr(armpostgresqlflexibleservers.RestrictedEnumDisabled), + // StorageAutoGrowthSupported: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowthSupportedEnumEnabled), + // SupportedFastProvisioningEditions: []*armpostgresqlflexibleservers.FastProvisioningEditionCapability{ // { - // Name: to.Ptr("Burstable"), - // Status: to.Ptr("Available"), - // SupportedServerVersions: []*armpostgresqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("11"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_B1ms"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("12"), - // to.Ptr("13"), - // to.Ptr("14")}, - // }, - // { - // Name: to.Ptr("12"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_B1ms"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }, - // { - // Name: to.Ptr("12.0"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_B1ms"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }, - // { - // Name: to.Ptr("12.1"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_B1ms"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }, - // { - // Name: to.Ptr("13"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_B1ms"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }}, - // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("ManagedDisk"), - // Status: to.Ptr("Default"), - // SupportedStorageMB: []*armpostgresqlflexibleservers.StorageMBCapability{ - // { - // Name: to.Ptr("32768"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int64](120), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("65536"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](65536), - // SupportedIops: to.Ptr[int64](240), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("131072"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](131072), - // SupportedIops: to.Ptr[int64](500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("262144"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](262144), - // SupportedIops: to.Ptr[int64](1100), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("524288"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](524288), - // SupportedIops: to.Ptr[int64](2300), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("1048576"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](1048576), - // SupportedIops: to.Ptr[int64](5000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("2097152"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](2097152), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("4194304"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](4194304), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("8388608"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](8388608), - // SupportedIops: to.Ptr[int64](16000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("16777216"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](16777216), - // SupportedIops: to.Ptr[int64](18000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }}, - // }}, - // }, - // { - // Name: to.Ptr("GeneralPurpose"), - // Status: to.Ptr("Available"), - // SupportedServerVersions: []*armpostgresqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("11"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_D2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("12"), - // to.Ptr("13"), - // to.Ptr("14")}, - // }, - // { - // Name: to.Ptr("12"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_D2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("12.0"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_D2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("12.1"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_D2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("13"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_D2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }}, - // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("ManagedDisk"), - // Status: to.Ptr("Default"), - // SupportedStorageMB: []*armpostgresqlflexibleservers.StorageMBCapability{ - // { - // Name: to.Ptr("32768"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int64](120), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("65536"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](65536), - // SupportedIops: to.Ptr[int64](240), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("131072"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](131072), - // SupportedIops: to.Ptr[int64](500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("262144"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](262144), - // SupportedIops: to.Ptr[int64](1100), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("524288"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](524288), - // SupportedIops: to.Ptr[int64](2300), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("1048576"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](1048576), - // SupportedIops: to.Ptr[int64](5000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("2097152"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](2097152), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("4194304"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](4194304), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("8388608"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](8388608), - // SupportedIops: to.Ptr[int64](16000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("16777216"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](16777216), - // SupportedIops: to.Ptr[int64](18000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }}, - // }}, - // }, - // { - // Name: to.Ptr("MemoryOptimized"), - // Status: to.Ptr("Available"), - // SupportedServerVersions: []*armpostgresqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("11"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_E2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E20ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](20), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }}, - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("12"), - // to.Ptr("13"), - // to.Ptr("14")}, - // }, - // { - // Name: to.Ptr("12"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_E2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E20ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](20), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("12.0"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_E2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E20ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](20), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("12.1"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_E2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E20ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](20), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("13"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_E2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E20ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](20), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }}, - // }}, - // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("ManagedDisk"), - // Status: to.Ptr("Default"), - // SupportedStorageMB: []*armpostgresqlflexibleservers.StorageMBCapability{ - // { - // Name: to.Ptr("32768"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int64](120), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("65536"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](65536), - // SupportedIops: to.Ptr[int64](240), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("131072"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](131072), - // SupportedIops: to.Ptr[int64](500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("262144"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](262144), - // SupportedIops: to.Ptr[int64](1100), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("524288"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](524288), - // SupportedIops: to.Ptr[int64](2300), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("1048576"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](1048576), - // SupportedIops: to.Ptr[int64](5000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("2097152"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](2097152), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("4194304"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](4194304), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("8388608"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](8388608), - // SupportedIops: to.Ptr[int64](16000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("16777216"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](16777216), - // SupportedIops: to.Ptr[int64](18000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }}, - // }}, - // }}, - // SupportedHAMode: []*string{ - // to.Ptr("SameZone"), - // to.Ptr("ZoneRedundant")}, - // SupportedHyperscaleNodeEditions: []*armpostgresqlflexibleservers.HyperscaleNodeEditionCapability{ - // { - // Name: to.Ptr("GeneralPurpose"), - // Status: to.Ptr("Available"), - // SupportedNodeTypes: []*armpostgresqlflexibleservers.NodeTypeCapability{ - // { - // Name: to.Ptr("Coordinator"), - // NodeType: to.Ptr("Coordinator"), - // Status: to.Ptr("Default"), - // }}, - // SupportedServerVersions: []*armpostgresqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("11"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_D4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](25600), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](51200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](80000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("12"), - // to.Ptr("13"), - // to.Ptr("14")}, - // }, - // { - // Name: to.Ptr("11.0"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_D4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // Status: to.Ptr("Available"), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // Status: to.Ptr("Available"), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // Status: to.Ptr("Available"), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("11.2"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_D4s_v3"), - // Status: to.Ptr("Available"), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](25600), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](51200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](80000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("11.2.8"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_D4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](25600), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](51200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](80000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }}, - // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("ManagedDisk"), - // Status: to.Ptr("Default"), - // SupportedStorageMB: []*armpostgresqlflexibleservers.StorageMBCapability{ - // { - // Name: to.Ptr("524288"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](524288), - // SupportedIops: to.Ptr[int64](2300), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("1048576"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](1048576), - // SupportedIops: to.Ptr[int64](5000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("2097152"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](2097152), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("4194304"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](4194304), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("8388608"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](8388608), - // SupportedIops: to.Ptr[int64](16000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("16777216"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](16777216), - // SupportedIops: to.Ptr[int64](18000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("33553408"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](33553408), - // SupportedIops: to.Ptr[int64](20000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }}, - // }}, - // }, - // { - // Name: to.Ptr("MemoryOptimized"), - // Status: to.Ptr("Available"), - // SupportedNodeTypes: []*armpostgresqlflexibleservers.NodeTypeCapability{ - // { - // Name: to.Ptr("Worker"), - // NodeType: to.Ptr("Worker"), - // Status: to.Ptr("Default"), - // }}, - // SupportedServerVersions: []*armpostgresqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("11"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_E4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](25600), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](51200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](80000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](64), - // }}, - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("12"), - // to.Ptr("13"), - // to.Ptr("14")}, - // }, - // { - // Name: to.Ptr("11.0"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_E4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](25600), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](51200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](80000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("11.2"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_E4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](25600), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](51200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](80000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("11.2.8"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_E4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](25600), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](51200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](80000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }}, - // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("ManagedDisk"), - // Status: to.Ptr("Default"), - // SupportedStorageMB: []*armpostgresqlflexibleservers.StorageMBCapability{ - // { - // Name: to.Ptr("524288"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](524288), - // SupportedIops: to.Ptr[int64](2300), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("1048576"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](1048576), - // SupportedIops: to.Ptr[int64](5000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("2097152"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](2097152), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("4194304"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](4194304), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("8388608"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](8388608), - // SupportedIops: to.Ptr[int64](16000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("16777216"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](16777216), - // SupportedIops: to.Ptr[int64](18000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("33553408"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](33553408), - // SupportedIops: to.Ptr[int64](20000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }}, - // }}, - // }}, - // Zone: to.Ptr("none"), - // ZoneRedundantHaAndGeoBackupSupported: to.Ptr(true), - // ZoneRedundantHaSupported: to.Ptr(true), - // }, - // { - // GeoBackupSupported: to.Ptr(true), - // Status: to.Ptr("Available"), - // SupportedFlexibleServerEditions: []*armpostgresqlflexibleservers.FlexibleServerEditionCapability{ - // { - // Name: to.Ptr("Burstable"), - // Status: to.Ptr("Available"), - // SupportedServerVersions: []*armpostgresqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("11"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_B1ms"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("12"), - // to.Ptr("13"), - // to.Ptr("14")}, - // }, - // { - // Name: to.Ptr("12"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_B1ms"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }, - // { - // Name: to.Ptr("12.0"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_B1ms"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }, - // { - // Name: to.Ptr("12.1"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_B1ms"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }, - // { - // Name: to.Ptr("13"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_B1ms"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }}, - // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("ManagedDisk"), - // Status: to.Ptr("Default"), - // SupportedStorageMB: []*armpostgresqlflexibleservers.StorageMBCapability{ - // { - // Name: to.Ptr("32768"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int64](120), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("65536"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](65536), - // SupportedIops: to.Ptr[int64](240), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("131072"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](131072), - // SupportedIops: to.Ptr[int64](500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("262144"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](262144), - // SupportedIops: to.Ptr[int64](1100), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("524288"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](524288), - // SupportedIops: to.Ptr[int64](2300), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("1048576"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](1048576), - // SupportedIops: to.Ptr[int64](5000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("2097152"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](2097152), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("4194304"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](4194304), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("8388608"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](8388608), - // SupportedIops: to.Ptr[int64](16000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("16777216"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](16777216), - // SupportedIops: to.Ptr[int64](18000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }}, - // }}, - // }, - // { - // Name: to.Ptr("GeneralPurpose"), - // Status: to.Ptr("Available"), - // SupportedServerVersions: []*armpostgresqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("11"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_D2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("12"), - // to.Ptr("13"), - // to.Ptr("14")}, - // }, - // { - // Name: to.Ptr("12"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_D2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("12.0"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_D2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("12.1"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_D2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("13"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_D2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }}, - // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("ManagedDisk"), - // Status: to.Ptr("Default"), - // SupportedStorageMB: []*armpostgresqlflexibleservers.StorageMBCapability{ - // { - // Name: to.Ptr("32768"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int64](120), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("65536"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](65536), - // SupportedIops: to.Ptr[int64](240), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("131072"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](131072), - // SupportedIops: to.Ptr[int64](500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("262144"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](262144), - // SupportedIops: to.Ptr[int64](1100), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("524288"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](524288), - // SupportedIops: to.Ptr[int64](2300), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("1048576"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](1048576), - // SupportedIops: to.Ptr[int64](5000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("2097152"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](2097152), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("4194304"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](4194304), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("8388608"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](8388608), - // SupportedIops: to.Ptr[int64](16000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("16777216"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](16777216), - // SupportedIops: to.Ptr[int64](18000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }}, - // }}, - // }, - // { - // Name: to.Ptr("MemoryOptimized"), - // Status: to.Ptr("Available"), - // SupportedServerVersions: []*armpostgresqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("11"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_E2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E20ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](20), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }}, - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("12"), - // to.Ptr("13"), - // to.Ptr("14")}, - // }, - // { - // Name: to.Ptr("12"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_E2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E20ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](20), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("12.0"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_E2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E20ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](20), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("12.1"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_E2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E20ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](20), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("13"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_E2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E20ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](20), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }}, - // }}, - // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("ManagedDisk"), - // Status: to.Ptr("Default"), - // SupportedStorageMB: []*armpostgresqlflexibleservers.StorageMBCapability{ - // { - // Name: to.Ptr("32768"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int64](120), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("65536"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](65536), - // SupportedIops: to.Ptr[int64](240), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("131072"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](131072), - // SupportedIops: to.Ptr[int64](500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("262144"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](262144), - // SupportedIops: to.Ptr[int64](1100), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("524288"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](524288), - // SupportedIops: to.Ptr[int64](2300), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("1048576"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](1048576), - // SupportedIops: to.Ptr[int64](5000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("2097152"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](2097152), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("4194304"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](4194304), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("8388608"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](8388608), - // SupportedIops: to.Ptr[int64](16000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("16777216"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](16777216), - // SupportedIops: to.Ptr[int64](18000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }}, - // }}, - // }}, - // SupportedHyperscaleNodeEditions: []*armpostgresqlflexibleservers.HyperscaleNodeEditionCapability{ - // }, - // Zone: to.Ptr("1"), - // ZoneRedundantHaAndGeoBackupSupported: to.Ptr(true), - // ZoneRedundantHaSupported: to.Ptr(true), - // }, - // { - // GeoBackupSupported: to.Ptr(true), - // Status: to.Ptr("Available"), - // SupportedFlexibleServerEditions: []*armpostgresqlflexibleservers.FlexibleServerEditionCapability{ - // { - // Name: to.Ptr("Burstable"), - // Status: to.Ptr("Available"), - // SupportedServerVersions: []*armpostgresqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("11"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_B1ms"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("12"), - // to.Ptr("13"), - // to.Ptr("14")}, - // }, - // { - // Name: to.Ptr("12"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_B1ms"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }, - // { - // Name: to.Ptr("12.0"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_B1ms"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }, - // { - // Name: to.Ptr("12.1"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_B1ms"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }, - // { - // Name: to.Ptr("13"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_B1ms"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }}, - // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("ManagedDisk"), - // Status: to.Ptr("Default"), - // SupportedStorageMB: []*armpostgresqlflexibleservers.StorageMBCapability{ - // { - // Name: to.Ptr("32768"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int64](120), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("65536"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](65536), - // SupportedIops: to.Ptr[int64](240), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("131072"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](131072), - // SupportedIops: to.Ptr[int64](500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("262144"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](262144), - // SupportedIops: to.Ptr[int64](1100), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("524288"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](524288), - // SupportedIops: to.Ptr[int64](2300), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("1048576"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](1048576), - // SupportedIops: to.Ptr[int64](5000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("2097152"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](2097152), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("4194304"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](4194304), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("8388608"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](8388608), - // SupportedIops: to.Ptr[int64](16000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("16777216"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](16777216), - // SupportedIops: to.Ptr[int64](18000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }}, - // }}, - // }, - // { - // Name: to.Ptr("GeneralPurpose"), - // Status: to.Ptr("Available"), - // SupportedServerVersions: []*armpostgresqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("11"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_D2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("12"), - // to.Ptr("13"), - // to.Ptr("14")}, - // }, - // { - // Name: to.Ptr("12"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_D2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("12.0"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_D2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("12.1"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_D2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("13"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_D2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }}, - // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("ManagedDisk"), - // Status: to.Ptr("Default"), - // SupportedStorageMB: []*armpostgresqlflexibleservers.StorageMBCapability{ - // { - // Name: to.Ptr("32768"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int64](120), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("65536"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](65536), - // SupportedIops: to.Ptr[int64](240), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("131072"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](131072), - // SupportedIops: to.Ptr[int64](500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("262144"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](262144), - // SupportedIops: to.Ptr[int64](1100), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("524288"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](524288), - // SupportedIops: to.Ptr[int64](2300), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("1048576"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](1048576), - // SupportedIops: to.Ptr[int64](5000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("2097152"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](2097152), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("4194304"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](4194304), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("8388608"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](8388608), - // SupportedIops: to.Ptr[int64](16000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("16777216"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](16777216), - // SupportedIops: to.Ptr[int64](18000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }}, - // }}, - // }, - // { - // Name: to.Ptr("MemoryOptimized"), - // Status: to.Ptr("Available"), - // SupportedServerVersions: []*armpostgresqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("11"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_E2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E20ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](20), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }}, - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("12"), - // to.Ptr("13"), - // to.Ptr("14")}, - // }, - // { - // Name: to.Ptr("12"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_E2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E20ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](20), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("12.0"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_E2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E20ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](20), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("12.1"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_E2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E20ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](20), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("13"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_E2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E20ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](20), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }}, - // }}, - // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("ManagedDisk"), - // Status: to.Ptr("Default"), - // SupportedStorageMB: []*armpostgresqlflexibleservers.StorageMBCapability{ - // { - // Name: to.Ptr("32768"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int64](120), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("65536"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](65536), - // SupportedIops: to.Ptr[int64](240), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("131072"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](131072), - // SupportedIops: to.Ptr[int64](500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("262144"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](262144), - // SupportedIops: to.Ptr[int64](1100), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("524288"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](524288), - // SupportedIops: to.Ptr[int64](2300), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("1048576"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](1048576), - // SupportedIops: to.Ptr[int64](5000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("2097152"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](2097152), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("4194304"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](4194304), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("8388608"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](8388608), - // SupportedIops: to.Ptr[int64](16000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("16777216"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](16777216), - // SupportedIops: to.Ptr[int64](18000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }}, - // }}, - // }}, - // SupportedHyperscaleNodeEditions: []*armpostgresqlflexibleservers.HyperscaleNodeEditionCapability{ - // }, - // Zone: to.Ptr("2"), - // ZoneRedundantHaAndGeoBackupSupported: to.Ptr(true), - // ZoneRedundantHaSupported: to.Ptr(true), + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("12"), + // SupportedSKU: to.Ptr("standard_b1ms"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("12"), + // SupportedSKU: to.Ptr("standard_b2s"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("12"), + // SupportedSKU: to.Ptr("standard_d2s_v3"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("12"), + // SupportedSKU: to.Ptr("standard_d2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("12"), + // SupportedSKU: to.Ptr("standard_e2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](512), + // SupportedTier: to.Ptr("MemoryOptimized"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("13"), + // SupportedSKU: to.Ptr("standard_b1ms"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("13"), + // SupportedSKU: to.Ptr("standard_b2s"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("13"), + // SupportedSKU: to.Ptr("standard_d2s_v3"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("13"), + // SupportedSKU: to.Ptr("standard_d2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("13"), + // SupportedSKU: to.Ptr("standard_e2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](512), + // SupportedTier: to.Ptr("MemoryOptimized"), + // }, + // { + // ServerCount: to.Ptr[int32](23), + // SupportedServerVersions: to.Ptr("14"), + // SupportedSKU: to.Ptr("standard_b1ms"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("14"), + // SupportedSKU: to.Ptr("standard_b2s"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("14"), + // SupportedSKU: to.Ptr("standard_d2s_v3"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("14"), + // SupportedSKU: to.Ptr("standard_d2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("14"), + // SupportedSKU: to.Ptr("standard_e2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](512), + // SupportedTier: to.Ptr("MemoryOptimized"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("15"), + // SupportedSKU: to.Ptr("standard_b1ms"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("15"), + // SupportedSKU: to.Ptr("standard_b2s"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("15"), + // SupportedSKU: to.Ptr("standard_d2s_v3"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("15"), + // SupportedSKU: to.Ptr("standard_d2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("15"), + // SupportedSKU: to.Ptr("standard_e2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](512), + // SupportedTier: to.Ptr("MemoryOptimized"), + // }}, + // SupportedServerEditions: []*armpostgresqlflexibleservers.FlexibleServerEditionCapability{ + // { + // Name: to.Ptr("Burstable"), + // DefaultSKUName: to.Ptr("Standard_B1ms"), + // SupportedServerSKUs: []*armpostgresqlflexibleservers.ServerSKUCapability{ + // { + // Name: to.Ptr("Standard_B1ms"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](640), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](1), + // }, + // { + // Name: to.Ptr("Standard_B2s"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](1280), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_B2ms"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](1700), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_B4ms"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](2400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](4), // }, // { - // GeoBackupSupported: to.Ptr(true), - // Status: to.Ptr("Available"), - // SupportedFlexibleServerEditions: []*armpostgresqlflexibleservers.FlexibleServerEditionCapability{ - // { - // Name: to.Ptr("Burstable"), - // Status: to.Ptr("Available"), - // SupportedServerVersions: []*armpostgresqlflexibleservers.ServerVersionCapability{ + // Name: to.Ptr("Standard_B8ms"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](3100), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_B12ms"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](3800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](12), + // }, // { - // Name: to.Ptr("11"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_B1ms"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("12"), - // to.Ptr("13"), - // to.Ptr("14")}, - // }, - // { - // Name: to.Ptr("12"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_B1ms"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }, - // { - // Name: to.Ptr("12.0"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_B1ms"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }, - // { - // Name: to.Ptr("12.1"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_B1ms"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }, - // { - // Name: to.Ptr("13"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_B1ms"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](640), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](1), - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](1280), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](2048), - // VCores: to.Ptr[int64](2), - // }}, - // }}, - // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("ManagedDisk"), - // Status: to.Ptr("Default"), - // SupportedStorageMB: []*armpostgresqlflexibleservers.StorageMBCapability{ - // { - // Name: to.Ptr("32768"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int64](120), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("65536"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](65536), - // SupportedIops: to.Ptr[int64](240), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("131072"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](131072), - // SupportedIops: to.Ptr[int64](500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("262144"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](262144), - // SupportedIops: to.Ptr[int64](1100), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("524288"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](524288), - // SupportedIops: to.Ptr[int64](2300), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("1048576"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](1048576), - // SupportedIops: to.Ptr[int64](5000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("2097152"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](2097152), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("4194304"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](4194304), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("8388608"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](8388608), - // SupportedIops: to.Ptr[int64](16000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("16777216"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](16777216), - // SupportedIops: to.Ptr[int64](18000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }}, - // }}, - // }, - // { - // Name: to.Ptr("GeneralPurpose"), - // Status: to.Ptr("Available"), - // SupportedServerVersions: []*armpostgresqlflexibleservers.ServerVersionCapability{ - // { - // Name: to.Ptr("11"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_D2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("12"), - // to.Ptr("13"), - // to.Ptr("14")}, - // }, - // { - // Name: to.Ptr("12"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_D2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("12.0"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_D2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("12.1"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_D2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("13"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_D2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_D4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_D8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_D16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_D32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_D48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_D64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](4096), - // VCores: to.Ptr[int64](64), + // Name: to.Ptr("Standard_B16ms"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](4300), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_B20ms"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](5000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](20), // }}, - // }}, - // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("ManagedDisk"), - // Status: to.Ptr("Default"), - // SupportedStorageMB: []*armpostgresqlflexibleservers.StorageMBCapability{ + // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ // { - // Name: to.Ptr("32768"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int64](120), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ + // Name: to.Ptr("ManagedDisk"), + // DefaultStorageSizeMb: to.Ptr[int64](32768), + // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), + // DefaultIopsTier: to.Ptr("P4"), + // StorageSizeMb: to.Ptr[int64](32768), + // SupportedIops: to.Ptr[int32](120), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P4"), + // Iops: to.Ptr[int32](120), + // }, + // { + // Name: to.Ptr("P6"), + // Iops: to.Ptr[int32](240), + // }, + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, // }, // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("65536"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](65536), - // SupportedIops: to.Ptr[int64](240), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), + // DefaultIopsTier: to.Ptr("P6"), + // StorageSizeMb: to.Ptr[int64](65536), + // SupportedIops: to.Ptr[int32](240), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P6"), + // Iops: to.Ptr[int32](240), + // }, + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, // }, // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("131072"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](131072), - // SupportedIops: to.Ptr[int64](500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), + // DefaultIopsTier: to.Ptr("P10"), + // StorageSizeMb: to.Ptr[int64](131072), + // SupportedIops: to.Ptr[int32](500), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, // }, // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("262144"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](262144), - // SupportedIops: to.Ptr[int64](1100), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), + // DefaultIopsTier: to.Ptr("P15"), + // StorageSizeMb: to.Ptr[int64](262144), + // SupportedIops: to.Ptr[int32](1100), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, // }, // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("524288"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](524288), - // SupportedIops: to.Ptr[int64](2300), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), + // DefaultIopsTier: to.Ptr("P20"), + // StorageSizeMb: to.Ptr[int64](524288), + // SupportedIops: to.Ptr[int32](2300), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, // }, // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("1048576"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](1048576), - // SupportedIops: to.Ptr[int64](5000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), + // DefaultIopsTier: to.Ptr("P30"), + // StorageSizeMb: to.Ptr[int64](1048576), + // SupportedIops: to.Ptr[int32](5000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, // }, // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("2097152"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](2097152), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), + // DefaultIopsTier: to.Ptr("P40"), + // StorageSizeMb: to.Ptr[int64](2097152), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, // }, // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("4194304"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](4194304), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), + // DefaultIopsTier: to.Ptr("P50"), + // StorageSizeMb: to.Ptr[int64](4194304), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, // }, // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("8388608"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](8388608), - // SupportedIops: to.Ptr[int64](16000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ + // DefaultIopsTier: to.Ptr("P60"), + // StorageSizeMb: to.Ptr[int64](8388608), + // SupportedIops: to.Ptr[int32](16000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P60"), + // Iops: to.Ptr[int32](16000), + // }, + // { + // Name: to.Ptr("P70"), + // Iops: to.Ptr[int32](18000), + // }, + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }}, + // }, // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), + // DefaultIopsTier: to.Ptr("P70"), + // StorageSizeMb: to.Ptr[int64](16777216), + // SupportedIops: to.Ptr[int32](18000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P70"), + // Iops: to.Ptr[int32](18000), + // }, + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }}, // }, // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), + // DefaultIopsTier: to.Ptr("P80"), + // StorageSizeMb: to.Ptr[int64](33553408), + // SupportedIops: to.Ptr[int32](20000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }}, // }}, // }, // { - // Name: to.Ptr("16777216"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](16777216), - // SupportedIops: to.Ptr[int64](18000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, + // Name: to.Ptr("ManagedDiskV2"), + // DefaultStorageSizeMb: to.Ptr[int64](65536), + // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), + // DefaultIopsTier: to.Ptr("None"), + // MaximumStorageSizeMb: to.Ptr[int64](67108864), + // StorageSizeMb: to.Ptr[int64](32768), + // SupportedIops: to.Ptr[int32](3000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("None"), + // Iops: to.Ptr[int32](0), + // }}, + // SupportedMaximumIops: to.Ptr[int32](80000), + // SupportedMaximumThroughput: to.Ptr[int32](750), + // SupportedThroughput: to.Ptr[int32](125), // }}, // }}, - // }}, - // }, - // { - // Name: to.Ptr("MemoryOptimized"), - // Status: to.Ptr("Available"), - // SupportedServerVersions: []*armpostgresqlflexibleservers.ServerVersionCapability{ + // }, // { - // Name: to.Ptr("11"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_E2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E20ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](20), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, + // Name: to.Ptr("GeneralPurpose"), + // DefaultSKUName: to.Ptr("Standard_D2ds_v4"), + // SupportedServerSKUs: []*armpostgresqlflexibleservers.ServerSKUCapability{ // { - // Name: to.Ptr("Standard_E64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }}, - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("12"), - // to.Ptr("13"), - // to.Ptr("14")}, - // }, - // { - // Name: to.Ptr("12"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_E2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E20ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](20), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("12.0"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_E2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E20ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](20), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("12.1"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_E2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E20ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](20), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }}, - // }, - // { - // Name: to.Ptr("13"), - // Status: to.Ptr("Available"), - // SupportedVcores: []*armpostgresqlflexibleservers.VcoreCapability{ - // { - // Name: to.Ptr("Standard_E2s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E32s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64s_v3"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](3200), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](2), - // }, - // { - // Name: to.Ptr("Standard_E4ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](6400), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](4), - // }, - // { - // Name: to.Ptr("Standard_E8ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](12800), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](8), - // }, - // { - // Name: to.Ptr("Standard_E16ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](16), - // }, - // { - // Name: to.Ptr("Standard_E20ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](20), - // }, - // { - // Name: to.Ptr("Standard_E32ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](32), - // }, - // { - // Name: to.Ptr("Standard_E48ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](8192), - // VCores: to.Ptr[int64](48), - // }, - // { - // Name: to.Ptr("Standard_E64ds_v4"), - // Status: to.Ptr("Available"), - // SupportedIops: to.Ptr[int64](18000), - // SupportedMemoryPerVcoreMB: to.Ptr[int64](6912), - // VCores: to.Ptr[int64](64), - // }}, - // }}, - // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ - // { - // Name: to.Ptr("ManagedDisk"), - // Status: to.Ptr("Default"), - // SupportedStorageMB: []*armpostgresqlflexibleservers.StorageMBCapability{ - // { - // Name: to.Ptr("32768"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](32768), - // SupportedIops: to.Ptr[int64](120), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("65536"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](65536), - // SupportedIops: to.Ptr[int64](240), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("131072"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](131072), - // SupportedIops: to.Ptr[int64](500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("262144"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](262144), - // SupportedIops: to.Ptr[int64](1100), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("524288"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](524288), - // SupportedIops: to.Ptr[int64](2300), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("1048576"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](1048576), - // SupportedIops: to.Ptr[int64](5000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("2097152"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](2097152), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("4194304"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](4194304), - // SupportedIops: to.Ptr[int64](7500), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("8388608"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](8388608), - // SupportedIops: to.Ptr[int64](16000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }, - // { - // Name: to.Ptr("16777216"), - // Status: to.Ptr("Available"), - // StorageSizeMB: to.Ptr[int64](16777216), - // SupportedIops: to.Ptr[int64](18000), - // SupportedUpgradableTierList: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // Name: to.Ptr("P4"), - // Iops: to.Ptr[int64](120), - // IsBaseline: to.Ptr(true), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P4"), - // }, - // { - // Name: to.Ptr("P6"), - // Iops: to.Ptr[int64](240), - // IsBaseline: to.Ptr(false), - // Status: to.Ptr("Available"), - // TierName: to.Ptr("P6"), - // }}, - // }}, - // }}, - // }}, - // SupportedHyperscaleNodeEditions: []*armpostgresqlflexibleservers.HyperscaleNodeEditionCapability{ - // }, - // Zone: to.Ptr("3"), - // ZoneRedundantHaAndGeoBackupSupported: to.Ptr(true), - // ZoneRedundantHaSupported: to.Ptr(true), - // }}, - // } + // Name: to.Ptr("Standard_D2s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](3200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_D4s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_D8s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_D16s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_D32s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_D48s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_D64s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_D2ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](3200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_D4ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_D8ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_D16ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_D32ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_D48ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_D64ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_D2ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](3200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_D4ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_D8ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_D16ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_D32ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_D48ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_D64ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_D96ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](96), + // }}, + // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ + // { + // Name: to.Ptr("ManagedDisk"), + // DefaultStorageSizeMb: to.Ptr[int64](65536), + // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ + // { + // DefaultIopsTier: to.Ptr("P4"), + // StorageSizeMb: to.Ptr[int64](32768), + // SupportedIops: to.Ptr[int32](120), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P4"), + // Iops: to.Ptr[int32](120), + // }, + // { + // Name: to.Ptr("P6"), + // Iops: to.Ptr[int32](240), + // }, + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P6"), + // StorageSizeMb: to.Ptr[int64](65536), + // SupportedIops: to.Ptr[int32](240), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P6"), + // Iops: to.Ptr[int32](240), + // }, + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P10"), + // StorageSizeMb: to.Ptr[int64](131072), + // SupportedIops: to.Ptr[int32](500), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P15"), + // StorageSizeMb: to.Ptr[int64](262144), + // SupportedIops: to.Ptr[int32](1100), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P20"), + // StorageSizeMb: to.Ptr[int64](524288), + // SupportedIops: to.Ptr[int32](2300), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P30"), + // StorageSizeMb: to.Ptr[int64](1048576), + // SupportedIops: to.Ptr[int32](5000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P40"), + // StorageSizeMb: to.Ptr[int64](2097152), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P50"), + // StorageSizeMb: to.Ptr[int64](4194304), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P60"), + // StorageSizeMb: to.Ptr[int64](8388608), + // SupportedIops: to.Ptr[int32](16000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P60"), + // Iops: to.Ptr[int32](16000), + // }, + // { + // Name: to.Ptr("P70"), + // Iops: to.Ptr[int32](18000), + // }, + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P70"), + // StorageSizeMb: to.Ptr[int64](16777216), + // SupportedIops: to.Ptr[int32](18000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P70"), + // Iops: to.Ptr[int32](18000), + // }, + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P80"), + // StorageSizeMb: to.Ptr[int64](33553408), + // SupportedIops: to.Ptr[int32](20000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }}, + // }}, + // }, + // { + // Name: to.Ptr("ManagedDiskV2"), + // DefaultStorageSizeMb: to.Ptr[int64](65536), + // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ + // { + // DefaultIopsTier: to.Ptr("None"), + // MaximumStorageSizeMb: to.Ptr[int64](67108864), + // StorageSizeMb: to.Ptr[int64](32768), + // SupportedIops: to.Ptr[int32](3000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("None"), + // Iops: to.Ptr[int32](0), + // }}, + // SupportedMaximumIops: to.Ptr[int32](80000), + // SupportedMaximumThroughput: to.Ptr[int32](750), + // SupportedThroughput: to.Ptr[int32](125), + // }}, + // }}, + // }, + // { + // Name: to.Ptr("MemoryOptimized"), + // DefaultSKUName: to.Ptr("Standard_E2ds_v4"), + // SupportedServerSKUs: []*armpostgresqlflexibleservers.ServerSKUCapability{ + // { + // Name: to.Ptr("Standard_E2s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](3200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_E4s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_E8s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_E16s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_E32s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_E48s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_E64s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](6912), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_E2ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](3200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_E4ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_E8ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_E16ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_E20ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](20), + // }, + // { + // Name: to.Ptr("Standard_E32ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_E48ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_E64ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](6912), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_E2ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](3200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_E4ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_E8ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_E16ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_E32ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_E48ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_E64ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_E96ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](7168), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](96), + // }}, + // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ + // { + // Name: to.Ptr("ManagedDisk"), + // DefaultStorageSizeMb: to.Ptr[int64](131072), + // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ + // { + // DefaultIopsTier: to.Ptr("P4"), + // StorageSizeMb: to.Ptr[int64](32768), + // SupportedIops: to.Ptr[int32](120), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P4"), + // Iops: to.Ptr[int32](120), + // }, + // { + // Name: to.Ptr("P6"), + // Iops: to.Ptr[int32](240), + // }, + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P6"), + // StorageSizeMb: to.Ptr[int64](65536), + // SupportedIops: to.Ptr[int32](240), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P6"), + // Iops: to.Ptr[int32](240), + // }, + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P10"), + // StorageSizeMb: to.Ptr[int64](131072), + // SupportedIops: to.Ptr[int32](500), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P15"), + // StorageSizeMb: to.Ptr[int64](262144), + // SupportedIops: to.Ptr[int32](1100), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P20"), + // StorageSizeMb: to.Ptr[int64](524288), + // SupportedIops: to.Ptr[int32](2300), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P30"), + // StorageSizeMb: to.Ptr[int64](1048576), + // SupportedIops: to.Ptr[int32](5000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P40"), + // StorageSizeMb: to.Ptr[int64](2097152), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P50"), + // StorageSizeMb: to.Ptr[int64](4194304), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P60"), + // StorageSizeMb: to.Ptr[int64](8388608), + // SupportedIops: to.Ptr[int32](16000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P60"), + // Iops: to.Ptr[int32](16000), + // }, + // { + // Name: to.Ptr("P70"), + // Iops: to.Ptr[int32](18000), + // }, + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P70"), + // StorageSizeMb: to.Ptr[int64](16777216), + // SupportedIops: to.Ptr[int32](18000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P70"), + // Iops: to.Ptr[int32](18000), + // }, + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P80"), + // StorageSizeMb: to.Ptr[int64](33553408), + // SupportedIops: to.Ptr[int32](20000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }}, + // }}, + // }, + // { + // Name: to.Ptr("ManagedDiskV2"), + // DefaultStorageSizeMb: to.Ptr[int64](65536), + // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ + // { + // DefaultIopsTier: to.Ptr("None"), + // MaximumStorageSizeMb: to.Ptr[int64](67108864), + // StorageSizeMb: to.Ptr[int64](32768), + // SupportedIops: to.Ptr[int32](3000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("None"), + // Iops: to.Ptr[int32](0), + // }}, + // SupportedMaximumIops: to.Ptr[int32](80000), + // SupportedMaximumThroughput: to.Ptr[int32](750), + // SupportedThroughput: to.Ptr[int32](125), + // }}, + // }}, + // }}, + // SupportedServerVersions: []*armpostgresqlflexibleservers.ServerVersionCapability{ + // { + // Name: to.Ptr("11"), + // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("12"), + // to.Ptr("13"), + // to.Ptr("14"), + // to.Ptr("15")}, + // }, + // { + // Name: to.Ptr("12"), + // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("13"), + // to.Ptr("14"), + // to.Ptr("15")}, + // }, + // { + // Name: to.Ptr("13"), + // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("14"), + // to.Ptr("15")}, + // }, + // { + // Name: to.Ptr("14"), + // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("15")}, + // }}, + // ZoneRedundantHaAndGeoBackupSupported: to.Ptr(armpostgresqlflexibleservers.ZoneRedundantHaAndGeoBackupSupportedEnumEnabled), + // ZoneRedundantHaSupported: to.Ptr(armpostgresqlflexibleservers.ZoneRedundantHaSupportedEnumEnabled), + // }}, + // } } } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/logfiles_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/logfiles_client.go new file mode 100644 index 000000000000..54f93b6b1a56 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/logfiles_client.go @@ -0,0 +1,109 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 armpostgresqlflexibleservers + +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" +) + +// LogFilesClient contains the methods for the LogFiles group. +// Don't use this type directly, use NewLogFilesClient() instead. +type LogFilesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewLogFilesClient creates a new instance of LogFilesClient 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 NewLogFilesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LogFilesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &LogFilesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListByServerPager - List all the server log files in a given server. +// +// Generated from API version 2023-06-01-preview +// - 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 +// method. +func (client *LogFilesClient) NewListByServerPager(resourceGroupName string, serverName string, options *LogFilesClientListByServerOptions) *runtime.Pager[LogFilesClientListByServerResponse] { + return runtime.NewPager(runtime.PagingHandler[LogFilesClientListByServerResponse]{ + More: func(page LogFilesClientListByServerResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *LogFilesClientListByServerResponse) (LogFilesClientListByServerResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "LogFilesClient.NewListByServerPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) + }, nil) + if err != nil { + return LogFilesClientListByServerResponse{}, err + } + return client.listByServerHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByServerCreateRequest creates the ListByServer request. +func (client *LogFilesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *LogFilesClientListByServerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/logFiles" + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByServerHandleResponse handles the ListByServer response. +func (client *LogFilesClient) listByServerHandleResponse(resp *http.Response) (LogFilesClientListByServerResponse, error) { + result := LogFilesClientListByServerResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LogFileListResult); err != nil { + return LogFilesClientListByServerResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/logfiles_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/logfiles_client_example_test.go new file mode 100644 index 000000000000..2112006d89dd --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/logfiles_client_example_test.go @@ -0,0 +1,58 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armpostgresqlflexibleservers_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/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 := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewLogFilesClient().NewListByServerPager("testrg", "postgresqltestsvc1", 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.LogFileListResult = armpostgresqlflexibleservers.LogFileListResult{ + // Value: []*armpostgresqlflexibleservers.LogFile{ + // { + // Name: to.Ptr("postgresql-slow-postgresqltestsvc1-2018022823.log"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/logFiles"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestsvc1/logFiles/postgresql-slow-postgresqltestsvc1-2018022823.log"), + // Properties: &armpostgresqlflexibleservers.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/postgresql-slow-postgresqltestsvc1-2018022823.log?sv=2015-04-05&sr=f&se=2018-03-01T07%3A12%3A13Z&sp=r"), + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_client.go new file mode 100644 index 000000000000..0223701ed407 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_client.go @@ -0,0 +1,178 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 armpostgresqlflexibleservers + +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" +) + +// LtrBackupOperationsClient contains the methods for the LtrBackupOperations group. +// Don't use this type directly, use NewLtrBackupOperationsClient() instead. +type LtrBackupOperationsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewLtrBackupOperationsClient creates a new instance of LtrBackupOperationsClient 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 NewLtrBackupOperationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LtrBackupOperationsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &LtrBackupOperationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Gets the result of the give long term retention backup operation for the flexible server. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - backupName - The name of the backup. +// - options - LtrBackupOperationsClientGetOptions contains the optional parameters for the LtrBackupOperationsClient.Get method. +func (client *LtrBackupOperationsClient) Get(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *LtrBackupOperationsClientGetOptions) (LtrBackupOperationsClientGetResponse, error) { + var err error + const operationName = "LtrBackupOperationsClient.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, backupName, options) + if err != nil { + return LtrBackupOperationsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LtrBackupOperationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LtrBackupOperationsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *LtrBackupOperationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *LtrBackupOperationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/ltrBackupOperations/{backupName}" + 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 backupName == "" { + return nil, errors.New("parameter backupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{backupName}", url.PathEscape(backupName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *LtrBackupOperationsClient) getHandleResponse(resp *http.Response) (LtrBackupOperationsClientGetResponse, error) { + result := LtrBackupOperationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LtrServerBackupOperation); err != nil { + return LtrBackupOperationsClientGetResponse{}, err + } + return result, nil +} + +// NewListByServerPager - Gets the result of the give long term retention backup operations for the flexible server. +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - options - LtrBackupOperationsClientListByServerOptions contains the optional parameters for the LtrBackupOperationsClient.NewListByServerPager +// method. +func (client *LtrBackupOperationsClient) NewListByServerPager(resourceGroupName string, serverName string, options *LtrBackupOperationsClientListByServerOptions) *runtime.Pager[LtrBackupOperationsClientListByServerResponse] { + return runtime.NewPager(runtime.PagingHandler[LtrBackupOperationsClientListByServerResponse]{ + More: func(page LtrBackupOperationsClientListByServerResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *LtrBackupOperationsClientListByServerResponse) (LtrBackupOperationsClientListByServerResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "LtrBackupOperationsClient.NewListByServerPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) + }, nil) + if err != nil { + return LtrBackupOperationsClientListByServerResponse{}, err + } + return client.listByServerHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByServerCreateRequest creates the ListByServer request. +func (client *LtrBackupOperationsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *LtrBackupOperationsClientListByServerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/ltrBackupOperations" + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByServerHandleResponse handles the ListByServer response. +func (client *LtrBackupOperationsClient) listByServerHandleResponse(resp *http.Response) (LtrBackupOperationsClientListByServerResponse, error) { + result := LtrBackupOperationsClientListByServerResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LtrServerBackupOperationList); err != nil { + return LtrBackupOperationsClientListByServerResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_client_example_test.go new file mode 100644 index 000000000000..f7a059df19d7 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_client_example_test.go @@ -0,0 +1,96 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armpostgresqlflexibleservers_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionOperationGet.json +func ExampleLtrBackupOperationsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewLtrBackupOperationsClient().Get(ctx, "rgLongTermRetention", "pgsqlltrtestserver", "backup1", 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.LtrServerBackupOperation = armpostgresqlflexibleservers.LtrServerBackupOperation{ + // Name: to.Ptr("backup1"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/ltrbackupOperations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rgLongTermRetention/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgsqlltrtestserver"), + // Properties: &armpostgresqlflexibleservers.LtrBackupOperationResponseProperties{ + // BackupMetadata: to.Ptr("backupMetadata"), + // BackupName: to.Ptr("backup1"), + // DataTransferredInBytes: to.Ptr[int64](9), + // DatasourceSizeInBytes: to.Ptr[int64](21), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-13T01:32:30.128Z"); return t}()), + // PercentComplete: to.Ptr[float64](4), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-13T01:32:30.128Z"); return t}()), + // Status: to.Ptr(armpostgresqlflexibleservers.ExecutionStatusRunning), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionOperationListByServer.json +func ExampleLtrBackupOperationsClient_NewListByServerPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewLtrBackupOperationsClient().NewListByServerPager("rgLongTermRetention", "pgsqlltrtestserver", 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.LtrServerBackupOperationList = armpostgresqlflexibleservers.LtrServerBackupOperationList{ + // Value: []*armpostgresqlflexibleservers.LtrServerBackupOperation{ + // { + // Name: to.Ptr("backup1"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/ltrbackupOperations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/rgLongTermRetention/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgsqlltrtestserver"), + // Properties: &armpostgresqlflexibleservers.LtrBackupOperationResponseProperties{ + // BackupMetadata: to.Ptr("backupMetadata"), + // BackupName: to.Ptr("backup1"), + // DataTransferredInBytes: to.Ptr[int64](9), + // DatasourceSizeInBytes: to.Ptr[int64](21), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-13T01:32:30.128Z"); return t}()), + // PercentComplete: to.Ptr[float64](4), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-13T01:32:30.128Z"); return t}()), + // Status: to.Ptr(armpostgresqlflexibleservers.ExecutionStatusRunning), + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client.go new file mode 100644 index 000000000000..e84a9c19a26e --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client.go @@ -0,0 +1,389 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 armpostgresqlflexibleservers + +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" +) + +// MigrationsClient contains the methods for the Migrations group. +// Don't use this type directly, use NewMigrationsClient() instead. +type MigrationsClient struct { + internal *arm.Client +} + +// NewMigrationsClient creates a new instance of MigrationsClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewMigrationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*MigrationsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &MigrationsClient{ + internal: cl, + } + return client, nil +} + +// Create - Creates a new migration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - subscriptionID - The subscription ID of the target database server. +// - resourceGroupName - The resource group name of the target database server. +// - targetDbServerName - The name of the target database server. +// - migrationName - The name of the migration. +// - parameters - The required parameters for creating a migration. +// - options - MigrationsClientCreateOptions contains the optional parameters for the MigrationsClient.Create method. +func (client *MigrationsClient) Create(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, migrationName string, parameters MigrationResource, options *MigrationsClientCreateOptions) (MigrationsClientCreateResponse, error) { + var err error + const operationName = "MigrationsClient.Create" + 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, subscriptionID, resourceGroupName, targetDbServerName, migrationName, parameters, options) + if err != nil { + return MigrationsClientCreateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return MigrationsClientCreateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return MigrationsClientCreateResponse{}, err + } + resp, err := client.createHandleResponse(httpResp) + return resp, err +} + +// createCreateRequest creates the Create request. +func (client *MigrationsClient) createCreateRequest(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, migrationName string, parameters MigrationResource, options *MigrationsClientCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/migrations/{migrationName}" + if subscriptionID == "" { + return nil, errors.New("parameter subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if targetDbServerName == "" { + return nil, errors.New("parameter targetDbServerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetDbServerName}", url.PathEscape(targetDbServerName)) + if migrationName == "" { + return nil, errors.New("parameter migrationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{migrationName}", url.PathEscape(migrationName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createHandleResponse handles the Create response. +func (client *MigrationsClient) createHandleResponse(resp *http.Response) (MigrationsClientCreateResponse, error) { + result := MigrationsClientCreateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MigrationResource); err != nil { + return MigrationsClientCreateResponse{}, err + } + return result, nil +} + +// Delete - Deletes a migration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - subscriptionID - The subscription ID of the target database server. +// - resourceGroupName - The resource group name of the target database server. +// - targetDbServerName - The name of the target database server. +// - migrationName - The name of the migration. +// - options - MigrationsClientDeleteOptions contains the optional parameters for the MigrationsClient.Delete method. +func (client *MigrationsClient) Delete(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, migrationName string, options *MigrationsClientDeleteOptions) (MigrationsClientDeleteResponse, error) { + var err error + const operationName = "MigrationsClient.Delete" + 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, subscriptionID, resourceGroupName, targetDbServerName, migrationName, options) + if err != nil { + return MigrationsClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return MigrationsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return MigrationsClientDeleteResponse{}, err + } + return MigrationsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *MigrationsClient) deleteCreateRequest(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, migrationName string, options *MigrationsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/migrations/{migrationName}" + if subscriptionID == "" { + return nil, errors.New("parameter subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if targetDbServerName == "" { + return nil, errors.New("parameter targetDbServerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetDbServerName}", url.PathEscape(targetDbServerName)) + if migrationName == "" { + return nil, errors.New("parameter migrationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{migrationName}", url.PathEscape(migrationName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets details of a migration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - subscriptionID - The subscription ID of the target database server. +// - resourceGroupName - The resource group name of the target database server. +// - targetDbServerName - The name of the target database server. +// - migrationName - The name of the migration. +// - options - MigrationsClientGetOptions contains the optional parameters for the MigrationsClient.Get method. +func (client *MigrationsClient) Get(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, migrationName string, options *MigrationsClientGetOptions) (MigrationsClientGetResponse, error) { + var err error + const operationName = "MigrationsClient.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, subscriptionID, resourceGroupName, targetDbServerName, migrationName, options) + if err != nil { + return MigrationsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return MigrationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MigrationsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *MigrationsClient) getCreateRequest(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, migrationName string, options *MigrationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/migrations/{migrationName}" + if subscriptionID == "" { + return nil, errors.New("parameter subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if targetDbServerName == "" { + return nil, errors.New("parameter targetDbServerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetDbServerName}", url.PathEscape(targetDbServerName)) + if migrationName == "" { + return nil, errors.New("parameter migrationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{migrationName}", url.PathEscape(migrationName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *MigrationsClient) getHandleResponse(resp *http.Response) (MigrationsClientGetResponse, error) { + result := MigrationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MigrationResource); err != nil { + return MigrationsClientGetResponse{}, err + } + return result, nil +} + +// NewListByTargetServerPager - List all the migrations on a given target server. +// +// Generated from API version 2023-06-01-preview +// - subscriptionID - The subscription ID of the target database server. +// - resourceGroupName - The resource group name of the target database server. +// - targetDbServerName - The name of the target database server. +// - options - MigrationsClientListByTargetServerOptions contains the optional parameters for the MigrationsClient.NewListByTargetServerPager +// method. +func (client *MigrationsClient) NewListByTargetServerPager(subscriptionID string, resourceGroupName string, targetDbServerName string, options *MigrationsClientListByTargetServerOptions) *runtime.Pager[MigrationsClientListByTargetServerResponse] { + return runtime.NewPager(runtime.PagingHandler[MigrationsClientListByTargetServerResponse]{ + More: func(page MigrationsClientListByTargetServerResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *MigrationsClientListByTargetServerResponse) (MigrationsClientListByTargetServerResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "MigrationsClient.NewListByTargetServerPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByTargetServerCreateRequest(ctx, subscriptionID, resourceGroupName, targetDbServerName, options) + }, nil) + if err != nil { + return MigrationsClientListByTargetServerResponse{}, err + } + return client.listByTargetServerHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByTargetServerCreateRequest creates the ListByTargetServer request. +func (client *MigrationsClient) listByTargetServerCreateRequest(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, options *MigrationsClientListByTargetServerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/migrations" + if subscriptionID == "" { + return nil, errors.New("parameter subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if targetDbServerName == "" { + return nil, errors.New("parameter targetDbServerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetDbServerName}", url.PathEscape(targetDbServerName)) + 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", "2023-06-01-preview") + if options != nil && options.MigrationListFilter != nil { + reqQP.Set("migrationListFilter", string(*options.MigrationListFilter)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByTargetServerHandleResponse handles the ListByTargetServer response. +func (client *MigrationsClient) listByTargetServerHandleResponse(resp *http.Response) (MigrationsClientListByTargetServerResponse, error) { + result := MigrationsClientListByTargetServerResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MigrationResourceListResult); err != nil { + return MigrationsClientListByTargetServerResponse{}, err + } + return result, nil +} + +// Update - Updates an existing migration. The request body can contain one to many of the mutable properties present in the +// migration definition. Certain property updates initiate migration state transitions. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - subscriptionID - The subscription ID of the target database server. +// - resourceGroupName - The resource group name of the target database server. +// - targetDbServerName - The name of the target database server. +// - migrationName - The name of the migration. +// - parameters - The required parameters for updating a migration. +// - options - MigrationsClientUpdateOptions contains the optional parameters for the MigrationsClient.Update method. +func (client *MigrationsClient) Update(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, migrationName string, parameters MigrationResourceForPatch, options *MigrationsClientUpdateOptions) (MigrationsClientUpdateResponse, error) { + var err error + const operationName = "MigrationsClient.Update" + 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, subscriptionID, resourceGroupName, targetDbServerName, migrationName, parameters, options) + if err != nil { + return MigrationsClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return MigrationsClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MigrationsClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *MigrationsClient) updateCreateRequest(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, migrationName string, parameters MigrationResourceForPatch, options *MigrationsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/migrations/{migrationName}" + if subscriptionID == "" { + return nil, errors.New("parameter subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if targetDbServerName == "" { + return nil, errors.New("parameter targetDbServerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetDbServerName}", url.PathEscape(targetDbServerName)) + if migrationName == "" { + return nil, errors.New("parameter migrationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{migrationName}", url.PathEscape(migrationName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *MigrationsClient) updateHandleResponse(resp *http.Response) (MigrationsClientUpdateResponse, error) { + result := MigrationsClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MigrationResource); err != nil { + return MigrationsClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client_example_test.go new file mode 100644 index 000000000000..caa565d83d0d --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client_example_test.go @@ -0,0 +1,1073 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armpostgresqlflexibleservers_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/postgresql/armpostgresqlflexibleservers/v4" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create_Other_SourceTypes_Validate_Migrate.json +func ExampleMigrationsClient_Create_createMigrationWithOtherSourceTypesForValidateAndMigrate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewMigrationsClient().Create(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", armpostgresqlflexibleservers.MigrationResource{ + Location: to.Ptr("westus"), + Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + DbsToMigrate: []*string{ + to.Ptr("db1"), + to.Ptr("db2"), + to.Ptr("db3"), + to.Ptr("db4")}, + MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), + MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidateAndMigrate), + OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), + SecretParameters: &armpostgresqlflexibleservers.MigrationSecretParameters{ + AdminCredentials: &armpostgresqlflexibleservers.AdminCredentials{ + SourceServerPassword: to.Ptr("xxxxxxxx"), + TargetServerPassword: to.Ptr("xxxxxxxx"), + }, + }, + SourceDbServerResourceID: to.Ptr("testsource:5432@pguser"), + SourceType: to.Ptr(armpostgresqlflexibleservers.SourceTypeOnPremises), + SSLMode: to.Ptr(armpostgresqlflexibleservers.SSLModePrefer), + }, + }, 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.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ + // Name: to.Ptr("testmigration"), + // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "key1624": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // }, + // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStateValidationInProgress), + // }, + // Error: to.Ptr(""), + // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("db1"), + // to.Ptr("db2"), + // to.Ptr("db3"), + // to.Ptr("db4")}, + // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), + // MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidateAndMigrate), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-06T16:05:58.895Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumFalse), + // SourceDbServerResourceID: to.Ptr("testsource:5432@pguser"), + // SourceType: to.Ptr(armpostgresqlflexibleservers.SourceTypeOnPremises), + // SSLMode: to.Ptr(armpostgresqlflexibleservers.SSLModePrefer), + // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), + // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create_Validate_Only.json +func ExampleMigrationsClient_Create_createPreMigrationValidation() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewMigrationsClient().Create(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", armpostgresqlflexibleservers.MigrationResource{ + Location: to.Ptr("westus"), + Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + DbsToMigrate: []*string{ + to.Ptr("db1"), + to.Ptr("db2"), + to.Ptr("db3"), + to.Ptr("db4")}, + MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), + MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidate), + OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), + SecretParameters: &armpostgresqlflexibleservers.MigrationSecretParameters{ + AdminCredentials: &armpostgresqlflexibleservers.AdminCredentials{ + SourceServerPassword: to.Ptr("xxxxxxxx"), + TargetServerPassword: to.Ptr("xxxxxxxx"), + }, + }, + SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), + }, + }, 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.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ + // Name: to.Ptr("testmigration"), + // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "key1624": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // }, + // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStateValidationInProgress), + // }, + // Error: to.Ptr(""), + // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("db1"), + // to.Ptr("db2"), + // to.Ptr("db3"), + // to.Ptr("db4")}, + // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), + // MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidate), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-06T16:05:58.895Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumFalse), + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), + // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), + // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create_With_Other_Users.json +func ExampleMigrationsClient_Create_migrationsCreateByPassingUserNames() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewMigrationsClient().Create(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", armpostgresqlflexibleservers.MigrationResource{ + Location: to.Ptr("westus"), + Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + DbsToMigrate: []*string{ + to.Ptr("db1"), + to.Ptr("db2"), + to.Ptr("db3"), + to.Ptr("db4")}, + MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), + SecretParameters: &armpostgresqlflexibleservers.MigrationSecretParameters{ + AdminCredentials: &armpostgresqlflexibleservers.AdminCredentials{ + SourceServerPassword: to.Ptr("xxxxxxxx"), + TargetServerPassword: to.Ptr("xxxxxxxx"), + }, + SourceServerUsername: to.Ptr("newadmin@testsource"), + TargetServerUsername: to.Ptr("targetadmin"), + }, + SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), + }, + }, 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.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ + // Name: to.Ptr("testmigration"), + // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "key1624": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // }, + // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStatePerformingPreRequisiteSteps), + // }, + // Error: to.Ptr(""), + // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("db1"), + // to.Ptr("db2"), + // to.Ptr("db3"), + // to.Ptr("db4")}, + // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), + // MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-06T16:05:58.895Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumFalse), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumFalse), + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), + // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), + // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create.json +func ExampleMigrationsClient_Create_migrationsCreate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewMigrationsClient().Create(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", armpostgresqlflexibleservers.MigrationResource{ + Location: to.Ptr("westus"), + Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + DbsToMigrate: []*string{ + to.Ptr("db1"), + to.Ptr("db2"), + to.Ptr("db3"), + to.Ptr("db4")}, + MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), + OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), + SecretParameters: &armpostgresqlflexibleservers.MigrationSecretParameters{ + AdminCredentials: &armpostgresqlflexibleservers.AdminCredentials{ + SourceServerPassword: to.Ptr("xxxxxxxx"), + TargetServerPassword: to.Ptr("xxxxxxxx"), + }, + }, + SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), + }, + }, 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.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ + // Name: to.Ptr("testmigration"), + // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "key1624": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // }, + // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStatePerformingPreRequisiteSteps), + // }, + // Error: to.Ptr(""), + // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("db1"), + // to.Ptr("db2"), + // to.Ptr("db3"), + // to.Ptr("db4")}, + // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-06T16:05:58.895Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumFalse), + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), + // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), + // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Get.json +func ExampleMigrationsClient_Get_migrationsGet() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewMigrationsClient().Get(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", 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.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ + // Name: to.Ptr("testmigration"), + // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), + // Location: to.Ptr("westus"), + // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStatePerformingPreRequisiteSteps), + // }, + // Error: to.Ptr(""), + // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("db1"), + // to.Ptr("db2"), + // to.Ptr("db3"), + // to.Ptr("db4")}, + // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-06T16:05:58.895Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumFalse), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumFalse), + // SourceDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ + // Location: to.Ptr("westus"), + // SKU: &armpostgresqlflexibleservers.ServerSKU{ + // Name: to.Ptr("B_Gen5_2"), + // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTier("Basic")), + // }, + // StorageMb: to.Ptr[int32](1024), + // Version: to.Ptr("10"), + // }, + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), + // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), + // TargetDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ + // Location: to.Ptr("westus"), + // SKU: &armpostgresqlflexibleservers.ServerSKU{ + // Name: to.Ptr("Standard_D4s_v3"), + // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), + // }, + // StorageMb: to.Ptr[int32](2048), + // Version: to.Ptr("11"), + // }, + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), + // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationAndMigration.json +func ExampleMigrationsClient_Get_migrationsGetMigrationWithSuccessfulValidationAndMigration() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewMigrationsClient().Get(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigrationwithsuccessfulvalidationandmigration", 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.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ + // Name: to.Ptr("testmigrationwithsuccessfulvalidationandmigration"), + // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigrationwithsuccessfulvalidationandmigration"), + // Location: to.Ptr("eastus"), + // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStateCompleted), + // DbDetails: map[string]*armpostgresqlflexibleservers.DbMigrationStatus{ + // "testdb3": &armpostgresqlflexibleservers.DbMigrationStatus{ + // AppliedChanges: to.Ptr[int32](0), + // CdcDeleteCounter: to.Ptr[int32](0), + // CdcInsertCounter: to.Ptr[int32](0), + // CdcUpdateCounter: to.Ptr[int32](0), + // DatabaseName: to.Ptr("testdb3"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:55:49.681Z"); return t}()), + // FullLoadCompletedTables: to.Ptr[int32](10), + // FullLoadErroredTables: to.Ptr[int32](0), + // FullLoadLoadingTables: to.Ptr[int32](0), + // FullLoadQueuedTables: to.Ptr[int32](0), + // IncomingChanges: to.Ptr[int32](0), + // Latency: to.Ptr[int32](0), + // MigrationState: to.Ptr(armpostgresqlflexibleservers.MigrationDbStateSucceeded), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:55:28.995Z"); return t}()), + // }, + // }, + // ValidationDetails: &armpostgresqlflexibleservers.ValidationDetails{ + // DbLevelValidationDetails: []*armpostgresqlflexibleservers.DbLevelValidationStatus{ + // { + // DatabaseName: to.Ptr("testdb3"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:54:29.894Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:54:29.553Z"); return t}()), + // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ + // { + // Type: to.Ptr("SchemaValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("ExtensionsValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("CollationsValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }}, + // }}, + // ServerLevelValidationDetails: []*armpostgresqlflexibleservers.ValidationSummaryItem{ + // { + // Type: to.Ptr("AuthenticationAndConnectivityValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("SourceVersionValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("ServerParametersValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }}, + // Status: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:55:00.499Z"); return t}()), + // ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:54:28.077Z"); return t}()), + // }, + // }, + // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateSucceeded), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("testdb3")}, + // MigrationID: to.Ptr("f2354e72-2828-4a19-ad20-b4cd9e2673c1"), + // MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), + // MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidateAndMigrate), + // MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:57:30.736Z"); return t}()), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-12T05:54:15.999Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumTrue), + // SourceDbServerResourceID: to.Ptr("20.228.214.65:5432@postgres"), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), + // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumTrue), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure.json +func ExampleMigrationsClient_Get_migrationsGetMigrationWithSuccessfulValidationButMigrationFailure() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewMigrationsClient().Get(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigrationwithsuccessfulvalidationbutmigrationfailure", 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.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ + // Name: to.Ptr("testmigrationwithsuccessfulvalidationbutmigrationfailure"), + // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigrationwithsuccessfulvalidationbutmigrationfailure"), + // Location: to.Ptr("eastus2"), + // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStateCompleted), + // DbDetails: map[string]*armpostgresqlflexibleservers.DbMigrationStatus{ + // "testdb6": &armpostgresqlflexibleservers.DbMigrationStatus{ + // AppliedChanges: to.Ptr[int32](0), + // CdcDeleteCounter: to.Ptr[int32](0), + // CdcInsertCounter: to.Ptr[int32](0), + // CdcUpdateCounter: to.Ptr[int32](0), + // DatabaseName: to.Ptr("testdb6"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:09:53.252Z"); return t}()), + // FullLoadCompletedTables: to.Ptr[int32](0), + // FullLoadErroredTables: to.Ptr[int32](0), + // FullLoadLoadingTables: to.Ptr[int32](0), + // FullLoadQueuedTables: to.Ptr[int32](0), + // IncomingChanges: to.Ptr[int32](0), + // Latency: to.Ptr[int32](0), + // Message: to.Ptr("Collation/Encoding not Supported Error: User defined Collations are present in the source database. Please drop them before retrying the migration."), + // MigrationState: to.Ptr(armpostgresqlflexibleservers.MigrationDbStateFailed), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:09:52.922Z"); return t}()), + // }, + // }, + // ValidationDetails: &armpostgresqlflexibleservers.ValidationDetails{ + // DbLevelValidationDetails: []*armpostgresqlflexibleservers.DbLevelValidationStatus{ + // { + // DatabaseName: to.Ptr("address_standardizer"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:04:24.565Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:04:24.565Z"); return t}()), + // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ + // { + // Type: to.Ptr("ExtensionsValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }}, + // }}, + // ServerLevelValidationDetails: []*armpostgresqlflexibleservers.ValidationSummaryItem{ + // { + // Type: to.Ptr("AuthenticationAndConnectivityValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }}, + // Status: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:04:24.565Z"); return t}()), + // ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:04:21.623Z"); return t}()), + // }, + // }, + // Error: to.Ptr("testdb6: Collation/Encoding not Supported Error: User defined Collations are present in the source database. Please drop them before retrying the migration. "), + // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateFailed), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("testdb6")}, + // MigrationID: to.Ptr("da52db29-cfeb-4670-a1ad-683edb14c621"), + // MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), + // MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidateAndMigrate), + // MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:04:24.565Z"); return t}()), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-21T13:04:24.565Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumTrue), + // SourceDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ + // Location: to.Ptr("eastus2"), + // SKU: &armpostgresqlflexibleservers.ServerSKU{ + // }, + // StorageMb: to.Ptr[int32](102400), + // }, + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/source-rg/providers/Microsoft.DBforPostgreSQL/servers/testsource"), + // TargetDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ + // Location: to.Ptr("East US 2"), + // SKU: &armpostgresqlflexibleservers.ServerSKU{ + // Name: to.Ptr("Standard_D2ds_v4"), + // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTier("Standard_D2ds_v4")), + // }, + // StorageMb: to.Ptr[int32](131072), + // }, + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testtarget"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationOnly.json +func ExampleMigrationsClient_Get_migrationsGetMigrationWithSuccessfulValidationOnly() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewMigrationsClient().Get(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigrationwithsuccessfulvalidationonly", 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.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ + // Name: to.Ptr("testmigrationwithsuccessfulvalidationonly"), + // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigrationwithsuccessfulvalidationonly"), + // Location: to.Ptr("westus"), + // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStateCompleted), + // DbDetails: map[string]*armpostgresqlflexibleservers.DbMigrationStatus{ + // }, + // ValidationDetails: &armpostgresqlflexibleservers.ValidationDetails{ + // DbLevelValidationDetails: []*armpostgresqlflexibleservers.DbLevelValidationStatus{ + // { + // DatabaseName: to.Ptr("UnknownCollationTest"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-16T05:29:39.248Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-16T05:29:38.904Z"); return t}()), + // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ + // { + // Type: to.Ptr("SchemaValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("ExtensionsValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("CollationsValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }}, + // }}, + // ServerLevelValidationDetails: []*armpostgresqlflexibleservers.ValidationSummaryItem{ + // { + // Type: to.Ptr("AuthenticationAndConnectivityValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("SourceVersionValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("ServerParametersValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }}, + // Status: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-16T05:29:39.666Z"); return t}()), + // ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-16T05:29:35.634Z"); return t}()), + // }, + // }, + // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateSucceeded), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("UnknownCollationTest")}, + // MigrationID: to.Ptr("77840327-7be8-44b8-adc0-af0ccccfeb36"), + // MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), + // MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidate), + // MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-16T05:30:05.885Z"); return t}()), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-16T05:28:58.775Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumTrue), + // SourceDbServerResourceID: to.Ptr("20.228.214.65:5432@postgres"), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), + // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumTrue), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_GetMigrationWithValidationFailures.json +func ExampleMigrationsClient_Get_migrationsGetMigrationWithValidationFailures() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewMigrationsClient().Get(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigrationwithvalidationfailure", 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.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ + // Name: to.Ptr("testmigrationwithvalidationfailure"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/migrations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testtarget/migrations/testmigrationwithvalidationfailure"), + // Location: to.Ptr("East US"), + // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStateCompleted), + // DbDetails: map[string]*armpostgresqlflexibleservers.DbMigrationStatus{ + // }, + // ValidationDetails: &armpostgresqlflexibleservers.ValidationDetails{ + // DbLevelValidationDetails: []*armpostgresqlflexibleservers.DbLevelValidationStatus{ + // { + // DatabaseName: to.Ptr("c.utf-8"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()), + // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ + // { + // Type: to.Ptr("SchemaValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("ExtensionsValidation"), + // Messages: []*armpostgresqlflexibleservers.ValidationMessage{ + // { + // Message: to.Ptr("Unsupported Extension. Single to Flex migration tool does not support migration of databases having postgres_fdw extension. Consider performing the migration through other migration tools such as pg_dump/pg_restore (https://aka.ms/migrate-using-pgdump-restore)"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateFailed), + // }}, + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateFailed), + // }, + // { + // Type: to.Ptr("CollationsValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }}, + // }, + // { + // DatabaseName: to.Ptr("postgres"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()), + // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ + // { + // Type: to.Ptr("SchemaValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("ExtensionsValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("CollationsValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }}, + // }, + // { + // DatabaseName: to.Ptr("readme_to_recover"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()), + // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ + // { + // Type: to.Ptr("SchemaValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("ExtensionsValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("CollationsValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }}, + // }, + // { + // DatabaseName: to.Ptr("testdb1"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()), + // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ + // { + // Type: to.Ptr("SchemaValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("ExtensionsValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }}, + // }, + // { + // DatabaseName: to.Ptr("testdb2"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()), + // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ + // { + // Type: to.Ptr("SchemaValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("ExtensionsValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }}, + // }, + // { + // DatabaseName: to.Ptr("testSchema"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()), + // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ + // { + // Type: to.Ptr("SchemaValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("ExtensionsValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }}, + // }, + // { + // DatabaseName: to.Ptr("UnknownCollationTest"), + // EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:02.810Z"); return t}()), + // StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:01.830Z"); return t}()), + // Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{ + // { + // Type: to.Ptr("SchemaValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("ExtensionsValidation"), + // Messages: []*armpostgresqlflexibleservers.ValidationMessage{ + // { + // Message: to.Ptr("Unsupported Extension. Single to Flex migration tool does not support migration of databases having postgres_fdw extension. Consider performing the migration through other migration tools such as pg_dump/pg_restore (https://aka.ms/migrate-using-pgdump-restore)"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateFailed), + // }}, + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateFailed), + // }}, + // }}, + // ServerLevelValidationDetails: []*armpostgresqlflexibleservers.ValidationSummaryItem{ + // { + // Type: to.Ptr("AuthenticationAndConnectivityValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("SourceVersionValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }, + // { + // Type: to.Ptr("ServerParametersValidation"), + // State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded), + // }}, + // Status: to.Ptr(armpostgresqlflexibleservers.ValidationStateFailed), + // ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:20:33.136Z"); return t}()), + // ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:19:59.917Z"); return t}()), + // }, + // }, + // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateValidationFailed), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("c.utf-8"), + // to.Ptr("postgres"), + // to.Ptr("readme_to_recover"), + // to.Ptr("testdb1"), + // to.Ptr("testdb2"), + // to.Ptr("testSchema"), + // to.Ptr("UnknownCollationTest")}, + // MigrationID: to.Ptr("a3e2d3cc-b139-4201-9431-e4f3003140fd"), + // MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline), + // MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidate), + // MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:21:00.043Z"); return t}()), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-17T19:19:47.448Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumTrue), + // SourceDbServerResourceID: to.Ptr("20.228.214.65:5432@postgres"), + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testtarget"), + // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumTrue), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Cancel.json +func ExampleMigrationsClient_Update_cancelMigration() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewMigrationsClient().Update(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", armpostgresqlflexibleservers.MigrationResourceForPatch{ + Properties: &armpostgresqlflexibleservers.MigrationResourcePropertiesForPatch{ + Cancel: to.Ptr(armpostgresqlflexibleservers.CancelEnumTrue), + }, + }, 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.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ + // Name: to.Ptr("testmigration"), + // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), + // Location: to.Ptr("westus"), + // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStateCompleted), + // }, + // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateCanceled), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("postgres")}, + // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), + // MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOnline), + // MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-15T07:23:56.326Z"); return t}()), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-15T07:22:57.700Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumTrue), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumTrue), + // SourceDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ + // Location: to.Ptr("eastasia"), + // SKU: &armpostgresqlflexibleservers.ServerSKU{ + // Name: to.Ptr("B_Gen5_2"), + // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTier("Basic")), + // }, + // }, + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), + // TargetDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ + // Location: to.Ptr("East Asia"), + // SKU: &armpostgresqlflexibleservers.ServerSKU{ + // Name: to.Ptr("Standard_D2ds_v4"), + // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTier("Standard_D2ds_v4")), + // }, + // }, + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Update.json +func ExampleMigrationsClient_Update_migrationsUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewMigrationsClient().Update(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", armpostgresqlflexibleservers.MigrationResourceForPatch{ + Properties: &armpostgresqlflexibleservers.MigrationResourcePropertiesForPatch{ + SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumTrue), + }, + }, 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.MigrationResource = armpostgresqlflexibleservers.MigrationResource{ + // Name: to.Ptr("testmigration"), + // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), + // Location: to.Ptr("westus"), + // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStatePerformingPreRequisiteSteps), + // }, + // Error: to.Ptr(""), + // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("db1"), + // to.Ptr("db2"), + // to.Ptr("db3"), + // to.Ptr("db4")}, + // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-06T16:05:58.895Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumFalse), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumTrue), + // SourceDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ + // Location: to.Ptr("westus"), + // SKU: &armpostgresqlflexibleservers.ServerSKU{ + // Name: to.Ptr("B_Gen5_2"), + // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTier("Basic")), + // }, + // StorageMb: to.Ptr[int32](1024), + // Version: to.Ptr("10"), + // }, + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), + // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), + // TargetDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ + // Location: to.Ptr("westus"), + // SKU: &armpostgresqlflexibleservers.ServerSKU{ + // Name: to.Ptr("Standard_D4s_v3"), + // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), + // }, + // StorageMb: to.Ptr[int32](2048), + // Version: to.Ptr("11"), + // }, + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), + // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Delete.json +func ExampleMigrationsClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewMigrationsClient().Delete(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", "testmigration", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_ListByTargetServer.json +func ExampleMigrationsClient_NewListByTargetServerPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewMigrationsClient().NewListByTargetServerPager("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", &armpostgresqlflexibleservers.MigrationsClientListByTargetServerOptions{MigrationListFilter: to.Ptr(armpostgresqlflexibleservers.MigrationListFilterAll)}) + 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.MigrationResourceListResult = armpostgresqlflexibleservers.MigrationResourceListResult{ + // Value: []*armpostgresqlflexibleservers.MigrationResource{ + // { + // Name: to.Ptr("testmigration"), + // Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget/migrations/testmigration"), + // Location: to.Ptr("westus"), + // Properties: &armpostgresqlflexibleservers.MigrationResourceProperties{ + // CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{ + // CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubStateDetails{ + // CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubStatePerformingPreRequisiteSteps), + // }, + // Error: to.Ptr(""), + // State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress), + // }, + // DbsToMigrate: []*string{ + // to.Ptr("db1"), + // to.Ptr("db2"), + // to.Ptr("db3"), + // to.Ptr("db4")}, + // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), + // MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-06T16:05:58.895Z"); return t}()), + // OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDbsInTargetEnumFalse), + // SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceDbEnumFalse), + // SourceDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ + // Location: to.Ptr("westus"), + // SKU: &armpostgresqlflexibleservers.ServerSKU{ + // Name: to.Ptr("B_Gen5_2"), + // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTier("Basic")), + // }, + // StorageMb: to.Ptr[int32](1024), + // Version: to.Ptr("10"), + // }, + // SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"), + // StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationEnumFalse), + // TargetDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{ + // Location: to.Ptr("westus"), + // SKU: &armpostgresqlflexibleservers.ServerSKU{ + // Name: to.Ptr("Standard_D4s_v3"), + // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), + // }, + // StorageMb: to.Ptr[int32](2048), + // Version: to.Ptr("11"), + // }, + // TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testtarget"), + // TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverEnumFalse), + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models.go index 9aa895bdcd23..64c2f105b891 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models.go @@ -15,7 +15,7 @@ type ActiveDirectoryAdministrator struct { // REQUIRED; Properties of the active directory administrator. Properties *AdministratorProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // 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 @@ -34,6 +34,15 @@ type ActiveDirectoryAdministratorAdd struct { Properties *AdministratorPropertiesForAdd } +// AdminCredentials - Server admin credentials. +type AdminCredentials struct { + // REQUIRED; Password for source server. + SourceServerPassword *string + + // REQUIRED; Password for target server. + TargetServerPassword *string +} + // AdministratorListResult - A list of active directory administrators. type AdministratorListResult struct { // The link used to get the next page of active directory. @@ -94,46 +103,25 @@ type Backup struct { EarliestRestoreDate *time.Time } -// CapabilitiesListResult - location capability +// BackupSettings - The settings for the long term backup. +type BackupSettings struct { + // REQUIRED; Backup Name for the current backup + BackupName *string +} + +// BackupStoreDetails - Details about the target where the backup content will be stored. +type BackupStoreDetails struct { + // REQUIRED; List of SAS uri of storage containers where backup data is to be streamed/copied. + SasURIList []*string +} + +// CapabilitiesListResult - Capability for the PostgreSQL server type CapabilitiesListResult struct { // READ-ONLY; Link to retrieve next page of results. NextLink *string // READ-ONLY; A list of supported capabilities. - Value []*CapabilityProperties -} - -// CapabilityProperties - Location capabilities. -type CapabilityProperties struct { - // READ-ONLY; A value indicating whether fast provisioning is supported in this region. - FastProvisioningSupported *bool - - // READ-ONLY; A value indicating whether a new server in this region can have geo-backups to paired region. - GeoBackupSupported *bool - - // READ-ONLY; The status - Status *string - - // READ-ONLY - SupportedFastProvisioningEditions []*FastProvisioningEditionCapability - - // READ-ONLY - SupportedFlexibleServerEditions []*FlexibleServerEditionCapability - - // READ-ONLY; Supported high availability mode - SupportedHAMode []*string - - // READ-ONLY - SupportedHyperscaleNodeEditions []*HyperscaleNodeEditionCapability - - // READ-ONLY; zone name - Zone *string - - // READ-ONLY; A value indicating whether a new server in this region can have geo-backups to paired region. - ZoneRedundantHaAndGeoBackupSupported *bool - - // READ-ONLY; A value indicating whether a new server in this region can support multi zone HA. - ZoneRedundantHaSupported *bool + Value []*FlexibleServerCapability } // CheckNameAvailabilityRequest - The check availability request body. @@ -150,7 +138,7 @@ type Configuration struct { // The properties of a configuration. Properties *ConfigurationProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // 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 @@ -216,10 +204,22 @@ type ConfigurationProperties struct { // DataEncryption - Data encryption properties of a server type DataEncryption struct { - // URI for the key for data encryption for primary server. + // Geo-backup encryption key status for Data encryption enabled server. + GeoBackupEncryptionKeyStatus *KeyStatusEnum + + // URI for the key in keyvault for data encryption for geo-backup of server. + GeoBackupKeyURI *string + + // Resource Id for the User assigned identity to be used for data encryption for geo-backup of server. + GeoBackupUserAssignedIdentityID *string + + // Primary encryption key status for Data encryption enabled server. + PrimaryEncryptionKeyStatus *KeyStatusEnum + + // URI for the key in keyvault for data encryption of the primary server. PrimaryKeyURI *string - // Resource Id for the User assigned identity to be used for data encryption for primary server. + // Resource Id for the User assigned identity to be used for data encryption of the primary server. PrimaryUserAssignedIdentityID *string // Data encryption type to depict if it is System Managed vs Azure Key vault. @@ -231,7 +231,7 @@ type Database struct { // The properties of a database. Properties *DatabaseProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // 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 @@ -262,6 +262,87 @@ type DatabaseProperties struct { Collation *string } +// DbLevelValidationStatus - Validation status summary for an individual database +type DbLevelValidationStatus struct { + // Name of the database + DatabaseName *string + + // End date-time of a database level validation + EndedOn *time.Time + + // Start date-time of a database level validation + StartedOn *time.Time + + // Summary of database level validations + Summary []*ValidationSummaryItem +} + +// DbMigrationStatus - Migration status of an individual database +type DbMigrationStatus struct { + // CDC applied changes counter + AppliedChanges *int32 + + // CDC delete counter + CdcDeleteCounter *int32 + + // CDC insert counter + CdcInsertCounter *int32 + + // CDC update counter + CdcUpdateCounter *int32 + + // Name of the database + DatabaseName *string + + // End date-time of a migration state + EndedOn *time.Time + + // Number of tables loaded during the migration of a DB + FullLoadCompletedTables *int32 + + // Number of tables errored out during the migration of a DB + FullLoadErroredTables *int32 + + // Number of tables loading during the migration of a DB + FullLoadLoadingTables *int32 + + // Number of tables queued for the migration of a DB + FullLoadQueuedTables *int32 + + // CDC incoming changes counter + IncomingChanges *int32 + + // Lag in seconds between source and target during online phase + Latency *int32 + + // Error message, if any, for the migration state + Message *string + + // Migration operation of an individual database + MigrationOperation *string + + // Migration db state of an individual database + MigrationState *MigrationDbState + + // Start date-time of a migration state + StartedOn *time.Time +} + +// DbServerMetadata - Database server metadata. +type DbServerMetadata struct { + // SKU for the database server. This object is empty for PG single server + SKU *ServerSKU + + // Storage size in MB for database server + StorageMb *int32 + + // Version for database engine + Version *string + + // READ-ONLY; Location of database server + Location *string +} + // DelegatedSubnetUsage - Delegated subnet usage data. type DelegatedSubnetUsage struct { // READ-ONLY; Name of the delegated subnet for which IP addresses are in use @@ -271,7 +352,17 @@ type DelegatedSubnetUsage struct { Usage *int64 } +// FastProvisioningEditionCapability - Represents capability of a fast provisioning edition type FastProvisioningEditionCapability struct { + // READ-ONLY; The reason for the capability not being available. + Reason *string + + // READ-ONLY; Count of servers in cache matching the spec + ServerCount *int32 + + // READ-ONLY; The status of the capability. + Status *CapabilityStatus + // READ-ONLY; Fast provisioning supported sku name SupportedSKU *string @@ -279,7 +370,10 @@ type FastProvisioningEditionCapability struct { SupportedServerVersions *string // READ-ONLY; Fast provisioning supported storage in Gb - SupportedStorageGb *int64 + SupportedStorageGb *int32 + + // READ-ONLY; Fast provisioning supported tier name + SupportedTier *string } // FirewallRule - Represents a server firewall rule. @@ -287,7 +381,7 @@ type FirewallRule struct { // REQUIRED; The properties of a firewall rule. Properties *FirewallRuleProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // 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 @@ -318,16 +412,73 @@ type FirewallRuleProperties struct { StartIPAddress *string } +// FlexibleServerCapability - Capability for the PostgreSQL server +type FlexibleServerCapability struct { + // Name of flexible servers capability + Name *string + + // READ-ONLY; Gets a value indicating whether fast provisioning is supported. "Enabled" means fast provisioning is supported. + // "Disabled" stands for fast provisioning is not supported. + FastProvisioningSupported *FastProvisioningSupportedEnum + + // READ-ONLY; Determines if geo-backup is supported in this region. "Enabled" means geo-backup is supported. "Disabled" stands + // for geo-back is not supported. + GeoBackupSupported *GeoBackupSupportedEnum + + // READ-ONLY; A value indicating whether online resize is supported in this region for the given subscription. "Enabled" means + // storage online resize is supported. "Disabled" means storage online resize is not + // supported. + OnlineResizeSupported *OnlineResizeSupportedEnum + + // READ-ONLY; The reason for the capability not being available. + Reason *string + + // READ-ONLY; A value indicating whether this region is restricted. "Enabled" means region is restricted. "Disabled" stands + // for region is not restricted. + Restricted *RestrictedEnum + + // READ-ONLY; The status of the capability. + Status *CapabilityStatus + + // READ-ONLY; A value indicating whether storage auto-grow is supported in this region. "Enabled" means storage auto-grow + // is supported. "Disabled" stands for storage auto-grow is not supported. + StorageAutoGrowthSupported *StorageAutoGrowthSupportedEnum + + // READ-ONLY; List of supported server editions for fast provisioning + SupportedFastProvisioningEditions []*FastProvisioningEditionCapability + + // READ-ONLY; List of supported flexible server editions + SupportedServerEditions []*FlexibleServerEditionCapability + + // READ-ONLY; The list of server versions supported for this capability. + SupportedServerVersions []*ServerVersionCapability + + // READ-ONLY; A value indicating whether Zone Redundant HA and Geo-backup is supported in this region. "Enabled" means zone + // redundant HA and geo-backup is supported. "Disabled" stands for zone redundant HA and + // geo-backup is not supported. + ZoneRedundantHaAndGeoBackupSupported *ZoneRedundantHaAndGeoBackupSupportedEnum + + // READ-ONLY; A value indicating whether Zone Redundant HA is supported in this region. "Enabled" means zone redundant HA + // is supported. "Disabled" stands for zone redundant HA is not supported. + ZoneRedundantHaSupported *ZoneRedundantHaSupportedEnum +} + // FlexibleServerEditionCapability - Flexible server edition capabilities. type FlexibleServerEditionCapability struct { + // READ-ONLY; Default sku name for the server edition + DefaultSKUName *string + // READ-ONLY; Server edition name Name *string - // READ-ONLY; The status - Status *string + // READ-ONLY; The reason for the capability not being available. + Reason *string - // READ-ONLY; The list of server versions supported by this server edition. - SupportedServerVersions []*ServerVersionCapability + // READ-ONLY; The status of the capability. + Status *CapabilityStatus + + // READ-ONLY; List of supported server SKUs. + SupportedServerSKUs []*ServerSKUCapability // READ-ONLY; The list of editions supported by this server edition. SupportedStorageEditions []*StorageEditionCapability @@ -345,22 +496,144 @@ type HighAvailability struct { State *ServerHAState } -// HyperscaleNodeEditionCapability - Hyperscale node edition capabilities. -type HyperscaleNodeEditionCapability struct { - // READ-ONLY; Server edition name +// LogFile - Represents a logFile. +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}" + ID *string + + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The status - Status *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData - // READ-ONLY; The list of Node Types supported by this server edition. - SupportedNodeTypes []*NodeTypeCapability + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} - // READ-ONLY; The list of server versions supported by this server edition. - SupportedServerVersions []*ServerVersionCapability +// LogFileListResult - A List of logFiles. +type LogFileListResult struct { + // The link used to get the next page of operations. + NextLink *string - // READ-ONLY; The list of editions supported by this server edition. - SupportedStorageEditions []*StorageEditionCapability + // The list of logFiles in a server + Value []*LogFile +} + +// LogFileProperties - The properties of a logFile. +type LogFileProperties struct { + // Creation timestamp of the log file. + CreatedTime *time.Time + + // Last modified timestamp of the log file. + LastModifiedTime *time.Time + + // The size in kb of the logFile. + SizeInKb *int64 + + // Type of the log file. + Type *string + + // The url to download the log file from. + URL *string +} + +// LtrBackupOperationResponseProperties - Response for the backup request. +type LtrBackupOperationResponseProperties struct { + // REQUIRED; Start time of the operation. + StartTime *time.Time + + // REQUIRED; Service-set extensible enum indicating the status of operation + Status *ExecutionStatus + + // Metadata to be stored in RP. Store everything that will be required to perform a successful restore using this Recovery + // point. e.g. Versions, DataFormat etc + BackupMetadata *string + + // Name of Backup operation + BackupName *string + + // Data transferred in bytes + DataTransferredInBytes *int64 + + // Size of datasource in bytes + DatasourceSizeInBytes *int64 + + // End time of the operation. + EndTime *time.Time + + // PercentageCompleted + PercentComplete *float64 + + // READ-ONLY; The error code. + ErrorCode *string + + // READ-ONLY; The error message. + ErrorMessage *string +} + +// LtrBackupRequest - The request that is made for a long term retention backup. +type LtrBackupRequest struct { + // REQUIRED; Backup Settings + BackupSettings *BackupSettings + + // REQUIRED; Backup store detail for target server + TargetDetails *BackupStoreDetails +} + +// LtrBackupResponse - Response for the LTR backup API call +type LtrBackupResponse struct { + // Long Term Retention Backup Operation Resource Properties + Properties *LtrBackupOperationResponseProperties +} + +// LtrPreBackupRequest - A request that is made for pre-backup. +type LtrPreBackupRequest struct { + // REQUIRED; Backup Settings + BackupSettings *BackupSettings +} + +// LtrPreBackupResponse - Response for the LTR pre-backup API call +type LtrPreBackupResponse struct { + // REQUIRED; Additional Properties for the pre backup response + Properties *LtrPreBackupResponseProperties +} + +// LtrPreBackupResponseProperties - Response for the pre-backup request. +type LtrPreBackupResponseProperties struct { + // REQUIRED; Number of storage containers the plugin will use during backup. More than one containers may be used for size + // limitations, parallelism, or redundancy etc. + NumberOfContainers *int32 +} + +// LtrServerBackupOperation - Response for the LTR backup Operation API call +type LtrServerBackupOperation struct { + // Long Term Retention Backup Operation Resource Properties + Properties *LtrBackupOperationResponseProperties + + // 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 +} + +// LtrServerBackupOperationList - A list of long term retention backup operations for server. +type LtrServerBackupOperationList struct { + // The link used to get the next page of operations. + NextLink *string + + // The list of long term retention server backup operations + Value []*LtrServerBackupOperation } // MaintenanceWindow - Maintenance window properties of a server. @@ -378,6 +651,228 @@ type MaintenanceWindow struct { StartMinute *int32 } +// MigrationNameAvailabilityResource - Represents a migration name's availability. +type MigrationNameAvailabilityResource struct { + // REQUIRED; The resource name to verify. + Name *string + + // REQUIRED; The type of the resource. + Type *string + + // READ-ONLY; Migration name availability message. + Message *string + + // READ-ONLY; Indicates whether the resource name is available. + NameAvailable *bool + + // READ-ONLY; Migration name availability reason + Reason *MigrationNameAvailabilityReason +} + +// MigrationResource - Represents a migration resource. +type MigrationResource struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // Migration resource properties. + Properties *MigrationResourceProperties + + // 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 +} + +// MigrationResourceForPatch - Represents a migration resource for patch. +type MigrationResourceForPatch struct { + // Migration resource properties. + Properties *MigrationResourcePropertiesForPatch + + // Application-specific metadata in the form of key-value pairs. + Tags map[string]*string +} + +// MigrationResourceListResult - A list of migration resources. +type MigrationResourceListResult struct { + // READ-ONLY; The link used to get the next page of migrations. + NextLink *string + + // READ-ONLY; A list of migration resources. + Value []*MigrationResource +} + +// MigrationResourceProperties - Migration resource properties. +type MigrationResourceProperties struct { + // To trigger cancel for entire migration we need to send this flag as True + Cancel *CancelEnum + + // When you want to trigger cancel for specific databases send cancel flag as True and database names in this array + DbsToCancelMigrationOn []*string + + // Number of databases to migrate + DbsToMigrate []*string + + // When you want to trigger cutover for specific databases send triggerCutover flag as True and database names in this array + DbsToTriggerCutoverOn []*string + + // There are two types of migration modes Online and Offline + MigrationMode *MigrationMode + + // This indicates the supported Migration option for the migration + MigrationOption *MigrationOption + + // End time in UTC for migration window + MigrationWindowEndTimeInUTC *time.Time + + // Start time in UTC for migration window + MigrationWindowStartTimeInUTC *time.Time + + // Indicates whether the databases on the target server can be overwritten, if already present. If set to False, the migration + // workflow will wait for a confirmation, if it detects that the database + // already exists. + OverwriteDbsInTarget *OverwriteDbsInTargetEnum + + // SSL modes for migration. Default SSL mode for PostgreSQLSingleServer is VerifyFull and Prefer for other source types + SSLMode *SSLMode + + // Migration secret parameters + SecretParameters *MigrationSecretParameters + + // Indicates whether to setup LogicalReplicationOnSourceDb, if needed + SetupLogicalReplicationOnSourceDbIfNeeded *LogicalReplicationOnSourceDbEnum + + // Source server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always use it + // for connection + SourceDbServerFullyQualifiedDomainName *string + + // ResourceId of the source database server in case the sourceType is PostgreSQLSingleServer. For other source types this + // should be ipaddress:port@username or hostname:port@username + SourceDbServerResourceID *string + + // migration source server type : OnPremises, AWS, GCP, AzureVM or PostgreSQLSingleServer + SourceType *SourceType + + // Indicates whether the data migration should start right away + StartDataMigration *StartDataMigrationEnum + + // Target server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always use it + // for connection + TargetDbServerFullyQualifiedDomainName *string + + // To trigger cutover for entire migration we need to send this flag as True + TriggerCutover *TriggerCutoverEnum + + // READ-ONLY; Current status of migration + CurrentStatus *MigrationStatus + + // READ-ONLY; ID for migration, a GUID. + MigrationID *string + + // READ-ONLY; Metadata of the source database server + SourceDbServerMetadata *DbServerMetadata + + // READ-ONLY; Metadata of the target database server + TargetDbServerMetadata *DbServerMetadata + + // READ-ONLY; ResourceId of the source database server + TargetDbServerResourceID *string +} + +// MigrationResourcePropertiesForPatch - Migration resource properties for patch. +type MigrationResourcePropertiesForPatch struct { + // To trigger cancel for entire migration we need to send this flag as True + Cancel *CancelEnum + + // When you want to trigger cancel for specific databases send cancel flag as True and database names in this array + DbsToCancelMigrationOn []*string + + // Number of databases to migrate + DbsToMigrate []*string + + // When you want to trigger cutover for specific databases send triggerCutover flag as True and database names in this array + DbsToTriggerCutoverOn []*string + + // There are two types of migration modes Online and Offline + MigrationMode *MigrationMode + + // Start time in UTC for migration window + MigrationWindowStartTimeInUTC *time.Time + + // Indicates whether the databases on the target server can be overwritten, if already present. If set to False, the migration + // workflow will wait for a confirmation, if it detects that the database + // already exists. + OverwriteDbsInTarget *OverwriteDbsInTargetEnum + + // Migration secret parameters + SecretParameters *MigrationSecretParameters + + // Indicates whether to setup LogicalReplicationOnSourceDb, if needed + SetupLogicalReplicationOnSourceDbIfNeeded *LogicalReplicationOnSourceDbEnum + + // Source server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always use it + // for connection + SourceDbServerFullyQualifiedDomainName *string + + // ResourceId of the source database server + SourceDbServerResourceID *string + + // Indicates whether the data migration should start right away + StartDataMigration *StartDataMigrationEnum + + // Target server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always use it + // for connection + TargetDbServerFullyQualifiedDomainName *string + + // To trigger cutover for entire migration we need to send this flag as True + TriggerCutover *TriggerCutoverEnum +} + +// MigrationSecretParameters - Migration secret parameters. +type MigrationSecretParameters struct { + // REQUIRED; Admin credentials for source and target servers + AdminCredentials *AdminCredentials + + // Gets or sets the username for the source server. This user need not be an admin. + SourceServerUsername *string + + // Gets or sets the username for the target server. This user need not be an admin. + TargetServerUsername *string +} + +// MigrationStatus - Migration status. +type MigrationStatus struct { + // READ-ONLY; Current Migration sub state details. + CurrentSubStateDetails *MigrationSubStateDetails + + // READ-ONLY; Error message, if any, for the migration state + Error *string + + // READ-ONLY; State of migration + State *MigrationState +} + +// MigrationSubStateDetails - Migration sub state details. +type MigrationSubStateDetails struct { + // Dictionary of + DbDetails map[string]*DbMigrationStatus + + // Details for the validation for migration + ValidationDetails *ValidationDetails + + // READ-ONLY; Migration sub state. + CurrentSubState *MigrationSubState +} + // NameAvailability - Represents a resource name availability. type NameAvailability struct { // Detailed reason why the given name is available. @@ -396,30 +891,31 @@ type NameAvailability struct { Type *string } -// Network properties of a server +// NameProperty - Name property for quota usage +type NameProperty struct { + // Localized name + LocalizedValue *string + + // Name value + Value *string +} + +// Network properties of a server. type Network struct { - // delegated subnet arm resource id. + // Delegated subnet arm resource id. This is required to be passed during create, in case we want the server to be VNET injected, + // i.e. Private access server. During update, pass this only if we want to + // update the value for Private DNS zone. DelegatedSubnetResourceID *string - // private dns zone arm resource id. + // Private dns zone arm resource id. This is required to be passed during create, in case we want the server to be VNET injected, + // i.e. Private access server. During update, pass this only if we want to + // update the value for Private DNS zone. PrivateDNSZoneArmResourceID *string - // READ-ONLY; public network access is enabled or not + // public network access is enabled or not PublicNetworkAccess *ServerPublicNetworkAccessState } -// NodeTypeCapability - node type capability -type NodeTypeCapability struct { - // READ-ONLY; note type name - Name *string - - // READ-ONLY; note type - NodeType *string - - // READ-ONLY; The status - Status *string -} - // Operation - REST API operation definition. type Operation struct { // Indicates whether the operation is a data action @@ -462,6 +958,152 @@ type OperationListResult struct { Value []*Operation } +// PrivateEndpoint - The private endpoint resource. +type PrivateEndpoint struct { + // READ-ONLY; The ARM identifier for private endpoint. + ID *string +} + +// PrivateEndpointConnection - The 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}" + 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 +} + +// PrivateEndpointConnectionListResult - A list of private endpoint connections. +type PrivateEndpointConnectionListResult struct { + // READ-ONLY; The URL to get the next set of results. + NextLink *string + + // READ-ONLY; Array of results. + Value []*PrivateEndpointConnection +} + +// 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. + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState + + // The private endpoint resource. + PrivateEndpoint *PrivateEndpoint + + // READ-ONLY; The group ids for the private endpoint resource. + GroupIDs []*string + + // READ-ONLY; The provisioning state of the private endpoint connection resource. + ProvisioningState *PrivateEndpointConnectionProvisioningState +} + +// 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}" + 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 +} + +// PrivateLinkResourceListResult - A list of private link resources +type PrivateLinkResourceListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string + + // READ-ONLY; Array of results. + Value []*PrivateLinkResource +} + +// PrivateLinkResourceProperties - Properties of a private link resource. +type PrivateLinkResourceProperties struct { + // The private link resource private link DNS zone name. + RequiredZoneNames []*string + + // READ-ONLY; The private link resource group id. + GroupID *string + + // READ-ONLY; The private link resource required member names. + RequiredMembers []*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 + + // 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 +} + +// QuotaUsage - Quota usage for flexible servers +type QuotaUsage struct { + // Current Quota usage value + CurrentValue *int64 + + // Fully qualified ARM resource Id + ID *string + + // Quota limit + Limit *int64 + + // Name of quota usage for flexible servers + Name *NameProperty + + // Quota unit + Unit *string +} + +// QuotaUsagesListResult - Capability for the PostgreSQL server +type QuotaUsagesListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string + + // READ-ONLY; A list of quota usages. + Value []*QuotaUsage +} + +// Replica properties of a server +type Replica struct { + // Sets the promote mode for a replica server. This is a write only property. + PromoteMode *ReadReplicaPromoteMode + + // Sets the promote options for a replica server. This is a write only property. + PromoteOption *ReplicationPromoteOption + + // Used to indicate role of the server in replication set. + Role *ReplicationRole + + // READ-ONLY; Replicas allowed for a server. + Capacity *int32 + + // READ-ONLY; Gets the replication state of a replica server. This property is returned only for replicas api call. Supported + // values are Active, Catchup, Provisioning, Updating, Broken, Reconfiguring + ReplicationState *ReplicationState +} + // RestartParameter - Represents server restart parameters. type RestartParameter struct { // Failover mode. @@ -497,7 +1139,7 @@ type Server struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // 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 @@ -515,7 +1157,7 @@ type ServerBackup struct { // The properties of a server backup. Properties *ServerBackupProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // 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 @@ -603,21 +1245,23 @@ type ServerProperties struct { // Maintenance window properties of a server. MaintenanceWindow *MaintenanceWindow - // Network properties of a server. + // Network properties of a server. This Network property is required to be passed only in case you want the server to be Private + // access server. Network *Network // Restore point creation time (ISO8601 format), specifying the time to restore from. It's required when 'createMode' is 'PointInTimeRestore' - // or 'GeoRestore'. + // or 'GeoRestore' or 'ReviveDropped'. PointInTimeUTC *time.Time - // Replicas allowed for a server. - ReplicaCapacity *int32 + // Replica properties of a server. These Replica properties are required to be passed only in case you want to Promote a server. + Replica *Replica // Replication role of the server ReplicationRole *ReplicationRole // The source server resource ID to restore from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore' - // or 'Replica'. + // or 'Replica' or 'ReviveDropped'. This property is returned only for Replica + // server SourceServerResourceID *string // Storage properties of a server. @@ -632,6 +1276,12 @@ type ServerProperties struct { // READ-ONLY; The minor version of the server. MinorVersion *string + // READ-ONLY; List of private endpoint connections associated with the specified resource. + PrivateEndpointConnections []*PrivateEndpointConnection + + // READ-ONLY; Replicas allowed for a server. + ReplicaCapacity *int32 + // READ-ONLY; A state of a server that is visible to user. State *ServerState } @@ -658,26 +1308,105 @@ type ServerPropertiesForUpdate struct { // Maintenance window properties of a server. MaintenanceWindow *MaintenanceWindow + // Network properties of a server. These are required to be passed only in case if server is a private access server. + Network *Network + + // Replica properties of a server. These Replica properties are required to be passed only in case you want to Promote a server. + Replica *Replica + // Replication role of the server ReplicationRole *ReplicationRole // Storage properties of a server. Storage *Storage - // PostgreSQL Server version. + // PostgreSQL Server version. Version 16 is currently not supported for MVU. Version *ServerVersion } +// ServerSKU - Sku information related properties of a server. +type ServerSKU struct { + // The name of the sku, typically, tier + family + cores, e.g. StandardD4sv3. + Name *string + + // The tier of the particular SKU, e.g. Burstable. + Tier *SKUTier +} + +// ServerSKUCapability - Sku capability +type ServerSKUCapability struct { + // READ-ONLY; Sku name + Name *string + + // READ-ONLY; The reason for the capability not being available. + Reason *string + + // READ-ONLY; The status of the capability. + Status *CapabilityStatus + + // READ-ONLY; Supported high availability mode + SupportedHaMode []*HaMode + + // READ-ONLY; Supported IOPS + SupportedIops *int32 + + // READ-ONLY; Supported memory per vCore in MB + SupportedMemoryPerVcoreMb *int64 + + // READ-ONLY; List of supported Availability Zones. E.g. "1", "2", "3" + SupportedZones []*string + + // READ-ONLY; Supported vCores + VCores *int32 +} + +// ServerThreatProtectionListResult - A list of the server's Advanced Threat Protection settings. +type ServerThreatProtectionListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string + + // READ-ONLY; Array of results. + Value []*ServerThreatProtectionSettingsModel +} + +// ServerThreatProtectionProperties - Properties of server Threat Protection state. +type ServerThreatProtectionProperties struct { + // REQUIRED; Specifies the state of the Threat Protection, whether it is enabled or disabled or a state has not been applied + // yet on the specific server. + State *ThreatProtectionState + + // READ-ONLY; Specifies the UTC creation time of the policy. + CreationTime *time.Time +} + +// ServerThreatProtectionSettingsModel - Server's Advanced Threat Protection settings. +type ServerThreatProtectionSettingsModel struct { + // Advanced Threat Protection properties. + Properties *ServerThreatProtectionProperties + + // 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 +} + // ServerVersionCapability - Server version capabilities. type ServerVersionCapability struct { - // READ-ONLY; server version + // READ-ONLY; Server version Name *string - // READ-ONLY; The status - Status *string + // READ-ONLY; The reason for the capability not being available. + Reason *string - // READ-ONLY - SupportedVcores []*VcoreCapability + // READ-ONLY; The status of the capability. + Status *CapabilityStatus // READ-ONLY; Supported servers versions to upgrade SupportedVersionsToUpgrade []*string @@ -685,55 +1414,89 @@ type ServerVersionCapability struct { // Storage properties of a server type Storage struct { + // Flag to enable / disable Storage Auto grow for flexible server. + AutoGrow *StorageAutoGrow + + // Storage tier IOPS quantity. This property is required to be set for storage Type PremiumV2_LRS + Iops *int32 + // Max storage allowed for a server. StorageSizeGB *int32 + + // Storage throughput for the server. This is required to be set for storage Type PremiumV2_LRS + Throughput *int32 + + // Name of storage tier for IOPS. + Tier *AzureManagedDiskPerformanceTiers + + // Storage type for the server. Allowed values are PremiumLRS and PremiumV2LRS, and default is Premium_LRS if not specified + Type *StorageType } -// StorageEditionCapability - storage edition capability +// StorageEditionCapability - Storage edition capability type StorageEditionCapability struct { - // READ-ONLY; storage edition name + // READ-ONLY; Default storage size in MB for storage edition + DefaultStorageSizeMb *int64 + + // READ-ONLY; Storage edition name Name *string - // READ-ONLY; The status - Status *string + // READ-ONLY; The reason for the capability not being available. + Reason *string - // READ-ONLY - SupportedStorageMB []*StorageMBCapability + // READ-ONLY; The status of the capability. + Status *CapabilityStatus + + // READ-ONLY; Flexible server supported storage range in MB + SupportedStorageMb []*StorageMbCapability } -// StorageMBCapability - storage size in MB capability -type StorageMBCapability struct { - // READ-ONLY; storage MB name - Name *string +// StorageMbCapability - storage size in MB capability +type StorageMbCapability struct { + // READ-ONLY; Default tier for IOPS + DefaultIopsTier *string - // READ-ONLY; The status - Status *string + // READ-ONLY; Maximum value of Storage size in MB + MaximumStorageSizeMb *int64 - // READ-ONLY; storage size in MB - StorageSizeMB *int64 + // READ-ONLY; The reason for the capability not being available. + Reason *string - // READ-ONLY; supported IOPS - SupportedIops *int64 + // READ-ONLY; The status of the capability. + Status *CapabilityStatus - // READ-ONLY - SupportedUpgradableTierList []*StorageTierCapability + // READ-ONLY; Storage size in MB + StorageSizeMb *int64 + + // READ-ONLY; Supported IOPS + SupportedIops *int32 + + // READ-ONLY; List of available options to upgrade the storage performance + SupportedIopsTiers []*StorageTierCapability + + // READ-ONLY; Maximum IOPS supported by this #Vcores or PremiumV2_LRS Storage Size + SupportedMaximumIops *int32 + + // READ-ONLY; Maximum values of throughput in MB/s + SupportedMaximumThroughput *int32 + + // READ-ONLY; Values of throughput in MB/s + SupportedThroughput *int32 } +// StorageTierCapability - Represents capability of a storage tier type StorageTierCapability struct { // READ-ONLY; Supported IOPS for this storage tier - Iops *int64 - - // READ-ONLY; Indicates if this is a baseline storage tier or not - IsBaseline *bool + Iops *int32 // READ-ONLY; Name to represent Storage tier capability Name *string - // READ-ONLY; Status os this storage tier - Status *string + // READ-ONLY; The reason for the capability not being available. + Reason *string - // READ-ONLY; Storage tier name - TierName *string + // READ-ONLY; The status of the capability. + Status *CapabilityStatus } // SystemData - Metadata pertaining to creation and last modification of the resource. @@ -759,11 +1522,14 @@ type SystemData struct { // UserAssignedIdentity - Information describing the identities associated with this application. type UserAssignedIdentity struct { - // REQUIRED; the types of identities associated with this resource; currently restricted to 'SystemAssigned and UserAssigned' + // REQUIRED; the types of identities associated with this resource; currently restricted to 'None and UserAssigned' Type *IdentityType // represents user assigned identities map. UserAssignedIdentities map[string]*UserIdentity + + // READ-ONLY; Tenant id of the server. + TenantID *string } // UserIdentity - Describes a single user-assigned identity associated with the application. @@ -775,22 +1541,88 @@ type UserIdentity struct { PrincipalID *string } -// VcoreCapability - Vcores capability -type VcoreCapability struct { - // READ-ONLY; vCore name +// ValidationDetails - Details for the validation for migration +type ValidationDetails struct { + // Details of server level validations + DbLevelValidationDetails []*DbLevelValidationStatus + + // Details of server level validations + ServerLevelValidationDetails []*ValidationSummaryItem + + // Validation status for migration + Status *ValidationState + + // Validation End date-time in UTC + ValidationEndTimeInUTC *time.Time + + // Validation Start date-time in UTC + ValidationStartTimeInUTC *time.Time +} + +// ValidationMessage - Validation message object +type ValidationMessage struct { + // Validation message string + Message *string + + // Severity of validation message + State *ValidationState +} + +// ValidationSummaryItem - Validation summary object +type ValidationSummaryItem struct { + // Validation messages + Messages []*ValidationMessage + + // Validation status for migration + State *ValidationState + + // Validation type + Type *string +} + +// VirtualEndpointResource - Represents a virtual endpoint for a server. +type VirtualEndpointResource struct { + // Properties of the virtual endpoint resource. + Properties *VirtualEndpointResourceProperties + + // 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; The status - Status *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 +} + +// VirtualEndpointResourceForPatch - Represents a virtual endpoint for a server. +type VirtualEndpointResourceForPatch struct { + // Properties of the virtual endpoint resource. + Properties *VirtualEndpointResourceProperties +} + +// VirtualEndpointResourceProperties - The properties of a virtual endpoint. +type VirtualEndpointResourceProperties struct { + // The endpoint type for the virtual endpoint. + EndpointType *VirtualEndpointType + + // List of members for a virtual endpoint + Members []*string - // READ-ONLY; supported IOPS - SupportedIops *int64 + // READ-ONLY; List of virtual endpoints for a server + VirtualEndpoints []*string +} - // READ-ONLY; supported memory per vCore in MB - SupportedMemoryPerVcoreMB *int64 +// VirtualEndpointsListResult - A list of virtual endpoints. +type VirtualEndpointsListResult struct { + // The link used to get the next page of operations. + NextLink *string - // READ-ONLY; supported vCores - VCores *int64 + // The list of virtual endpoints + Value []*VirtualEndpointResource } // VirtualNetworkSubnetUsageParameter - Virtual network subnet usage parameter diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models_serde.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models_serde.go index d501f84d0914..9f17212a446e 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models_serde.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models_serde.go @@ -85,6 +85,37 @@ func (a *ActiveDirectoryAdministratorAdd) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AdminCredentials. +func (a AdminCredentials) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sourceServerPassword", a.SourceServerPassword) + populate(objectMap, "targetServerPassword", a.TargetServerPassword) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdminCredentials. +func (a *AdminCredentials) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "sourceServerPassword": + err = unpopulate(val, "SourceServerPassword", &a.SourceServerPassword) + delete(rawMsg, key) + case "targetServerPassword": + err = unpopulate(val, "TargetServerPassword", &a.TargetServerPassword) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AdministratorListResult. func (a AdministratorListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -260,55 +291,70 @@ func (b *Backup) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CapabilitiesListResult. -func (c CapabilitiesListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BackupSettings. +func (b BackupSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + populate(objectMap, "backupName", b.BackupName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CapabilitiesListResult. -func (c *CapabilitiesListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupSettings. +func (b *BackupSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) + case "backupName": + err = unpopulate(val, "BackupName", &b.BackupName) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackupStoreDetails. +func (b BackupStoreDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sasUriList", b.SasURIList) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupStoreDetails. +func (b *BackupStoreDetails) UnmarshalJSON(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 "sasUriList": + err = unpopulate(val, "SasURIList", &b.SasURIList) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CapabilityProperties. -func (c CapabilityProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CapabilitiesListResult. +func (c CapabilitiesListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "fastProvisioningSupported", c.FastProvisioningSupported) - populate(objectMap, "geoBackupSupported", c.GeoBackupSupported) - populate(objectMap, "status", c.Status) - populate(objectMap, "supportedFastProvisioningEditions", c.SupportedFastProvisioningEditions) - populate(objectMap, "supportedFlexibleServerEditions", c.SupportedFlexibleServerEditions) - populate(objectMap, "supportedHAMode", c.SupportedHAMode) - populate(objectMap, "supportedHyperscaleNodeEditions", c.SupportedHyperscaleNodeEditions) - populate(objectMap, "zone", c.Zone) - populate(objectMap, "zoneRedundantHaAndGeoBackupSupported", c.ZoneRedundantHaAndGeoBackupSupported) - populate(objectMap, "zoneRedundantHaSupported", c.ZoneRedundantHaSupported) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CapabilityProperties. -func (c *CapabilityProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CapabilitiesListResult. +func (c *CapabilitiesListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -316,35 +362,11 @@ func (c *CapabilityProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "fastProvisioningSupported": - err = unpopulate(val, "FastProvisioningSupported", &c.FastProvisioningSupported) - delete(rawMsg, key) - case "geoBackupSupported": - err = unpopulate(val, "GeoBackupSupported", &c.GeoBackupSupported) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &c.Status) - delete(rawMsg, key) - case "supportedFastProvisioningEditions": - err = unpopulate(val, "SupportedFastProvisioningEditions", &c.SupportedFastProvisioningEditions) - delete(rawMsg, key) - case "supportedFlexibleServerEditions": - err = unpopulate(val, "SupportedFlexibleServerEditions", &c.SupportedFlexibleServerEditions) - delete(rawMsg, key) - case "supportedHAMode": - err = unpopulate(val, "SupportedHAMode", &c.SupportedHAMode) - delete(rawMsg, key) - case "supportedHyperscaleNodeEditions": - err = unpopulate(val, "SupportedHyperscaleNodeEditions", &c.SupportedHyperscaleNodeEditions) - delete(rawMsg, key) - case "zone": - err = unpopulate(val, "Zone", &c.Zone) - delete(rawMsg, key) - case "zoneRedundantHaAndGeoBackupSupported": - err = unpopulate(val, "ZoneRedundantHaAndGeoBackupSupported", &c.ZoneRedundantHaAndGeoBackupSupported) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) - case "zoneRedundantHaSupported": - err = unpopulate(val, "ZoneRedundantHaSupported", &c.ZoneRedundantHaSupported) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { @@ -556,6 +578,10 @@ func (c *ConfigurationProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DataEncryption. func (d DataEncryption) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "geoBackupEncryptionKeyStatus", d.GeoBackupEncryptionKeyStatus) + populate(objectMap, "geoBackupKeyURI", d.GeoBackupKeyURI) + populate(objectMap, "geoBackupUserAssignedIdentityId", d.GeoBackupUserAssignedIdentityID) + populate(objectMap, "primaryEncryptionKeyStatus", d.PrimaryEncryptionKeyStatus) populate(objectMap, "primaryKeyURI", d.PrimaryKeyURI) populate(objectMap, "primaryUserAssignedIdentityId", d.PrimaryUserAssignedIdentityID) populate(objectMap, "type", d.Type) @@ -571,6 +597,18 @@ func (d *DataEncryption) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "geoBackupEncryptionKeyStatus": + err = unpopulate(val, "GeoBackupEncryptionKeyStatus", &d.GeoBackupEncryptionKeyStatus) + delete(rawMsg, key) + case "geoBackupKeyURI": + err = unpopulate(val, "GeoBackupKeyURI", &d.GeoBackupKeyURI) + delete(rawMsg, key) + case "geoBackupUserAssignedIdentityId": + err = unpopulate(val, "GeoBackupUserAssignedIdentityID", &d.GeoBackupUserAssignedIdentityID) + delete(rawMsg, key) + case "primaryEncryptionKeyStatus": + err = unpopulate(val, "PrimaryEncryptionKeyStatus", &d.PrimaryEncryptionKeyStatus) + delete(rawMsg, key) case "primaryKeyURI": err = unpopulate(val, "PrimaryKeyURI", &d.PrimaryKeyURI) delete(rawMsg, key) @@ -693,6 +731,171 @@ func (d *DatabaseProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DbLevelValidationStatus. +func (d DbLevelValidationStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databaseName", d.DatabaseName) + populateDateTimeRFC3339(objectMap, "endedOn", d.EndedOn) + populateDateTimeRFC3339(objectMap, "startedOn", d.StartedOn) + populate(objectMap, "summary", d.Summary) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DbLevelValidationStatus. +func (d *DbLevelValidationStatus) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databaseName": + err = unpopulate(val, "DatabaseName", &d.DatabaseName) + delete(rawMsg, key) + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &d.EndedOn) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &d.StartedOn) + delete(rawMsg, key) + case "summary": + err = unpopulate(val, "Summary", &d.Summary) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DbMigrationStatus. +func (d DbMigrationStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "appliedChanges", d.AppliedChanges) + populate(objectMap, "cdcDeleteCounter", d.CdcDeleteCounter) + populate(objectMap, "cdcInsertCounter", d.CdcInsertCounter) + populate(objectMap, "cdcUpdateCounter", d.CdcUpdateCounter) + populate(objectMap, "databaseName", d.DatabaseName) + populateDateTimeRFC3339(objectMap, "endedOn", d.EndedOn) + populate(objectMap, "fullLoadCompletedTables", d.FullLoadCompletedTables) + populate(objectMap, "fullLoadErroredTables", d.FullLoadErroredTables) + populate(objectMap, "fullLoadLoadingTables", d.FullLoadLoadingTables) + populate(objectMap, "fullLoadQueuedTables", d.FullLoadQueuedTables) + populate(objectMap, "incomingChanges", d.IncomingChanges) + populate(objectMap, "latency", d.Latency) + populate(objectMap, "message", d.Message) + populate(objectMap, "migrationOperation", d.MigrationOperation) + populate(objectMap, "migrationState", d.MigrationState) + populateDateTimeRFC3339(objectMap, "startedOn", d.StartedOn) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DbMigrationStatus. +func (d *DbMigrationStatus) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "appliedChanges": + err = unpopulate(val, "AppliedChanges", &d.AppliedChanges) + delete(rawMsg, key) + case "cdcDeleteCounter": + err = unpopulate(val, "CdcDeleteCounter", &d.CdcDeleteCounter) + delete(rawMsg, key) + case "cdcInsertCounter": + err = unpopulate(val, "CdcInsertCounter", &d.CdcInsertCounter) + delete(rawMsg, key) + case "cdcUpdateCounter": + err = unpopulate(val, "CdcUpdateCounter", &d.CdcUpdateCounter) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &d.DatabaseName) + delete(rawMsg, key) + case "endedOn": + err = unpopulateDateTimeRFC3339(val, "EndedOn", &d.EndedOn) + delete(rawMsg, key) + case "fullLoadCompletedTables": + err = unpopulate(val, "FullLoadCompletedTables", &d.FullLoadCompletedTables) + delete(rawMsg, key) + case "fullLoadErroredTables": + err = unpopulate(val, "FullLoadErroredTables", &d.FullLoadErroredTables) + delete(rawMsg, key) + case "fullLoadLoadingTables": + err = unpopulate(val, "FullLoadLoadingTables", &d.FullLoadLoadingTables) + delete(rawMsg, key) + case "fullLoadQueuedTables": + err = unpopulate(val, "FullLoadQueuedTables", &d.FullLoadQueuedTables) + delete(rawMsg, key) + case "incomingChanges": + err = unpopulate(val, "IncomingChanges", &d.IncomingChanges) + delete(rawMsg, key) + case "latency": + err = unpopulate(val, "Latency", &d.Latency) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &d.Message) + delete(rawMsg, key) + case "migrationOperation": + err = unpopulate(val, "MigrationOperation", &d.MigrationOperation) + delete(rawMsg, key) + case "migrationState": + err = unpopulate(val, "MigrationState", &d.MigrationState) + delete(rawMsg, key) + case "startedOn": + err = unpopulateDateTimeRFC3339(val, "StartedOn", &d.StartedOn) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DbServerMetadata. +func (d DbServerMetadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "location", d.Location) + populate(objectMap, "sku", d.SKU) + populate(objectMap, "storageMb", d.StorageMb) + populate(objectMap, "version", d.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DbServerMetadata. +func (d *DbServerMetadata) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "location": + err = unpopulate(val, "Location", &d.Location) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &d.SKU) + delete(rawMsg, key) + case "storageMb": + err = unpopulate(val, "StorageMb", &d.StorageMb) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &d.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DelegatedSubnetUsage. func (d DelegatedSubnetUsage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -727,9 +930,13 @@ func (d *DelegatedSubnetUsage) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type FastProvisioningEditionCapability. func (f FastProvisioningEditionCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "reason", f.Reason) + populate(objectMap, "serverCount", f.ServerCount) + populate(objectMap, "status", f.Status) populate(objectMap, "supportedSku", f.SupportedSKU) populate(objectMap, "supportedServerVersions", f.SupportedServerVersions) populate(objectMap, "supportedStorageGb", f.SupportedStorageGb) + populate(objectMap, "supportedTier", f.SupportedTier) return json.Marshal(objectMap) } @@ -742,6 +949,15 @@ func (f *FastProvisioningEditionCapability) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "reason": + err = unpopulate(val, "Reason", &f.Reason) + delete(rawMsg, key) + case "serverCount": + err = unpopulate(val, "ServerCount", &f.ServerCount) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &f.Status) + delete(rawMsg, key) case "supportedSku": err = unpopulate(val, "SupportedSKU", &f.SupportedSKU) delete(rawMsg, key) @@ -751,6 +967,9 @@ func (f *FastProvisioningEditionCapability) UnmarshalJSON(data []byte) error { case "supportedStorageGb": err = unpopulate(val, "SupportedStorageGb", &f.SupportedStorageGb) delete(rawMsg, key) + case "supportedTier": + err = unpopulate(val, "SupportedTier", &f.SupportedTier) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", f, err) @@ -864,12 +1083,89 @@ func (f *FirewallRuleProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type FlexibleServerCapability. +func (f FlexibleServerCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "fastProvisioningSupported", f.FastProvisioningSupported) + populate(objectMap, "geoBackupSupported", f.GeoBackupSupported) + populate(objectMap, "name", f.Name) + populate(objectMap, "onlineResizeSupported", f.OnlineResizeSupported) + populate(objectMap, "reason", f.Reason) + populate(objectMap, "restricted", f.Restricted) + populate(objectMap, "status", f.Status) + populate(objectMap, "storageAutoGrowthSupported", f.StorageAutoGrowthSupported) + populate(objectMap, "supportedFastProvisioningEditions", f.SupportedFastProvisioningEditions) + populate(objectMap, "supportedServerEditions", f.SupportedServerEditions) + populate(objectMap, "supportedServerVersions", f.SupportedServerVersions) + populate(objectMap, "zoneRedundantHaAndGeoBackupSupported", f.ZoneRedundantHaAndGeoBackupSupported) + populate(objectMap, "zoneRedundantHaSupported", f.ZoneRedundantHaSupported) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FlexibleServerCapability. +func (f *FlexibleServerCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "fastProvisioningSupported": + err = unpopulate(val, "FastProvisioningSupported", &f.FastProvisioningSupported) + delete(rawMsg, key) + case "geoBackupSupported": + err = unpopulate(val, "GeoBackupSupported", &f.GeoBackupSupported) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "onlineResizeSupported": + err = unpopulate(val, "OnlineResizeSupported", &f.OnlineResizeSupported) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &f.Reason) + delete(rawMsg, key) + case "restricted": + err = unpopulate(val, "Restricted", &f.Restricted) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &f.Status) + delete(rawMsg, key) + case "storageAutoGrowthSupported": + err = unpopulate(val, "StorageAutoGrowthSupported", &f.StorageAutoGrowthSupported) + delete(rawMsg, key) + case "supportedFastProvisioningEditions": + err = unpopulate(val, "SupportedFastProvisioningEditions", &f.SupportedFastProvisioningEditions) + delete(rawMsg, key) + case "supportedServerEditions": + err = unpopulate(val, "SupportedServerEditions", &f.SupportedServerEditions) + delete(rawMsg, key) + case "supportedServerVersions": + err = unpopulate(val, "SupportedServerVersions", &f.SupportedServerVersions) + delete(rawMsg, key) + case "zoneRedundantHaAndGeoBackupSupported": + err = unpopulate(val, "ZoneRedundantHaAndGeoBackupSupported", &f.ZoneRedundantHaAndGeoBackupSupported) + delete(rawMsg, key) + case "zoneRedundantHaSupported": + err = unpopulate(val, "ZoneRedundantHaSupported", &f.ZoneRedundantHaSupported) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type FlexibleServerEditionCapability. func (f FlexibleServerEditionCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "defaultSkuName", f.DefaultSKUName) populate(objectMap, "name", f.Name) + populate(objectMap, "reason", f.Reason) populate(objectMap, "status", f.Status) - populate(objectMap, "supportedServerVersions", f.SupportedServerVersions) + populate(objectMap, "supportedServerSkus", f.SupportedServerSKUs) populate(objectMap, "supportedStorageEditions", f.SupportedStorageEditions) return json.Marshal(objectMap) } @@ -883,14 +1179,20 @@ func (f *FlexibleServerEditionCapability) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "defaultSkuName": + err = unpopulate(val, "DefaultSKUName", &f.DefaultSKUName) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &f.Name) delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &f.Reason) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &f.Status) delete(rawMsg, key) - case "supportedServerVersions": - err = unpopulate(val, "SupportedServerVersions", &f.SupportedServerVersions) + case "supportedServerSkus": + err = unpopulate(val, "SupportedServerSKUs", &f.SupportedServerSKUs) delete(rawMsg, key) case "supportedStorageEditions": err = unpopulate(val, "SupportedStorageEditions", &f.SupportedStorageEditions) @@ -938,76 +1240,426 @@ func (h *HighAvailability) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type HyperscaleNodeEditionCapability. -func (h HyperscaleNodeEditionCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LogFile. +func (l LogFile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", h.Name) - populate(objectMap, "status", h.Status) - populate(objectMap, "supportedNodeTypes", h.SupportedNodeTypes) - populate(objectMap, "supportedServerVersions", h.SupportedServerVersions) - populate(objectMap, "supportedStorageEditions", h.SupportedStorageEditions) + populate(objectMap, "id", l.ID) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "systemData", l.SystemData) + populate(objectMap, "type", l.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HyperscaleNodeEditionCapability. -func (h *HyperscaleNodeEditionCapability) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LogFile. +func (l *LogFile) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &h.Name) + case "id": + err = unpopulate(val, "ID", &l.ID) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &h.Status) + case "name": + err = unpopulate(val, "Name", &l.Name) delete(rawMsg, key) - case "supportedNodeTypes": - err = unpopulate(val, "SupportedNodeTypes", &h.SupportedNodeTypes) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) delete(rawMsg, key) - case "supportedServerVersions": - err = unpopulate(val, "SupportedServerVersions", &h.SupportedServerVersions) + case "systemData": + err = unpopulate(val, "SystemData", &l.SystemData) delete(rawMsg, key) - case "supportedStorageEditions": - err = unpopulate(val, "SupportedStorageEditions", &h.SupportedStorageEditions) + case "type": + err = unpopulate(val, "Type", &l.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindow. -func (m MaintenanceWindow) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LogFileListResult. +func (l LogFileListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "customWindow", m.CustomWindow) - populate(objectMap, "dayOfWeek", m.DayOfWeek) - populate(objectMap, "startHour", m.StartHour) - populate(objectMap, "startMinute", m.StartMinute) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceWindow. -func (m *MaintenanceWindow) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LogFileListResult. +func (l *LogFileListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "customWindow": - err = unpopulate(val, "CustomWindow", &m.CustomWindow) + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) delete(rawMsg, key) - case "dayOfWeek": - err = unpopulate(val, "DayOfWeek", &m.DayOfWeek) + case "value": + err = unpopulate(val, "Value", &l.Value) delete(rawMsg, key) - case "startHour": - err = unpopulate(val, "StartHour", &m.StartHour) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LogFileProperties. +func (l LogFileProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "createdTime", l.CreatedTime) + populateDateTimeRFC3339(objectMap, "lastModifiedTime", l.LastModifiedTime) + populate(objectMap, "sizeInKb", l.SizeInKb) + populate(objectMap, "type", l.Type) + populate(objectMap, "url", l.URL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogFileProperties. +func (l *LogFileProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdTime": + err = unpopulateDateTimeRFC3339(val, "CreatedTime", &l.CreatedTime) + delete(rawMsg, key) + case "lastModifiedTime": + err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &l.LastModifiedTime) + delete(rawMsg, key) + case "sizeInKb": + err = unpopulate(val, "SizeInKb", &l.SizeInKb) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &l.URL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LtrBackupOperationResponseProperties. +func (l LtrBackupOperationResponseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupMetadata", l.BackupMetadata) + populate(objectMap, "backupName", l.BackupName) + populate(objectMap, "dataTransferredInBytes", l.DataTransferredInBytes) + populate(objectMap, "datasourceSizeInBytes", l.DatasourceSizeInBytes) + populateDateTimeRFC3339(objectMap, "endTime", l.EndTime) + populate(objectMap, "errorCode", l.ErrorCode) + populate(objectMap, "errorMessage", l.ErrorMessage) + populate(objectMap, "percentComplete", l.PercentComplete) + populateDateTimeRFC3339(objectMap, "startTime", l.StartTime) + populate(objectMap, "status", l.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LtrBackupOperationResponseProperties. +func (l *LtrBackupOperationResponseProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupMetadata": + err = unpopulate(val, "BackupMetadata", &l.BackupMetadata) + delete(rawMsg, key) + case "backupName": + err = unpopulate(val, "BackupName", &l.BackupName) + delete(rawMsg, key) + case "dataTransferredInBytes": + err = unpopulate(val, "DataTransferredInBytes", &l.DataTransferredInBytes) + delete(rawMsg, key) + case "datasourceSizeInBytes": + err = unpopulate(val, "DatasourceSizeInBytes", &l.DatasourceSizeInBytes) + delete(rawMsg, key) + case "endTime": + err = unpopulateDateTimeRFC3339(val, "EndTime", &l.EndTime) + delete(rawMsg, key) + case "errorCode": + err = unpopulate(val, "ErrorCode", &l.ErrorCode) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &l.ErrorMessage) + delete(rawMsg, key) + case "percentComplete": + err = unpopulate(val, "PercentComplete", &l.PercentComplete) + delete(rawMsg, key) + case "startTime": + err = unpopulateDateTimeRFC3339(val, "StartTime", &l.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &l.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LtrBackupRequest. +func (l LtrBackupRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupSettings", l.BackupSettings) + populate(objectMap, "targetDetails", l.TargetDetails) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LtrBackupRequest. +func (l *LtrBackupRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupSettings": + err = unpopulate(val, "BackupSettings", &l.BackupSettings) + delete(rawMsg, key) + case "targetDetails": + err = unpopulate(val, "TargetDetails", &l.TargetDetails) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LtrBackupResponse. +func (l LtrBackupResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", l.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LtrBackupResponse. +func (l *LtrBackupResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LtrPreBackupRequest. +func (l LtrPreBackupRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupSettings", l.BackupSettings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LtrPreBackupRequest. +func (l *LtrPreBackupRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupSettings": + err = unpopulate(val, "BackupSettings", &l.BackupSettings) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LtrPreBackupResponse. +func (l LtrPreBackupResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", l.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LtrPreBackupResponse. +func (l *LtrPreBackupResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LtrPreBackupResponseProperties. +func (l LtrPreBackupResponseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "numberOfContainers", l.NumberOfContainers) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LtrPreBackupResponseProperties. +func (l *LtrPreBackupResponseProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "numberOfContainers": + err = unpopulate(val, "NumberOfContainers", &l.NumberOfContainers) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LtrServerBackupOperation. +func (l LtrServerBackupOperation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", l.ID) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "systemData", l.SystemData) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LtrServerBackupOperation. +func (l *LtrServerBackupOperation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &l.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LtrServerBackupOperationList. +func (l LtrServerBackupOperationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LtrServerBackupOperationList. +func (l *LtrServerBackupOperationList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindow. +func (m MaintenanceWindow) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "customWindow", m.CustomWindow) + populate(objectMap, "dayOfWeek", m.DayOfWeek) + populate(objectMap, "startHour", m.StartHour) + populate(objectMap, "startMinute", m.StartMinute) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceWindow. +func (m *MaintenanceWindow) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "customWindow": + err = unpopulate(val, "CustomWindow", &m.CustomWindow) + delete(rawMsg, key) + case "dayOfWeek": + err = unpopulate(val, "DayOfWeek", &m.DayOfWeek) + delete(rawMsg, key) + case "startHour": + err = unpopulate(val, "StartHour", &m.StartHour) delete(rawMsg, key) case "startMinute": err = unpopulate(val, "StartMinute", &m.StartMinute) @@ -1020,227 +1672,1079 @@ func (m *MaintenanceWindow) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NameAvailability. -func (n NameAvailability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrationNameAvailabilityResource. +func (m MigrationNameAvailabilityResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "message", n.Message) - populate(objectMap, "name", n.Name) - populate(objectMap, "nameAvailable", n.NameAvailable) - populate(objectMap, "reason", n.Reason) - populate(objectMap, "type", n.Type) + populate(objectMap, "message", m.Message) + populate(objectMap, "name", m.Name) + populate(objectMap, "nameAvailable", m.NameAvailable) + populate(objectMap, "reason", m.Reason) + populate(objectMap, "type", m.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NameAvailability. -func (n *NameAvailability) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationNameAvailabilityResource. +func (m *MigrationNameAvailabilityResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { case "message": - err = unpopulate(val, "Message", &n.Message) + err = unpopulate(val, "Message", &m.Message) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &n.Name) + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) case "nameAvailable": - err = unpopulate(val, "NameAvailable", &n.NameAvailable) + err = unpopulate(val, "NameAvailable", &m.NameAvailable) delete(rawMsg, key) case "reason": - err = unpopulate(val, "Reason", &n.Reason) + err = unpopulate(val, "Reason", &m.Reason) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &n.Type) + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Network. -func (n Network) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrationResource. +func (m MigrationResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "delegatedSubnetResourceId", n.DelegatedSubnetResourceID) - populate(objectMap, "privateDnsZoneArmResourceId", n.PrivateDNSZoneArmResourceID) - populate(objectMap, "publicNetworkAccess", n.PublicNetworkAccess) + populate(objectMap, "id", m.ID) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Network. -func (n *Network) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationResource. +func (m *MigrationResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &m.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrationResourceForPatch. +func (m MigrationResourceForPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "tags", m.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationResourceForPatch. +func (m *MigrationResourceForPatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrationResourceListResult. +func (m MigrationResourceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationResourceListResult. +func (m *MigrationResourceListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrationResourceProperties. +func (m MigrationResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cancel", m.Cancel) + populate(objectMap, "currentStatus", m.CurrentStatus) + populate(objectMap, "dbsToCancelMigrationOn", m.DbsToCancelMigrationOn) + populate(objectMap, "dbsToMigrate", m.DbsToMigrate) + populate(objectMap, "dbsToTriggerCutoverOn", m.DbsToTriggerCutoverOn) + populate(objectMap, "migrationId", m.MigrationID) + populate(objectMap, "migrationMode", m.MigrationMode) + populate(objectMap, "migrationOption", m.MigrationOption) + populateDateTimeRFC3339(objectMap, "migrationWindowEndTimeInUtc", m.MigrationWindowEndTimeInUTC) + populateDateTimeRFC3339(objectMap, "migrationWindowStartTimeInUtc", m.MigrationWindowStartTimeInUTC) + populate(objectMap, "overwriteDbsInTarget", m.OverwriteDbsInTarget) + populate(objectMap, "sslMode", m.SSLMode) + populate(objectMap, "secretParameters", m.SecretParameters) + populate(objectMap, "setupLogicalReplicationOnSourceDbIfNeeded", m.SetupLogicalReplicationOnSourceDbIfNeeded) + populate(objectMap, "sourceDbServerFullyQualifiedDomainName", m.SourceDbServerFullyQualifiedDomainName) + populate(objectMap, "sourceDbServerMetadata", m.SourceDbServerMetadata) + populate(objectMap, "sourceDbServerResourceId", m.SourceDbServerResourceID) + populate(objectMap, "sourceType", m.SourceType) + populate(objectMap, "startDataMigration", m.StartDataMigration) + populate(objectMap, "targetDbServerFullyQualifiedDomainName", m.TargetDbServerFullyQualifiedDomainName) + populate(objectMap, "targetDbServerMetadata", m.TargetDbServerMetadata) + populate(objectMap, "targetDbServerResourceId", m.TargetDbServerResourceID) + populate(objectMap, "triggerCutover", m.TriggerCutover) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationResourceProperties. +func (m *MigrationResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cancel": + err = unpopulate(val, "Cancel", &m.Cancel) + delete(rawMsg, key) + case "currentStatus": + err = unpopulate(val, "CurrentStatus", &m.CurrentStatus) + delete(rawMsg, key) + case "dbsToCancelMigrationOn": + err = unpopulate(val, "DbsToCancelMigrationOn", &m.DbsToCancelMigrationOn) + delete(rawMsg, key) + case "dbsToMigrate": + err = unpopulate(val, "DbsToMigrate", &m.DbsToMigrate) + delete(rawMsg, key) + case "dbsToTriggerCutoverOn": + err = unpopulate(val, "DbsToTriggerCutoverOn", &m.DbsToTriggerCutoverOn) + delete(rawMsg, key) + case "migrationId": + err = unpopulate(val, "MigrationID", &m.MigrationID) + delete(rawMsg, key) + case "migrationMode": + err = unpopulate(val, "MigrationMode", &m.MigrationMode) + delete(rawMsg, key) + case "migrationOption": + err = unpopulate(val, "MigrationOption", &m.MigrationOption) + delete(rawMsg, key) + case "migrationWindowEndTimeInUtc": + err = unpopulateDateTimeRFC3339(val, "MigrationWindowEndTimeInUTC", &m.MigrationWindowEndTimeInUTC) + delete(rawMsg, key) + case "migrationWindowStartTimeInUtc": + err = unpopulateDateTimeRFC3339(val, "MigrationWindowStartTimeInUTC", &m.MigrationWindowStartTimeInUTC) + delete(rawMsg, key) + case "overwriteDbsInTarget": + err = unpopulate(val, "OverwriteDbsInTarget", &m.OverwriteDbsInTarget) + delete(rawMsg, key) + case "sslMode": + err = unpopulate(val, "SSLMode", &m.SSLMode) + delete(rawMsg, key) + case "secretParameters": + err = unpopulate(val, "SecretParameters", &m.SecretParameters) + delete(rawMsg, key) + case "setupLogicalReplicationOnSourceDbIfNeeded": + err = unpopulate(val, "SetupLogicalReplicationOnSourceDbIfNeeded", &m.SetupLogicalReplicationOnSourceDbIfNeeded) + delete(rawMsg, key) + case "sourceDbServerFullyQualifiedDomainName": + err = unpopulate(val, "SourceDbServerFullyQualifiedDomainName", &m.SourceDbServerFullyQualifiedDomainName) + delete(rawMsg, key) + case "sourceDbServerMetadata": + err = unpopulate(val, "SourceDbServerMetadata", &m.SourceDbServerMetadata) + delete(rawMsg, key) + case "sourceDbServerResourceId": + err = unpopulate(val, "SourceDbServerResourceID", &m.SourceDbServerResourceID) + delete(rawMsg, key) + case "sourceType": + err = unpopulate(val, "SourceType", &m.SourceType) + delete(rawMsg, key) + case "startDataMigration": + err = unpopulate(val, "StartDataMigration", &m.StartDataMigration) + delete(rawMsg, key) + case "targetDbServerFullyQualifiedDomainName": + err = unpopulate(val, "TargetDbServerFullyQualifiedDomainName", &m.TargetDbServerFullyQualifiedDomainName) + delete(rawMsg, key) + case "targetDbServerMetadata": + err = unpopulate(val, "TargetDbServerMetadata", &m.TargetDbServerMetadata) + delete(rawMsg, key) + case "targetDbServerResourceId": + err = unpopulate(val, "TargetDbServerResourceID", &m.TargetDbServerResourceID) + delete(rawMsg, key) + case "triggerCutover": + err = unpopulate(val, "TriggerCutover", &m.TriggerCutover) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrationResourcePropertiesForPatch. +func (m MigrationResourcePropertiesForPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cancel", m.Cancel) + populate(objectMap, "dbsToCancelMigrationOn", m.DbsToCancelMigrationOn) + populate(objectMap, "dbsToMigrate", m.DbsToMigrate) + populate(objectMap, "dbsToTriggerCutoverOn", m.DbsToTriggerCutoverOn) + populate(objectMap, "migrationMode", m.MigrationMode) + populateDateTimeRFC3339(objectMap, "migrationWindowStartTimeInUtc", m.MigrationWindowStartTimeInUTC) + populate(objectMap, "overwriteDbsInTarget", m.OverwriteDbsInTarget) + populate(objectMap, "secretParameters", m.SecretParameters) + populate(objectMap, "setupLogicalReplicationOnSourceDbIfNeeded", m.SetupLogicalReplicationOnSourceDbIfNeeded) + populate(objectMap, "sourceDbServerFullyQualifiedDomainName", m.SourceDbServerFullyQualifiedDomainName) + populate(objectMap, "sourceDbServerResourceId", m.SourceDbServerResourceID) + populate(objectMap, "startDataMigration", m.StartDataMigration) + populate(objectMap, "targetDbServerFullyQualifiedDomainName", m.TargetDbServerFullyQualifiedDomainName) + populate(objectMap, "triggerCutover", m.TriggerCutover) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationResourcePropertiesForPatch. +func (m *MigrationResourcePropertiesForPatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cancel": + err = unpopulate(val, "Cancel", &m.Cancel) + delete(rawMsg, key) + case "dbsToCancelMigrationOn": + err = unpopulate(val, "DbsToCancelMigrationOn", &m.DbsToCancelMigrationOn) + delete(rawMsg, key) + case "dbsToMigrate": + err = unpopulate(val, "DbsToMigrate", &m.DbsToMigrate) + delete(rawMsg, key) + case "dbsToTriggerCutoverOn": + err = unpopulate(val, "DbsToTriggerCutoverOn", &m.DbsToTriggerCutoverOn) + delete(rawMsg, key) + case "migrationMode": + err = unpopulate(val, "MigrationMode", &m.MigrationMode) + delete(rawMsg, key) + case "migrationWindowStartTimeInUtc": + err = unpopulateDateTimeRFC3339(val, "MigrationWindowStartTimeInUTC", &m.MigrationWindowStartTimeInUTC) + delete(rawMsg, key) + case "overwriteDbsInTarget": + err = unpopulate(val, "OverwriteDbsInTarget", &m.OverwriteDbsInTarget) + delete(rawMsg, key) + case "secretParameters": + err = unpopulate(val, "SecretParameters", &m.SecretParameters) + delete(rawMsg, key) + case "setupLogicalReplicationOnSourceDbIfNeeded": + err = unpopulate(val, "SetupLogicalReplicationOnSourceDbIfNeeded", &m.SetupLogicalReplicationOnSourceDbIfNeeded) + delete(rawMsg, key) + case "sourceDbServerFullyQualifiedDomainName": + err = unpopulate(val, "SourceDbServerFullyQualifiedDomainName", &m.SourceDbServerFullyQualifiedDomainName) + delete(rawMsg, key) + case "sourceDbServerResourceId": + err = unpopulate(val, "SourceDbServerResourceID", &m.SourceDbServerResourceID) + delete(rawMsg, key) + case "startDataMigration": + err = unpopulate(val, "StartDataMigration", &m.StartDataMigration) + delete(rawMsg, key) + case "targetDbServerFullyQualifiedDomainName": + err = unpopulate(val, "TargetDbServerFullyQualifiedDomainName", &m.TargetDbServerFullyQualifiedDomainName) + delete(rawMsg, key) + case "triggerCutover": + err = unpopulate(val, "TriggerCutover", &m.TriggerCutover) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrationSecretParameters. +func (m MigrationSecretParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "adminCredentials", m.AdminCredentials) + populate(objectMap, "sourceServerUsername", m.SourceServerUsername) + populate(objectMap, "targetServerUsername", m.TargetServerUsername) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationSecretParameters. +func (m *MigrationSecretParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "adminCredentials": + err = unpopulate(val, "AdminCredentials", &m.AdminCredentials) + delete(rawMsg, key) + case "sourceServerUsername": + err = unpopulate(val, "SourceServerUsername", &m.SourceServerUsername) + delete(rawMsg, key) + case "targetServerUsername": + err = unpopulate(val, "TargetServerUsername", &m.TargetServerUsername) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrationStatus. +func (m MigrationStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "currentSubStateDetails", m.CurrentSubStateDetails) + populate(objectMap, "error", m.Error) + populate(objectMap, "state", m.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationStatus. +func (m *MigrationStatus) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "currentSubStateDetails": + err = unpopulate(val, "CurrentSubStateDetails", &m.CurrentSubStateDetails) + delete(rawMsg, key) + case "error": + err = unpopulate(val, "Error", &m.Error) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrationSubStateDetails. +func (m MigrationSubStateDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "currentSubState", m.CurrentSubState) + populate(objectMap, "dbDetails", m.DbDetails) + populate(objectMap, "validationDetails", m.ValidationDetails) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationSubStateDetails. +func (m *MigrationSubStateDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "currentSubState": + err = unpopulate(val, "CurrentSubState", &m.CurrentSubState) + delete(rawMsg, key) + case "dbDetails": + err = unpopulate(val, "DbDetails", &m.DbDetails) + delete(rawMsg, key) + case "validationDetails": + err = unpopulate(val, "ValidationDetails", &m.ValidationDetails) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NameAvailability. +func (n NameAvailability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "message", n.Message) + populate(objectMap, "name", n.Name) + populate(objectMap, "nameAvailable", n.NameAvailable) + populate(objectMap, "reason", n.Reason) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NameAvailability. +func (n *NameAvailability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "message": + err = unpopulate(val, "Message", &n.Message) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "nameAvailable": + err = unpopulate(val, "NameAvailable", &n.NameAvailable) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &n.Reason) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NameProperty. +func (n NameProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "localizedValue", n.LocalizedValue) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NameProperty. +func (n *NameProperty) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "localizedValue": + err = unpopulate(val, "LocalizedValue", &n.LocalizedValue) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Network. +func (n Network) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "delegatedSubnetResourceId", n.DelegatedSubnetResourceID) + populate(objectMap, "privateDnsZoneArmResourceId", n.PrivateDNSZoneArmResourceID) + populate(objectMap, "publicNetworkAccess", n.PublicNetworkAccess) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Network. +func (n *Network) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "delegatedSubnetResourceId": + err = unpopulate(val, "DelegatedSubnetResourceID", &n.DelegatedSubnetResourceID) + delete(rawMsg, key) + case "privateDnsZoneArmResourceId": + err = unpopulate(val, "PrivateDNSZoneArmResourceID", &n.PrivateDNSZoneArmResourceID) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &n.PublicNetworkAccess) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + populate(objectMap, "properties", o.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint. +func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint. +func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. +func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. +func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. +func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult. +func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. +func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 PrivateEndpointConnectionProperties. +func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "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) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. +func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. +func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. +func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult. +func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. +func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "delegatedSubnetResourceId": - err = unpopulate(val, "DelegatedSubnetResourceID", &n.DelegatedSubnetResourceID) + case "groupId": + err = unpopulate(val, "GroupID", &p.GroupID) delete(rawMsg, key) - case "privateDnsZoneArmResourceId": - err = unpopulate(val, "PrivateDNSZoneArmResourceID", &n.PrivateDNSZoneArmResourceID) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &n.PublicNetworkAccess) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NodeTypeCapability. -func (n NodeTypeCapability) 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, "name", n.Name) - populate(objectMap, "nodeType", n.NodeType) - populate(objectMap, "status", n.Status) + 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 NodeTypeCapability. -func (n *NodeTypeCapability) 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", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &n.Name) + case "actionsRequired": + err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) delete(rawMsg, key) - case "nodeType": - err = unpopulate(val, "NodeType", &n.NodeType) + case "description": + err = unpopulate(val, "Description", &p.Description) delete(rawMsg, key) case "status": - err = unpopulate(val, "Status", &n.Status) + err = unpopulate(val, "Status", &p.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Operation. -func (o Operation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type QuotaUsage. +func (q QuotaUsage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "display", o.Display) - populate(objectMap, "isDataAction", o.IsDataAction) - populate(objectMap, "name", o.Name) - populate(objectMap, "origin", o.Origin) - populate(objectMap, "properties", o.Properties) + populate(objectMap, "currentValue", q.CurrentValue) + populate(objectMap, "id", q.ID) + populate(objectMap, "limit", q.Limit) + populate(objectMap, "name", q.Name) + populate(objectMap, "unit", q.Unit) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. -func (o *Operation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaUsage. +func (q *QuotaUsage) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { - case "display": - err = unpopulate(val, "Display", &o.Display) + case "currentValue": + err = unpopulate(val, "CurrentValue", &q.CurrentValue) delete(rawMsg, key) - case "isDataAction": - err = unpopulate(val, "IsDataAction", &o.IsDataAction) + case "id": + err = unpopulate(val, "ID", &q.ID) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) + case "limit": + err = unpopulate(val, "Limit", &q.Limit) delete(rawMsg, key) - case "origin": - err = unpopulate(val, "Origin", &o.Origin) + case "name": + err = unpopulate(val, "Name", &q.Name) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &o.Properties) + case "unit": + err = unpopulate(val, "Unit", &q.Unit) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. -func (o OperationDisplay) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type QuotaUsagesListResult. +func (q QuotaUsagesListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", o.Description) - populate(objectMap, "operation", o.Operation) - populate(objectMap, "provider", o.Provider) - populate(objectMap, "resource", o.Resource) + populate(objectMap, "nextLink", q.NextLink) + populate(objectMap, "value", q.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. -func (o *OperationDisplay) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaUsagesListResult. +func (q *QuotaUsagesListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &o.Description) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &o.Operation) - delete(rawMsg, key) - case "provider": - err = unpopulate(val, "Provider", &o.Provider) + case "nextLink": + err = unpopulate(val, "NextLink", &q.NextLink) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &o.Resource) + case "value": + err = unpopulate(val, "Value", &q.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationListResult. -func (o OperationListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Replica. +func (r Replica) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) + populate(objectMap, "capacity", r.Capacity) + populate(objectMap, "promoteMode", r.PromoteMode) + populate(objectMap, "promoteOption", r.PromoteOption) + populate(objectMap, "replicationState", r.ReplicationState) + populate(objectMap, "role", r.Role) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. -func (o *OperationListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Replica. +func (r *Replica) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &o.NextLink) + case "capacity": + err = unpopulate(val, "Capacity", &r.Capacity) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &o.Value) + case "promoteMode": + err = unpopulate(val, "PromoteMode", &r.PromoteMode) + delete(rawMsg, key) + case "promoteOption": + err = unpopulate(val, "PromoteOption", &r.PromoteOption) + delete(rawMsg, key) + case "replicationState": + err = unpopulate(val, "ReplicationState", &r.ReplicationState) + delete(rawMsg, key) + case "role": + err = unpopulate(val, "Role", &r.Role) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil @@ -1562,6 +3066,8 @@ func (s ServerProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "minorVersion", s.MinorVersion) populate(objectMap, "network", s.Network) populateDateTimeRFC3339(objectMap, "pointInTimeUTC", s.PointInTimeUTC) + populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) + populate(objectMap, "replica", s.Replica) populate(objectMap, "replicaCapacity", s.ReplicaCapacity) populate(objectMap, "replicationRole", s.ReplicationRole) populate(objectMap, "sourceServerResourceId", s.SourceServerResourceID) @@ -1619,6 +3125,12 @@ func (s *ServerProperties) UnmarshalJSON(data []byte) error { case "pointInTimeUTC": err = unpopulateDateTimeRFC3339(val, "PointInTimeUTC", &s.PointInTimeUTC) delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &s.PrivateEndpointConnections) + delete(rawMsg, key) + case "replica": + err = unpopulate(val, "Replica", &s.Replica) + delete(rawMsg, key) case "replicaCapacity": err = unpopulate(val, "ReplicaCapacity", &s.ReplicaCapacity) delete(rawMsg, key) @@ -1631,12 +3143,231 @@ func (s *ServerProperties) UnmarshalJSON(data []byte) error { case "state": err = unpopulate(val, "State", &s.State) delete(rawMsg, key) - case "storage": - err = unpopulate(val, "Storage", &s.Storage) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &s.Version) - delete(rawMsg, key) + case "storage": + err = unpopulate(val, "Storage", &s.Storage) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &s.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerPropertiesForUpdate. +func (s ServerPropertiesForUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "administratorLoginPassword", s.AdministratorLoginPassword) + populate(objectMap, "authConfig", s.AuthConfig) + populate(objectMap, "backup", s.Backup) + populate(objectMap, "createMode", s.CreateMode) + populate(objectMap, "dataEncryption", s.DataEncryption) + populate(objectMap, "highAvailability", s.HighAvailability) + populate(objectMap, "maintenanceWindow", s.MaintenanceWindow) + populate(objectMap, "network", s.Network) + populate(objectMap, "replica", s.Replica) + populate(objectMap, "replicationRole", s.ReplicationRole) + populate(objectMap, "storage", s.Storage) + populate(objectMap, "version", s.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForUpdate. +func (s *ServerPropertiesForUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "administratorLoginPassword": + err = unpopulate(val, "AdministratorLoginPassword", &s.AdministratorLoginPassword) + delete(rawMsg, key) + case "authConfig": + err = unpopulate(val, "AuthConfig", &s.AuthConfig) + delete(rawMsg, key) + case "backup": + err = unpopulate(val, "Backup", &s.Backup) + delete(rawMsg, key) + case "createMode": + err = unpopulate(val, "CreateMode", &s.CreateMode) + delete(rawMsg, key) + case "dataEncryption": + err = unpopulate(val, "DataEncryption", &s.DataEncryption) + delete(rawMsg, key) + case "highAvailability": + err = unpopulate(val, "HighAvailability", &s.HighAvailability) + delete(rawMsg, key) + case "maintenanceWindow": + err = unpopulate(val, "MaintenanceWindow", &s.MaintenanceWindow) + delete(rawMsg, key) + case "network": + err = unpopulate(val, "Network", &s.Network) + delete(rawMsg, key) + case "replica": + err = unpopulate(val, "Replica", &s.Replica) + delete(rawMsg, key) + case "replicationRole": + err = unpopulate(val, "ReplicationRole", &s.ReplicationRole) + delete(rawMsg, key) + case "storage": + err = unpopulate(val, "Storage", &s.Storage) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &s.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerSKU. +func (s ServerSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", s.Name) + populate(objectMap, "tier", s.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerSKU. +func (s *ServerSKU) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerSKUCapability. +func (s ServerSKUCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", s.Name) + populate(objectMap, "reason", s.Reason) + populate(objectMap, "status", s.Status) + populate(objectMap, "supportedHaMode", s.SupportedHaMode) + populate(objectMap, "supportedIops", s.SupportedIops) + populate(objectMap, "supportedMemoryPerVcoreMb", s.SupportedMemoryPerVcoreMb) + populate(objectMap, "supportedZones", s.SupportedZones) + populate(objectMap, "vCores", s.VCores) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerSKUCapability. +func (s *ServerSKUCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &s.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "supportedHaMode": + err = unpopulate(val, "SupportedHaMode", &s.SupportedHaMode) + delete(rawMsg, key) + case "supportedIops": + err = unpopulate(val, "SupportedIops", &s.SupportedIops) + delete(rawMsg, key) + case "supportedMemoryPerVcoreMb": + err = unpopulate(val, "SupportedMemoryPerVcoreMb", &s.SupportedMemoryPerVcoreMb) + delete(rawMsg, key) + case "supportedZones": + err = unpopulate(val, "SupportedZones", &s.SupportedZones) + delete(rawMsg, key) + case "vCores": + err = unpopulate(val, "VCores", &s.VCores) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerThreatProtectionListResult. +func (s ServerThreatProtectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerThreatProtectionListResult. +func (s *ServerThreatProtectionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerThreatProtectionProperties. +func (s ServerThreatProtectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "creationTime", s.CreationTime) + populate(objectMap, "state", s.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerThreatProtectionProperties. +func (s *ServerThreatProtectionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "creationTime": + err = unpopulateDateTimeRFC3339(val, "CreationTime", &s.CreationTime) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &s.State) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1645,24 +3376,19 @@ func (s *ServerProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerPropertiesForUpdate. -func (s ServerPropertiesForUpdate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerThreatProtectionSettingsModel. +func (s ServerThreatProtectionSettingsModel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "administratorLoginPassword", s.AdministratorLoginPassword) - populate(objectMap, "authConfig", s.AuthConfig) - populate(objectMap, "backup", s.Backup) - populate(objectMap, "createMode", s.CreateMode) - populate(objectMap, "dataEncryption", s.DataEncryption) - populate(objectMap, "highAvailability", s.HighAvailability) - populate(objectMap, "maintenanceWindow", s.MaintenanceWindow) - populate(objectMap, "replicationRole", s.ReplicationRole) - populate(objectMap, "storage", s.Storage) - populate(objectMap, "version", s.Version) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForUpdate. -func (s *ServerPropertiesForUpdate) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerThreatProtectionSettingsModel. +func (s *ServerThreatProtectionSettingsModel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1670,35 +3396,20 @@ func (s *ServerPropertiesForUpdate) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "administratorLoginPassword": - err = unpopulate(val, "AdministratorLoginPassword", &s.AdministratorLoginPassword) - delete(rawMsg, key) - case "authConfig": - err = unpopulate(val, "AuthConfig", &s.AuthConfig) - delete(rawMsg, key) - case "backup": - err = unpopulate(val, "Backup", &s.Backup) - delete(rawMsg, key) - case "createMode": - err = unpopulate(val, "CreateMode", &s.CreateMode) - delete(rawMsg, key) - case "dataEncryption": - err = unpopulate(val, "DataEncryption", &s.DataEncryption) - delete(rawMsg, key) - case "highAvailability": - err = unpopulate(val, "HighAvailability", &s.HighAvailability) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "maintenanceWindow": - err = unpopulate(val, "MaintenanceWindow", &s.MaintenanceWindow) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "replicationRole": - err = unpopulate(val, "ReplicationRole", &s.ReplicationRole) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) - case "storage": - err = unpopulate(val, "Storage", &s.Storage) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &s.Version) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { @@ -1712,8 +3423,8 @@ func (s *ServerPropertiesForUpdate) UnmarshalJSON(data []byte) error { func (s ServerVersionCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "name", s.Name) + populate(objectMap, "reason", s.Reason) populate(objectMap, "status", s.Status) - populate(objectMap, "supportedVcores", s.SupportedVcores) populate(objectMap, "supportedVersionsToUpgrade", s.SupportedVersionsToUpgrade) return json.Marshal(objectMap) } @@ -1730,12 +3441,12 @@ func (s *ServerVersionCapability) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &s.Reason) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) - case "supportedVcores": - err = unpopulate(val, "SupportedVcores", &s.SupportedVcores) - delete(rawMsg, key) case "supportedVersionsToUpgrade": err = unpopulate(val, "SupportedVersionsToUpgrade", &s.SupportedVersionsToUpgrade) delete(rawMsg, key) @@ -1750,7 +3461,12 @@ func (s *ServerVersionCapability) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Storage. func (s Storage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "autoGrow", s.AutoGrow) + populate(objectMap, "iops", s.Iops) populate(objectMap, "storageSizeGB", s.StorageSizeGB) + populate(objectMap, "throughput", s.Throughput) + populate(objectMap, "tier", s.Tier) + populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } @@ -1763,9 +3479,24 @@ func (s *Storage) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "autoGrow": + err = unpopulate(val, "AutoGrow", &s.AutoGrow) + delete(rawMsg, key) + case "iops": + err = unpopulate(val, "Iops", &s.Iops) + delete(rawMsg, key) case "storageSizeGB": err = unpopulate(val, "StorageSizeGB", &s.StorageSizeGB) delete(rawMsg, key) + case "throughput": + err = unpopulate(val, "Throughput", &s.Throughput) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1777,9 +3508,11 @@ func (s *Storage) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StorageEditionCapability. func (s StorageEditionCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "defaultStorageSizeMb", s.DefaultStorageSizeMb) populate(objectMap, "name", s.Name) + populate(objectMap, "reason", s.Reason) populate(objectMap, "status", s.Status) - populate(objectMap, "supportedStorageMB", s.SupportedStorageMB) + populate(objectMap, "supportedStorageMb", s.SupportedStorageMb) return json.Marshal(objectMap) } @@ -1792,14 +3525,20 @@ func (s *StorageEditionCapability) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "defaultStorageSizeMb": + err = unpopulate(val, "DefaultStorageSizeMb", &s.DefaultStorageSizeMb) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &s.Reason) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) - case "supportedStorageMB": - err = unpopulate(val, "SupportedStorageMB", &s.SupportedStorageMB) + case "supportedStorageMb": + err = unpopulate(val, "SupportedStorageMb", &s.SupportedStorageMb) delete(rawMsg, key) } if err != nil { @@ -1809,19 +3548,24 @@ func (s *StorageEditionCapability) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type StorageMBCapability. -func (s StorageMBCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StorageMbCapability. +func (s StorageMbCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", s.Name) + populate(objectMap, "defaultIopsTier", s.DefaultIopsTier) + populate(objectMap, "maximumStorageSizeMb", s.MaximumStorageSizeMb) + populate(objectMap, "reason", s.Reason) populate(objectMap, "status", s.Status) - populate(objectMap, "storageSizeMB", s.StorageSizeMB) + populate(objectMap, "storageSizeMb", s.StorageSizeMb) populate(objectMap, "supportedIops", s.SupportedIops) - populate(objectMap, "supportedUpgradableTierList", s.SupportedUpgradableTierList) + populate(objectMap, "supportedIopsTiers", s.SupportedIopsTiers) + populate(objectMap, "supportedMaximumIops", s.SupportedMaximumIops) + populate(objectMap, "supportedMaximumThroughput", s.SupportedMaximumThroughput) + populate(objectMap, "supportedThroughput", s.SupportedThroughput) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type StorageMBCapability. -func (s *StorageMBCapability) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageMbCapability. +func (s *StorageMbCapability) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1829,20 +3573,35 @@ func (s *StorageMBCapability) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &s.Name) + case "defaultIopsTier": + err = unpopulate(val, "DefaultIopsTier", &s.DefaultIopsTier) + delete(rawMsg, key) + case "maximumStorageSizeMb": + err = unpopulate(val, "MaximumStorageSizeMb", &s.MaximumStorageSizeMb) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &s.Reason) delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) - case "storageSizeMB": - err = unpopulate(val, "StorageSizeMB", &s.StorageSizeMB) + case "storageSizeMb": + err = unpopulate(val, "StorageSizeMb", &s.StorageSizeMb) delete(rawMsg, key) case "supportedIops": err = unpopulate(val, "SupportedIops", &s.SupportedIops) delete(rawMsg, key) - case "supportedUpgradableTierList": - err = unpopulate(val, "SupportedUpgradableTierList", &s.SupportedUpgradableTierList) + case "supportedIopsTiers": + err = unpopulate(val, "SupportedIopsTiers", &s.SupportedIopsTiers) + delete(rawMsg, key) + case "supportedMaximumIops": + err = unpopulate(val, "SupportedMaximumIops", &s.SupportedMaximumIops) + delete(rawMsg, key) + case "supportedMaximumThroughput": + err = unpopulate(val, "SupportedMaximumThroughput", &s.SupportedMaximumThroughput) + delete(rawMsg, key) + case "supportedThroughput": + err = unpopulate(val, "SupportedThroughput", &s.SupportedThroughput) delete(rawMsg, key) } if err != nil { @@ -1856,10 +3615,9 @@ func (s *StorageMBCapability) UnmarshalJSON(data []byte) error { func (s StorageTierCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "iops", s.Iops) - populate(objectMap, "isBaseline", s.IsBaseline) populate(objectMap, "name", s.Name) + populate(objectMap, "reason", s.Reason) populate(objectMap, "status", s.Status) - populate(objectMap, "tierName", s.TierName) return json.Marshal(objectMap) } @@ -1875,18 +3633,15 @@ func (s *StorageTierCapability) UnmarshalJSON(data []byte) error { case "iops": err = unpopulate(val, "Iops", &s.Iops) delete(rawMsg, key) - case "isBaseline": - err = unpopulate(val, "IsBaseline", &s.IsBaseline) - delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &s.Reason) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) - case "tierName": - err = unpopulate(val, "TierName", &s.TierName) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1945,6 +3700,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity. func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "tenantId", u.TenantID) populate(objectMap, "type", u.Type) populate(objectMap, "userAssignedIdentities", u.UserAssignedIdentities) return json.Marshal(objectMap) @@ -1959,6 +3715,9 @@ func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "tenantId": + err = unpopulate(val, "TenantID", &u.TenantID) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &u.Type) delete(rawMsg, key) @@ -2004,19 +3763,19 @@ func (u *UserIdentity) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type VcoreCapability. -func (v VcoreCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ValidationDetails. +func (v ValidationDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", v.Name) + populate(objectMap, "dbLevelValidationDetails", v.DbLevelValidationDetails) + populate(objectMap, "serverLevelValidationDetails", v.ServerLevelValidationDetails) populate(objectMap, "status", v.Status) - populate(objectMap, "supportedIops", v.SupportedIops) - populate(objectMap, "supportedMemoryPerVcoreMB", v.SupportedMemoryPerVcoreMB) - populate(objectMap, "vCores", v.VCores) + populateDateTimeRFC3339(objectMap, "validationEndTimeInUtc", v.ValidationEndTimeInUTC) + populateDateTimeRFC3339(objectMap, "validationStartTimeInUtc", v.ValidationStartTimeInUTC) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type VcoreCapability. -func (v *VcoreCapability) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidationDetails. +func (v *ValidationDetails) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", v, err) @@ -2024,20 +3783,222 @@ func (v *VcoreCapability) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) + case "dbLevelValidationDetails": + err = unpopulate(val, "DbLevelValidationDetails", &v.DbLevelValidationDetails) + delete(rawMsg, key) + case "serverLevelValidationDetails": + err = unpopulate(val, "ServerLevelValidationDetails", &v.ServerLevelValidationDetails) delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &v.Status) delete(rawMsg, key) - case "supportedIops": - err = unpopulate(val, "SupportedIops", &v.SupportedIops) + case "validationEndTimeInUtc": + err = unpopulateDateTimeRFC3339(val, "ValidationEndTimeInUTC", &v.ValidationEndTimeInUTC) delete(rawMsg, key) - case "supportedMemoryPerVcoreMB": - err = unpopulate(val, "SupportedMemoryPerVcoreMB", &v.SupportedMemoryPerVcoreMB) + case "validationStartTimeInUtc": + err = unpopulateDateTimeRFC3339(val, "ValidationStartTimeInUTC", &v.ValidationStartTimeInUTC) delete(rawMsg, key) - case "vCores": - err = unpopulate(val, "VCores", &v.VCores) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidationMessage. +func (v ValidationMessage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "message", v.Message) + populate(objectMap, "state", v.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidationMessage. +func (v *ValidationMessage) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "message": + err = unpopulate(val, "Message", &v.Message) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &v.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidationSummaryItem. +func (v ValidationSummaryItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "messages", v.Messages) + populate(objectMap, "state", v.State) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidationSummaryItem. +func (v *ValidationSummaryItem) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "messages": + err = unpopulate(val, "Messages", &v.Messages) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &v.State) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualEndpointResource. +func (v VirtualEndpointResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "systemData", v.SystemData) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualEndpointResource. +func (v *VirtualEndpointResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &v.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualEndpointResourceForPatch. +func (v VirtualEndpointResourceForPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", v.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualEndpointResourceForPatch. +func (v *VirtualEndpointResourceForPatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualEndpointResourceProperties. +func (v VirtualEndpointResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "endpointType", v.EndpointType) + populate(objectMap, "members", v.Members) + populate(objectMap, "virtualEndpoints", v.VirtualEndpoints) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualEndpointResourceProperties. +func (v *VirtualEndpointResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endpointType": + err = unpopulate(val, "EndpointType", &v.EndpointType) + delete(rawMsg, key) + case "members": + err = unpopulate(val, "Members", &v.Members) + delete(rawMsg, key) + case "virtualEndpoints": + err = unpopulate(val, "VirtualEndpoints", &v.VirtualEndpoints) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualEndpointsListResult. +func (v VirtualEndpointsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualEndpointsListResult. +func (v *VirtualEndpointsListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) delete(rawMsg, key) } if err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client.go index e767504e1f58..6df4a66ae584 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client.go @@ -40,7 +40,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // List - Lists all of the available REST API operations. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) List(ctx context.Context, options *OperationsClientListOptions) (OperationsClientListResponse, error) { var err error @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client_example_test.go index 4643529e062b..f10317cfc9d7 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/OperationList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/OperationList.json func ExampleOperationsClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/options.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/options.go index ebfc344e1cff..f52d3dbbe0aa 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/options.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/options.go @@ -122,6 +122,19 @@ type FirewallRulesClientListByServerOptions struct { // placeholder for future optional parameters } +// FlexibleServerClientBeginStartLtrBackupOptions contains the optional parameters for the FlexibleServerClient.BeginStartLtrBackup +// method. +type FlexibleServerClientBeginStartLtrBackupOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FlexibleServerClientTriggerLtrPreBackupOptions contains the optional parameters for the FlexibleServerClient.TriggerLtrPreBackup +// method. +type FlexibleServerClientTriggerLtrPreBackupOptions struct { + // placeholder for future optional parameters +} + // GetPrivateDNSZoneSuffixClientExecuteOptions contains the optional parameters for the GetPrivateDNSZoneSuffixClient.Execute // method. type GetPrivateDNSZoneSuffixClientExecuteOptions struct { @@ -134,16 +147,131 @@ type LocationBasedCapabilitiesClientExecuteOptions struct { // placeholder for future optional parameters } +// LogFilesClientListByServerOptions contains the optional parameters for the LogFilesClient.NewListByServerPager method. +type LogFilesClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// LtrBackupOperationsClientGetOptions contains the optional parameters for the LtrBackupOperationsClient.Get method. +type LtrBackupOperationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// LtrBackupOperationsClientListByServerOptions contains the optional parameters for the LtrBackupOperationsClient.NewListByServerPager +// method. +type LtrBackupOperationsClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// MigrationsClientCreateOptions contains the optional parameters for the MigrationsClient.Create method. +type MigrationsClientCreateOptions struct { + // placeholder for future optional parameters +} + +// MigrationsClientDeleteOptions contains the optional parameters for the MigrationsClient.Delete method. +type MigrationsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// MigrationsClientGetOptions contains the optional parameters for the MigrationsClient.Get method. +type MigrationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// MigrationsClientListByTargetServerOptions contains the optional parameters for the MigrationsClient.NewListByTargetServerPager +// method. +type MigrationsClientListByTargetServerOptions struct { + // Migration list filter. Retrieves either active migrations or all migrations. + MigrationListFilter *MigrationListFilter +} + +// MigrationsClientUpdateOptions contains the optional parameters for the MigrationsClient.Update method. +type MigrationsClientUpdateOptions struct { + // placeholder for future optional parameters +} + // OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. type OperationsClientListOptions struct { // placeholder for future optional parameters } +// PostgreSQLManagementClientCheckMigrationNameAvailabilityOptions contains the optional parameters for the PostgreSQLManagementClient.CheckMigrationNameAvailability +// method. +type PostgreSQLManagementClientCheckMigrationNameAvailabilityOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginDelete +// method. +type PrivateEndpointConnectionClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateEndpointConnectionClientBeginUpdateOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginUpdate +// method. +type PrivateEndpointConnectionClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get +// method. +type PrivateEndpointConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientListByServerOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByServerPager +// method. +type PrivateEndpointConnectionsClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get method. +type PrivateLinkResourcesClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkResourcesClientListByServerOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByServerPager +// method. +type PrivateLinkResourcesClientListByServerOptions struct { + // placeholder for future optional parameters +} + +// QuotaUsagesClientListOptions contains the optional parameters for the QuotaUsagesClient.NewListPager method. +type QuotaUsagesClientListOptions struct { + // placeholder for future optional parameters +} + // ReplicasClientListByServerOptions contains the optional parameters for the ReplicasClient.NewListByServerPager method. type ReplicasClientListByServerOptions struct { // placeholder for future optional parameters } +// ServerCapabilitiesClientListOptions contains the optional parameters for the ServerCapabilitiesClient.NewListPager method. +type ServerCapabilitiesClientListOptions struct { + // placeholder for future optional parameters +} + +// ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerThreatProtectionSettingsClient.BeginCreateOrUpdate +// method. +type ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerThreatProtectionSettingsClientGetOptions contains the optional parameters for the ServerThreatProtectionSettingsClient.Get +// method. +type ServerThreatProtectionSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServerThreatProtectionSettingsClientListByServerOptions contains the optional parameters for the ServerThreatProtectionSettingsClient.NewListByServerPager +// method. +type ServerThreatProtectionSettingsClientListByServerOptions struct { + // placeholder for future optional parameters +} + // ServersClientBeginCreateOptions contains the optional parameters for the ServersClient.BeginCreate method. type ServersClientBeginCreateOptions struct { // Resumes the LRO from the provided token. @@ -199,6 +327,35 @@ type ServersClientListOptions struct { // placeholder for future optional parameters } +// VirtualEndpointsClientBeginCreateOptions contains the optional parameters for the VirtualEndpointsClient.BeginCreate method. +type VirtualEndpointsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualEndpointsClientBeginDeleteOptions contains the optional parameters for the VirtualEndpointsClient.BeginDelete method. +type VirtualEndpointsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualEndpointsClientBeginUpdateOptions contains the optional parameters for the VirtualEndpointsClient.BeginUpdate method. +type VirtualEndpointsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualEndpointsClientGetOptions contains the optional parameters for the VirtualEndpointsClient.Get method. +type VirtualEndpointsClientGetOptions struct { + // placeholder for future optional parameters +} + +// VirtualEndpointsClientListByServerOptions contains the optional parameters for the VirtualEndpointsClient.NewListByServerPager +// method. +type VirtualEndpointsClientListByServerOptions struct { + // placeholder for future optional parameters +} + // VirtualNetworkSubnetUsageClientExecuteOptions contains the optional parameters for the VirtualNetworkSubnetUsageClient.Execute // method. type VirtualNetworkSubnetUsageClientExecuteOptions struct { diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlmanagement_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlmanagement_client.go new file mode 100644 index 000000000000..871ab6ca32e5 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlmanagement_client.go @@ -0,0 +1,111 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 armpostgresqlflexibleservers + +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" +) + +// PostgreSQLManagementClient contains the methods for the PostgreSQLManagementClient group. +// Don't use this type directly, use NewPostgreSQLManagementClient() instead. +type PostgreSQLManagementClient struct { + internal *arm.Client +} + +// NewPostgreSQLManagementClient creates a new instance of PostgreSQLManagementClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewPostgreSQLManagementClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*PostgreSQLManagementClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PostgreSQLManagementClient{ + internal: cl, + } + return client, nil +} + +// CheckMigrationNameAvailability - This method checks whether a proposed migration name is valid and available. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - subscriptionID - The subscription ID of the target database server. +// - resourceGroupName - The resource group name of the target database server. +// - targetDbServerName - The name of the target database server. +// - parameters - The required parameters for checking if a migration name is available. +// - options - PostgreSQLManagementClientCheckMigrationNameAvailabilityOptions contains the optional parameters for the PostgreSQLManagementClient.CheckMigrationNameAvailability +// method. +func (client *PostgreSQLManagementClient) CheckMigrationNameAvailability(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, parameters MigrationNameAvailabilityResource, options *PostgreSQLManagementClientCheckMigrationNameAvailabilityOptions) (PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse, error) { + var err error + const operationName = "PostgreSQLManagementClient.CheckMigrationNameAvailability" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.checkMigrationNameAvailabilityCreateRequest(ctx, subscriptionID, resourceGroupName, targetDbServerName, parameters, options) + if err != nil { + return PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse{}, err + } + resp, err := client.checkMigrationNameAvailabilityHandleResponse(httpResp) + return resp, err +} + +// checkMigrationNameAvailabilityCreateRequest creates the CheckMigrationNameAvailability request. +func (client *PostgreSQLManagementClient) checkMigrationNameAvailabilityCreateRequest(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, parameters MigrationNameAvailabilityResource, options *PostgreSQLManagementClientCheckMigrationNameAvailabilityOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/checkMigrationNameAvailability" + if subscriptionID == "" { + return nil, errors.New("parameter subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if targetDbServerName == "" { + return nil, errors.New("parameter targetDbServerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{targetDbServerName}", url.PathEscape(targetDbServerName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// checkMigrationNameAvailabilityHandleResponse handles the CheckMigrationNameAvailability response. +func (client *PostgreSQLManagementClient) checkMigrationNameAvailabilityHandleResponse(resp *http.Response) (PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse, error) { + result := PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MigrationNameAvailabilityResource); err != nil { + return PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlmanagement_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlmanagement_client_example_test.go new file mode 100644 index 000000000000..05c4b5a37e96 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlmanagement_client_example_test.go @@ -0,0 +1,47 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armpostgresqlflexibleservers_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/postgresql/armpostgresqlflexibleservers/v4" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CheckMigrationNameAvailability.json +func ExamplePostgreSQLManagementClient_CheckMigrationNameAvailability() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewPostgreSQLManagementClient().CheckMigrationNameAvailability(ctx, "ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget", armpostgresqlflexibleservers.MigrationNameAvailabilityResource{ + Name: to.Ptr("name1"), + Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/migrations"), + }, 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.MigrationNameAvailabilityResource = armpostgresqlflexibleservers.MigrationNameAvailabilityResource{ + // Name: to.Ptr("name1"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/migrations"), + // NameAvailable: to.Ptr(true), + // } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnection_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnection_client.go new file mode 100644 index 000000000000..9e047fd64d45 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnection_client.go @@ -0,0 +1,211 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 armpostgresqlflexibleservers + +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" +) + +// PrivateEndpointConnectionClient contains the methods for the PrivateEndpointConnection group. +// Don't use this type directly, use NewPrivateEndpointConnectionClient() instead. +type PrivateEndpointConnectionClient struct { + internal *arm.Client + subscriptionID string +} + +// NewPrivateEndpointConnectionClient creates a new instance of PrivateEndpointConnectionClient 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 NewPrivateEndpointConnectionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PrivateEndpointConnectionClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, 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 2023-06-01-preview +// - 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. +// - options - PrivateEndpointConnectionClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginDelete +// method. +func (client *PrivateEndpointConnectionClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionClientDeleteResponse], 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[PrivateEndpointConnectionClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[PrivateEndpointConnectionClientDeleteResponse]{ + 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 2023-06-01-preview +func (client *PrivateEndpointConnectionClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "PrivateEndpointConnectionClient.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.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PrivateEndpointConnectionClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginUpdate - 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 2023-06-01-preview +// - 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. +// - parameters - The required parameters for updating private endpoint connection. +// - options - PrivateEndpointConnectionClientBeginUpdateOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginUpdate +// method. +func (client *PrivateEndpointConnectionClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionClientBeginUpdateOptions) (*runtime.Poller[PrivateEndpointConnectionClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, serverName, privateEndpointConnectionName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointConnectionClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[PrivateEndpointConnectionClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Update - 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 2023-06-01-preview +func (client *PrivateEndpointConnectionClient) update(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionClientBeginUpdateOptions) (*http.Response, error) { + var err error + const operationName = "PrivateEndpointConnectionClient.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, 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 +} + +// updateCreateRequest creates the Update request. +func (client *PrivateEndpointConnectionClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnection_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnection_client_example_test.go new file mode 100644 index 000000000000..13caa385c223 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnection_client_example_test.go @@ -0,0 +1,89 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armpostgresqlflexibleservers_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/postgresql/armpostgresqlflexibleservers/v4" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionUpdate.json +func ExamplePrivateEndpointConnectionClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewPrivateEndpointConnectionClient().BeginUpdate(ctx, "Default", "test-svr", "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", armpostgresqlflexibleservers.PrivateEndpointConnection{ + Properties: &armpostgresqlflexibleservers.PrivateEndpointConnectionProperties{ + PrivateLinkServiceConnectionState: &armpostgresqlflexibleservers.PrivateLinkServiceConnectionState{ + Description: to.Ptr("Approved by johndoe@contoso.com"), + Status: to.Ptr(armpostgresqlflexibleservers.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.PrivateEndpointConnection = armpostgresqlflexibleservers.PrivateEndpointConnection{ + // Name: to.Ptr("private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateEndpointConnections"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/flexibleServers/test-svr/privateEndpointConnections/private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"), + // Properties: &armpostgresqlflexibleservers.PrivateEndpointConnectionProperties{ + // GroupIDs: []*string{ + // to.Ptr("postgresqlServer")}, + // PrivateEndpoint: &armpostgresqlflexibleservers.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), + // }, + // PrivateLinkServiceConnectionState: &armpostgresqlflexibleservers.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Approved by johndoe@contoso.com"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr(armpostgresqlflexibleservers.PrivateEndpointServiceConnectionStatusApproved), + // }, + // ProvisioningState: to.Ptr(armpostgresqlflexibleservers.PrivateEndpointConnectionProvisioningStateSucceeded), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionDelete.json +func ExamplePrivateEndpointConnectionClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewPrivateEndpointConnectionClient().BeginDelete(ctx, "Default", "test-svr", "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client.go new file mode 100644 index 000000000000..08d76ba64ac3 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client.go @@ -0,0 +1,179 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 armpostgresqlflexibleservers + +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 +} + +// Get - Gets a private endpoint connection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - 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. +// - 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, options *PrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientGetResponse, error) { + result := PrivateEndpointConnectionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnection); err != nil { + return PrivateEndpointConnectionsClientGetResponse{}, err + } + return result, nil +} + +// NewListByServerPager - Gets all private endpoint connections on a server. +// +// Generated from API version 2023-06-01-preview +// - 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.NewListByServerPager +// method. +func (client *PrivateEndpointConnectionsClient) NewListByServerPager(resourceGroupName string, serverName string, options *PrivateEndpointConnectionsClientListByServerOptions) *runtime.Pager[PrivateEndpointConnectionsClientListByServerResponse] { + return runtime.NewPager(runtime.PagingHandler[PrivateEndpointConnectionsClientListByServerResponse]{ + More: func(page PrivateEndpointConnectionsClientListByServerResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PrivateEndpointConnectionsClientListByServerResponse) (PrivateEndpointConnectionsClientListByServerResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "PrivateEndpointConnectionsClient.NewListByServerPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) + }, nil) + if err != nil { + return PrivateEndpointConnectionsClientListByServerResponse{}, err + } + return client.listByServerHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByServerCreateRequest creates the ListByServer request. +func (client *PrivateEndpointConnectionsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *PrivateEndpointConnectionsClientListByServerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByServerHandleResponse handles the ListByServer response. +func (client *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/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client_example_test.go new file mode 100644 index 000000000000..c7b6f497f4af --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client_example_test.go @@ -0,0 +1,120 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armpostgresqlflexibleservers_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionGet.json +func ExamplePrivateEndpointConnectionsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", 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.1fa229cd-bf3f-47f0-8c49-afb36723997e", 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.PrivateEndpointConnection = armpostgresqlflexibleservers.PrivateEndpointConnection{ + // Name: to.Ptr("private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateEndpointConnections"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/flexibleServers/test-svr/privateEndpointConnections/private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"), + // Properties: &armpostgresqlflexibleservers.PrivateEndpointConnectionProperties{ + // GroupIDs: []*string{ + // to.Ptr("postgresqlServer")}, + // PrivateEndpoint: &armpostgresqlflexibleservers.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), + // }, + // PrivateLinkServiceConnectionState: &armpostgresqlflexibleservers.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr(armpostgresqlflexibleservers.PrivateEndpointServiceConnectionStatusApproved), + // }, + // ProvisioningState: to.Ptr(armpostgresqlflexibleservers.PrivateEndpointConnectionProvisioningStateSucceeded), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionList.json +func ExamplePrivateEndpointConnectionsClient_NewListByServerPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByServerPager("Default", "test-svr", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.PrivateEndpointConnectionListResult = armpostgresqlflexibleservers.PrivateEndpointConnectionListResult{ + // Value: []*armpostgresqlflexibleservers.PrivateEndpointConnection{ + // { + // Name: to.Ptr("private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateEndpointConnections"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/flexibleServers/test-svr/privateEndpointConnections/private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e"), + // Properties: &armpostgresqlflexibleservers.PrivateEndpointConnectionProperties{ + // GroupIDs: []*string{ + // to.Ptr("postgresqlServer")}, + // PrivateEndpoint: &armpostgresqlflexibleservers.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), + // }, + // PrivateLinkServiceConnectionState: &armpostgresqlflexibleservers.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr(armpostgresqlflexibleservers.PrivateEndpointServiceConnectionStatusApproved), + // }, + // ProvisioningState: to.Ptr(armpostgresqlflexibleservers.PrivateEndpointConnectionProvisioningStateSucceeded), + // }, + // }, + // { + // Name: to.Ptr("private-endpoint-connection-name-2.1fa229cd-bf3f-47f0-8c49-afb36723997e"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateEndpointConnections"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/flexibleServers/test-svr/privateEndpointConnections/private-endpoint-connection-name-2.1fa229cd-bf3f-47f0-8c49-afb36723997e"), + // Properties: &armpostgresqlflexibleservers.PrivateEndpointConnectionProperties{ + // GroupIDs: []*string{ + // to.Ptr("postgresqlServer")}, + // PrivateEndpoint: &armpostgresqlflexibleservers.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name-2"), + // }, + // PrivateLinkServiceConnectionState: &armpostgresqlflexibleservers.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr(armpostgresqlflexibleservers.PrivateEndpointServiceConnectionStatusApproved), + // }, + // ProvisioningState: to.Ptr(armpostgresqlflexibleservers.PrivateEndpointConnectionProvisioningStateSucceeded), + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client.go new file mode 100644 index 000000000000..ee12b6babf67 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client.go @@ -0,0 +1,179 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 armpostgresqlflexibleservers + +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 PostgreSQL server. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - 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, options *PrivateLinkResourcesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *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 - Gets the private link resources for PostgreSQL server. +// +// Generated from API version 2023-06-01-preview +// - 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 page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PrivateLinkResourcesClientListByServerResponse) (PrivateLinkResourcesClientListByServerResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "PrivateLinkResourcesClient.NewListByServerPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) + }, nil) + if err != nil { + return PrivateLinkResourcesClientListByServerResponse{}, err + } + return client.listByServerHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByServerCreateRequest creates the ListByServer request. +func (client *PrivateLinkResourcesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *PrivateLinkResourcesClientListByServerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByServerHandleResponse handles the ListByServer response. +func (client *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/postgresql/armpostgresqlflexibleservers/privatelinkresources_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client_example_test.go new file mode 100644 index 000000000000..d2997e6cedb6 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client_example_test.go @@ -0,0 +1,90 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armpostgresqlflexibleservers_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateLinkResourcesList.json +func ExamplePrivateLinkResourcesClient_NewListByServerPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", 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.PrivateLinkResourceListResult = armpostgresqlflexibleservers.PrivateLinkResourceListResult{ + // Value: []*armpostgresqlflexibleservers.PrivateLinkResource{ + // { + // Name: to.Ptr("plr"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateLinkResources"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/flexibleServers/test-svr/privateLinkResources/plr"), + // Properties: &armpostgresqlflexibleservers.PrivateLinkResourceProperties{ + // GroupID: to.Ptr("postgresqlServer"), + // RequiredMembers: []*string{ + // to.Ptr("postgresqlServer")}, + // RequiredZoneNames: []*string{ + // to.Ptr("privatelink.meru.com")}, + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateLinkResourcesGet.json +func ExamplePrivateLinkResourcesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", 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.PrivateLinkResource = armpostgresqlflexibleservers.PrivateLinkResource{ + // Name: to.Ptr("plr"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateLinkResources"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/flexibleServers/test-svr/privateLinkResources/plr"), + // Properties: &armpostgresqlflexibleservers.PrivateLinkResourceProperties{ + // GroupID: to.Ptr("postgresqlServer"), + // RequiredMembers: []*string{ + // to.Ptr("postgresqlServer")}, + // RequiredZoneNames: []*string{ + // to.Ptr("privatelink.meru.com")}, + // }, + // } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/quotausages_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/quotausages_client.go new file mode 100644 index 000000000000..8826a48cad26 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/quotausages_client.go @@ -0,0 +1,103 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 armpostgresqlflexibleservers + +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" +) + +// QuotaUsagesClient contains the methods for the QuotaUsages group. +// Don't use this type directly, use NewQuotaUsagesClient() instead. +type QuotaUsagesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewQuotaUsagesClient creates a new instance of QuotaUsagesClient 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 NewQuotaUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QuotaUsagesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &QuotaUsagesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - Get quota usages at specified location in a given subscription. +// +// Generated from API version 2023-06-01-preview +// - locationName - The name of the location. +// - options - QuotaUsagesClientListOptions contains the optional parameters for the QuotaUsagesClient.NewListPager method. +func (client *QuotaUsagesClient) NewListPager(locationName string, options *QuotaUsagesClientListOptions) *runtime.Pager[QuotaUsagesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[QuotaUsagesClientListResponse]{ + More: func(page QuotaUsagesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *QuotaUsagesClientListResponse) (QuotaUsagesClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "QuotaUsagesClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, locationName, options) + }, nil) + if err != nil { + return QuotaUsagesClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *QuotaUsagesClient) listCreateRequest(ctx context.Context, locationName string, options *QuotaUsagesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/resourceType/flexibleServers/usages" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if locationName == "" { + return nil, errors.New("parameter locationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{locationName}", url.PathEscape(locationName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *QuotaUsagesClient) listHandleResponse(resp *http.Response) (QuotaUsagesClientListResponse, error) { + result := QuotaUsagesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.QuotaUsagesListResult); err != nil { + return QuotaUsagesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/quotausages_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/quotausages_client_example_test.go new file mode 100644 index 000000000000..dba3a0e84a2b --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/quotausages_client_example_test.go @@ -0,0 +1,66 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armpostgresqlflexibleservers_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/QuotaUsagesForFlexibleServers.json +func ExampleQuotaUsagesClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewQuotaUsagesClient().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.QuotaUsagesListResult = armpostgresqlflexibleservers.QuotaUsagesListResult{ + // Value: []*armpostgresqlflexibleservers.QuotaUsage{ + // { + // Name: &armpostgresqlflexibleservers.NameProperty{ + // LocalizedValue: to.Ptr("standardBSFamily"), + // Value: to.Ptr("standardBSFamily"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr(""), + // Limit: to.Ptr[int64](10000), + // Unit: to.Ptr("Count"), + // }, + // { + // Name: &armpostgresqlflexibleservers.NameProperty{ + // LocalizedValue: to.Ptr("standardDDSv4Family"), + // Value: to.Ptr("standardDDSv4Family"), + // }, + // CurrentValue: to.Ptr[int64](0), + // ID: to.Ptr(""), + // Limit: to.Ptr[int64](100), + // Unit: to.Ptr("Count"), + // }}, + // } + } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client.go index 559ccf25c9be..e0ef681ec40d 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client.go @@ -28,7 +28,7 @@ type ReplicasClient struct { } // NewReplicasClient creates a new instance of ReplicasClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - 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 NewReplicasClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ReplicasClient, error) { @@ -45,7 +45,7 @@ func NewReplicasClient(subscriptionID string, credential azcore.TokenCredential, // NewListByServerPager - List all the replicas for a given server. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - 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 @@ -94,7 +94,7 @@ func (client *ReplicasClient) listByServerCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client_example_test.go index a065e052b35c..b1381f7a5c35 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ReplicasListByServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ReplicasListByServer.json func ExampleReplicasClient_NewListByServerPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -79,11 +79,19 @@ func ExampleReplicasClient_NewListByServerPager() { // Network: &armpostgresqlflexibleservers.Network{ // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), // }, + // Replica: &armpostgresqlflexibleservers.Replica{ + // Capacity: to.Ptr[int32](0), + // ReplicationState: to.Ptr(armpostgresqlflexibleservers.ReplicationStateActive), + // Role: to.Ptr(armpostgresqlflexibleservers.ReplicationRoleAsyncReplica), + // }, // ReplicaCapacity: to.Ptr[int32](0), // ReplicationRole: to.Ptr(armpostgresqlflexibleservers.ReplicationRoleAsyncReplica), // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), // Storage: &armpostgresqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](2300), // StorageSizeGB: to.Ptr[int32](512), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), // }, // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), // }, diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/response_types.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/response_types.go index b09e2eb5a1b1..621cf7a0c5f6 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/response_types.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/response_types.go @@ -125,6 +125,21 @@ type FirewallRulesClientListByServerResponse struct { FirewallRuleListResult } +// FlexibleServerClientStartLtrBackupResponse contains the response from method FlexibleServerClient.BeginStartLtrBackup. +type FlexibleServerClientStartLtrBackupResponse struct { + // Response for the LTR backup API call + LtrBackupResponse +} + +// FlexibleServerClientTriggerLtrPreBackupResponse contains the response from method FlexibleServerClient.TriggerLtrPreBackup. +type FlexibleServerClientTriggerLtrPreBackupResponse struct { + // Response for the LTR pre-backup API call + LtrPreBackupResponse + + // XMSRequestID contains the information returned from the x-ms-request-id header response. + XMSRequestID *string +} + // GetPrivateDNSZoneSuffixClientExecuteResponse contains the response from method GetPrivateDNSZoneSuffixClient.Execute. type GetPrivateDNSZoneSuffixClientExecuteResponse struct { // Represents a resource name availability. @@ -133,22 +148,140 @@ type GetPrivateDNSZoneSuffixClientExecuteResponse struct { // LocationBasedCapabilitiesClientExecuteResponse contains the response from method LocationBasedCapabilitiesClient.NewExecutePager. type LocationBasedCapabilitiesClientExecuteResponse struct { - // location capability + // Capability for the PostgreSQL server CapabilitiesListResult } +// LogFilesClientListByServerResponse contains the response from method LogFilesClient.NewListByServerPager. +type LogFilesClientListByServerResponse struct { + // A List of logFiles. + LogFileListResult +} + +// LtrBackupOperationsClientGetResponse contains the response from method LtrBackupOperationsClient.Get. +type LtrBackupOperationsClientGetResponse struct { + // Response for the LTR backup Operation API call + LtrServerBackupOperation +} + +// LtrBackupOperationsClientListByServerResponse contains the response from method LtrBackupOperationsClient.NewListByServerPager. +type LtrBackupOperationsClientListByServerResponse struct { + // A list of long term retention backup operations for server. + LtrServerBackupOperationList +} + +// MigrationsClientCreateResponse contains the response from method MigrationsClient.Create. +type MigrationsClientCreateResponse struct { + // Represents a migration resource. + MigrationResource +} + +// MigrationsClientDeleteResponse contains the response from method MigrationsClient.Delete. +type MigrationsClientDeleteResponse struct { + // placeholder for future response values +} + +// MigrationsClientGetResponse contains the response from method MigrationsClient.Get. +type MigrationsClientGetResponse struct { + // Represents a migration resource. + MigrationResource +} + +// MigrationsClientListByTargetServerResponse contains the response from method MigrationsClient.NewListByTargetServerPager. +type MigrationsClientListByTargetServerResponse struct { + // A list of migration resources. + MigrationResourceListResult +} + +// MigrationsClientUpdateResponse contains the response from method MigrationsClient.Update. +type MigrationsClientUpdateResponse struct { + // Represents a migration resource. + MigrationResource +} + // OperationsClientListResponse contains the response from method OperationsClient.List. type OperationsClientListResponse struct { // A list of resource provider operations. OperationListResult } +// PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse contains the response from method PostgreSQLManagementClient.CheckMigrationNameAvailability. +type PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse struct { + // Represents a migration name's availability. + MigrationNameAvailabilityResource +} + +// PrivateEndpointConnectionClientDeleteResponse contains the response from method PrivateEndpointConnectionClient.BeginDelete. +type PrivateEndpointConnectionClientDeleteResponse struct { + // placeholder for future response values +} + +// PrivateEndpointConnectionClientUpdateResponse contains the response from method PrivateEndpointConnectionClient.BeginUpdate. +type PrivateEndpointConnectionClientUpdateResponse struct { + // The private endpoint connection resource. + PrivateEndpointConnection +} + +// PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get. +type PrivateEndpointConnectionsClientGetResponse struct { + // The private endpoint connection resource. + PrivateEndpointConnection +} + +// PrivateEndpointConnectionsClientListByServerResponse contains the response from method PrivateEndpointConnectionsClient.NewListByServerPager. +type PrivateEndpointConnectionsClientListByServerResponse struct { + // A list of private endpoint connections. + PrivateEndpointConnectionListResult +} + +// PrivateLinkResourcesClientGetResponse contains the response from method PrivateLinkResourcesClient.Get. +type PrivateLinkResourcesClientGetResponse struct { + // A private link resource. + PrivateLinkResource +} + +// PrivateLinkResourcesClientListByServerResponse contains the response from method PrivateLinkResourcesClient.NewListByServerPager. +type PrivateLinkResourcesClientListByServerResponse struct { + // A list of private link resources + PrivateLinkResourceListResult +} + +// QuotaUsagesClientListResponse contains the response from method QuotaUsagesClient.NewListPager. +type QuotaUsagesClientListResponse struct { + // Capability for the PostgreSQL server + QuotaUsagesListResult +} + // ReplicasClientListByServerResponse contains the response from method ReplicasClient.NewListByServerPager. type ReplicasClientListByServerResponse struct { // A list of servers. ServerListResult } +// ServerCapabilitiesClientListResponse contains the response from method ServerCapabilitiesClient.NewListPager. +type ServerCapabilitiesClientListResponse struct { + // Capability for the PostgreSQL server + CapabilitiesListResult +} + +// ServerThreatProtectionSettingsClientCreateOrUpdateResponse contains the response from method ServerThreatProtectionSettingsClient.BeginCreateOrUpdate. +type ServerThreatProtectionSettingsClientCreateOrUpdateResponse struct { + // Server's Advanced Threat Protection settings. + ServerThreatProtectionSettingsModel +} + +// ServerThreatProtectionSettingsClientGetResponse contains the response from method ServerThreatProtectionSettingsClient.Get. +type ServerThreatProtectionSettingsClientGetResponse struct { + // Server's Advanced Threat Protection settings. + ServerThreatProtectionSettingsModel +} + +// ServerThreatProtectionSettingsClientListByServerResponse contains the response from method ServerThreatProtectionSettingsClient.NewListByServerPager. +type ServerThreatProtectionSettingsClientListByServerResponse struct { + // A list of the server's Advanced Threat Protection settings. + ServerThreatProtectionListResult +} + // ServersClientCreateResponse contains the response from method ServersClient.BeginCreate. type ServersClientCreateResponse struct { // Represents a server. @@ -199,6 +332,35 @@ type ServersClientUpdateResponse struct { Server } +// VirtualEndpointsClientCreateResponse contains the response from method VirtualEndpointsClient.BeginCreate. +type VirtualEndpointsClientCreateResponse struct { + // Represents a virtual endpoint for a server. + VirtualEndpointResource +} + +// VirtualEndpointsClientDeleteResponse contains the response from method VirtualEndpointsClient.BeginDelete. +type VirtualEndpointsClientDeleteResponse struct { + // placeholder for future response values +} + +// VirtualEndpointsClientGetResponse contains the response from method VirtualEndpointsClient.Get. +type VirtualEndpointsClientGetResponse struct { + // Represents a virtual endpoint for a server. + VirtualEndpointResource +} + +// VirtualEndpointsClientListByServerResponse contains the response from method VirtualEndpointsClient.NewListByServerPager. +type VirtualEndpointsClientListByServerResponse struct { + // A list of virtual endpoints. + VirtualEndpointsListResult +} + +// VirtualEndpointsClientUpdateResponse contains the response from method VirtualEndpointsClient.BeginUpdate. +type VirtualEndpointsClientUpdateResponse struct { + // Represents a virtual endpoint for a server. + VirtualEndpointResource +} + // VirtualNetworkSubnetUsageClientExecuteResponse contains the response from method VirtualNetworkSubnetUsageClient.Execute. type VirtualNetworkSubnetUsageClientExecuteResponse struct { // Virtual network subnet usage data. diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client.go new file mode 100644 index 000000000000..f5702e93aa9b --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client.go @@ -0,0 +1,109 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 armpostgresqlflexibleservers + +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" +) + +// ServerCapabilitiesClient contains the methods for the ServerCapabilities group. +// Don't use this type directly, use NewServerCapabilitiesClient() instead. +type ServerCapabilitiesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewServerCapabilitiesClient creates a new instance of ServerCapabilitiesClient 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 NewServerCapabilitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerCapabilitiesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ServerCapabilitiesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - Get capabilities for a flexible server. +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - options - ServerCapabilitiesClientListOptions contains the optional parameters for the ServerCapabilitiesClient.NewListPager +// method. +func (client *ServerCapabilitiesClient) NewListPager(resourceGroupName string, serverName string, options *ServerCapabilitiesClientListOptions) *runtime.Pager[ServerCapabilitiesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ServerCapabilitiesClientListResponse]{ + More: func(page ServerCapabilitiesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ServerCapabilitiesClientListResponse) (ServerCapabilitiesClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ServerCapabilitiesClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, serverName, options) + }, nil) + if err != nil { + return ServerCapabilitiesClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *ServerCapabilitiesClient) listCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServerCapabilitiesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/capabilities" + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ServerCapabilitiesClient) listHandleResponse(resp *http.Response) (ServerCapabilitiesClientListResponse, error) { + result := ServerCapabilitiesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CapabilitiesListResult); err != nil { + return ServerCapabilitiesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client_example_test.go new file mode 100644 index 000000000000..c568b5608d10 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client_example_test.go @@ -0,0 +1,1706 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armpostgresqlflexibleservers_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCapabilities.json +func ExampleServerCapabilitiesClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewServerCapabilitiesClient().NewListPager("testrg", "pgtestsvc4", 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.CapabilitiesListResult = armpostgresqlflexibleservers.CapabilitiesListResult{ + // Value: []*armpostgresqlflexibleservers.FlexibleServerCapability{ + // { + // Name: to.Ptr("FlexibleServerCapabilities"), + // FastProvisioningSupported: to.Ptr(armpostgresqlflexibleservers.FastProvisioningSupportedEnumEnabled), + // GeoBackupSupported: to.Ptr(armpostgresqlflexibleservers.GeoBackupSupportedEnumEnabled), + // OnlineResizeSupported: to.Ptr(armpostgresqlflexibleservers.OnlineResizeSupportedEnumDisabled), + // Restricted: to.Ptr(armpostgresqlflexibleservers.RestrictedEnumDisabled), + // StorageAutoGrowthSupported: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowthSupportedEnumEnabled), + // SupportedFastProvisioningEditions: []*armpostgresqlflexibleservers.FastProvisioningEditionCapability{ + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("12"), + // SupportedSKU: to.Ptr("standard_b1ms"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("12"), + // SupportedSKU: to.Ptr("standard_b2s"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("12"), + // SupportedSKU: to.Ptr("standard_d2s_v3"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("12"), + // SupportedSKU: to.Ptr("standard_d2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("12"), + // SupportedSKU: to.Ptr("standard_e2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](512), + // SupportedTier: to.Ptr("MemoryOptimized"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("13"), + // SupportedSKU: to.Ptr("standard_b1ms"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("13"), + // SupportedSKU: to.Ptr("standard_b2s"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("13"), + // SupportedSKU: to.Ptr("standard_d2s_v3"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("13"), + // SupportedSKU: to.Ptr("standard_d2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("13"), + // SupportedSKU: to.Ptr("standard_e2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](512), + // SupportedTier: to.Ptr("MemoryOptimized"), + // }, + // { + // ServerCount: to.Ptr[int32](23), + // SupportedServerVersions: to.Ptr("14"), + // SupportedSKU: to.Ptr("standard_b1ms"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("14"), + // SupportedSKU: to.Ptr("standard_b2s"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("14"), + // SupportedSKU: to.Ptr("standard_d2s_v3"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("14"), + // SupportedSKU: to.Ptr("standard_d2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("14"), + // SupportedSKU: to.Ptr("standard_e2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](512), + // SupportedTier: to.Ptr("MemoryOptimized"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("15"), + // SupportedSKU: to.Ptr("standard_b1ms"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("15"), + // SupportedSKU: to.Ptr("standard_b2s"), + // SupportedStorageGb: to.Ptr[int32](32), + // SupportedTier: to.Ptr("Burstable"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("15"), + // SupportedSKU: to.Ptr("standard_d2s_v3"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("15"), + // SupportedSKU: to.Ptr("standard_d2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](128), + // SupportedTier: to.Ptr("GeneralPurpose"), + // }, + // { + // ServerCount: to.Ptr[int32](0), + // SupportedServerVersions: to.Ptr("15"), + // SupportedSKU: to.Ptr("standard_e2ds_v4"), + // SupportedStorageGb: to.Ptr[int32](512), + // SupportedTier: to.Ptr("MemoryOptimized"), + // }}, + // SupportedServerEditions: []*armpostgresqlflexibleservers.FlexibleServerEditionCapability{ + // { + // Name: to.Ptr("Burstable"), + // DefaultSKUName: to.Ptr("Standard_B1ms"), + // SupportedServerSKUs: []*armpostgresqlflexibleservers.ServerSKUCapability{ + // { + // Name: to.Ptr("Standard_B1ms"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](640), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](1), + // }, + // { + // Name: to.Ptr("Standard_B2s"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](1280), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_B2ms"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](1700), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_B4ms"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](2400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_B8ms"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](3100), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_B12ms"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](3800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](12), + // }, + // { + // Name: to.Ptr("Standard_B16ms"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](4300), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_B20ms"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](5000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](2048), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](20), + // }}, + // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ + // { + // Name: to.Ptr("ManagedDisk"), + // DefaultStorageSizeMb: to.Ptr[int64](32768), + // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ + // { + // DefaultIopsTier: to.Ptr("P4"), + // StorageSizeMb: to.Ptr[int64](32768), + // SupportedIops: to.Ptr[int32](120), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P4"), + // Iops: to.Ptr[int32](120), + // }, + // { + // Name: to.Ptr("P6"), + // Iops: to.Ptr[int32](240), + // }, + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P6"), + // StorageSizeMb: to.Ptr[int64](65536), + // SupportedIops: to.Ptr[int32](240), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P6"), + // Iops: to.Ptr[int32](240), + // }, + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P10"), + // StorageSizeMb: to.Ptr[int64](131072), + // SupportedIops: to.Ptr[int32](500), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P15"), + // StorageSizeMb: to.Ptr[int64](262144), + // SupportedIops: to.Ptr[int32](1100), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P20"), + // StorageSizeMb: to.Ptr[int64](524288), + // SupportedIops: to.Ptr[int32](2300), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P30"), + // StorageSizeMb: to.Ptr[int64](1048576), + // SupportedIops: to.Ptr[int32](5000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P40"), + // StorageSizeMb: to.Ptr[int64](2097152), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P50"), + // StorageSizeMb: to.Ptr[int64](4194304), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P60"), + // StorageSizeMb: to.Ptr[int64](8388608), + // SupportedIops: to.Ptr[int32](16000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P60"), + // Iops: to.Ptr[int32](16000), + // }, + // { + // Name: to.Ptr("P70"), + // Iops: to.Ptr[int32](18000), + // }, + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P70"), + // StorageSizeMb: to.Ptr[int64](16777216), + // SupportedIops: to.Ptr[int32](18000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P70"), + // Iops: to.Ptr[int32](18000), + // }, + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P80"), + // StorageSizeMb: to.Ptr[int64](33553408), + // SupportedIops: to.Ptr[int32](20000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }}, + // }}, + // }, + // { + // Name: to.Ptr("ManagedDiskV2"), + // DefaultStorageSizeMb: to.Ptr[int64](65536), + // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ + // { + // DefaultIopsTier: to.Ptr("None"), + // MaximumStorageSizeMb: to.Ptr[int64](67108864), + // StorageSizeMb: to.Ptr[int64](32768), + // SupportedIops: to.Ptr[int32](3000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("None"), + // Iops: to.Ptr[int32](0), + // }}, + // SupportedMaximumIops: to.Ptr[int32](80000), + // SupportedMaximumThroughput: to.Ptr[int32](750), + // SupportedThroughput: to.Ptr[int32](125), + // }}, + // }}, + // }, + // { + // Name: to.Ptr("GeneralPurpose"), + // DefaultSKUName: to.Ptr("Standard_D2ds_v4"), + // SupportedServerSKUs: []*armpostgresqlflexibleservers.ServerSKUCapability{ + // { + // Name: to.Ptr("Standard_D2s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](3200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_D4s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_D8s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_D16s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_D32s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_D48s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_D64s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_D2ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](3200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_D4ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_D8ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_D16ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_D32ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_D48ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_D64ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_D2ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](3200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_D4ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_D8ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_D16ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_D32ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_D48ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_D64ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_D96ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](96), + // }}, + // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ + // { + // Name: to.Ptr("ManagedDisk"), + // DefaultStorageSizeMb: to.Ptr[int64](65536), + // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ + // { + // DefaultIopsTier: to.Ptr("P4"), + // StorageSizeMb: to.Ptr[int64](32768), + // SupportedIops: to.Ptr[int32](120), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P4"), + // Iops: to.Ptr[int32](120), + // }, + // { + // Name: to.Ptr("P6"), + // Iops: to.Ptr[int32](240), + // }, + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P6"), + // StorageSizeMb: to.Ptr[int64](65536), + // SupportedIops: to.Ptr[int32](240), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P6"), + // Iops: to.Ptr[int32](240), + // }, + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P10"), + // StorageSizeMb: to.Ptr[int64](131072), + // SupportedIops: to.Ptr[int32](500), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P15"), + // StorageSizeMb: to.Ptr[int64](262144), + // SupportedIops: to.Ptr[int32](1100), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P20"), + // StorageSizeMb: to.Ptr[int64](524288), + // SupportedIops: to.Ptr[int32](2300), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P30"), + // StorageSizeMb: to.Ptr[int64](1048576), + // SupportedIops: to.Ptr[int32](5000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P40"), + // StorageSizeMb: to.Ptr[int64](2097152), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P50"), + // StorageSizeMb: to.Ptr[int64](4194304), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P60"), + // StorageSizeMb: to.Ptr[int64](8388608), + // SupportedIops: to.Ptr[int32](16000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P60"), + // Iops: to.Ptr[int32](16000), + // }, + // { + // Name: to.Ptr("P70"), + // Iops: to.Ptr[int32](18000), + // }, + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P70"), + // StorageSizeMb: to.Ptr[int64](16777216), + // SupportedIops: to.Ptr[int32](18000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P70"), + // Iops: to.Ptr[int32](18000), + // }, + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P80"), + // StorageSizeMb: to.Ptr[int64](33553408), + // SupportedIops: to.Ptr[int32](20000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }}, + // }}, + // }, + // { + // Name: to.Ptr("ManagedDiskV2"), + // DefaultStorageSizeMb: to.Ptr[int64](65536), + // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ + // { + // DefaultIopsTier: to.Ptr("None"), + // MaximumStorageSizeMb: to.Ptr[int64](67108864), + // StorageSizeMb: to.Ptr[int64](32768), + // SupportedIops: to.Ptr[int32](3000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("None"), + // Iops: to.Ptr[int32](0), + // }}, + // SupportedMaximumIops: to.Ptr[int32](80000), + // SupportedMaximumThroughput: to.Ptr[int32](750), + // SupportedThroughput: to.Ptr[int32](125), + // }}, + // }}, + // }, + // { + // Name: to.Ptr("MemoryOptimized"), + // DefaultSKUName: to.Ptr("Standard_E2ds_v4"), + // SupportedServerSKUs: []*armpostgresqlflexibleservers.ServerSKUCapability{ + // { + // Name: to.Ptr("Standard_E2s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](3200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_E4s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_E8s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_E16s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_E32s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_E48s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_E64s_v3"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](6912), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_E2ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](3200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_E4ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_E8ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_E16ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_E20ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](20), + // }, + // { + // Name: to.Ptr("Standard_E32ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_E48ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_E64ds_v4"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](6912), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_E2ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](3200), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](2), + // }, + // { + // Name: to.Ptr("Standard_E4ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](6400), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](4), + // }, + // { + // Name: to.Ptr("Standard_E8ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](12800), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](8), + // }, + // { + // Name: to.Ptr("Standard_E16ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](16), + // }, + // { + // Name: to.Ptr("Standard_E32ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](32), + // }, + // { + // Name: to.Ptr("Standard_E48ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](48), + // }, + // { + // Name: to.Ptr("Standard_E64ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](8192), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](64), + // }, + // { + // Name: to.Ptr("Standard_E96ads_v5"), + // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ + // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), + // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, + // SupportedIops: to.Ptr[int32](20000), + // SupportedMemoryPerVcoreMb: to.Ptr[int64](7168), + // SupportedZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // VCores: to.Ptr[int32](96), + // }}, + // SupportedStorageEditions: []*armpostgresqlflexibleservers.StorageEditionCapability{ + // { + // Name: to.Ptr("ManagedDisk"), + // DefaultStorageSizeMb: to.Ptr[int64](131072), + // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ + // { + // DefaultIopsTier: to.Ptr("P4"), + // StorageSizeMb: to.Ptr[int64](32768), + // SupportedIops: to.Ptr[int32](120), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P4"), + // Iops: to.Ptr[int32](120), + // }, + // { + // Name: to.Ptr("P6"), + // Iops: to.Ptr[int32](240), + // }, + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P6"), + // StorageSizeMb: to.Ptr[int64](65536), + // SupportedIops: to.Ptr[int32](240), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P6"), + // Iops: to.Ptr[int32](240), + // }, + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P10"), + // StorageSizeMb: to.Ptr[int64](131072), + // SupportedIops: to.Ptr[int32](500), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P10"), + // Iops: to.Ptr[int32](500), + // }, + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P15"), + // StorageSizeMb: to.Ptr[int64](262144), + // SupportedIops: to.Ptr[int32](1100), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P15"), + // Iops: to.Ptr[int32](1100), + // }, + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P20"), + // StorageSizeMb: to.Ptr[int64](524288), + // SupportedIops: to.Ptr[int32](2300), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P20"), + // Iops: to.Ptr[int32](2300), + // }, + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P30"), + // StorageSizeMb: to.Ptr[int64](1048576), + // SupportedIops: to.Ptr[int32](5000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P30"), + // Iops: to.Ptr[int32](5000), + // }, + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P40"), + // StorageSizeMb: to.Ptr[int64](2097152), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P40"), + // Iops: to.Ptr[int32](7500), + // }, + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P50"), + // StorageSizeMb: to.Ptr[int64](4194304), + // SupportedIops: to.Ptr[int32](7500), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P50"), + // Iops: to.Ptr[int32](7500), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P60"), + // StorageSizeMb: to.Ptr[int64](8388608), + // SupportedIops: to.Ptr[int32](16000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P60"), + // Iops: to.Ptr[int32](16000), + // }, + // { + // Name: to.Ptr("P70"), + // Iops: to.Ptr[int32](18000), + // }, + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P70"), + // StorageSizeMb: to.Ptr[int64](16777216), + // SupportedIops: to.Ptr[int32](18000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P70"), + // Iops: to.Ptr[int32](18000), + // }, + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }}, + // }, + // { + // DefaultIopsTier: to.Ptr("P80"), + // StorageSizeMb: to.Ptr[int64](33553408), + // SupportedIops: to.Ptr[int32](20000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("P80"), + // Iops: to.Ptr[int32](20000), + // }}, + // }}, + // }, + // { + // Name: to.Ptr("ManagedDiskV2"), + // DefaultStorageSizeMb: to.Ptr[int64](65536), + // SupportedStorageMb: []*armpostgresqlflexibleservers.StorageMbCapability{ + // { + // DefaultIopsTier: to.Ptr("None"), + // MaximumStorageSizeMb: to.Ptr[int64](67108864), + // StorageSizeMb: to.Ptr[int64](32768), + // SupportedIops: to.Ptr[int32](3000), + // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ + // { + // Name: to.Ptr("None"), + // Iops: to.Ptr[int32](0), + // }}, + // SupportedMaximumIops: to.Ptr[int32](80000), + // SupportedMaximumThroughput: to.Ptr[int32](750), + // SupportedThroughput: to.Ptr[int32](125), + // }}, + // }}, + // }}, + // SupportedServerVersions: []*armpostgresqlflexibleservers.ServerVersionCapability{ + // { + // Name: to.Ptr("11"), + // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("12"), + // to.Ptr("13"), + // to.Ptr("14"), + // to.Ptr("15")}, + // }, + // { + // Name: to.Ptr("12"), + // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("13"), + // to.Ptr("14"), + // to.Ptr("15")}, + // }, + // { + // Name: to.Ptr("13"), + // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("14"), + // to.Ptr("15")}, + // }, + // { + // Name: to.Ptr("14"), + // SupportedVersionsToUpgrade: []*string{ + // to.Ptr("15")}, + // }}, + // ZoneRedundantHaAndGeoBackupSupported: to.Ptr(armpostgresqlflexibleservers.ZoneRedundantHaAndGeoBackupSupportedEnumEnabled), + // ZoneRedundantHaSupported: to.Ptr(armpostgresqlflexibleservers.ZoneRedundantHaSupportedEnumEnabled), + // }}, + // } + } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servers_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servers_client.go index b941d9f5ee7a..a7f15eda4b61 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servers_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servers_client.go @@ -28,7 +28,7 @@ type ServersClient struct { } // NewServersClient creates a new instance of ServersClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - 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 NewServersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServersClient, error) { @@ -46,7 +46,7 @@ func NewServersClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreate - Creates a new server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - 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. @@ -72,7 +72,7 @@ func (client *ServersClient) BeginCreate(ctx context.Context, resourceGroupName // Create - Creates a new server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview 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" @@ -114,7 +114,7 @@ func (client *ServersClient) createCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -126,7 +126,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 2022-12-01 +// Generated from API version 2023-06-01-preview // - 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. @@ -151,7 +151,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 2022-12-01 +// Generated from API version 2023-06-01-preview func (client *ServersClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginDelete" @@ -193,7 +193,7 @@ func (client *ServersClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -202,7 +202,7 @@ func (client *ServersClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Gets information about a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - 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. @@ -248,7 +248,7 @@ func (client *ServersClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -265,7 +265,7 @@ func (client *ServersClient) getHandleResponse(resp *http.Response) (ServersClie // NewListPager - List all the servers in a given subscription. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - options - ServersClientListOptions contains the optional parameters for the ServersClient.NewListPager method. func (client *ServersClient) NewListPager(options *ServersClientListOptions) *runtime.Pager[ServersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ServersClientListResponse]{ @@ -302,7 +302,7 @@ func (client *ServersClient) listCreateRequest(ctx context.Context, options *Ser return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -319,7 +319,7 @@ func (client *ServersClient) listHandleResponse(resp *http.Response) (ServersCli // NewListByResourceGroupPager - List all the servers in a given resource group. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ServersClientListByResourceGroupOptions contains the optional parameters for the ServersClient.NewListByResourceGroupPager // method. @@ -362,7 +362,7 @@ func (client *ServersClient) listByResourceGroupCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -380,7 +380,7 @@ func (client *ServersClient) listByResourceGroupHandleResponse(resp *http.Respon // BeginRestart - Restarts a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - options - ServersClientBeginRestartOptions contains the optional parameters for the ServersClient.BeginRestart method. @@ -405,7 +405,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 2022-12-01 +// Generated from API version 2023-06-01-preview func (client *ServersClient) restart(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginRestartOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginRestart" @@ -447,7 +447,7 @@ func (client *ServersClient) restartCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -462,7 +462,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 2022-12-01 +// Generated from API version 2023-06-01-preview // - 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. @@ -487,7 +487,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 2022-12-01 +// Generated from API version 2023-06-01-preview func (client *ServersClient) start(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginStart" @@ -529,7 +529,7 @@ func (client *ServersClient) startCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -538,7 +538,7 @@ func (client *ServersClient) startCreateRequest(ctx context.Context, resourceGro // BeginStop - Stops a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview // - 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. @@ -563,7 +563,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 2022-12-01 +// Generated from API version 2023-06-01-preview func (client *ServersClient) stop(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginStop" @@ -605,7 +605,7 @@ func (client *ServersClient) stopCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -615,7 +615,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 2022-12-01 +// Generated from API version 2023-06-01-preview // - 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. @@ -642,7 +642,7 @@ func (client *ServersClient) BeginUpdate(ctx context.Context, resourceGroupName // definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-06-01-preview 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" @@ -684,7 +684,7 @@ func (client *ServersClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servers_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servers_client_example_test.go index f3f07486dd76..98069912a0f3 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servers_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servers_client_example_test.go @@ -17,10 +17,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerCreateGeoRestore.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateGeoRestoreWithDataEncryptionEnabled.json func ExampleServersClient_BeginCreate_createADatabaseAsAGeoRestoreInGeoPairedLocation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -33,8 +33,22 @@ func ExampleServersClient_BeginCreate_createADatabaseAsAGeoRestoreInGeoPairedLoc } poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "pgtestsvc5geo", armpostgresqlflexibleservers.Server{ Location: to.Ptr("eastus"), + Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ + Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity": {}, + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": {}, + }, + }, Properties: &armpostgresqlflexibleservers.ServerProperties{ - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeGeoRestore), + CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeGeoRestore), + DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ + Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), + GeoBackupKeyURI: to.Ptr("https://test-geo-kv.vault.azure.net/keys/test-key1/66f57315bab34b0189daa113fbc78787"), + GeoBackupUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity"), + PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787"), + PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), + }, PointInTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T00:04:59.407Z"); return t }()), SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername"), }, @@ -57,6 +71,19 @@ func ExampleServersClient_BeginCreate_createADatabaseAsAGeoRestoreInGeoPairedLoc // Tags: map[string]*string{ // "ElasticServer": to.Ptr("1"), // }, + // Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ + // Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ + // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity": &armpostgresqlflexibleservers.UserIdentity{ + // ClientID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"), + // PrincipalID: to.Ptr("0a4e0c6e-7751-4078-ae1f-a477306c11e9"), + // }, + // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": &armpostgresqlflexibleservers.UserIdentity{ + // ClientID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"), + // PrincipalID: to.Ptr("0a4e0c6e-7751-4078-ae1f-a477306c11e9"), + // }, + // }, + // }, // Properties: &armpostgresqlflexibleservers.ServerProperties{ // AdministratorLogin: to.Ptr("cloudsa"), // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ @@ -70,7 +97,13 @@ func ExampleServersClient_BeginCreate_createADatabaseAsAGeoRestoreInGeoPairedLoc // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumEnabled), // }, // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), + // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), + // GeoBackupEncryptionKeyStatus: to.Ptr(armpostgresqlflexibleservers.KeyStatusEnumValid), + // GeoBackupKeyURI: to.Ptr("https://test-geo-kv.vault.azure.net/keys/test-key1/66f57315bab34b0189daa113fbc78787"), + // GeoBackupUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity"), + // PrimaryEncryptionKeyStatus: to.Ptr(armpostgresqlflexibleservers.KeyStatusEnumValid), + // PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787"), + // PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), // }, // FullyQualifiedDomainName: to.Ptr("pgtestsvc5geo.postgres.database.azure.com"), // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ @@ -89,7 +122,10 @@ func ExampleServersClient_BeginCreate_createADatabaseAsAGeoRestoreInGeoPairedLoc // }, // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), // Storage: &armpostgresqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](2300), // StorageSizeGB: to.Ptr[int32](512), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), // }, // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), // }, @@ -100,7 +136,7 @@ func ExampleServersClient_BeginCreate_createADatabaseAsAGeoRestoreInGeoPairedLoc // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerCreatePointInTimeRestore.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreatePointInTimeRestore.json func ExampleServersClient_BeginCreate_createADatabaseAsAPointInTimeRestore() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -169,7 +205,10 @@ func ExampleServersClient_BeginCreate_createADatabaseAsAPointInTimeRestore() { // }, // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), // Storage: &armpostgresqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](2300), // StorageSizeGB: to.Ptr[int32](512), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), // }, // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), // }, @@ -180,7 +219,7 @@ func ExampleServersClient_BeginCreate_createADatabaseAsAPointInTimeRestore() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreate.json func ExampleServersClient_BeginCreate_createANewServer() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -213,7 +252,9 @@ func ExampleServersClient_BeginCreate_createANewServer() { PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), }, Storage: &armpostgresqlflexibleservers.Storage{ + AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), StorageSizeGB: to.Ptr[int32](512), + Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), }, Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), }, @@ -275,7 +316,10 @@ func ExampleServersClient_BeginCreate_createANewServer() { // }, // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), // Storage: &armpostgresqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](2300), // StorageSizeGB: to.Ptr[int32](512), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), // }, // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), // }, @@ -286,7 +330,7 @@ func ExampleServersClient_BeginCreate_createANewServer() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerCreateWithAadAuthEnabled.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateWithAadAuthEnabled.json func ExampleServersClient_BeginCreate_createANewServerWithActiveDirectoryAuthenticationEnabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -327,7 +371,9 @@ func ExampleServersClient_BeginCreate_createANewServerWithActiveDirectoryAuthent PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), }, Storage: &armpostgresqlflexibleservers.Storage{ + AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), StorageSizeGB: to.Ptr[int32](512), + Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), }, Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), }, @@ -387,7 +433,10 @@ func ExampleServersClient_BeginCreate_createANewServerWithActiveDirectoryAuthent // }, // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), // Storage: &armpostgresqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](2300), // StorageSizeGB: to.Ptr[int32](512), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), // }, // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), // }, @@ -398,7 +447,7 @@ func ExampleServersClient_BeginCreate_createANewServerWithActiveDirectoryAuthent // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerCreateReplica.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateReplica.json func ExampleServersClient_BeginCreate_serverCreateReplica() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -411,8 +460,21 @@ func ExampleServersClient_BeginCreate_serverCreateReplica() { } poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "pgtestsvc5rep", armpostgresqlflexibleservers.Server{ Location: to.Ptr("westus"), + Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ + Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": {}, + }, + }, Properties: &armpostgresqlflexibleservers.ServerProperties{ - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeReplica), + CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeReplica), + DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ + Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), + GeoBackupKeyURI: to.Ptr(""), + GeoBackupUserAssignedIdentityID: to.Ptr(""), + PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787"), + PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), + }, PointInTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T00:04:59.407Z"); return t }()), SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername"), }, @@ -435,6 +497,15 @@ func ExampleServersClient_BeginCreate_serverCreateReplica() { // Tags: map[string]*string{ // "ElasticServer": to.Ptr("1"), // }, + // Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ + // Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ + // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": &armpostgresqlflexibleservers.UserIdentity{ + // ClientID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"), + // PrincipalID: to.Ptr("0a4e0c6e-7751-4078-ae1f-a477306c11e9"), + // }, + // }, + // }, // Properties: &armpostgresqlflexibleservers.ServerProperties{ // AdministratorLogin: to.Ptr("cloudsa"), // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ @@ -448,7 +519,10 @@ func ExampleServersClient_BeginCreate_serverCreateReplica() { // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), // }, // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), + // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), + // PrimaryEncryptionKeyStatus: to.Ptr(armpostgresqlflexibleservers.KeyStatusEnumValid), + // PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787"), + // PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), // }, // FullyQualifiedDomainName: to.Ptr("pgtestsvc5rep.postgres.database.azure.com"), // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ @@ -465,11 +539,102 @@ func ExampleServersClient_BeginCreate_serverCreateReplica() { // Network: &armpostgresqlflexibleservers.Network{ // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), // }, + // Replica: &armpostgresqlflexibleservers.Replica{ + // Capacity: to.Ptr[int32](0), + // ReplicationState: to.Ptr(armpostgresqlflexibleservers.ReplicationStateActive), + // Role: to.Ptr(armpostgresqlflexibleservers.ReplicationRoleAsyncReplica), + // }, // ReplicaCapacity: to.Ptr[int32](0), // ReplicationRole: to.Ptr(armpostgresqlflexibleservers.ReplicationRoleAsyncReplica), + // SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername"), + // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), + // Storage: &armpostgresqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](2300), + // StorageSizeGB: to.Ptr[int32](512), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), + // }, + // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), + // }, + // SKU: &armpostgresqlflexibleservers.SKU{ + // Name: to.Ptr("Standard_D4s_v3"), + // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateReviveDropped.json +func ExampleServersClient_BeginCreate_serverCreateReviveDropped() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "pgtestsvc5-rev", armpostgresqlflexibleservers.Server{ + Location: to.Ptr("westus"), + Properties: &armpostgresqlflexibleservers.ServerProperties{ + CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeReviveDropped), + PointInTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-27T00:04:59.407Z"); return t }()), + SourceServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5"), + }, + }, 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 = armpostgresqlflexibleservers.Server{ + // Name: to.Ptr("pgtestsvc5-rev"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5-rev"), + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "ElasticServer": to.Ptr("1"), + // }, + // Properties: &armpostgresqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ + // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), + // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), + // }, + // AvailabilityZone: to.Ptr("2"), + // Backup: &armpostgresqlflexibleservers.Backup{ + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-27T00:28:17.727Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), + // }, + // FullyQualifiedDomainName: to.Ptr("pgtestsvc5-rev.postgres.database.azure.com"), + // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeDisabled), + // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateNotEnabled), + // }, + // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // MinorVersion: to.Ptr("6"), + // Network: &armpostgresqlflexibleservers.Network{ + // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), + // }, + // ReplicaCapacity: to.Ptr[int32](0), + // ReplicationRole: to.Ptr(armpostgresqlflexibleservers.ReplicationRolePrimary), // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), // Storage: &armpostgresqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](2300), // StorageSizeGB: to.Ptr[int32](512), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), // }, // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), // }, @@ -480,7 +645,7 @@ func ExampleServersClient_BeginCreate_serverCreateReplica() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerCreateWithDataEncryptionEnabled.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateWithDataEncryptionEnabled.json func ExampleServersClient_BeginCreate_serverCreateWithDataEncryptionEnabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -512,9 +677,11 @@ func ExampleServersClient_BeginCreate_serverCreateWithDataEncryptionEnabled() { }, CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeCreate), DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), - PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787"), - PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), + Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), + GeoBackupKeyURI: to.Ptr(""), + GeoBackupUserAssignedIdentityID: to.Ptr(""), + PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787"), + PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), }, HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), @@ -524,6 +691,7 @@ func ExampleServersClient_BeginCreate_serverCreateWithDataEncryptionEnabled() { PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), }, Storage: &armpostgresqlflexibleservers.Storage{ + AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), StorageSizeGB: to.Ptr[int32](512), }, Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), @@ -574,6 +742,7 @@ func ExampleServersClient_BeginCreate_serverCreateWithDataEncryptionEnabled() { // }, // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), + // PrimaryEncryptionKeyStatus: to.Ptr(armpostgresqlflexibleservers.KeyStatusEnumValid), // PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787"), // PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), // }, @@ -597,7 +766,10 @@ func ExampleServersClient_BeginCreate_serverCreateWithDataEncryptionEnabled() { // }, // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), // Storage: &armpostgresqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](2300), // StorageSizeGB: to.Ptr[int32](512), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), // }, // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), // }, @@ -608,7 +780,187 @@ func ExampleServersClient_BeginCreate_serverCreateWithDataEncryptionEnabled() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsForcedStandaloneServer.json +func ExampleServersClient_BeginUpdate_promoteAReplicaServerAsAStandaloneServerAsForcedIEItWillPromoteAReplicaServerImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testResourceGroup", "pgtestsvc4-replica", armpostgresqlflexibleservers.ServerForUpdate{ + Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ + Replica: &armpostgresqlflexibleservers.Replica{ + PromoteMode: to.Ptr(armpostgresqlflexibleservers.ReadReplicaPromoteModeStandalone), + PromoteOption: to.Ptr(armpostgresqlflexibleservers.ReplicationPromoteOptionForced), + }, + }, + }, 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 = armpostgresqlflexibleservers.Server{ + // Name: to.Ptr("pgtestsvc4-replica"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4-replica"), + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "ElasticServer": to.Ptr("1"), + // }, + // Properties: &armpostgresqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ + // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), + // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), + // }, + // AvailabilityZone: to.Ptr("1"), + // Backup: &armpostgresqlflexibleservers.Backup{ + // BackupRetentionDays: to.Ptr[int32](20), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:16:58.372Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), + // }, + // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ + // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), + // }, + // FullyQualifiedDomainName: to.Ptr("pgtestsvc4-replica.postgres.database.azure.com"), + // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), + // StandbyAvailabilityZone: to.Ptr("2"), + // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), + // }, + // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // MinorVersion: to.Ptr("6"), + // Network: &armpostgresqlflexibleservers.Network{ + // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), + // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), + // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), + // }, + // Replica: &armpostgresqlflexibleservers.Replica{ + // Capacity: to.Ptr[int32](0), + // Role: to.Ptr(armpostgresqlflexibleservers.ReplicationRoleNone), + // }, + // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), + // Storage: &armpostgresqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled), + // Iops: to.Ptr[int32](5000), + // StorageSizeGB: to.Ptr[int32](1024), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), + // }, + // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), + // }, + // SKU: &armpostgresqlflexibleservers.SKU{ + // Name: to.Ptr("Standard_D8s_v3"), + // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsPlannedStandaloneServer.json +func ExampleServersClient_BeginUpdate_promoteAReplicaServerAsAStandaloneServerAsPlannedIEItWillWaitForReplicationToComplete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testResourceGroup", "pgtestsvc4-replica", armpostgresqlflexibleservers.ServerForUpdate{ + Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ + Replica: &armpostgresqlflexibleservers.Replica{ + PromoteMode: to.Ptr(armpostgresqlflexibleservers.ReadReplicaPromoteModeStandalone), + PromoteOption: to.Ptr(armpostgresqlflexibleservers.ReplicationPromoteOptionPlanned), + }, + }, + }, 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 = armpostgresqlflexibleservers.Server{ + // Name: to.Ptr("pgtestsvc4-replica"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4-replica"), + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "ElasticServer": to.Ptr("1"), + // }, + // Properties: &armpostgresqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ + // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), + // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), + // }, + // AvailabilityZone: to.Ptr("1"), + // Backup: &armpostgresqlflexibleservers.Backup{ + // BackupRetentionDays: to.Ptr[int32](20), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:16:58.372Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), + // }, + // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ + // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), + // }, + // FullyQualifiedDomainName: to.Ptr("pgtestsvc4-replica.postgres.database.azure.com"), + // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), + // StandbyAvailabilityZone: to.Ptr("2"), + // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), + // }, + // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // MinorVersion: to.Ptr("6"), + // Network: &armpostgresqlflexibleservers.Network{ + // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), + // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), + // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), + // }, + // Replica: &armpostgresqlflexibleservers.Replica{ + // Capacity: to.Ptr[int32](0), + // Role: to.Ptr(armpostgresqlflexibleservers.ReplicationRoleNone), + // }, + // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), + // Storage: &armpostgresqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled), + // Iops: to.Ptr[int32](5000), + // StorageSizeGB: to.Ptr[int32](1024), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), + // }, + // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), + // }, + // SKU: &armpostgresqlflexibleservers.SKU{ + // Name: to.Ptr("Standard_D8s_v3"), + // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdate.json func ExampleServersClient_BeginUpdate_serverUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -627,7 +979,9 @@ func ExampleServersClient_BeginUpdate_serverUpdate() { }, CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForUpdateUpdate), Storage: &armpostgresqlflexibleservers.Storage{ + AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled), StorageSizeGB: to.Ptr[int32](1024), + Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), }, }, SKU: &armpostgresqlflexibleservers.SKU{ @@ -688,7 +1042,10 @@ func ExampleServersClient_BeginUpdate_serverUpdate() { // }, // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), // Storage: &armpostgresqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled), + // Iops: to.Ptr[int32](5000), // StorageSizeGB: to.Ptr[int32](1024), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), // }, // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), // }, @@ -699,7 +1056,7 @@ func ExampleServersClient_BeginUpdate_serverUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerUpdateWithAadAuthEnabled.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdateWithAadAuthEnabled.json func ExampleServersClient_BeginUpdate_serverUpdateWithAadAuthEnabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -723,7 +1080,9 @@ func ExampleServersClient_BeginUpdate_serverUpdateWithAadAuthEnabled() { }, CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForUpdateUpdate), Storage: &armpostgresqlflexibleservers.Storage{ + AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), StorageSizeGB: to.Ptr[int32](1024), + Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), }, }, SKU: &armpostgresqlflexibleservers.SKU{ @@ -785,7 +1144,10 @@ func ExampleServersClient_BeginUpdate_serverUpdateWithAadAuthEnabled() { // }, // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), // Storage: &armpostgresqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](5000), // StorageSizeGB: to.Ptr[int32](1024), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), // }, // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), // }, @@ -796,7 +1158,7 @@ func ExampleServersClient_BeginUpdate_serverUpdateWithAadAuthEnabled() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerUpdateWithCustomerMaintenanceWindow.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json func ExampleServersClient_BeginUpdate_serverUpdateWithCustomerMaintenanceWindow() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -871,7 +1233,10 @@ func ExampleServersClient_BeginUpdate_serverUpdateWithCustomerMaintenanceWindow( // }, // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), // Storage: &armpostgresqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](2300), // StorageSizeGB: to.Ptr[int32](512), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), // }, // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), // }, @@ -882,7 +1247,7 @@ func ExampleServersClient_BeginUpdate_serverUpdateWithCustomerMaintenanceWindow( // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerUpdateWithDataEncryptionEnabled.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdateWithDataEncryptionEnabled.json func ExampleServersClient_BeginUpdate_serverUpdateWithDataEncryptionEnabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -897,7 +1262,8 @@ func ExampleServersClient_BeginUpdate_serverUpdateWithDataEncryptionEnabled() { Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": {}, + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity": {}, + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": {}, }, }, Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ @@ -907,12 +1273,11 @@ func ExampleServersClient_BeginUpdate_serverUpdateWithDataEncryptionEnabled() { }, CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForUpdateUpdate), DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), - PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787"), - PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), - }, - Storage: &armpostgresqlflexibleservers.Storage{ - StorageSizeGB: to.Ptr[int32](1024), + Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), + GeoBackupKeyURI: to.Ptr("https://test-geo-kv.vault.azure.net/keys/test-key1/66f57315bab34b0189daa113fbc78787"), + GeoBackupUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity"), + PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787"), + PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), }, }, SKU: &armpostgresqlflexibleservers.SKU{ @@ -941,6 +1306,10 @@ func ExampleServersClient_BeginUpdate_serverUpdateWithDataEncryptionEnabled() { // Identity: &armpostgresqlflexibleservers.UserAssignedIdentity{ // Type: to.Ptr(armpostgresqlflexibleservers.IdentityTypeUserAssigned), // UserAssignedIdentities: map[string]*armpostgresqlflexibleservers.UserIdentity{ + // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity": &armpostgresqlflexibleservers.UserIdentity{ + // ClientID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"), + // PrincipalID: to.Ptr("0a4e0c6e-7751-4078-ae1f-a477306c11e9"), + // }, // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": &armpostgresqlflexibleservers.UserIdentity{ // ClientID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"), // PrincipalID: to.Ptr("0a4e0c6e-7751-4078-ae1f-a477306c11e9"), @@ -961,10 +1330,14 @@ func ExampleServersClient_BeginUpdate_serverUpdateWithDataEncryptionEnabled() { // Backup: &armpostgresqlflexibleservers.Backup{ // BackupRetentionDays: to.Ptr[int32](20), // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), + // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumEnabled), // }, // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeAzureKeyVault), + // GeoBackupEncryptionKeyStatus: to.Ptr(armpostgresqlflexibleservers.KeyStatusEnumValid), + // GeoBackupKeyURI: to.Ptr("https://test-geo-kv.vault.azure.net/keys/test-key1/66f57315bab34b0189daa113fbc78787"), + // GeoBackupUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity"), + // PrimaryEncryptionKeyStatus: to.Ptr(armpostgresqlflexibleservers.KeyStatusEnumValid), // PrimaryKeyURI: to.Ptr("https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787"), // PrimaryUserAssignedIdentityID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"), // }, @@ -988,7 +1361,10 @@ func ExampleServersClient_BeginUpdate_serverUpdateWithDataEncryptionEnabled() { // }, // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), // Storage: &armpostgresqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](5000), // StorageSizeGB: to.Ptr[int32](1024), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), // }, // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), // }, @@ -999,7 +1375,7 @@ func ExampleServersClient_BeginUpdate_serverUpdateWithDataEncryptionEnabled() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerUpdateWithMajorVersionUpgrade.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdateWithMajorVersionUpgrade.json func ExampleServersClient_BeginUpdate_serverUpdateWithMajorVersionUpgrade() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1069,7 +1445,10 @@ func ExampleServersClient_BeginUpdate_serverUpdateWithMajorVersionUpgrade() { // }, // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), // Storage: &armpostgresqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled), + // Iops: to.Ptr[int32](2300), // StorageSizeGB: to.Ptr[int32](512), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), // }, // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionFourteen), // }, @@ -1080,7 +1459,187 @@ func ExampleServersClient_BeginUpdate_serverUpdateWithMajorVersionUpgrade() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsForcedSwitchover.json +func ExampleServersClient_BeginUpdate_switchOverAReplicaServerAsForcedIEItWillReplicaAsPrimaryAndOriginalPrimaryAsReplicaImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testResourceGroup", "pgtestsvc4-replica", armpostgresqlflexibleservers.ServerForUpdate{ + Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ + Replica: &armpostgresqlflexibleservers.Replica{ + PromoteMode: to.Ptr(armpostgresqlflexibleservers.ReadReplicaPromoteModeSwitchover), + PromoteOption: to.Ptr(armpostgresqlflexibleservers.ReplicationPromoteOptionForced), + }, + }, + }, 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 = armpostgresqlflexibleservers.Server{ + // Name: to.Ptr("pgtestsvc4-replica"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4-replica"), + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "ElasticServer": to.Ptr("1"), + // }, + // Properties: &armpostgresqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ + // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), + // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), + // }, + // AvailabilityZone: to.Ptr("1"), + // Backup: &armpostgresqlflexibleservers.Backup{ + // BackupRetentionDays: to.Ptr[int32](20), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:16:58.372Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), + // }, + // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ + // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), + // }, + // FullyQualifiedDomainName: to.Ptr("pgtestsvc4-replica.postgres.database.azure.com"), + // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), + // StandbyAvailabilityZone: to.Ptr("2"), + // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), + // }, + // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // MinorVersion: to.Ptr("6"), + // Network: &armpostgresqlflexibleservers.Network{ + // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), + // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), + // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), + // }, + // Replica: &armpostgresqlflexibleservers.Replica{ + // Capacity: to.Ptr[int32](5), + // Role: to.Ptr(armpostgresqlflexibleservers.ReplicationRolePrimary), + // }, + // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), + // Storage: &armpostgresqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled), + // Iops: to.Ptr[int32](5000), + // StorageSizeGB: to.Ptr[int32](1024), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), + // }, + // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), + // }, + // SKU: &armpostgresqlflexibleservers.SKU{ + // Name: to.Ptr("Standard_D8s_v3"), + // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsPlannedSwitchover.json +func ExampleServersClient_BeginUpdate_switchOverAReplicaServerAsPlannedIEItWillWaitForReplicationToCompleteBeforePromotingReplicaAsPrimaryAndOriginalPrimaryAsReplica() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testResourceGroup", "pgtestsvc4-replica", armpostgresqlflexibleservers.ServerForUpdate{ + Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ + Replica: &armpostgresqlflexibleservers.Replica{ + PromoteMode: to.Ptr(armpostgresqlflexibleservers.ReadReplicaPromoteModeSwitchover), + PromoteOption: to.Ptr(armpostgresqlflexibleservers.ReplicationPromoteOptionPlanned), + }, + }, + }, 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 = armpostgresqlflexibleservers.Server{ + // Name: to.Ptr("pgtestsvc4-replica"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4-replica"), + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "ElasticServer": to.Ptr("1"), + // }, + // Properties: &armpostgresqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ + // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), + // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), + // }, + // AvailabilityZone: to.Ptr("1"), + // Backup: &armpostgresqlflexibleservers.Backup{ + // BackupRetentionDays: to.Ptr[int32](20), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T01:16:58.372Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), + // }, + // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ + // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), + // }, + // FullyQualifiedDomainName: to.Ptr("pgtestsvc4-replica.postgres.database.azure.com"), + // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), + // StandbyAvailabilityZone: to.Ptr("2"), + // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), + // }, + // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // MinorVersion: to.Ptr("6"), + // Network: &armpostgresqlflexibleservers.Network{ + // DelegatedSubnetResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"), + // PrivateDNSZoneArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"), + // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateDisabled), + // }, + // Replica: &armpostgresqlflexibleservers.Replica{ + // Capacity: to.Ptr[int32](5), + // Role: to.Ptr(armpostgresqlflexibleservers.ReplicationRolePrimary), + // }, + // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), + // Storage: &armpostgresqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled), + // Iops: to.Ptr[int32](5000), + // StorageSizeGB: to.Ptr[int32](1024), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP30), + // }, + // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), + // }, + // SKU: &armpostgresqlflexibleservers.SKU{ + // Name: to.Ptr("Standard_D8s_v3"), + // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerDelete.json func ExampleServersClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1101,7 +1660,7 @@ func ExampleServersClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerGet.json func ExampleServersClient_Get_serverGet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1156,7 +1715,10 @@ func ExampleServersClient_Get_serverGet() { // }, // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), // Storage: &armpostgresqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](2300), // StorageSizeGB: to.Ptr[int32](512), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), // }, // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), // }, @@ -1167,7 +1729,95 @@ func ExampleServersClient_Get_serverGet() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerGetWithVnet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerGetWithPrivateEndpoints.json +func ExampleServersClient_Get_serverGetWithPrivateEndpoints() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewServersClient().Get(ctx, "testrg", "pgtestsvc2", 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.Server = armpostgresqlflexibleservers.Server{ + // Name: to.Ptr("pgtestsvc1"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc2"), + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "ElasticServer": to.Ptr("1"), + // }, + // Properties: &armpostgresqlflexibleservers.ServerProperties{ + // AdministratorLogin: to.Ptr("cloudsa"), + // AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ + // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumDisabled), + // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), + // }, + // AvailabilityZone: to.Ptr("1"), + // Backup: &armpostgresqlflexibleservers.Backup{ + // BackupRetentionDays: to.Ptr[int32](7), + // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-26T23:07:25.816Z"); return t}()), + // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), + // }, + // FullyQualifiedDomainName: to.Ptr("pgtestsvc2.postgres.database.azure.com"), + // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ + // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeDisabled), + // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateNotEnabled), + // }, + // MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ + // CustomWindow: to.Ptr("Disabled"), + // DayOfWeek: to.Ptr[int32](0), + // StartHour: to.Ptr[int32](0), + // StartMinute: to.Ptr[int32](0), + // }, + // MinorVersion: to.Ptr("6"), + // Network: &armpostgresqlflexibleservers.Network{ + // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), + // }, + // PrivateEndpointConnections: []*armpostgresqlflexibleservers.PrivateEndpointConnection{ + // { + // Name: to.Ptr("asdfasdfa.40c899c7-5847-493e-9c9e-d0a0c90aaf92"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/privateEndpointConnections"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc2/privateEndpointConnections/asdfasdfa.40c899c7-5847-493e-9c9e-d0a0c90aaf92"), + // Properties: &armpostgresqlflexibleservers.PrivateEndpointConnectionProperties{ + // GroupIDs: []*string{ + // to.Ptr("postgresqlServer")}, + // PrivateEndpoint: &armpostgresqlflexibleservers.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/pe-test-rg/providers/Microsoft.Network/privateEndpoints/asdfasdfa"), + // }, + // PrivateLinkServiceConnectionState: &armpostgresqlflexibleservers.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-Approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr(armpostgresqlflexibleservers.PrivateEndpointServiceConnectionStatusApproved), + // }, + // ProvisioningState: to.Ptr(armpostgresqlflexibleservers.PrivateEndpointConnectionProvisioningStateSucceeded), + // }, + // }}, + // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), + // Storage: &armpostgresqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](2300), + // StorageSizeGB: to.Ptr[int32](512), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), + // }, + // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), + // }, + // SKU: &armpostgresqlflexibleservers.SKU{ + // Name: to.Ptr("Standard_D4s_v3"), + // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerGetWithVnet.json func ExampleServersClient_Get_serverGetWithVnet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1225,7 +1875,10 @@ func ExampleServersClient_Get_serverGetWithVnet() { // }, // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), // Storage: &armpostgresqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](2300), // StorageSizeGB: to.Ptr[int32](512), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), // }, // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), // }, @@ -1236,7 +1889,7 @@ func ExampleServersClient_Get_serverGetWithVnet() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerListByResourceGroup.json func ExampleServersClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1294,7 +1947,10 @@ func ExampleServersClient_NewListByResourceGroupPager() { // }, // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), // Storage: &armpostgresqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](2300), // StorageSizeGB: to.Ptr[int32](512), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), // }, // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), // }, @@ -1334,7 +1990,10 @@ func ExampleServersClient_NewListByResourceGroupPager() { // }, // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), // Storage: &armpostgresqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), + // Iops: to.Ptr[int32](2300), // StorageSizeGB: to.Ptr[int32](512), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), // }, // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), // }, @@ -1347,7 +2006,7 @@ func ExampleServersClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerList.json func ExampleServersClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1405,6 +2064,7 @@ func ExampleServersClient_NewListPager() { // }, // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), // Storage: &armpostgresqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), // StorageSizeGB: to.Ptr[int32](512), // }, // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), @@ -1418,7 +2078,7 @@ func ExampleServersClient_NewListPager() { // Name: to.Ptr("pgtestsvc1"), // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc1"), - // Location: to.Ptr("westus"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "ElasticServer": to.Ptr("1"), // }, @@ -1445,7 +2105,10 @@ func ExampleServersClient_NewListPager() { // }, // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), // Storage: &armpostgresqlflexibleservers.Storage{ + // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowEnabled), + // Iops: to.Ptr[int32](2300), // StorageSizeGB: to.Ptr[int32](512), + // Tier: to.Ptr(armpostgresqlflexibleservers.AzureManagedDiskPerformanceTiersP20), // }, // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), // }, @@ -1458,7 +2121,7 @@ func ExampleServersClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerRestart.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerRestart.json func ExampleServersClient_BeginRestart_serverRestart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1479,7 +2142,7 @@ func ExampleServersClient_BeginRestart_serverRestart() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerRestartWithFailover.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerRestartWithFailover.json func ExampleServersClient_BeginRestart_serverRestartWithFailover() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1504,7 +2167,7 @@ func ExampleServersClient_BeginRestart_serverRestartWithFailover() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerStart.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerStart.json func ExampleServersClient_BeginStart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1525,7 +2188,7 @@ func ExampleServersClient_BeginStart() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerStop.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerStop.json func ExampleServersClient_BeginStop() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client.go new file mode 100644 index 000000000000..5162f2aaab3b --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client.go @@ -0,0 +1,265 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 armpostgresqlflexibleservers + +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" +) + +// ServerThreatProtectionSettingsClient contains the methods for the ServerThreatProtectionSettings group. +// Don't use this type directly, use NewServerThreatProtectionSettingsClient() instead. +type ServerThreatProtectionSettingsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewServerThreatProtectionSettingsClient creates a new instance of ServerThreatProtectionSettingsClient 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 NewServerThreatProtectionSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerThreatProtectionSettingsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ServerThreatProtectionSettingsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a server's Advanced Threat Protection settings. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - threatProtectionName - The name of the Threat Protection state. +// - parameters - The Advanced Threat Protection state for the flexible server. +// - options - ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerThreatProtectionSettingsClient.BeginCreateOrUpdate +// method. +func (client *ServerThreatProtectionSettingsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, threatProtectionName ThreatProtectionName, parameters ServerThreatProtectionSettingsModel, options *ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerThreatProtectionSettingsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, threatProtectionName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServerThreatProtectionSettingsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ServerThreatProtectionSettingsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Creates or updates a server's Advanced Threat Protection settings. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +func (client *ServerThreatProtectionSettingsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, threatProtectionName ThreatProtectionName, parameters ServerThreatProtectionSettingsModel, options *ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "ServerThreatProtectionSettingsClient.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, threatProtectionName, 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) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ServerThreatProtectionSettingsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, threatProtectionName ThreatProtectionName, parameters ServerThreatProtectionSettingsModel, options *ServerThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{threatProtectionName}" + 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 threatProtectionName == "" { + return nil, errors.New("parameter threatProtectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{threatProtectionName}", url.PathEscape(string(threatProtectionName))) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// Get - Get a server's Advanced Threat Protection settings. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - threatProtectionName - The name of the Threat Protection state. +// - options - ServerThreatProtectionSettingsClientGetOptions contains the optional parameters for the ServerThreatProtectionSettingsClient.Get +// method. +func (client *ServerThreatProtectionSettingsClient) Get(ctx context.Context, resourceGroupName string, serverName string, threatProtectionName ThreatProtectionName, options *ServerThreatProtectionSettingsClientGetOptions) (ServerThreatProtectionSettingsClientGetResponse, error) { + var err error + const operationName = "ServerThreatProtectionSettingsClient.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, threatProtectionName, options) + if err != nil { + return ServerThreatProtectionSettingsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServerThreatProtectionSettingsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerThreatProtectionSettingsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ServerThreatProtectionSettingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, threatProtectionName ThreatProtectionName, options *ServerThreatProtectionSettingsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{threatProtectionName}" + 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 threatProtectionName == "" { + return nil, errors.New("parameter threatProtectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{threatProtectionName}", url.PathEscape(string(threatProtectionName))) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ServerThreatProtectionSettingsClient) getHandleResponse(resp *http.Response) (ServerThreatProtectionSettingsClientGetResponse, error) { + result := ServerThreatProtectionSettingsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServerThreatProtectionSettingsModel); err != nil { + return ServerThreatProtectionSettingsClientGetResponse{}, err + } + return result, nil +} + +// NewListByServerPager - Get a list of server's Threat Protection state. +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - options - ServerThreatProtectionSettingsClientListByServerOptions contains the optional parameters for the ServerThreatProtectionSettingsClient.NewListByServerPager +// method. +func (client *ServerThreatProtectionSettingsClient) NewListByServerPager(resourceGroupName string, serverName string, options *ServerThreatProtectionSettingsClientListByServerOptions) *runtime.Pager[ServerThreatProtectionSettingsClientListByServerResponse] { + return runtime.NewPager(runtime.PagingHandler[ServerThreatProtectionSettingsClientListByServerResponse]{ + More: func(page ServerThreatProtectionSettingsClientListByServerResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ServerThreatProtectionSettingsClientListByServerResponse) (ServerThreatProtectionSettingsClientListByServerResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ServerThreatProtectionSettingsClient.NewListByServerPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) + }, nil) + if err != nil { + return ServerThreatProtectionSettingsClientListByServerResponse{}, err + } + return client.listByServerHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByServerCreateRequest creates the ListByServer request. +func (client *ServerThreatProtectionSettingsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServerThreatProtectionSettingsClientListByServerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/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") + } + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByServerHandleResponse handles the ListByServer response. +func (client *ServerThreatProtectionSettingsClient) listByServerHandleResponse(resp *http.Response) (ServerThreatProtectionSettingsClientListByServerResponse, error) { + result := ServerThreatProtectionSettingsClientListByServerResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServerThreatProtectionListResult); err != nil { + return ServerThreatProtectionSettingsClientListByServerResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client_example_test.go new file mode 100644 index 000000000000..64a5ea83b431 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client_example_test.go @@ -0,0 +1,122 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armpostgresqlflexibleservers_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/postgresql/armpostgresqlflexibleservers/v4" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerThreatProtectionSettingsListByServer.json +func ExampleServerThreatProtectionSettingsClient_NewListByServerPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewServerThreatProtectionSettingsClient().NewListByServerPager("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.ServerThreatProtectionListResult = armpostgresqlflexibleservers.ServerThreatProtectionListResult{ + // Value: []*armpostgresqlflexibleservers.ServerThreatProtectionSettingsModel{ + // { + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/advancedThreatProtectionSettings"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-6852/providers/Microsoft.DBforPostgreSQL/flexibleServers/threatprotection-2080/advancedThreatProtectionSettings/Default"), + // Properties: &armpostgresqlflexibleservers.ServerThreatProtectionProperties{ + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-03T04:41:33.937Z"); return t}()), + // State: to.Ptr(armpostgresqlflexibleservers.ThreatProtectionStateEnabled), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerThreatProtectionSettingsGet.json +func ExampleServerThreatProtectionSettingsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewServerThreatProtectionSettingsClient().Get(ctx, "threatprotection-6852", "threatprotection-2080", armpostgresqlflexibleservers.ThreatProtectionNameDefault, 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.ServerThreatProtectionSettingsModel = armpostgresqlflexibleservers.ServerThreatProtectionSettingsModel{ + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/advancedThreatProtectionSettings"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.DBforPostgreSQL/flexibleServers/threatprotection-6440/advancedThreatProtectionSettings/Default"), + // Properties: &armpostgresqlflexibleservers.ServerThreatProtectionProperties{ + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-03T04:41:33.937Z"); return t}()), + // State: to.Ptr(armpostgresqlflexibleservers.ThreatProtectionStateEnabled), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerThreatProtectionSettingsCreate.json +func ExampleServerThreatProtectionSettingsClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServerThreatProtectionSettingsClient().BeginCreateOrUpdate(ctx, "threatprotection-4799", "threatprotection-6440", armpostgresqlflexibleservers.ThreatProtectionNameDefault, armpostgresqlflexibleservers.ServerThreatProtectionSettingsModel{ + Properties: &armpostgresqlflexibleservers.ServerThreatProtectionProperties{ + State: to.Ptr(armpostgresqlflexibleservers.ThreatProtectionStateEnabled), + }, + }, 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.ServerThreatProtectionSettingsModel = armpostgresqlflexibleservers.ServerThreatProtectionSettingsModel{ + // Name: to.Ptr("Default"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/advancedThreatProtectionSettings"), + // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.DBforPostgreSQL/flexibleServers/threatprotection-6440/advancedThreatProtectionSettings/Default"), + // Properties: &armpostgresqlflexibleservers.ServerThreatProtectionProperties{ + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-03T04:41:33.937Z"); return t}()), + // State: to.Ptr(armpostgresqlflexibleservers.ThreatProtectionStateEnabled), + // }, + // } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client.go new file mode 100644 index 000000000000..7240d5339e6a --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client.go @@ -0,0 +1,434 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 armpostgresqlflexibleservers + +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" +) + +// VirtualEndpointsClient contains the methods for the VirtualEndpoints group. +// Don't use this type directly, use NewVirtualEndpointsClient() instead. +type VirtualEndpointsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVirtualEndpointsClient creates a new instance of VirtualEndpointsClient 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 NewVirtualEndpointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualEndpointsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VirtualEndpointsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreate - Creates a new virtual endpoint for PostgreSQL flexible server. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - virtualEndpointName - The name of the virtual endpoint. +// - parameters - The required parameters for creating or updating virtual endpoints. +// - options - VirtualEndpointsClientBeginCreateOptions contains the optional parameters for the VirtualEndpointsClient.BeginCreate +// method. +func (client *VirtualEndpointsClient) BeginCreate(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters VirtualEndpointResource, options *VirtualEndpointsClientBeginCreateOptions) (*runtime.Poller[VirtualEndpointsClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, serverName, virtualEndpointName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualEndpointsClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualEndpointsClientCreateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Create - Creates a new virtual endpoint for PostgreSQL flexible server. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +func (client *VirtualEndpointsClient) create(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters VirtualEndpointResource, options *VirtualEndpointsClientBeginCreateOptions) (*http.Response, error) { + var err error + const operationName = "VirtualEndpointsClient.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, virtualEndpointName, 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 +} + +// createCreateRequest creates the Create request. +func (client *VirtualEndpointsClient) createCreateRequest(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters VirtualEndpointResource, options *VirtualEndpointsClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/virtualendpoints/{virtualEndpointName}" + 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 virtualEndpointName == "" { + return nil, errors.New("parameter virtualEndpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualEndpointName}", url.PathEscape(virtualEndpointName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Deletes a virtual endpoint. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - virtualEndpointName - The name of the virtual endpoint. +// - options - VirtualEndpointsClientBeginDeleteOptions contains the optional parameters for the VirtualEndpointsClient.BeginDelete +// method. +func (client *VirtualEndpointsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, options *VirtualEndpointsClientBeginDeleteOptions) (*runtime.Poller[VirtualEndpointsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, virtualEndpointName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualEndpointsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualEndpointsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes a virtual endpoint. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +func (client *VirtualEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, options *VirtualEndpointsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "VirtualEndpointsClient.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, virtualEndpointName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *VirtualEndpointsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, options *VirtualEndpointsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/virtualendpoints/{virtualEndpointName}" + 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 virtualEndpointName == "" { + return nil, errors.New("parameter virtualEndpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualEndpointName}", url.PathEscape(virtualEndpointName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets information about a virtual endpoint. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - virtualEndpointName - The name of the virtual endpoint. +// - options - VirtualEndpointsClientGetOptions contains the optional parameters for the VirtualEndpointsClient.Get method. +func (client *VirtualEndpointsClient) Get(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, options *VirtualEndpointsClientGetOptions) (VirtualEndpointsClientGetResponse, error) { + var err error + const operationName = "VirtualEndpointsClient.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, virtualEndpointName, options) + if err != nil { + return VirtualEndpointsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualEndpointsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return VirtualEndpointsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *VirtualEndpointsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, options *VirtualEndpointsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/virtualendpoints/{virtualEndpointName}" + 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 virtualEndpointName == "" { + return nil, errors.New("parameter virtualEndpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualEndpointName}", url.PathEscape(virtualEndpointName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VirtualEndpointsClient) getHandleResponse(resp *http.Response) (VirtualEndpointsClientGetResponse, error) { + result := VirtualEndpointsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualEndpointResource); err != nil { + return VirtualEndpointsClientGetResponse{}, err + } + return result, nil +} + +// NewListByServerPager - List all the servers in a given resource group. +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - options - VirtualEndpointsClientListByServerOptions contains the optional parameters for the VirtualEndpointsClient.NewListByServerPager +// method. +func (client *VirtualEndpointsClient) NewListByServerPager(resourceGroupName string, serverName string, options *VirtualEndpointsClientListByServerOptions) *runtime.Pager[VirtualEndpointsClientListByServerResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualEndpointsClientListByServerResponse]{ + More: func(page VirtualEndpointsClientListByServerResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualEndpointsClientListByServerResponse) (VirtualEndpointsClientListByServerResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualEndpointsClient.NewListByServerPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) + }, nil) + if err != nil { + return VirtualEndpointsClientListByServerResponse{}, err + } + return client.listByServerHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByServerCreateRequest creates the ListByServer request. +func (client *VirtualEndpointsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *VirtualEndpointsClientListByServerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/virtualendpoints" + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByServerHandleResponse handles the ListByServer response. +func (client *VirtualEndpointsClient) listByServerHandleResponse(resp *http.Response) (VirtualEndpointsClientListByServerResponse, error) { + result := VirtualEndpointsClientListByServerResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualEndpointsListResult); err != nil { + return VirtualEndpointsClientListByServerResponse{}, err + } + return result, nil +} + +// BeginUpdate - Updates an existing virtual endpoint. The request body can contain one to many of the properties present +// in the normal virtual endpoint definition. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - virtualEndpointName - The name of the virtual endpoint. +// - parameters - The required parameters for updating a server. +// - options - VirtualEndpointsClientBeginUpdateOptions contains the optional parameters for the VirtualEndpointsClient.BeginUpdate +// method. +func (client *VirtualEndpointsClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters VirtualEndpointResourceForPatch, options *VirtualEndpointsClientBeginUpdateOptions) (*runtime.Poller[VirtualEndpointsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, serverName, virtualEndpointName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualEndpointsClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualEndpointsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Update - Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the +// normal virtual endpoint definition. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +func (client *VirtualEndpointsClient) update(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters VirtualEndpointResourceForPatch, options *VirtualEndpointsClientBeginUpdateOptions) (*http.Response, error) { + var err error + const operationName = "VirtualEndpointsClient.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, virtualEndpointName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// updateCreateRequest creates the Update request. +func (client *VirtualEndpointsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, virtualEndpointName string, parameters VirtualEndpointResourceForPatch, options *VirtualEndpointsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/virtualendpoints/{virtualEndpointName}" + 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 virtualEndpointName == "" { + return nil, errors.New("parameter virtualEndpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualEndpointName}", url.PathEscape(virtualEndpointName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client_example_test.go new file mode 100644 index 000000000000..75c8b1fefd9d --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client_example_test.go @@ -0,0 +1,200 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armpostgresqlflexibleservers_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/postgresql/armpostgresqlflexibleservers/v4" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointCreate.json +func ExampleVirtualEndpointsClient_BeginCreate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewVirtualEndpointsClient().BeginCreate(ctx, "testrg", "pgtestsvc4", "pgVirtualEndpoint1", armpostgresqlflexibleservers.VirtualEndpointResource{ + Properties: &armpostgresqlflexibleservers.VirtualEndpointResourceProperties{ + EndpointType: to.Ptr(armpostgresqlflexibleservers.VirtualEndpointTypeReadWrite), + Members: []*string{ + to.Ptr("testPrimary1")}, + }, + }, 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.VirtualEndpointResource = armpostgresqlflexibleservers.VirtualEndpointResource{ + // Name: to.Ptr("pgVirtualEndpoint1"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/virtualEndpoints"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4/virtualEndpoints/pgVirtualEndpoint1"), + // Properties: &armpostgresqlflexibleservers.VirtualEndpointResourceProperties{ + // EndpointType: to.Ptr(armpostgresqlflexibleservers.VirtualEndpointTypeReadWrite), + // Members: []*string{ + // to.Ptr("testPrimary1")}, + // VirtualEndpoints: []*string{ + // to.Ptr("pgVirtualEndpoint1.reader.postgres.database.azure.com"), + // to.Ptr("pgVirtualEndpoint1.writer.postgres.database.azure.com")}, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointUpdate.json +func ExampleVirtualEndpointsClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewVirtualEndpointsClient().BeginUpdate(ctx, "testrg", "pgtestsvc4", "pgVirtualEndpoint1", armpostgresqlflexibleservers.VirtualEndpointResourceForPatch{ + Properties: &armpostgresqlflexibleservers.VirtualEndpointResourceProperties{ + EndpointType: to.Ptr(armpostgresqlflexibleservers.VirtualEndpointTypeReadWrite), + Members: []*string{ + to.Ptr("testReplica1")}, + }, + }, 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.VirtualEndpointResource = armpostgresqlflexibleservers.VirtualEndpointResource{ + // Name: to.Ptr("pgVirtualEndpoint1"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/virtualEndpoints"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4/virtualEndpoints/pgVirtualEndpoint1"), + // Properties: &armpostgresqlflexibleservers.VirtualEndpointResourceProperties{ + // EndpointType: to.Ptr(armpostgresqlflexibleservers.VirtualEndpointTypeReadWrite), + // Members: []*string{ + // to.Ptr("testReplica1")}, + // VirtualEndpoints: []*string{ + // to.Ptr("pgVirtualEndpoint1.reader.postgres.database.azure.com"), + // to.Ptr("pgVirtualEndpoint1.writer.postgres.database.azure.com")}, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointDelete.json +func ExampleVirtualEndpointsClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewVirtualEndpointsClient().BeginDelete(ctx, "testrg", "pgtestsvc4", "pgVirtualEndpoint1", 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/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointsGet.json +func ExampleVirtualEndpointsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewVirtualEndpointsClient().Get(ctx, "testrg", "pgtestsvc4", "pgVirtualEndpoint1", 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.VirtualEndpointResource = armpostgresqlflexibleservers.VirtualEndpointResource{ + // Name: to.Ptr("pgVirtualEndpoint1"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/virtualEndpoints"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4/virtualEndpoints/pgVirtualEndpoint1"), + // Properties: &armpostgresqlflexibleservers.VirtualEndpointResourceProperties{ + // EndpointType: to.Ptr(armpostgresqlflexibleservers.VirtualEndpointTypeReadWrite), + // Members: []*string{ + // to.Ptr("testReplica1")}, + // VirtualEndpoints: []*string{ + // to.Ptr("pgVirtualEndpoint1.reader.postgres.database.azure.com"), + // to.Ptr("pgVirtualEndpoint1.writer.postgres.database.azure.com")}, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointsListByServer.json +func ExampleVirtualEndpointsClient_NewListByServerPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewVirtualEndpointsClient().NewListByServerPager("testrg", "pgtestsvc4", 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.VirtualEndpointsListResult = armpostgresqlflexibleservers.VirtualEndpointsListResult{ + // Value: []*armpostgresqlflexibleservers.VirtualEndpointResource{ + // { + // Name: to.Ptr("pgVirtualEndpoint1"), + // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/virtualEndpoints"), + // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4/virtualEndpoints/pgVirtualEndpoint1"), + // Properties: &armpostgresqlflexibleservers.VirtualEndpointResourceProperties{ + // EndpointType: to.Ptr(armpostgresqlflexibleservers.VirtualEndpointTypeReadWrite), + // Members: []*string{ + // to.Ptr("testReplica1")}, + // VirtualEndpoints: []*string{ + // to.Ptr("pgVirtualEndpoint1.reader.postgres.database.azure.com"), + // to.Ptr("pgVirtualEndpoint1.writer.postgres.database.azure.com")}, + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_client.go index ab52b479ded9..4525171c4e42 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_client.go @@ -28,7 +28,7 @@ type VirtualNetworkSubnetUsageClient struct { } // NewVirtualNetworkSubnetUsageClient creates a new instance of VirtualNetworkSubnetUsageClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - 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 NewVirtualNetworkSubnetUsageClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworkSubnetUsageClient, error) { @@ -46,7 +46,7 @@ func NewVirtualNetworkSubnetUsageClient(subscriptionID string, credential azcore // 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 2022-12-01 +// Generated from API version 2023-06-01-preview // - locationName - The name of the location. // - parameters - The required parameters for creating or updating a server. // - options - VirtualNetworkSubnetUsageClientExecuteOptions contains the optional parameters for the VirtualNetworkSubnetUsageClient.Execute @@ -89,7 +89,7 @@ func (client *VirtualNetworkSubnetUsageClient) executeCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_client_example_test.go index 40f0a382c17a..2b7c02d85fc3 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_client_example_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/75ece9197dbac70ac0ba651c53a79c1841944be2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/VirtualNetworkSubnetUsage.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualNetworkSubnetUsage.json func ExampleVirtualNetworkSubnetUsageClient_Execute() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil {