diff --git a/sdk/resourcemanager/postgresql/armpostgresql/CHANGELOG.md b/sdk/resourcemanager/postgresql/armpostgresql/CHANGELOG.md index 377dcb234dd7..5efb05ad8c2c 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/CHANGELOG.md +++ b/sdk/resourcemanager/postgresql/armpostgresql/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.2.1 (2025-05-13) +### Other Changes + + ## 1.2.0 (2023-11-30) ### Features Added diff --git a/sdk/resourcemanager/postgresql/armpostgresql/README.md b/sdk/resourcemanager/postgresql/armpostgresql/README.md index 1f22024da97a..d45b6d3e39d8 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/README.md +++ b/sdk/resourcemanager/postgresql/armpostgresql/README.md @@ -55,7 +55,7 @@ clientFactory, err := armpostgresql.NewClientFactory(, cred, &o A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. ```go -client := clientFactory.NewServersClient() +client := clientFactory.NewCheckNameAvailabilityClient() ``` ## Fakes diff --git a/sdk/resourcemanager/postgresql/armpostgresql/autorest.md b/sdk/resourcemanager/postgresql/armpostgresql/autorest.md index 188641623a3d..10e6a0d355eb 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/autorest.md +++ b/sdk/resourcemanager/postgresql/armpostgresql/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/postgresql/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/postgresql/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.2.0 +module-version: 1.2.1 package-singleservers: true ``` \ No newline at end of file diff --git a/sdk/resourcemanager/postgresql/armpostgresql/checknameavailability_client.go b/sdk/resourcemanager/postgresql/armpostgresql/checknameavailability_client.go index d64ce4c8f8a7..d8349b23d5af 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/checknameavailability_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/checknameavailability_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -73,7 +70,7 @@ func (client *CheckNameAvailabilityClient) Execute(ctx context.Context, nameAvai } // executeCreateRequest creates the Execute request. -func (client *CheckNameAvailabilityClient) executeCreateRequest(ctx context.Context, nameAvailabilityRequest NameAvailabilityRequest, options *CheckNameAvailabilityClientExecuteOptions) (*policy.Request, error) { +func (client *CheckNameAvailabilityClient) executeCreateRequest(ctx context.Context, nameAvailabilityRequest NameAvailabilityRequest, _ *CheckNameAvailabilityClientExecuteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/checkNameAvailability" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") diff --git a/sdk/resourcemanager/postgresql/armpostgresql/checknameavailability_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/checknameavailability_client_example_test.go deleted file mode 100644 index c68c35f20b31..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/checknameavailability_client_example_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresql_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/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/CheckNameAvailability.json -func ExampleCheckNameAvailabilityClient_Execute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCheckNameAvailabilityClient().Execute(ctx, armpostgresql.NameAvailabilityRequest{ - Name: to.Ptr("name1"), - Type: to.Ptr("Microsoft.DBforPostgreSQL"), - }, 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.NameAvailability = armpostgresql.NameAvailability{ - // Message: to.Ptr(""), - // NameAvailable: to.Ptr(true), - // Reason: to.Ptr(""), - // } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/client_factory.go b/sdk/resourcemanager/postgresql/armpostgresql/client_factory.go index 8f7f4d7175a7..06f6853323b1 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/client_factory.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/client_factory.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -17,8 +14,7 @@ import ( // Don't use this type directly, use NewClientFactory instead. type ClientFactory struct { subscriptionID string - credential azcore.TokenCredential - options *arm.ClientOptions + internal *arm.Client } // NewClientFactory creates a new instance of ClientFactory with the specified values. @@ -27,120 +23,155 @@ type ClientFactory struct { // - 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) { - _, err := arm.NewClient(moduleName, moduleVersion, credential, options) + internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } return &ClientFactory{ - subscriptionID: subscriptionID, credential: credential, - options: options.Clone(), + subscriptionID: subscriptionID, + internal: internal, }, nil } // NewCheckNameAvailabilityClient creates a new instance of CheckNameAvailabilityClient. func (c *ClientFactory) NewCheckNameAvailabilityClient() *CheckNameAvailabilityClient { - subClient, _ := NewCheckNameAvailabilityClient(c.subscriptionID, c.credential, c.options) - return subClient + return &CheckNameAvailabilityClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewConfigurationsClient creates a new instance of ConfigurationsClient. func (c *ClientFactory) NewConfigurationsClient() *ConfigurationsClient { - subClient, _ := NewConfigurationsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ConfigurationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewDatabasesClient creates a new instance of DatabasesClient. func (c *ClientFactory) NewDatabasesClient() *DatabasesClient { - subClient, _ := NewDatabasesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &DatabasesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewFirewallRulesClient creates a new instance of FirewallRulesClient. func (c *ClientFactory) NewFirewallRulesClient() *FirewallRulesClient { - subClient, _ := NewFirewallRulesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &FirewallRulesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewLocationBasedPerformanceTierClient creates a new instance of LocationBasedPerformanceTierClient. func (c *ClientFactory) NewLocationBasedPerformanceTierClient() *LocationBasedPerformanceTierClient { - subClient, _ := NewLocationBasedPerformanceTierClient(c.subscriptionID, c.credential, c.options) - return subClient + return &LocationBasedPerformanceTierClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewLogFilesClient creates a new instance of LogFilesClient. func (c *ClientFactory) NewLogFilesClient() *LogFilesClient { - subClient, _ := NewLogFilesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &LogFilesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) - return subClient + return &OperationsClient{ + internal: c.internal, + } } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient. func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { - subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateEndpointConnectionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient. func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient { - subClient, _ := NewPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateLinkResourcesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewRecoverableServersClient creates a new instance of RecoverableServersClient. func (c *ClientFactory) NewRecoverableServersClient() *RecoverableServersClient { - subClient, _ := NewRecoverableServersClient(c.subscriptionID, c.credential, c.options) - return subClient + return &RecoverableServersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewReplicasClient creates a new instance of ReplicasClient. func (c *ClientFactory) NewReplicasClient() *ReplicasClient { - subClient, _ := NewReplicasClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ReplicasClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewServerAdministratorsClient creates a new instance of ServerAdministratorsClient. func (c *ClientFactory) NewServerAdministratorsClient() *ServerAdministratorsClient { - subClient, _ := NewServerAdministratorsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ServerAdministratorsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewServerBasedPerformanceTierClient creates a new instance of ServerBasedPerformanceTierClient. func (c *ClientFactory) NewServerBasedPerformanceTierClient() *ServerBasedPerformanceTierClient { - subClient, _ := NewServerBasedPerformanceTierClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ServerBasedPerformanceTierClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewServerKeysClient creates a new instance of ServerKeysClient. func (c *ClientFactory) NewServerKeysClient() *ServerKeysClient { - subClient, _ := NewServerKeysClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ServerKeysClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewServerParametersClient creates a new instance of ServerParametersClient. func (c *ClientFactory) NewServerParametersClient() *ServerParametersClient { - subClient, _ := NewServerParametersClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ServerParametersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewServerSecurityAlertPoliciesClient creates a new instance of ServerSecurityAlertPoliciesClient. func (c *ClientFactory) NewServerSecurityAlertPoliciesClient() *ServerSecurityAlertPoliciesClient { - subClient, _ := NewServerSecurityAlertPoliciesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ServerSecurityAlertPoliciesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewServersClient creates a new instance of ServersClient. func (c *ClientFactory) NewServersClient() *ServersClient { - subClient, _ := NewServersClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ServersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewVirtualNetworkRulesClient creates a new instance of VirtualNetworkRulesClient. func (c *ClientFactory) NewVirtualNetworkRulesClient() *VirtualNetworkRulesClient { - subClient, _ := NewVirtualNetworkRulesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &VirtualNetworkRulesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/configurations_client.go b/sdk/resourcemanager/postgresql/armpostgresql/configurations_client.go index d053956e326d..97bffaf40f5f 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/configurations_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/configurations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -96,7 +93,7 @@ func (client *ConfigurationsClient) createOrUpdate(ctx context.Context, resource } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration, options *ConfigurationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration, _ *ConfigurationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/configurations/{configurationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -159,7 +156,7 @@ func (client *ConfigurationsClient) Get(ctx context.Context, resourceGroupName s } // getCreateRequest creates the Get request. -func (client *ConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, configurationName string, options *ConfigurationsClientGetOptions) (*policy.Request, error) { +func (client *ConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, configurationName string, _ *ConfigurationsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/configurations/{configurationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -229,7 +226,7 @@ func (client *ConfigurationsClient) NewListByServerPager(resourceGroupName strin } // listByServerCreateRequest creates the ListByServer request. -func (client *ConfigurationsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ConfigurationsClientListByServerOptions) (*policy.Request, error) { +func (client *ConfigurationsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ConfigurationsClientListByServerOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/configurations" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") diff --git a/sdk/resourcemanager/postgresql/armpostgresql/configurations_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/configurations_client_example_test.go deleted file mode 100644 index 3e46cc0d9482..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/configurations_client_example_test.go +++ /dev/null @@ -1,1162 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresql_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/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ConfigurationCreateOrUpdate.json -func ExampleConfigurationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationsClient().BeginCreateOrUpdate(ctx, "TestGroup", "testserver", "array_nulls", armpostgresql.Configuration{ - Properties: &armpostgresql.ConfigurationProperties{ - Source: to.Ptr("user-override"), - Value: to.Ptr("off"), - }, - }, 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.Configuration = armpostgresql.Configuration{ - // Name: to.Ptr("array_nulls"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/array_nulls"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enable input of NULL elements in arrays."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("user-override"), - // Value: to.Ptr("off"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ConfigurationGet.json -func ExampleConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConfigurationsClient().Get(ctx, "TestGroup", "testserver", "array_nulls", 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.Configuration = armpostgresql.Configuration{ - // Name: to.Ptr("array_nulls"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/array_nulls"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enable input of NULL elements in arrays."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ConfigurationListByServer.json -func ExampleConfigurationsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConfigurationsClient().NewListByServerPager("TestGroup", "testserver", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ConfigurationListResult = armpostgresql.ConfigurationListResult{ - // Value: []*armpostgresql.Configuration{ - // { - // Name: to.Ptr("array_nulls"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/array_nulls"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enable input of NULL elements in arrays."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("backslash_quote"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/backslash_quote"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets whether \"\\'\" is allowed in string literals."), - // AllowedValues: to.Ptr("safe_encoding,on,off"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("safe_encoding"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("safe_encoding"), - // }, - // }, - // { - // Name: to.Ptr("bytea_output"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/bytea_output"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the output format for bytea."), - // AllowedValues: to.Ptr("escape,hex"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("hex"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("hex"), - // }, - // }, - // { - // Name: to.Ptr("check_function_bodies"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/check_function_bodies"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Check function bodies during CREATE FUNCTION."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("client_encoding"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/client_encoding"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the client's character set encoding."), - // AllowedValues: to.Ptr("BIG5,EUC_CN,EUC_JP,EUC_JIS_2004,EUC_KR,EUC_TW,GB18030,GBK,ISO_8859_5,ISO_8859_6,ISO_8859_7,ISO_8859_8,JOHAB,KOI8R,KOI8U,LATIN1,LATIN2,LATIN3,LATIN4,LATIN5,LATIN6,LATIN7,LATIN8,LATIN9,LATIN10,MULE_INTERNAL,SJIS,SHIFT_JIS_2004,SQL_ASCII,UHC,UTF8,WIN866,WIN874,WIN1250,WIN1251,WIN1252,WIN1253,WIN1254,WIN1255,WIN1256,WIN1257,WIN1258"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("sql_ascii"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("sql_ascii"), - // }, - // }, - // { - // Name: to.Ptr("client_min_messages"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/client_min_messages"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the message levels that are sent to the client."), - // AllowedValues: to.Ptr("debug5,debug4,debug3,debug2,debug1,log,notice,warning,error"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("notice"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("notice"), - // }, - // }, - // { - // Name: to.Ptr("constraint_exclusion"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/constraint_exclusion"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner to use constraints to optimize queries."), - // AllowedValues: to.Ptr("partition,on,off"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("partition"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("partition"), - // }, - // }, - // { - // Name: to.Ptr("cpu_index_tuple_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/cpu_index_tuple_cost"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of processing each index entry during an index scan."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("0.005"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.005"), - // }, - // }, - // { - // Name: to.Ptr("cpu_operator_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/cpu_operator_cost"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of processing each operator or function call."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("0.0025"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.0025"), - // }, - // }, - // { - // Name: to.Ptr("cpu_tuple_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/cpu_tuple_cost"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of processing each tuple (row)."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("0.01"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.01"), - // }, - // }, - // { - // Name: to.Ptr("cursor_tuple_fraction"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/cursor_tuple_fraction"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the fraction of a cursor's rows that will be retrieved."), - // AllowedValues: to.Ptr("0-1"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("0.1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.1"), - // }, - // }, - // { - // Name: to.Ptr("datestyle"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/datestyle"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the display format for date and time values."), - // AllowedValues: to.Ptr("(iso|postgres|sql|german)\\,\\s(dmy|mdy|ymd)"), - // DataType: to.Ptr("String"), - // DefaultValue: to.Ptr("iso, mdy"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("iso, mdy"), - // }, - // }, - // { - // Name: to.Ptr("deadlock_timeout"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/deadlock_timeout"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the amount of time, in milliseconds, to wait on a lock before checking for deadlock."), - // AllowedValues: to.Ptr("1-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("1000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1000"), - // }, - // }, - // { - // Name: to.Ptr("debug_print_parse"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/debug_print_parse"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Logs each query's parse tree."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("debug_print_plan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/debug_print_plan"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Logs each query's execution plan."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("debug_print_rewritten"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/debug_print_rewritten"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Logs each query's rewritten parse tree."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("default_statistics_target"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/default_statistics_target"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the default statistics target."), - // AllowedValues: to.Ptr("1-10000"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("100"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("100"), - // }, - // }, - // { - // Name: to.Ptr("default_text_search_config"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/default_text_search_config"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets default text search configuration."), - // AllowedValues: to.Ptr("[A-Za-z\\._]+"), - // DataType: to.Ptr("String"), - // DefaultValue: to.Ptr("pg_catalog.english"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("pg_catalog.english"), - // }, - // }, - // { - // Name: to.Ptr("default_transaction_deferrable"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/default_transaction_deferrable"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the default deferrable status of new transactions."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("default_transaction_isolation"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/default_transaction_isolation"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the transaction isolation level of each new transaction."), - // AllowedValues: to.Ptr("serializable,repeatable read,read committed,read uncommitted"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("read committed"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("read committed"), - // }, - // }, - // { - // Name: to.Ptr("default_transaction_read_only"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/default_transaction_read_only"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the default read-only status of new transactions."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("default_with_oids"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/default_with_oids"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Create new tables with OIDs by default."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("enable_bitmapscan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_bitmapscan"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of bitmap-scan plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_hashagg"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_hashagg"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of hashed aggregation plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_hashjoin"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_hashjoin"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of hash join plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_indexonlyscan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_indexonlyscan"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of index-only-scan plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_indexscan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_indexscan"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of index-scan plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_material"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_material"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of materialization."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_mergejoin"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_mergejoin"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of merge join plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_nestloop"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_nestloop"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of nested-loop join plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_seqscan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_seqscan"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of sequential-scan plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_sort"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_sort"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of explicit sort steps."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_tidscan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/enable_tidscan"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of TID scan plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("escape_string_warning"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/escape_string_warning"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Warn about backslash escapes in ordinary string literals."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("exit_on_error"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/exit_on_error"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Terminate session on any error."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("extra_float_digits"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/extra_float_digits"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the number of digits displayed for floating-point values."), - // AllowedValues: to.Ptr("-15-3"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("from_collapse_limit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/from_collapse_limit"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the FROM-list size beyond which subqueries are not collapsed."), - // AllowedValues: to.Ptr("1-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("8"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("8"), - // }, - // }, - // { - // Name: to.Ptr("geqo"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enables genetic query optimization."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("geqo_effort"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo_effort"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("GEQO: effort is used to set the default for other GEQO parameters."), - // AllowedValues: to.Ptr("1-10"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("5"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("5"), - // }, - // }, - // { - // Name: to.Ptr("geqo_generations"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo_generations"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("GEQO: number of iterations of the algorithm."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("geqo_pool_size"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo_pool_size"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("GEQO: number of individuals in the population."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("geqo_seed"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo_seed"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("GEQO: seed for random path selection."), - // AllowedValues: to.Ptr("0-1"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("0.0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.0"), - // }, - // }, - // { - // Name: to.Ptr("geqo_selection_bias"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo_selection_bias"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("GEQO: selective pressure within the population."), - // AllowedValues: to.Ptr("1.5-2"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("2.0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("2.0"), - // }, - // }, - // { - // Name: to.Ptr("geqo_threshold"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/geqo_threshold"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the threshold of FROM items beyond which GEQO is used."), - // AllowedValues: to.Ptr("2-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("12"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("12"), - // }, - // }, - // { - // Name: to.Ptr("gin_fuzzy_search_limit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/gin_fuzzy_search_limit"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum allowed result for exact search by GIN."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("intervalstyle"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/intervalstyle"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the display format for interval values."), - // AllowedValues: to.Ptr("postgres,postgres_verbose,sql_standard,iso_8601"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("postgres"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("postgres"), - // }, - // }, - // { - // Name: to.Ptr("join_collapse_limit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/join_collapse_limit"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the FROM-list size beyond which JOIN constructs are not flattened."), - // AllowedValues: to.Ptr("1-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("8"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("8"), - // }, - // }, - // { - // Name: to.Ptr("lock_timeout"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/lock_timeout"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum allowed duration (in milliseconds) of any wait for a lock. 0 turns this off."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("log_checkpoints"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_checkpoints"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Logs each checkpoint."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("log_connections"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_connections"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Logs each successful connection."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("log_disconnections"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_disconnections"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Logs end of a session, including duration."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("log_duration"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_duration"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Logs the duration of each completed SQL statement."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("log_error_verbosity"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_error_verbosity"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the verbosity of logged messages."), - // AllowedValues: to.Ptr("terse,default,verbose"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("default"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("default"), - // }, - // }, - // { - // Name: to.Ptr("log_lock_waits"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_lock_waits"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Logs long lock waits."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("log_min_duration_statement"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_min_duration_statement"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the minimum execution time (in milliseconds) above which statements will be logged. -1 disables logging statement durations."), - // AllowedValues: to.Ptr("-1-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("-1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("-1"), - // }, - // }, - // { - // Name: to.Ptr("log_min_error_statement"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_min_error_statement"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Causes all statements generating error at or above this level to be logged."), - // AllowedValues: to.Ptr("debug5,debug4,debug3,debug2,debug1,info,notice,warning,error,log,fatal,panic"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("error"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("error"), - // }, - // }, - // { - // Name: to.Ptr("log_min_messages"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_min_messages"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the message levels that are logged."), - // AllowedValues: to.Ptr("debug5,debug4,debug3,debug2,debug1,info,notice,warning,error,log,fatal,panic"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("warning"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("warning"), - // }, - // }, - // { - // Name: to.Ptr("log_statement"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_statement"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the type of statements logged."), - // AllowedValues: to.Ptr("none,ddl,mod,all"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("none"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("none"), - // }, - // }, - // { - // Name: to.Ptr("max_locks_per_transaction"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/max_locks_per_transaction"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum number of locks per transaction."), - // AllowedValues: to.Ptr("10-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("64"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("64"), - // }, - // }, - // { - // Name: to.Ptr("max_pred_locks_per_transaction"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/max_pred_locks_per_transaction"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum number of predicate locks per transaction."), - // AllowedValues: to.Ptr("10-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("64"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("64"), - // }, - // }, - // { - // Name: to.Ptr("max_prepared_transactions"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/max_prepared_transactions"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum number of simultaneously prepared transactions."), - // AllowedValues: to.Ptr("0-8388607"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("quote_all_identifiers"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/quote_all_identifiers"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("When generating SQL fragments, quote all identifiers."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("random_page_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/random_page_cost"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of a nonsequentially fetched disk page."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("4.0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("4.0"), - // }, - // }, - // { - // Name: to.Ptr("search_path"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/search_path"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the schema search order for names that are not schema-qualified."), - // AllowedValues: to.Ptr("[A-Za-z.\"$, ]+"), - // DataType: to.Ptr("String"), - // DefaultValue: to.Ptr("\"$user\", public"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("\"$user\", public"), - // }, - // }, - // { - // Name: to.Ptr("seq_page_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/seq_page_cost"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of a sequentially fetched disk page."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("1.0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1.0"), - // }, - // }, - // { - // Name: to.Ptr("sql_inheritance"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/sql_inheritance"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Causes subtables to be included by default in various commands."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("standard_conforming_strings"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/standard_conforming_strings"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Causes '...' strings to treat backslashes literally."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("statement_timeout"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/statement_timeout"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum allowed duration (in milliseconds) of any statement. 0 turns this off."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("synchronize_seqscans"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/synchronize_seqscans"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enable synchronized sequential scans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("synchronous_commit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/synchronous_commit"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the current transaction's synchronization level."), - // AllowedValues: to.Ptr("local,remote_write,on,off"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("transform_null_equals"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/transform_null_equals"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Treats \"expr=NULL\" as \"expr IS NULL\"."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("xmlbinary"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/xmlbinary"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets how binary values are to be encoded in XML."), - // AllowedValues: to.Ptr("base64,hex"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("base64"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("base64"), - // }, - // }, - // { - // Name: to.Ptr("xmloption"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/xmloption"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets whether XML data in implicit parsing and serialization operations is to be considered as documents or content fragments."), - // AllowedValues: to.Ptr("content,document"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("content"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("content"), - // }, - // }, - // { - // Name: to.Ptr("force_parallel_mode"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/force_parallel_mode"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Forces use of parallel query facilities."), - // AllowedValues: to.Ptr("off,on,regress"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("idle_in_transaction_session_timeout"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/idle_in_transaction_session_timeout"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum allowed duration of any idling transaction."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("max_parallel_workers_per_gather"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/max_parallel_workers_per_gather"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum number of parallel processes per executor node."), - // AllowedValues: to.Ptr("0-1024"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("min_parallel_relation_size"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/min_parallel_relation_size"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the minimum size of relations to be considered for parallel scan."), - // AllowedValues: to.Ptr("0-715827882"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("8388608"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("8388608"), - // }, - // }, - // { - // Name: to.Ptr("parallel_setup_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/parallel_setup_cost"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of starting up worker processes for parallel query."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("1000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1000"), - // }, - // }, - // { - // Name: to.Ptr("parallel_tuple_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/parallel_tuple_cost"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of passing each tuple (row) from worker to master backend."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr("Numeric"), - // DefaultValue: to.Ptr("0.1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.1"), - // }, - // }, - // { - // Name: to.Ptr("log_retention_days"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/log_retention_days"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets how many days a log file is saved for."), - // AllowedValues: to.Ptr("1-7"), - // DataType: to.Ptr("Integer"), - // DefaultValue: to.Ptr("3"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("3"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/constants.go b/sdk/resourcemanager/postgresql/armpostgresql/constants.go index 55d1f4071767..f743eb37e8b0 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/constants.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/constants.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -10,7 +7,7 @@ package armpostgresql const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" - moduleVersion = "v1.2.0" + moduleVersion = "v1.2.1" ) // CreateMode - The mode to create a new server. diff --git a/sdk/resourcemanager/postgresql/armpostgresql/databases_client.go b/sdk/resourcemanager/postgresql/armpostgresql/databases_client.go index 1cba3568c4b7..e09198f816e0 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/databases_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/databases_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -96,7 +93,7 @@ func (client *DatabasesClient) createOrUpdate(ctx context.Context, resourceGroup } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DatabasesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database, options *DatabasesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *DatabasesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database, _ *DatabasesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases/{databaseName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -179,7 +176,7 @@ func (client *DatabasesClient) deleteOperation(ctx context.Context, resourceGrou } // deleteCreateRequest creates the Delete request. -func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginDeleteOptions) (*policy.Request, error) { +func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, _ *DatabasesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases/{databaseName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -239,7 +236,7 @@ func (client *DatabasesClient) Get(ctx context.Context, resourceGroupName string } // getCreateRequest creates the Get request. -func (client *DatabasesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientGetOptions) (*policy.Request, error) { +func (client *DatabasesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, _ *DatabasesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases/{databaseName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -309,7 +306,7 @@ func (client *DatabasesClient) NewListByServerPager(resourceGroupName string, se } // listByServerCreateRequest creates the ListByServer request. -func (client *DatabasesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *DatabasesClientListByServerOptions) (*policy.Request, error) { +func (client *DatabasesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *DatabasesClientListByServerOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") diff --git a/sdk/resourcemanager/postgresql/armpostgresql/databases_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/databases_client_example_test.go deleted file mode 100644 index deff297d9722..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/databases_client_example_test.go +++ /dev/null @@ -1,153 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresql_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/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/DatabaseCreate.json -func ExampleDatabasesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "TestGroup", "testserver", "db1", armpostgresql.Database{ - Properties: &armpostgresql.DatabaseProperties{ - Charset: to.Ptr("UTF8"), - Collation: to.Ptr("English_United States.1252"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armpostgresql.Database{ - // Name: to.Ptr("db1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/databases/db1"), - // Properties: &armpostgresql.DatabaseProperties{ - // Charset: to.Ptr("UTF8"), - // Collation: to.Ptr("English_United States.1252"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/DatabaseDelete.json -func ExampleDatabasesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginDelete(ctx, "TestGroup", "testserver", "db1", 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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/DatabaseGet.json -func ExampleDatabasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabasesClient().Get(ctx, "TestGroup", "testserver", "db1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armpostgresql.Database{ - // Name: to.Ptr("db1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/databases/db1"), - // Properties: &armpostgresql.DatabaseProperties{ - // Charset: to.Ptr("UTF8"), - // Collation: to.Ptr("English_United States.1252"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/DatabaseListByServer.json -func ExampleDatabasesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabasesClient().NewListByServerPager("TestGroup", "testserver", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DatabaseListResult = armpostgresql.DatabaseListResult{ - // Value: []*armpostgresql.Database{ - // { - // Name: to.Ptr("db1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/databases/db1"), - // Properties: &armpostgresql.DatabaseProperties{ - // Charset: to.Ptr("UTF8"), - // Collation: to.Ptr("English_United States.1252"), - // }, - // }, - // { - // Name: to.Ptr("db2"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/databases/db2"), - // Properties: &armpostgresql.DatabaseProperties{ - // Charset: to.Ptr("UTF8"), - // Collation: to.Ptr("English_United States.1252"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/checknameavailability_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/checknameavailability_server.go index 587ab53fb3e1..a3a840dbf4cc 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/checknameavailability_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/checknameavailability_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -48,21 +45,40 @@ func (c *CheckNameAvailabilityServerTransport) Do(req *http.Request) (*http.Resp return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "CheckNameAvailabilityClient.Execute": - resp, err = c.dispatchExecute(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *CheckNameAvailabilityServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if checkNameAvailabilityServerTransportInterceptor != nil { + res.resp, res.err, intercepted = checkNameAvailabilityServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "CheckNameAvailabilityClient.Execute": + res.resp, res.err = c.dispatchExecute(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *CheckNameAvailabilityServerTransport) dispatchExecute(req *http.Request) (*http.Response, error) { @@ -93,3 +109,9 @@ func (c *CheckNameAvailabilityServerTransport) dispatchExecute(req *http.Request } return resp, nil } + +// set this to conditionally intercept incoming requests to CheckNameAvailabilityServerTransport +var checkNameAvailabilityServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/configurations_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/configurations_server.go index 4496b00753a1..9f94708ef667 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/configurations_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/configurations_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -63,25 +60,44 @@ func (c *ConfigurationsServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "ConfigurationsClient.BeginCreateOrUpdate": - resp, err = c.dispatchBeginCreateOrUpdate(req) - case "ConfigurationsClient.Get": - resp, err = c.dispatchGet(req) - case "ConfigurationsClient.NewListByServerPager": - resp, err = c.dispatchNewListByServerPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *ConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if configurationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = configurationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ConfigurationsClient.BeginCreateOrUpdate": + res.resp, res.err = c.dispatchBeginCreateOrUpdate(req) + case "ConfigurationsClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "ConfigurationsClient.NewListByServerPager": + res.resp, res.err = c.dispatchNewListByServerPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *ConfigurationsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -210,3 +226,9 @@ func (c *ConfigurationsServerTransport) dispatchNewListByServerPager(req *http.R } return resp, nil } + +// set this to conditionally intercept incoming requests to ConfigurationsServerTransport +var configurationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/databases_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/databases_server.go index 6712949aeca5..1ea85ac11ca8 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/databases_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/databases_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -69,27 +66,46 @@ func (d *DatabasesServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return d.dispatchToMethodFake(req, method) +} - switch method { - case "DatabasesClient.BeginCreateOrUpdate": - resp, err = d.dispatchBeginCreateOrUpdate(req) - case "DatabasesClient.BeginDelete": - resp, err = d.dispatchBeginDelete(req) - case "DatabasesClient.Get": - resp, err = d.dispatchGet(req) - case "DatabasesClient.NewListByServerPager": - resp, err = d.dispatchNewListByServerPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (d *DatabasesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if databasesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = databasesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DatabasesClient.BeginCreateOrUpdate": + res.resp, res.err = d.dispatchBeginCreateOrUpdate(req) + case "DatabasesClient.BeginDelete": + res.resp, res.err = d.dispatchBeginDelete(req) + case "DatabasesClient.Get": + res.resp, res.err = d.dispatchGet(req) + case "DatabasesClient.NewListByServerPager": + res.resp, res.err = d.dispatchNewListByServerPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (d *DatabasesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -266,3 +282,9 @@ func (d *DatabasesServerTransport) dispatchNewListByServerPager(req *http.Reques } return resp, nil } + +// set this to conditionally intercept incoming requests to DatabasesServerTransport +var databasesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/firewallrules_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/firewallrules_server.go index 9ee71d5d8900..41dffe93662f 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/firewallrules_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/firewallrules_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -69,27 +66,46 @@ func (f *FirewallRulesServerTransport) Do(req *http.Request) (*http.Response, er return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return f.dispatchToMethodFake(req, method) +} - switch method { - case "FirewallRulesClient.BeginCreateOrUpdate": - resp, err = f.dispatchBeginCreateOrUpdate(req) - case "FirewallRulesClient.BeginDelete": - resp, err = f.dispatchBeginDelete(req) - case "FirewallRulesClient.Get": - resp, err = f.dispatchGet(req) - case "FirewallRulesClient.NewListByServerPager": - resp, err = f.dispatchNewListByServerPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (f *FirewallRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if firewallRulesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = firewallRulesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "FirewallRulesClient.BeginCreateOrUpdate": + res.resp, res.err = f.dispatchBeginCreateOrUpdate(req) + case "FirewallRulesClient.BeginDelete": + res.resp, res.err = f.dispatchBeginDelete(req) + case "FirewallRulesClient.Get": + res.resp, res.err = f.dispatchGet(req) + case "FirewallRulesClient.NewListByServerPager": + res.resp, res.err = f.dispatchNewListByServerPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (f *FirewallRulesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -266,3 +282,9 @@ func (f *FirewallRulesServerTransport) dispatchNewListByServerPager(req *http.Re } return resp, nil } + +// set this to conditionally intercept incoming requests to FirewallRulesServerTransport +var firewallRulesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/internal.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/internal.go index be04ff43d678..e3def49261ba 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/internal.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/internal.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -14,6 +11,11 @@ import ( "sync" ) +type result struct { + resp *http.Response + err error +} + type nonRetriableError struct { error } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/locationbasedperformancetier_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/locationbasedperformancetier_server.go index b674d20ec95b..79da176dc8ad 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/locationbasedperformancetier_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/locationbasedperformancetier_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -52,21 +49,40 @@ func (l *LocationBasedPerformanceTierServerTransport) Do(req *http.Request) (*ht return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return l.dispatchToMethodFake(req, method) +} - switch method { - case "LocationBasedPerformanceTierClient.NewListPager": - resp, err = l.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (l *LocationBasedPerformanceTierServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if locationBasedPerformanceTierServerTransportInterceptor != nil { + res.resp, res.err, intercepted = locationBasedPerformanceTierServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "LocationBasedPerformanceTierClient.NewListPager": + res.resp, res.err = l.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (l *LocationBasedPerformanceTierServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -102,3 +118,9 @@ func (l *LocationBasedPerformanceTierServerTransport) dispatchNewListPager(req * } return resp, nil } + +// set this to conditionally intercept incoming requests to LocationBasedPerformanceTierServerTransport +var locationBasedPerformanceTierServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/logfiles_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/logfiles_server.go index c0ef941de6d3..0f2176d65fe4 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/logfiles_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/logfiles_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -52,21 +49,40 @@ func (l *LogFilesServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return l.dispatchToMethodFake(req, method) +} - switch method { - case "LogFilesClient.NewListByServerPager": - resp, err = l.dispatchNewListByServerPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (l *LogFilesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if logFilesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = logFilesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "LogFilesClient.NewListByServerPager": + res.resp, res.err = l.dispatchNewListByServerPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (l *LogFilesServerTransport) dispatchNewListByServerPager(req *http.Request) (*http.Response, error) { @@ -106,3 +122,9 @@ func (l *LogFilesServerTransport) dispatchNewListByServerPager(req *http.Request } return resp, nil } + +// set this to conditionally intercept incoming requests to LogFilesServerTransport +var logFilesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/operations_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/operations_server.go index 955c3f8b2767..dba0d4e5d3d2 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/operations_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/operations_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -47,21 +44,40 @@ func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return o.dispatchToMethodFake(req, method) +} - switch method { - case "OperationsClient.List": - resp, err = o.dispatchList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if operationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperationsClient.List": + res.resp, res.err = o.dispatchList(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (o *OperationsServerTransport) dispatchList(req *http.Request) (*http.Response, error) { @@ -82,3 +98,9 @@ func (o *OperationsServerTransport) dispatchList(req *http.Request) (*http.Respo } return resp, nil } + +// set this to conditionally intercept incoming requests to OperationsServerTransport +var operationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/privateendpointconnections_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/privateendpointconnections_server.go index b4281e23de74..bd5964ee3d56 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/privateendpointconnections_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/privateendpointconnections_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -76,29 +73,48 @@ func (p *PrivateEndpointConnectionsServerTransport) Do(req *http.Request) (*http return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return p.dispatchToMethodFake(req, method) +} - switch method { - case "PrivateEndpointConnectionsClient.BeginCreateOrUpdate": - resp, err = p.dispatchBeginCreateOrUpdate(req) - case "PrivateEndpointConnectionsClient.BeginDelete": - resp, err = p.dispatchBeginDelete(req) - case "PrivateEndpointConnectionsClient.Get": - resp, err = p.dispatchGet(req) - case "PrivateEndpointConnectionsClient.NewListByServerPager": - resp, err = p.dispatchNewListByServerPager(req) - case "PrivateEndpointConnectionsClient.BeginUpdateTags": - resp, err = p.dispatchBeginUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (p *PrivateEndpointConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if privateEndpointConnectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = privateEndpointConnectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "PrivateEndpointConnectionsClient.BeginCreateOrUpdate": + res.resp, res.err = p.dispatchBeginCreateOrUpdate(req) + case "PrivateEndpointConnectionsClient.BeginDelete": + res.resp, res.err = p.dispatchBeginDelete(req) + case "PrivateEndpointConnectionsClient.Get": + res.resp, res.err = p.dispatchGet(req) + case "PrivateEndpointConnectionsClient.NewListByServerPager": + res.resp, res.err = p.dispatchNewListByServerPager(req) + case "PrivateEndpointConnectionsClient.BeginUpdateTags": + res.resp, res.err = p.dispatchBeginUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (p *PrivateEndpointConnectionsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -330,3 +346,9 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchBeginUpdateTags(req return resp, nil } + +// set this to conditionally intercept incoming requests to PrivateEndpointConnectionsServerTransport +var privateEndpointConnectionsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/privatelinkresources_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/privatelinkresources_server.go index 058600f609f1..9246770cf796 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/privatelinkresources_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/privatelinkresources_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -58,23 +55,42 @@ func (p *PrivateLinkResourcesServerTransport) Do(req *http.Request) (*http.Respo return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return p.dispatchToMethodFake(req, method) +} - 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) - } +func (p *PrivateLinkResourcesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if privateLinkResourcesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = privateLinkResourcesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "PrivateLinkResourcesClient.Get": + res.resp, res.err = p.dispatchGet(req) + case "PrivateLinkResourcesClient.NewListByServerPager": + res.resp, res.err = p.dispatchNewListByServerPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (p *PrivateLinkResourcesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -154,3 +170,9 @@ func (p *PrivateLinkResourcesServerTransport) dispatchNewListByServerPager(req * } return resp, nil } + +// set this to conditionally intercept incoming requests to PrivateLinkResourcesServerTransport +var privateLinkResourcesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/recoverableservers_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/recoverableservers_server.go index d63ca00cfa12..5ba98ce4ae7b 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/recoverableservers_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/recoverableservers_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -49,21 +46,40 @@ func (r *RecoverableServersServerTransport) Do(req *http.Request) (*http.Respons return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return r.dispatchToMethodFake(req, method) +} - switch method { - case "RecoverableServersClient.Get": - resp, err = r.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (r *RecoverableServersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if recoverableServersServerTransportInterceptor != nil { + res.resp, res.err, intercepted = recoverableServersServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "RecoverableServersClient.Get": + res.resp, res.err = r.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (r *RecoverableServersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -98,3 +114,9 @@ func (r *RecoverableServersServerTransport) dispatchGet(req *http.Request) (*htt } return resp, nil } + +// set this to conditionally intercept incoming requests to RecoverableServersServerTransport +var recoverableServersServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/replicas_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/replicas_server.go index 5dc841b48b9f..cc3579809f66 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/replicas_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/replicas_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -52,21 +49,40 @@ func (r *ReplicasServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return r.dispatchToMethodFake(req, method) +} - switch method { - case "ReplicasClient.NewListByServerPager": - resp, err = r.dispatchNewListByServerPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (r *ReplicasServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if replicasServerTransportInterceptor != nil { + res.resp, res.err, intercepted = replicasServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ReplicasClient.NewListByServerPager": + res.resp, res.err = r.dispatchNewListByServerPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (r *ReplicasServerTransport) dispatchNewListByServerPager(req *http.Request) (*http.Response, error) { @@ -106,3 +122,9 @@ func (r *ReplicasServerTransport) dispatchNewListByServerPager(req *http.Request } return resp, nil } + +// set this to conditionally intercept incoming requests to ReplicasServerTransport +var replicasServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/server_factory.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/server_factory.go index 24fe8f868ef0..dcf0140c1e5d 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/server_factory.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/server_factory.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -19,24 +16,59 @@ import ( // ServerFactory is a fake server for instances of the armpostgresql.ClientFactory type. type ServerFactory struct { - CheckNameAvailabilityServer CheckNameAvailabilityServer - ConfigurationsServer ConfigurationsServer - DatabasesServer DatabasesServer - FirewallRulesServer FirewallRulesServer + // CheckNameAvailabilityServer contains the fakes for client CheckNameAvailabilityClient + CheckNameAvailabilityServer CheckNameAvailabilityServer + + // ConfigurationsServer contains the fakes for client ConfigurationsClient + ConfigurationsServer ConfigurationsServer + + // DatabasesServer contains the fakes for client DatabasesClient + DatabasesServer DatabasesServer + + // FirewallRulesServer contains the fakes for client FirewallRulesClient + FirewallRulesServer FirewallRulesServer + + // LocationBasedPerformanceTierServer contains the fakes for client LocationBasedPerformanceTierClient LocationBasedPerformanceTierServer LocationBasedPerformanceTierServer - LogFilesServer LogFilesServer - OperationsServer OperationsServer - PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer - PrivateLinkResourcesServer PrivateLinkResourcesServer - RecoverableServersServer RecoverableServersServer - ReplicasServer ReplicasServer - ServerAdministratorsServer ServerAdministratorsServer - ServerBasedPerformanceTierServer ServerBasedPerformanceTierServer - ServerKeysServer ServerKeysServer - ServerParametersServer ServerParametersServer - ServerSecurityAlertPoliciesServer ServerSecurityAlertPoliciesServer - ServersServer ServersServer - VirtualNetworkRulesServer VirtualNetworkRulesServer + + // LogFilesServer contains the fakes for client LogFilesClient + LogFilesServer LogFilesServer + + // OperationsServer contains the fakes for client OperationsClient + OperationsServer OperationsServer + + // PrivateEndpointConnectionsServer contains the fakes for client PrivateEndpointConnectionsClient + PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer + + // PrivateLinkResourcesServer contains the fakes for client PrivateLinkResourcesClient + PrivateLinkResourcesServer PrivateLinkResourcesServer + + // RecoverableServersServer contains the fakes for client RecoverableServersClient + RecoverableServersServer RecoverableServersServer + + // ReplicasServer contains the fakes for client ReplicasClient + ReplicasServer ReplicasServer + + // ServerAdministratorsServer contains the fakes for client ServerAdministratorsClient + ServerAdministratorsServer ServerAdministratorsServer + + // ServerBasedPerformanceTierServer contains the fakes for client ServerBasedPerformanceTierClient + ServerBasedPerformanceTierServer ServerBasedPerformanceTierServer + + // ServerKeysServer contains the fakes for client ServerKeysClient + ServerKeysServer ServerKeysServer + + // ServerParametersServer contains the fakes for client ServerParametersClient + ServerParametersServer ServerParametersServer + + // ServerSecurityAlertPoliciesServer contains the fakes for client ServerSecurityAlertPoliciesClient + ServerSecurityAlertPoliciesServer ServerSecurityAlertPoliciesServer + + // ServersServer contains the fakes for client ServersClient + ServersServer ServersServer + + // VirtualNetworkRulesServer contains the fakes for client VirtualNetworkRulesClient + VirtualNetworkRulesServer VirtualNetworkRulesServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/serveradministrators_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/serveradministrators_server.go index 99fba62630d5..16f3006876c4 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/serveradministrators_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/serveradministrators_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -69,27 +66,46 @@ func (s *ServerAdministratorsServerTransport) Do(req *http.Request) (*http.Respo return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "ServerAdministratorsClient.BeginCreateOrUpdate": - resp, err = s.dispatchBeginCreateOrUpdate(req) - case "ServerAdministratorsClient.BeginDelete": - resp, err = s.dispatchBeginDelete(req) - case "ServerAdministratorsClient.Get": - resp, err = s.dispatchGet(req) - case "ServerAdministratorsClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *ServerAdministratorsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if serverAdministratorsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = serverAdministratorsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ServerAdministratorsClient.BeginCreateOrUpdate": + res.resp, res.err = s.dispatchBeginCreateOrUpdate(req) + case "ServerAdministratorsClient.BeginDelete": + res.resp, res.err = s.dispatchBeginDelete(req) + case "ServerAdministratorsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "ServerAdministratorsClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *ServerAdministratorsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -254,3 +270,9 @@ func (s *ServerAdministratorsServerTransport) dispatchNewListPager(req *http.Req } return resp, nil } + +// set this to conditionally intercept incoming requests to ServerAdministratorsServerTransport +var serverAdministratorsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/serverbasedperformancetier_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/serverbasedperformancetier_server.go index 3b0c1bb684ce..3ea749dc512c 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/serverbasedperformancetier_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/serverbasedperformancetier_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -52,21 +49,40 @@ func (s *ServerBasedPerformanceTierServerTransport) Do(req *http.Request) (*http return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "ServerBasedPerformanceTierClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *ServerBasedPerformanceTierServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if serverBasedPerformanceTierServerTransportInterceptor != nil { + res.resp, res.err, intercepted = serverBasedPerformanceTierServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ServerBasedPerformanceTierClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *ServerBasedPerformanceTierServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -106,3 +122,9 @@ func (s *ServerBasedPerformanceTierServerTransport) dispatchNewListPager(req *ht } return resp, nil } + +// set this to conditionally intercept incoming requests to ServerBasedPerformanceTierServerTransport +var serverBasedPerformanceTierServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/serverkeys_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/serverkeys_server.go index c3254f64f11c..80f1b327267b 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/serverkeys_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/serverkeys_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -70,27 +67,46 @@ func (s *ServerKeysServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "ServerKeysClient.BeginCreateOrUpdate": - resp, err = s.dispatchBeginCreateOrUpdate(req) - case "ServerKeysClient.BeginDelete": - resp, err = s.dispatchBeginDelete(req) - case "ServerKeysClient.Get": - resp, err = s.dispatchGet(req) - case "ServerKeysClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *ServerKeysServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if serverKeysServerTransportInterceptor != nil { + res.resp, res.err, intercepted = serverKeysServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ServerKeysClient.BeginCreateOrUpdate": + res.resp, res.err = s.dispatchBeginCreateOrUpdate(req) + case "ServerKeysClient.BeginDelete": + res.resp, res.err = s.dispatchBeginDelete(req) + case "ServerKeysClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "ServerKeysClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *ServerKeysServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (s *ServerKeysServerTransport) dispatchNewListPager(req *http.Request) (*ht } return resp, nil } + +// set this to conditionally intercept incoming requests to ServerKeysServerTransport +var serverKeysServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/serverparameters_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/serverparameters_server.go index 7e4df0afa08e..3a20ae51d740 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/serverparameters_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/serverparameters_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -53,21 +50,40 @@ func (s *ServerParametersServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "ServerParametersClient.BeginListUpdateConfigurations": - resp, err = s.dispatchBeginListUpdateConfigurations(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *ServerParametersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if serverParametersServerTransportInterceptor != nil { + res.resp, res.err, intercepted = serverParametersServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ServerParametersClient.BeginListUpdateConfigurations": + res.resp, res.err = s.dispatchBeginListUpdateConfigurations(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *ServerParametersServerTransport) dispatchBeginListUpdateConfigurations(req *http.Request) (*http.Response, error) { @@ -117,3 +133,9 @@ func (s *ServerParametersServerTransport) dispatchBeginListUpdateConfigurations( return resp, nil } + +// set this to conditionally intercept incoming requests to ServerParametersServerTransport +var serverParametersServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/servers_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/servers_server.go index 0b95105709f0..51a091c10137 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/servers_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/servers_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -44,7 +41,7 @@ type ServersServer struct { NewListByResourceGroupPager func(resourceGroupName string, options *armpostgresql.ServersClientListByResourceGroupOptions) (resp azfake.PagerResponder[armpostgresql.ServersClientListByResourceGroupResponse]) // BeginRestart is the fake for method ServersClient.BeginRestart - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginRestart func(ctx context.Context, resourceGroupName string, serverName string, options *armpostgresql.ServersClientBeginRestartOptions) (resp azfake.PollerResponder[armpostgresql.ServersClientRestartResponse], errResp azfake.ErrorResponder) // BeginUpdate is the fake for method ServersClient.BeginUpdate @@ -87,33 +84,52 @@ func (s *ServersServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "ServersClient.BeginCreate": - resp, err = s.dispatchBeginCreate(req) - case "ServersClient.BeginDelete": - resp, err = s.dispatchBeginDelete(req) - case "ServersClient.Get": - resp, err = s.dispatchGet(req) - case "ServersClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - case "ServersClient.NewListByResourceGroupPager": - resp, err = s.dispatchNewListByResourceGroupPager(req) - case "ServersClient.BeginRestart": - resp, err = s.dispatchBeginRestart(req) - case "ServersClient.BeginUpdate": - resp, err = s.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return s.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (s *ServersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - return resp, nil + go func() { + var intercepted bool + var res result + if serversServerTransportInterceptor != nil { + res.resp, res.err, intercepted = serversServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ServersClient.BeginCreate": + res.resp, res.err = s.dispatchBeginCreate(req) + case "ServersClient.BeginDelete": + res.resp, res.err = s.dispatchBeginDelete(req) + case "ServersClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "ServersClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + case "ServersClient.NewListByResourceGroupPager": + res.resp, res.err = s.dispatchNewListByResourceGroupPager(req) + case "ServersClient.BeginRestart": + res.resp, res.err = s.dispatchBeginRestart(req) + case "ServersClient.BeginUpdate": + res.resp, res.err = s.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *ServersServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { @@ -338,9 +354,9 @@ func (s *ServersServerTransport) dispatchBeginRestart(req *http.Request) (*http. return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginRestart.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginRestart) { s.beginRestart.remove(req) @@ -396,3 +412,9 @@ func (s *ServersServerTransport) dispatchBeginUpdate(req *http.Request) (*http.R return resp, nil } + +// set this to conditionally intercept incoming requests to ServersServerTransport +var serversServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/serversecurityalertpolicies_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/serversecurityalertpolicies_server.go index 7cb6ad87018d..edeb213c6f0c 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/serversecurityalertpolicies_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/serversecurityalertpolicies_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -64,25 +61,44 @@ func (s *ServerSecurityAlertPoliciesServerTransport) Do(req *http.Request) (*htt return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate": - resp, err = s.dispatchBeginCreateOrUpdate(req) - case "ServerSecurityAlertPoliciesClient.Get": - resp, err = s.dispatchGet(req) - case "ServerSecurityAlertPoliciesClient.NewListByServerPager": - resp, err = s.dispatchNewListByServerPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *ServerSecurityAlertPoliciesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if serverSecurityAlertPoliciesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = serverSecurityAlertPoliciesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate": + res.resp, res.err = s.dispatchBeginCreateOrUpdate(req) + case "ServerSecurityAlertPoliciesClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "ServerSecurityAlertPoliciesClient.NewListByServerPager": + res.resp, res.err = s.dispatchNewListByServerPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *ServerSecurityAlertPoliciesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -226,3 +242,9 @@ func (s *ServerSecurityAlertPoliciesServerTransport) dispatchNewListByServerPage } return resp, nil } + +// set this to conditionally intercept incoming requests to ServerSecurityAlertPoliciesServerTransport +var serverSecurityAlertPoliciesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/time_rfc3339.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/time_rfc3339.go deleted file mode 100644 index b0535a7b63e6..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/time_rfc3339.go +++ /dev/null @@ -1,86 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) - -const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { - layout = dateTimeJSON - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { - layout = time.RFC3339Nano - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/fake/virtualnetworkrules_server.go b/sdk/resourcemanager/postgresql/armpostgresql/fake/virtualnetworkrules_server.go index b4e7ead0bd8d..77583dfb4a22 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/fake/virtualnetworkrules_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/fake/virtualnetworkrules_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -70,27 +67,46 @@ func (v *VirtualNetworkRulesServerTransport) Do(req *http.Request) (*http.Respon return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VirtualNetworkRulesClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VirtualNetworkRulesClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VirtualNetworkRulesClient.Get": - resp, err = v.dispatchGet(req) - case "VirtualNetworkRulesClient.NewListByServerPager": - resp, err = v.dispatchNewListByServerPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VirtualNetworkRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if virtualNetworkRulesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = virtualNetworkRulesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VirtualNetworkRulesClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VirtualNetworkRulesClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VirtualNetworkRulesClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VirtualNetworkRulesClient.NewListByServerPager": + res.resp, res.err = v.dispatchNewListByServerPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VirtualNetworkRulesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (v *VirtualNetworkRulesServerTransport) dispatchNewListByServerPager(req *h } return resp, nil } + +// set this to conditionally intercept incoming requests to VirtualNetworkRulesServerTransport +var virtualNetworkRulesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/firewallrules_client.go b/sdk/resourcemanager/postgresql/armpostgresql/firewallrules_client.go index 5fe848a4de77..9a4d29a32662 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/firewallrules_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/firewallrules_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -96,7 +93,7 @@ func (client *FirewallRulesClient) createOrUpdate(ctx context.Context, resourceG } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *FirewallRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters FirewallRule, options *FirewallRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *FirewallRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters FirewallRule, _ *FirewallRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -180,7 +177,7 @@ func (client *FirewallRulesClient) deleteOperation(ctx context.Context, resource } // deleteCreateRequest creates the Delete request. -func (client *FirewallRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *FirewallRulesClientBeginDeleteOptions) (*policy.Request, error) { +func (client *FirewallRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, _ *FirewallRulesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -240,7 +237,7 @@ func (client *FirewallRulesClient) Get(ctx context.Context, resourceGroupName st } // getCreateRequest creates the Get request. -func (client *FirewallRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *FirewallRulesClientGetOptions) (*policy.Request, error) { +func (client *FirewallRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, _ *FirewallRulesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -310,7 +307,7 @@ func (client *FirewallRulesClient) NewListByServerPager(resourceGroupName string } // listByServerCreateRequest creates the ListByServer request. -func (client *FirewallRulesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *FirewallRulesClientListByServerOptions) (*policy.Request, error) { +func (client *FirewallRulesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *FirewallRulesClientListByServerOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/firewallRules" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") diff --git a/sdk/resourcemanager/postgresql/armpostgresql/firewallrules_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/firewallrules_client_example_test.go deleted file mode 100644 index e11f98ddaf7c..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/firewallrules_client_example_test.go +++ /dev/null @@ -1,153 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresql_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/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/FirewallRuleCreate.json -func ExampleFirewallRulesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallRulesClient().BeginCreateOrUpdate(ctx, "TestGroup", "testserver", "rule1", armpostgresql.FirewallRule{ - Properties: &armpostgresql.FirewallRuleProperties{ - EndIPAddress: to.Ptr("255.255.255.255"), - StartIPAddress: to.Ptr("0.0.0.0"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallRule = armpostgresql.FirewallRule{ - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/firewallRules/rule1"), - // Properties: &armpostgresql.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.255.255.255"), - // StartIPAddress: to.Ptr("0.0.0.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/FirewallRuleDelete.json -func ExampleFirewallRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallRulesClient().BeginDelete(ctx, "TestGroup", "testserver", "rule1", 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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/FirewallRuleGet.json -func ExampleFirewallRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallRulesClient().Get(ctx, "TestGroup", "testserver", "rule1", 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.FirewallRule = armpostgresql.FirewallRule{ - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/firewallRules/rule1"), - // Properties: &armpostgresql.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.255.255.255"), - // StartIPAddress: to.Ptr("0.0.0.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/FirewallRuleListByServer.json -func ExampleFirewallRulesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFirewallRulesClient().NewListByServerPager("TestGroup", "testserver", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FirewallRuleListResult = armpostgresql.FirewallRuleListResult{ - // Value: []*armpostgresql.FirewallRule{ - // { - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/firewallRules/rule1"), - // Properties: &armpostgresql.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.255.255.255"), - // StartIPAddress: to.Ptr("0.0.0.0"), - // }, - // }, - // { - // Name: to.Ptr("rule2"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/firewallRules/rule2"), - // Properties: &armpostgresql.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.0.0.0"), - // StartIPAddress: to.Ptr("1.0.0.0"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/go.mod b/sdk/resourcemanager/postgresql/armpostgresql/go.mod index c507173afa42..d14b2f1dbda4 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/go.mod +++ b/sdk/resourcemanager/postgresql/armpostgresql/go.mod @@ -4,7 +4,6 @@ go 1.23.0 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 @@ -12,6 +11,7 @@ require ( ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/golang-jwt/jwt/v5 v5.2.2 // indirect diff --git a/sdk/resourcemanager/postgresql/armpostgresql/interfaces.go b/sdk/resourcemanager/postgresql/armpostgresql/interfaces.go index 24c5bd26672e..e60234588c9c 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/interfaces.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/interfaces.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. diff --git a/sdk/resourcemanager/postgresql/armpostgresql/locationbasedperformancetier_client.go b/sdk/resourcemanager/postgresql/armpostgresql/locationbasedperformancetier_client.go index b586730ef207..930c4e5f7f05 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/locationbasedperformancetier_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/locationbasedperformancetier_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -74,7 +71,7 @@ func (client *LocationBasedPerformanceTierClient) NewListPager(locationName stri } // listCreateRequest creates the List request. -func (client *LocationBasedPerformanceTierClient) listCreateRequest(ctx context.Context, locationName string, options *LocationBasedPerformanceTierClientListOptions) (*policy.Request, error) { +func (client *LocationBasedPerformanceTierClient) listCreateRequest(ctx context.Context, locationName string, _ *LocationBasedPerformanceTierClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/performanceTiers" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") diff --git a/sdk/resourcemanager/postgresql/armpostgresql/locationbasedperformancetier_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/locationbasedperformancetier_client_example_test.go deleted file mode 100644 index ec07a5fe6dfb..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/locationbasedperformancetier_client_example_test.go +++ /dev/null @@ -1,206 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/PerformanceTiersListByLocation.json -func ExampleLocationBasedPerformanceTierClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLocationBasedPerformanceTierClient().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.PerformanceTierListResult = armpostgresql.PerformanceTierListResult{ - // Value: []*armpostgresql.PerformanceTierProperties{ - // { - // ID: to.Ptr("Basic"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxLargeStorageMB: to.Ptr[int32](0), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinLargeStorageMB: to.Ptr[int32](0), - // MinStorageMB: to.Ptr[int32](5120), - // ServiceLevelObjectives: []*armpostgresql.PerformanceTierServiceLevelObjectives{ - // { - // Edition: to.Ptr("Basic"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("B_Gen5_1"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](1048576), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](1), - // }, - // { - // Edition: to.Ptr("Basic"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("B_Gen5_2"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](1048576), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](2), - // }}, - // }, - // { - // ID: to.Ptr("GeneralPurpose"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxLargeStorageMB: to.Ptr[int32](16777216), - // MaxStorageMB: to.Ptr[int32](16777216), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinLargeStorageMB: to.Ptr[int32](0), - // MinStorageMB: to.Ptr[int32](5120), - // ServiceLevelObjectives: []*armpostgresql.PerformanceTierServiceLevelObjectives{ - // { - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("GP_Gen5_2"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](2), - // }, - // { - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("GP_Gen5_4"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](4), - // }, - // { - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("GP_Gen5_8"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](8), - // }, - // { - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("GP_Gen5_16"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](16), - // }, - // { - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("GP_Gen5_32"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](32), - // }, - // { - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("GP_Gen5_64"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](32), - // }}, - // }, - // { - // ID: to.Ptr("MemoryOptimized"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxLargeStorageMB: to.Ptr[int32](16777216), - // MaxStorageMB: to.Ptr[int32](16777216), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinLargeStorageMB: to.Ptr[int32](0), - // MinStorageMB: to.Ptr[int32](5120), - // ServiceLevelObjectives: []*armpostgresql.PerformanceTierServiceLevelObjectives{ - // { - // Edition: to.Ptr("MemoryOptimized"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("MO_Gen5_2"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](2), - // }, - // { - // Edition: to.Ptr("MemoryOptimized"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("MO_Gen5_4"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](4), - // }, - // { - // Edition: to.Ptr("MemoryOptimized"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("MO_Gen5_8"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](8), - // }, - // { - // Edition: to.Ptr("MemoryOptimized"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("MO_Gen5_16"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](16), - // }, - // { - // Edition: to.Ptr("MemoryOptimized"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("MO_Gen5_32"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](32), - // }}, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/logfiles_client.go b/sdk/resourcemanager/postgresql/armpostgresql/logfiles_client.go index beb25dd4c4e2..2968ae496bf2 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/logfiles_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/logfiles_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -75,7 +72,7 @@ func (client *LogFilesClient) NewListByServerPager(resourceGroupName string, ser } // listByServerCreateRequest creates the ListByServer request. -func (client *LogFilesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *LogFilesClientListByServerOptions) (*policy.Request, error) { +func (client *LogFilesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *LogFilesClientListByServerOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/logFiles" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") diff --git a/sdk/resourcemanager/postgresql/armpostgresql/logfiles_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/logfiles_client_example_test.go deleted file mode 100644 index 35a4f1a08df7..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/logfiles_client_example_test.go +++ /dev/null @@ -1,70 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/LogFileListByServer.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 := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLogFilesClient().NewListByServerPager("TestGroup", "testserver", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LogFileListResult = armpostgresql.LogFileListResult{ - // Value: []*armpostgresql.LogFile{ - // { - // Name: to.Ptr("postgresql-2017-06-22_010000.log"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/logFiles"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/logFiles/postgresql-2017-06-22_010000.log"), - // Properties: &armpostgresql.LogFileProperties{ - // Type: to.Ptr("text"), - // 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, "2017-06-22T01:59:36.000Z"); return t}()), - // SizeInKB: to.Ptr[int64](4), - // URL: to.Ptr("https://wasd2stageneu1btlm4.file.core.windows.net/42679871f6cc4302b39ab9c2e3044df3/pg_log/postgresql-2017-06-22_010000.log?sv=2015-04-05&sr=f&sig=gqIQsa6VyGyUNpzYYPWLP5gM%2BeF1so9GYbHKu6Zs0DM%3D&se=2017-06-22T03%3A21%3A09Z&sp=r"), - // }, - // }, - // { - // Name: to.Ptr("postgresql-2017-06-22_020000.log"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/logFiles"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/logFiles/postgresql-2017-06-22_020000.log"), - // Properties: &armpostgresql.LogFileProperties{ - // Type: to.Ptr("text"), - // 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, "2017-06-22T02:19:36.000Z"); return t}()), - // SizeInKB: to.Ptr[int64](1), - // URL: to.Ptr("https://wasd2stageneu1btlm4.file.core.windows.net/42679871f6cc4302b39ab9c2e3044df3/pg_log/postgresql-2017-06-22_020000.log?sv=2015-04-05&sr=f&sig=i99UWBlYfR0tKaxix8yHAOnfym4HV9Auto6BbZogyRs%3D&se=2017-06-22T03%3A21%3A09Z&sp=r"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/models.go b/sdk/resourcemanager/postgresql/armpostgresql/models.go index c1a2daad6619..3209abb0c78c 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/models.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/models.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. diff --git a/sdk/resourcemanager/postgresql/armpostgresql/models_serde.go b/sdk/resourcemanager/postgresql/armpostgresql/models_serde.go index 6e1ff5dca7b8..bbeee10e553b 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/models_serde.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/models_serde.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -2563,7 +2560,7 @@ func populateAny(m map[string]any, k string, v any) { } func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil { + if data == nil || string(data) == "null" { return nil } if err := json.Unmarshal(data, v); err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresql/operations_client.go b/sdk/resourcemanager/postgresql/armpostgresql/operations_client.go index 54d2ee03d1d0..b789f2ec3399 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/operations_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/operations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -65,7 +62,7 @@ func (client *OperationsClient) List(ctx context.Context, options *OperationsCli } // listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { +func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *OperationsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.DBforPostgreSQL/operations" req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { diff --git a/sdk/resourcemanager/postgresql/armpostgresql/operations_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/operations_client_example_test.go deleted file mode 100644 index ab1081e3bc84..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/operations_client_example_test.go +++ /dev/null @@ -1,207 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/OperationList.json -func ExampleOperationsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOperationsClient().List(ctx, 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.OperationListResult = armpostgresql.OperationListResult{ - // Value: []*armpostgresql.Operation{ - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/locations/performanceTiers/read"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Returns the list of Performance Tiers available."), - // Operation: to.Ptr("List Performance Tiers"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Performance Tiers"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/read"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Return the list of servers or gets the properties for the specified server."), - // Operation: to.Ptr("List/Get PostgreSQL Servers"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("PostgreSQL Server"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/write"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Creates a server with the specified parameters or update the properties or tags for the specified server."), - // Operation: to.Ptr("Create/Update PostgreSQL Server"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("PostgreSQL Server"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/delete"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Deletes an existing server."), - // Operation: to.Ptr("Delete PostgreSQL Server"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("PostgreSQL Server"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/performanceTiers/read"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Returns the list of Performance Tiers available."), - // Operation: to.Ptr("List Performance Tiers"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Performance Tiers"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules/read"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Return the list of firewall rules for a server or gets the properties for the specified firewall rule."), - // Operation: to.Ptr("List/Get Firewall Rules"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Firewall Rules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules/write"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Creates a firewall rule with the specified parameters or update an existing rule."), - // Operation: to.Ptr("Create/Update Firewall Rule"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Firewall Rules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules/delete"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Deletes an existing firewall rule."), - // Operation: to.Ptr("Delete Firewall Rule"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Firewall Rules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/providers/Microsoft.Insights/metricDefinitions/read"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Return types of metrics that are available for databases"), - // Operation: to.Ptr("Get database metric definitions"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Database Metric Definition"), - // }, - // Properties: map[string]any{ - // "serviceSpecification": map[string]any{ - // "metricSpecifications":[]any{ - // map[string]any{ - // "name": "cpu_percent", - // "aggregationType": "Average", - // "displayDescription": "CPU percent", - // "displayName": "CPU percent", - // "fillGapWithZero": true, - // "unit": "Percent", - // }, - // map[string]any{ - // "name": "memory_percent", - // "aggregationType": "Average", - // "displayDescription": "Memory percent", - // "displayName": "Memory percent", - // "fillGapWithZero": true, - // "unit": "Percent", - // }, - // map[string]any{ - // "name": "io_consumption_percent", - // "aggregationType": "Average", - // "displayDescription": "IO percent", - // "displayName": "IO percent", - // "fillGapWithZero": true, - // "unit": "Percent", - // }, - // map[string]any{ - // "name": "storage_percent", - // "aggregationType": "Average", - // "displayDescription": "Storage percentage", - // "displayName": "Storage percentage", - // "unit": "Percent", - // }, - // map[string]any{ - // "name": "storage_used", - // "aggregationType": "Average", - // "displayDescription": "Storage used", - // "displayName": "Storage used", - // "unit": "Bytes", - // }, - // map[string]any{ - // "name": "storage_limit", - // "aggregationType": "Average", - // "displayDescription": "Storage limit", - // "displayName": "Storage limit", - // "unit": "Bytes", - // }, - // map[string]any{ - // "name": "active_connections", - // "aggregationType": "Average", - // "displayDescription": "Total active connections", - // "displayName": "Total active connections", - // "fillGapWithZero": true, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "connections_failed", - // "aggregationType": "Average", - // "displayDescription": "Total failed connections", - // "displayName": "Total failed connections", - // "fillGapWithZero": true, - // "unit": "Count", - // }, - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/providers/Microsoft.Insights/diagnosticSettings/read"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Gets the disagnostic setting for the resource"), - // Operation: to.Ptr("Read diagnostic setting"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Database Metric Definition"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/providers/Microsoft.Insights/diagnosticSettings/write"), - // Display: &armpostgresql.OperationDisplay{ - // Description: to.Ptr("Creates or updates the diagnostic setting for the resource"), - // Operation: to.Ptr("Write diagnostic setting"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Database Metric Definition"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/options.go b/sdk/resourcemanager/postgresql/armpostgresql/options.go index 04a3103ccd01..37c691c5cb19 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/options.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/options.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -17,7 +14,7 @@ type CheckNameAvailabilityClientExecuteOptions struct { // ConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ConfigurationsClient.BeginCreateOrUpdate // method. type ConfigurationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -35,13 +32,13 @@ type ConfigurationsClientListByServerOptions struct { // DatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabasesClient.BeginCreateOrUpdate // method. type DatabasesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // DatabasesClientBeginDeleteOptions contains the optional parameters for the DatabasesClient.BeginDelete method. type DatabasesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -58,13 +55,13 @@ type DatabasesClientListByServerOptions struct { // FirewallRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the FirewallRulesClient.BeginCreateOrUpdate // method. type FirewallRulesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // FirewallRulesClientBeginDeleteOptions contains the optional parameters for the FirewallRulesClient.BeginDelete method. type FirewallRulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -98,21 +95,21 @@ type OperationsClientListOptions struct { // PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate // method. type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete // method. type PrivateEndpointConnectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // PrivateEndpointConnectionsClientBeginUpdateTagsOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginUpdateTags // method. type PrivateEndpointConnectionsClientBeginUpdateTagsOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -152,14 +149,14 @@ type ReplicasClientListByServerOptions struct { // ServerAdministratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerAdministratorsClient.BeginCreateOrUpdate // method. type ServerAdministratorsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ServerAdministratorsClientBeginDeleteOptions contains the optional parameters for the ServerAdministratorsClient.BeginDelete // method. type ServerAdministratorsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -183,13 +180,13 @@ type ServerBasedPerformanceTierClientListOptions struct { // ServerKeysClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerKeysClient.BeginCreateOrUpdate // method. type ServerKeysClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ServerKeysClientBeginDeleteOptions contains the optional parameters for the ServerKeysClient.BeginDelete method. type ServerKeysClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -206,14 +203,14 @@ type ServerKeysClientListOptions struct { // ServerParametersClientBeginListUpdateConfigurationsOptions contains the optional parameters for the ServerParametersClient.BeginListUpdateConfigurations // method. type ServerParametersClientBeginListUpdateConfigurationsOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate // method. type ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -231,25 +228,25 @@ type ServerSecurityAlertPoliciesClientListByServerOptions struct { // ServersClientBeginCreateOptions contains the optional parameters for the ServersClient.BeginCreate method. type ServersClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ServersClientBeginDeleteOptions contains the optional parameters for the ServersClient.BeginDelete method. type ServersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ServersClientBeginRestartOptions contains the optional parameters for the ServersClient.BeginRestart method. type ServersClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ServersClientBeginUpdateOptions contains the optional parameters for the ServersClient.BeginUpdate method. type ServersClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -272,14 +269,14 @@ type ServersClientListOptions struct { // VirtualNetworkRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginCreateOrUpdate // method. type VirtualNetworkRulesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkRulesClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginDelete // method. type VirtualNetworkRulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/polymorphic_helpers.go b/sdk/resourcemanager/postgresql/armpostgresql/polymorphic_helpers.go index 3f00b67c170c..4c8bfa9ddbdb 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/polymorphic_helpers.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/polymorphic_helpers.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -11,7 +8,7 @@ package armpostgresql import "encoding/json" func unmarshalServerPropertiesForCreateClassification(rawMsg json.RawMessage) (ServerPropertiesForCreateClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any diff --git a/sdk/resourcemanager/postgresql/armpostgresql/privateendpointconnections_client.go b/sdk/resourcemanager/postgresql/armpostgresql/privateendpointconnections_client.go index 380ce4eea86d..f8ac96c45304 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/privateendpointconnections_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/privateendpointconnections_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -94,7 +91,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdate(ctx context.Conte } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, _ *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -177,7 +174,7 @@ func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Cont } // deleteCreateRequest creates the Delete request. -func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, _ *PrivateEndpointConnectionsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -238,7 +235,7 @@ func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourc } // getCreateRequest creates the Get request. -func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, _ *PrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -307,7 +304,7 @@ func (client *PrivateEndpointConnectionsClient) NewListByServerPager(resourceGro } // listByServerCreateRequest creates the ListByServer request. -func (client *PrivateEndpointConnectionsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *PrivateEndpointConnectionsClientListByServerOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *PrivateEndpointConnectionsClientListByServerOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/privateEndpointConnections" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -393,7 +390,7 @@ func (client *PrivateEndpointConnectionsClient) updateTags(ctx context.Context, } // updateTagsCreateRequest creates the UpdateTags request. -func (client *PrivateEndpointConnectionsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters TagsObject, options *PrivateEndpointConnectionsClientBeginUpdateTagsOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters TagsObject, _ *PrivateEndpointConnectionsClientBeginUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") diff --git a/sdk/resourcemanager/postgresql/armpostgresql/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/privateendpointconnections_client_example_test.go deleted file mode 100644 index 68842d2c0caa..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,229 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresql_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/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/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 := armpostgresql.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", 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 = armpostgresql.PrivateEndpointConnection{ - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armpostgresql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateEndpointConnectionUpdate.json -func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginCreateOrUpdate(ctx, "Default", "test-svr", "private-endpoint-connection-name", armpostgresql.PrivateEndpointConnection{ - Properties: &armpostgresql.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armpostgresql.PrivateLinkServiceConnectionStateProperty{ - Description: to.Ptr("Approved by johndoe@contoso.com"), - Status: to.Ptr("Approved"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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 = armpostgresql.PrivateEndpointConnection{ - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armpostgresql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Approved by johndoe@contoso.com"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateEndpointConnectionDelete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "Default", "test-svr", "private-endpoint-connection-name", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, 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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateEndpointConnectionUpdateTags.json -func ExamplePrivateEndpointConnectionsClient_BeginUpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginUpdateTags(ctx, "Default", "test-svr", "private-endpoint-connection-name", armpostgresql.TagsObject{ - Tags: map[string]*string{ - "key1": to.Ptr("val1"), - "key2": to.Ptr("val2"), - "key3": to.Ptr("val3"), - }, - }, 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 = armpostgresql.PrivateEndpointConnection{ - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armpostgresql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Approved by johndoe@contoso.com"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/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 := armpostgresql.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 = armpostgresql.PrivateEndpointConnectionListResult{ - // Value: []*armpostgresql.PrivateEndpointConnection{ - // { - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name-2"), - // Properties: &armpostgresql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }, - // { - // Name: to.Ptr("private-endpoint-connection-name-2"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name-2"), - // Properties: &armpostgresql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name-2"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/privatelinkresources_client.go b/sdk/resourcemanager/postgresql/armpostgresql/privatelinkresources_client.go index 7a29775996d1..de33a2c36c26 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/privatelinkresources_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/privatelinkresources_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -75,7 +72,7 @@ func (client *PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroup } // getCreateRequest creates the Get request. -func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, groupName string, options *PrivateLinkResourcesClientGetOptions) (*policy.Request, error) { +func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, groupName string, _ *PrivateLinkResourcesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/privateLinkResources/{groupName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -144,7 +141,7 @@ func (client *PrivateLinkResourcesClient) NewListByServerPager(resourceGroupName } // listByServerCreateRequest creates the ListByServer request. -func (client *PrivateLinkResourcesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *PrivateLinkResourcesClientListByServerOptions) (*policy.Request, error) { +func (client *PrivateLinkResourcesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *PrivateLinkResourcesClientListByServerOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/privateLinkResources" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") diff --git a/sdk/resourcemanager/postgresql/armpostgresql/privatelinkresources_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/privatelinkresources_client_example_test.go deleted file mode 100644 index 8004a48c2c68..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,86 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/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 := armpostgresql.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 = armpostgresql.PrivateLinkResourceListResult{ - // Value: []*armpostgresql.PrivateLinkResource{ - // { - // Name: to.Ptr("plr"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateLinkResources"), - // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateLinkResources/plr"), - // Properties: &armpostgresql.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("postgresqlServer"), - // RequiredMembers: []*string{ - // to.Ptr("postgresqlServer")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/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 := armpostgresql.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 = armpostgresql.PrivateLinkResource{ - // Name: to.Ptr("plr"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/privateLinkResources"), - // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforPostgreSQL/servers/test-svr/privateLinkResources/plr"), - // Properties: &armpostgresql.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("postgresqlServer"), - // RequiredMembers: []*string{ - // to.Ptr("postgresqlServer")}, - // }, - // } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/recoverableservers_client.go b/sdk/resourcemanager/postgresql/armpostgresql/recoverableservers_client.go index 90b8b771efcd..fca542b339d7 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/recoverableservers_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/recoverableservers_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -73,7 +70,7 @@ func (client *RecoverableServersClient) Get(ctx context.Context, resourceGroupNa } // getCreateRequest creates the Get request. -func (client *RecoverableServersClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *RecoverableServersClientGetOptions) (*policy.Request, error) { +func (client *RecoverableServersClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *RecoverableServersClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/recoverableServers" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") diff --git a/sdk/resourcemanager/postgresql/armpostgresql/recoverableservers_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/recoverableservers_client_example_test.go deleted file mode 100644 index 54a7b75c8c90..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/recoverableservers_client_example_test.go +++ /dev/null @@ -1,51 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/RecoverableServersGet.json -func ExampleRecoverableServersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRecoverableServersClient().Get(ctx, "testrg", "pgtestsvc4", 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.RecoverableServerResource = armpostgresql.RecoverableServerResource{ - // Name: to.Ptr("recoverableServers"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/recoverableServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4/recoverableServers"), - // Properties: &armpostgresql.RecoverableServerProperties{ - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // LastAvailableBackupDateTime: to.Ptr("2020-11-20T01:06:29.78Z"), - // ServiceLevelObjective: to.Ptr("GP_Gen5_2"), - // VCore: to.Ptr[int32](2), - // Version: to.Ptr("9.6"), - // }, - // } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/replicas_client.go b/sdk/resourcemanager/postgresql/armpostgresql/replicas_client.go index 6a45585c54d5..510cd85b510d 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/replicas_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/replicas_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -75,7 +72,7 @@ func (client *ReplicasClient) NewListByServerPager(resourceGroupName string, ser } // listByServerCreateRequest creates the ListByServer request. -func (client *ReplicasClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ReplicasClientListByServerOptions) (*policy.Request, error) { +func (client *ReplicasClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ReplicasClientListByServerOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/replicas" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") diff --git a/sdk/resourcemanager/postgresql/armpostgresql/replicas_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/replicas_client_example_test.go deleted file mode 100644 index a331f36df66a..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/replicas_client_example_test.go +++ /dev/null @@ -1,186 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ReplicasListByServer.json -func ExampleReplicasClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicasClient().NewListByServerPager("TestGroup_WestCentralUS", "testserver-master", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerListResult = armpostgresql.ServerListResult{ - // Value: []*armpostgresql.Server{ - // { - // Name: to.Ptr("testserver-replica1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica1"), - // Location: to.Ptr("westcentralus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("postgres"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T00:05:03.269Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("testserver-replica1.postgres.database.azure.com"), - // MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"), - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr("Replica"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumDisabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](2048000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen4_16"), - // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("testserver-replica2"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica2"), - // Location: to.Ptr("westcentralus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("postgres"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T00:05:03.269Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("testserver-replica2.postgres.database.azure.com"), - // MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"), - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr("Replica"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumDisabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](2048000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen4_16"), - // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("testserver-replica3"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica3"), - // Location: to.Ptr("westcentralus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("postgres"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T00:05:03.269Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("testserver-replica3.postgres.database.azure.com"), - // MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"), - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr("Replica"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumDisabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](2048000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen4_16"), - // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("testserver-replica4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica4"), - // Location: to.Ptr("westcentralus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("postgres"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T00:05:03.269Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("testserver-replica4.postgres.database.azure.com"), - // MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"), - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr("Replica"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumDisabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](2048000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen4_16"), - // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("testserver-replica5"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica5"), - // Location: to.Ptr("westcentralus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("postgres"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T00:05:03.269Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("testserver-replica5.postgres.database.azure.com"), - // MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"), - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr("Replica"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumDisabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](2048000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen4_16"), - // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/response_types.go b/sdk/resourcemanager/postgresql/armpostgresql/responses.go similarity index 99% rename from sdk/resourcemanager/postgresql/armpostgresql/response_types.go rename to sdk/resourcemanager/postgresql/armpostgresql/responses.go index 421b665576a0..778b612b6bf6 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/response_types.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/responses.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. diff --git a/sdk/resourcemanager/postgresql/armpostgresql/serveradministrators_client.go b/sdk/resourcemanager/postgresql/armpostgresql/serveradministrators_client.go index b3a2b83cc97e..a7d6bf7362a1 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/serveradministrators_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/serveradministrators_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -97,7 +94,7 @@ func (client *ServerAdministratorsClient) createOrUpdate(ctx context.Context, re } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ServerAdministratorsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, properties ServerAdministratorResource, options *ServerAdministratorsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ServerAdministratorsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, properties ServerAdministratorResource, _ *ServerAdministratorsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/administrators/activeDirectory" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -176,7 +173,7 @@ func (client *ServerAdministratorsClient) deleteOperation(ctx context.Context, r } // deleteCreateRequest creates the Delete request. -func (client *ServerAdministratorsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServerAdministratorsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ServerAdministratorsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ServerAdministratorsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/administrators/activeDirectory" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -232,7 +229,7 @@ func (client *ServerAdministratorsClient) Get(ctx context.Context, resourceGroup } // getCreateRequest creates the Get request. -func (client *ServerAdministratorsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServerAdministratorsClientGetOptions) (*policy.Request, error) { +func (client *ServerAdministratorsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ServerAdministratorsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/administrators/activeDirectory" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -298,7 +295,7 @@ func (client *ServerAdministratorsClient) NewListPager(resourceGroupName string, } // listCreateRequest creates the List request. -func (client *ServerAdministratorsClient) listCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServerAdministratorsClientListOptions) (*policy.Request, error) { +func (client *ServerAdministratorsClient) listCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ServerAdministratorsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/administrators" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") diff --git a/sdk/resourcemanager/postgresql/armpostgresql/serveradministrators_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/serveradministrators_client_example_test.go deleted file mode 100644 index 7c219bc773a9..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/serveradministrators_client_example_test.go +++ /dev/null @@ -1,152 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresql_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/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerAdminGet.json -func ExampleServerAdministratorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerAdministratorsClient().Get(ctx, "testrg", "pgtestsvc4", 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.ServerAdministratorResource = armpostgresql.ServerAdministratorResource{ - // Name: to.Ptr("activeDirectory"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4/administrators/activeDirectory"), - // Properties: &armpostgresql.ServerAdministratorProperties{ - // AdministratorType: to.Ptr("ActiveDirectory"), - // Login: to.Ptr("bob@contoso.com"), - // Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - // TenantID: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerAdminCreateUpdate.json -func ExampleServerAdministratorsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerAdministratorsClient().BeginCreateOrUpdate(ctx, "testrg", "pgtestsvc4", armpostgresql.ServerAdministratorResource{ - Properties: &armpostgresql.ServerAdministratorProperties{ - AdministratorType: to.Ptr("ActiveDirectory"), - Login: to.Ptr("bob@contoso.com"), - Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - TenantID: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.ServerAdministratorResource = armpostgresql.ServerAdministratorResource{ - // Name: to.Ptr("activeDirectory"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4/administrators/activeDirectory"), - // Properties: &armpostgresql.ServerAdministratorProperties{ - // AdministratorType: to.Ptr("ActiveDirectory"), - // Login: to.Ptr("bob@contoso.com"), - // Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - // TenantID: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerAdminDelete.json -func ExampleServerAdministratorsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerAdministratorsClient().BeginDelete(ctx, "testrg", "pgtestsvc4", 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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerAdminList.json -func ExampleServerAdministratorsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerAdministratorsClient().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.ServerAdministratorResourceListResult = armpostgresql.ServerAdministratorResourceListResult{ - // Value: []*armpostgresql.ServerAdministratorResource{ - // { - // Name: to.Ptr("ActiveDirectory"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4/administrators/activeDirectory"), - // Properties: &armpostgresql.ServerAdministratorProperties{ - // AdministratorType: to.Ptr("ActiveDirectory"), - // Login: to.Ptr("bob@contoso.com"), - // Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - // TenantID: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/serverbasedperformancetier_client.go b/sdk/resourcemanager/postgresql/armpostgresql/serverbasedperformancetier_client.go index 52827245b6c0..c840d8372ddd 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/serverbasedperformancetier_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/serverbasedperformancetier_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -75,7 +72,7 @@ func (client *ServerBasedPerformanceTierClient) NewListPager(resourceGroupName s } // listCreateRequest creates the List request. -func (client *ServerBasedPerformanceTierClient) listCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServerBasedPerformanceTierClientListOptions) (*policy.Request, error) { +func (client *ServerBasedPerformanceTierClient) listCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ServerBasedPerformanceTierClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/performanceTiers" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") diff --git a/sdk/resourcemanager/postgresql/armpostgresql/serverbasedperformancetier_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/serverbasedperformancetier_client_example_test.go deleted file mode 100644 index ff7046752d7a..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/serverbasedperformancetier_client_example_test.go +++ /dev/null @@ -1,206 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/PerformanceTiersListByServer.json -func ExampleServerBasedPerformanceTierClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerBasedPerformanceTierClient().NewListPager("TestGroup", "testserver", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PerformanceTierListResult = armpostgresql.PerformanceTierListResult{ - // Value: []*armpostgresql.PerformanceTierProperties{ - // { - // ID: to.Ptr("Basic"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxLargeStorageMB: to.Ptr[int32](0), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinLargeStorageMB: to.Ptr[int32](0), - // MinStorageMB: to.Ptr[int32](5120), - // ServiceLevelObjectives: []*armpostgresql.PerformanceTierServiceLevelObjectives{ - // { - // Edition: to.Ptr("Basic"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("B_Gen5_1"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](1048576), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](1), - // }, - // { - // Edition: to.Ptr("Basic"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("B_Gen5_2"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](1048576), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](2), - // }}, - // }, - // { - // ID: to.Ptr("GeneralPurpose"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxLargeStorageMB: to.Ptr[int32](16777216), - // MaxStorageMB: to.Ptr[int32](16777216), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinLargeStorageMB: to.Ptr[int32](0), - // MinStorageMB: to.Ptr[int32](5120), - // ServiceLevelObjectives: []*armpostgresql.PerformanceTierServiceLevelObjectives{ - // { - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("GP_Gen5_2"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](2), - // }, - // { - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("GP_Gen5_4"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](4), - // }, - // { - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("GP_Gen5_8"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](8), - // }, - // { - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("GP_Gen5_16"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](16), - // }, - // { - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("GP_Gen5_32"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](32), - // }, - // { - // Edition: to.Ptr("GeneralPurpose"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("GP_Gen5_64"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](32), - // }}, - // }, - // { - // ID: to.Ptr("MemoryOptimized"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxLargeStorageMB: to.Ptr[int32](16777216), - // MaxStorageMB: to.Ptr[int32](16777216), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinLargeStorageMB: to.Ptr[int32](0), - // MinStorageMB: to.Ptr[int32](5120), - // ServiceLevelObjectives: []*armpostgresql.PerformanceTierServiceLevelObjectives{ - // { - // Edition: to.Ptr("MemoryOptimized"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("MO_Gen5_2"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](2), - // }, - // { - // Edition: to.Ptr("MemoryOptimized"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("MO_Gen5_4"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](4), - // }, - // { - // Edition: to.Ptr("MemoryOptimized"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("MO_Gen5_8"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](8), - // }, - // { - // Edition: to.Ptr("MemoryOptimized"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("MO_Gen5_16"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](16), - // }, - // { - // Edition: to.Ptr("MemoryOptimized"), - // HardwareGeneration: to.Ptr("Gen5"), - // ID: to.Ptr("MO_Gen5_32"), - // MaxBackupRetentionDays: to.Ptr[int32](35), - // MaxStorageMB: to.Ptr[int32](2097152), - // MinBackupRetentionDays: to.Ptr[int32](7), - // MinStorageMB: to.Ptr[int32](5120), - // VCore: to.Ptr[int32](32), - // }}, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/serverkeys_client.go b/sdk/resourcemanager/postgresql/armpostgresql/serverkeys_client.go index 6bd866100a53..3c0597ed6fae 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/serverkeys_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/serverkeys_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -96,7 +93,7 @@ func (client *ServerKeysClient) createOrUpdate(ctx context.Context, serverName s } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ServerKeysClient) createOrUpdateCreateRequest(ctx context.Context, serverName string, keyName string, resourceGroupName string, parameters ServerKey, options *ServerKeysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ServerKeysClient) createOrUpdateCreateRequest(ctx context.Context, serverName string, keyName string, resourceGroupName string, parameters ServerKey, _ *ServerKeysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/keys/{keyName}" if serverName == "" { return nil, errors.New("parameter serverName cannot be empty") @@ -179,7 +176,7 @@ func (client *ServerKeysClient) deleteOperation(ctx context.Context, serverName } // deleteCreateRequest creates the Delete request. -func (client *ServerKeysClient) deleteCreateRequest(ctx context.Context, serverName string, keyName string, resourceGroupName string, options *ServerKeysClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ServerKeysClient) deleteCreateRequest(ctx context.Context, serverName string, keyName string, resourceGroupName string, _ *ServerKeysClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/keys/{keyName}" if serverName == "" { return nil, errors.New("parameter serverName cannot be empty") @@ -239,7 +236,7 @@ func (client *ServerKeysClient) Get(ctx context.Context, resourceGroupName strin } // getCreateRequest creates the Get request. -func (client *ServerKeysClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, keyName string, options *ServerKeysClientGetOptions) (*policy.Request, error) { +func (client *ServerKeysClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, keyName string, _ *ServerKeysClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/keys/{keyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -307,7 +304,7 @@ func (client *ServerKeysClient) NewListPager(resourceGroupName string, serverNam } // listCreateRequest creates the List request. -func (client *ServerKeysClient) listCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServerKeysClientListOptions) (*policy.Request, error) { +func (client *ServerKeysClient) listCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ServerKeysClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/keys" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") diff --git a/sdk/resourcemanager/postgresql/armpostgresql/serverkeys_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/serverkeys_client_example_test.go deleted file mode 100644 index 6ce30f118cdd..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/serverkeys_client_example_test.go +++ /dev/null @@ -1,150 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresql_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/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2020-01-01/examples/ServerKeyList.json -func ExampleServerKeysClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerKeysClient().NewListPager("testrg", "testserver", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerKeyListResult = armpostgresql.ServerKeyListResult{ - // Value: []*armpostgresql.ServerKey{ - // { - // Name: to.Ptr("someVault_someKey_01234567890123456789012345678901"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/keys"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/testserver/keys/someVault_someKey_01234567890123456789012345678901"), - // Kind: to.Ptr("azurekeyvault"), - // Properties: &armpostgresql.ServerKeyProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T00:00:00.000Z"); return t}()), - // ServerKeyType: to.Ptr(armpostgresql.ServerKeyTypeAzureKeyVault), - // URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2020-01-01/examples/ServerKeyGet.json -func ExampleServerKeysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerKeysClient().Get(ctx, "testrg", "testserver", "someVault_someKey_01234567890123456789012345678901", 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.ServerKey = armpostgresql.ServerKey{ - // Name: to.Ptr("someVault_someKey_01234567890123456789012345678901"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/keys"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/testserver/keys/someVault_someKey_01234567890123456789012345678901"), - // Kind: to.Ptr("azurekeyvault"), - // Properties: &armpostgresql.ServerKeyProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T00:00:00.000Z"); return t}()), - // ServerKeyType: to.Ptr(armpostgresql.ServerKeyTypeAzureKeyVault), - // URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2020-01-01/examples/ServerKeyCreateOrUpdate.json -func ExampleServerKeysClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerKeysClient().BeginCreateOrUpdate(ctx, "testserver", "someVault_someKey_01234567890123456789012345678901", "testrg", armpostgresql.ServerKey{ - Properties: &armpostgresql.ServerKeyProperties{ - ServerKeyType: to.Ptr(armpostgresql.ServerKeyTypeAzureKeyVault), - URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.ServerKey = armpostgresql.ServerKey{ - // Name: to.Ptr("omeVault_someKey_01234567890123456789012345678901"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/keys"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/testserver/keys/someVault_someKey_01234567890123456789012345678901"), - // Kind: to.Ptr("azurekeyvault"), - // Properties: &armpostgresql.ServerKeyProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-01T00:00:00.000Z"); return t}()), - // ServerKeyType: to.Ptr(armpostgresql.ServerKeyTypeAzureKeyVault), - // URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2020-01-01/examples/ServerKeyDelete.json -func ExampleServerKeysClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerKeysClient().BeginDelete(ctx, "testserver", "someVault_someKey_01234567890123456789012345678901", "testrg", 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/armpostgresql/serverparameters_client.go b/sdk/resourcemanager/postgresql/armpostgresql/serverparameters_client.go index d05276ae1927..c432b1bc0a87 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/serverparameters_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/serverparameters_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -96,7 +93,7 @@ func (client *ServerParametersClient) listUpdateConfigurations(ctx context.Conte } // listUpdateConfigurationsCreateRequest creates the ListUpdateConfigurations request. -func (client *ServerParametersClient) listUpdateConfigurationsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, value ConfigurationListResult, options *ServerParametersClientBeginListUpdateConfigurationsOptions) (*policy.Request, error) { +func (client *ServerParametersClient) listUpdateConfigurationsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, value ConfigurationListResult, _ *ServerParametersClientBeginListUpdateConfigurationsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/updateConfigurations" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") diff --git a/sdk/resourcemanager/postgresql/armpostgresql/serverparameters_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/serverparameters_client_example_test.go deleted file mode 100644 index b9407efbfb1d..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/serverparameters_client_example_test.go +++ /dev/null @@ -1,71 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ConfigurationsUpdateByServer.json -func ExampleServerParametersClient_BeginListUpdateConfigurations() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerParametersClient().BeginListUpdateConfigurations(ctx, "TestGroup", "testserver", armpostgresql.ConfigurationListResult{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConfigurationListResult = armpostgresql.ConfigurationListResult{ - // Value: []*armpostgresql.Configuration{ - // { - // Name: to.Ptr("array_nulls"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/array_nulls"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Enable input of NULL elements in arrays."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr("Boolean"), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("backslash_quote"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/testserver/configurations/backslash_quote"), - // Properties: &armpostgresql.ConfigurationProperties{ - // Description: to.Ptr("Sets whether \"\\'\" is allowed in string literals."), - // AllowedValues: to.Ptr("safe_encoding,on,off"), - // DataType: to.Ptr("Enumeration"), - // DefaultValue: to.Ptr("safe_encoding"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("safe_encoding"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/servers_client.go b/sdk/resourcemanager/postgresql/armpostgresql/servers_client.go index 9cbcd5e478f3..7d8029f832ab 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/servers_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/servers_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -94,7 +91,7 @@ func (client *ServersClient) create(ctx context.Context, resourceGroupName strin } // createCreateRequest creates the Create request. -func (client *ServersClient) createCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters ServerForCreate, options *ServersClientBeginCreateOptions) (*policy.Request, error) { +func (client *ServersClient) createCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters ServerForCreate, _ *ServersClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -172,7 +169,7 @@ func (client *ServersClient) deleteOperation(ctx context.Context, resourceGroupN } // deleteCreateRequest creates the Delete request. -func (client *ServersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ServersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ServersClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -227,7 +224,7 @@ func (client *ServersClient) Get(ctx context.Context, resourceGroupName string, } // getCreateRequest creates the Get request. -func (client *ServersClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientGetOptions) (*policy.Request, error) { +func (client *ServersClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ServersClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -290,7 +287,7 @@ func (client *ServersClient) NewListPager(options *ServersClientListOptions) *ru } // listCreateRequest creates the List request. -func (client *ServersClient) listCreateRequest(ctx context.Context, options *ServersClientListOptions) (*policy.Request, error) { +func (client *ServersClient) listCreateRequest(ctx context.Context, _ *ServersClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/servers" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -347,7 +344,7 @@ func (client *ServersClient) NewListByResourceGroupPager(resourceGroupName strin } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ServersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ServersClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *ServersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *ServersClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -427,7 +424,7 @@ func (client *ServersClient) restart(ctx context.Context, resourceGroupName stri } // restartCreateRequest creates the Restart request. -func (client *ServersClient) restartCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginRestartOptions) (*policy.Request, error) { +func (client *ServersClient) restartCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ServersClientBeginRestartOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/restart" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -505,7 +502,7 @@ func (client *ServersClient) update(ctx context.Context, resourceGroupName strin } // updateCreateRequest creates the Update request. -func (client *ServersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters ServerUpdateParameters, options *ServersClientBeginUpdateOptions) (*policy.Request, error) { +func (client *ServersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, parameters ServerUpdateParameters, _ *ServersClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") diff --git a/sdk/resourcemanager/postgresql/armpostgresql/servers_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/servers_client_example_test.go deleted file mode 100644 index e9aca625b90c..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/servers_client_example_test.go +++ /dev/null @@ -1,761 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresql_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerCreatePointInTimeRestore.json -func ExampleServersClient_BeginCreate_createADatabaseAsAPointInTimeRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TargetResourceGroup", "targetserver", armpostgresql.ServerForCreate{ - Location: to.Ptr("brazilsouth"), - Properties: &armpostgresql.ServerPropertiesForRestore{ - CreateMode: to.Ptr(armpostgresql.CreateModePointInTimeRestore), - RestorePointInTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-14T00:00:37.467Z"); return t }()), - SourceServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforPostgreSQL/servers/sourceserver"), - }, - SKU: &armpostgresql.SKU{ - Name: to.Ptr("B_Gen5_2"), - Capacity: to.Ptr[int32](2), - Family: to.Ptr("Gen5"), - Tier: to.Ptr(armpostgresql.SKUTierBasic), - }, - Tags: map[string]*string{ - "ElasticServer": to.Ptr("1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armpostgresql.Server{ - // Name: to.Ptr("targetserver"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/targetserver"), - // Location: to.Ptr("brazilsouth"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-14T21:08:24.637Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("targetserver.postgres.database.azure.com"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](128000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("B_Gen5_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr(armpostgresql.SKUTierBasic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerCreate.json -func ExampleServersClient_BeginCreate_createANewServer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TestGroup", "pgtestsvc4", armpostgresql.ServerForCreate{ - Location: to.Ptr("westus"), - Properties: &armpostgresql.ServerPropertiesForDefaultCreate{ - CreateMode: to.Ptr(armpostgresql.CreateModeDefault), - MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12), - SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - StorageProfile: &armpostgresql.StorageProfile{ - BackupRetentionDays: to.Ptr[int32](7), - GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - StorageMB: to.Ptr[int32](128000), - }, - AdministratorLogin: to.Ptr("cloudsa"), - AdministratorLoginPassword: to.Ptr(""), - }, - SKU: &armpostgresql.SKU{ - Name: to.Ptr("B_Gen5_2"), - Capacity: to.Ptr[int32](2), - Family: to.Ptr("Gen5"), - Tier: to.Ptr(armpostgresql.SKUTierBasic), - }, - Tags: map[string]*string{ - "ElasticServer": to.Ptr("1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armpostgresql.Server{ - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T21:08:24.637Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4.postgres.database.azure.com"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](128000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("B_Gen5_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr(armpostgresql.SKUTierBasic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerCreateReplicaMode.json -func ExampleServersClient_BeginCreate_createAReplicaServer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TestGroup_WestCentralUS", "testserver-replica1", armpostgresql.ServerForCreate{ - Location: to.Ptr("westcentralus"), - Properties: &armpostgresql.ServerPropertiesForReplica{ - CreateMode: to.Ptr(armpostgresql.CreateModeReplica), - SourceServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"), - }, - SKU: &armpostgresql.SKU{ - Name: to.Ptr("GP_Gen5_2"), - Capacity: to.Ptr[int32](2), - Family: to.Ptr("Gen5"), - Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - }, - }, 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 = armpostgresql.Server{ - // Name: to.Ptr("testserver-replica1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-replica1"), - // Location: to.Ptr("westcentralus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("postgres"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-20T00:17:56.677Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("testserver-replica1.postgres.database.azure.com"), - // MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master"), - // ReplicaCapacity: to.Ptr[int32](0), - // ReplicationRole: to.Ptr("Replica"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumDisabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](2048000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen5_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerCreateGeoRestoreMode.json -func ExampleServersClient_BeginCreate_createAServerAsAGeoRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TargetResourceGroup", "targetserver", armpostgresql.ServerForCreate{ - Location: to.Ptr("westus"), - Properties: &armpostgresql.ServerPropertiesForGeoRestore{ - CreateMode: to.Ptr(armpostgresql.CreateModeGeoRestore), - SourceServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforPostgreSQL/servers/sourceserver"), - }, - SKU: &armpostgresql.SKU{ - Name: to.Ptr("GP_Gen5_2"), - Capacity: to.Ptr[int32](2), - Family: to.Ptr("Gen5"), - Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - }, - Tags: map[string]*string{ - "ElasticServer": to.Ptr("1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armpostgresql.Server{ - // Name: to.Ptr("targetserver"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/targetserver"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T21:08:24.637Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("targetserver.postgres.database.azure.com"), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](128000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen5_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerUpdate.json -func ExampleServersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testrg", "pgtestsvc4", armpostgresql.ServerUpdateParameters{ - Properties: &armpostgresql.ServerUpdateParametersProperties{ - AdministratorLoginPassword: to.Ptr(""), - MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12), - SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - }, - }, 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 = armpostgresql.Server{ - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T21:08:24.637Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4.postgres.database.azure.com"), - // MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](128000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("B_Gen4_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierBasic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerDelete.json -func ExampleServersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginDelete(ctx, "TestGroup", "testserver", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerGet.json -func ExampleServersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServersClient().Get(ctx, "testrg", "pgtestsvc1", 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 = armpostgresql.Server{ - // Name: to.Ptr("pgtestsvc1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc1"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("testuser"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-04T21:00:58.924Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc1.postgres.database.azure.com"), - // MasterServerID: to.Ptr(""), - // MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12), - // PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc1/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armpostgresql.ServerPrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.ServerPrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armpostgresql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled), - // ReplicationRole: to.Ptr(""), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](10), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](5120), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine5), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("B_Gen4_1"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierBasic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerListByResourceGroup.json -func ExampleServersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServersClient().NewListByResourceGroupPager("TestGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerListResult = armpostgresql.ServerListResult{ - // Value: []*armpostgresql.Server{ - // { - // Name: to.Ptr("pgtestsvc1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc1"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("testuser"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-04T21:01:55.149Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc1.postgres.database.azure.com"), - // PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{ - // }, - // PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](10), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](5120), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine5), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("B_Gen4_1"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierBasic), - // }, - // }, - // { - // Name: to.Ptr("pgtestsvc2"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc2"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("testuser"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-07T21:01:55.149Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc2.postgres.database.azure.com"), - // PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc2/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armpostgresql.ServerPrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.ServerPrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armpostgresql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](5120), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen4_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T21:08:24.637Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4.postgres.database.azure.com"), - // PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{ - // }, - // PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](128000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("B_Gen4_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierBasic), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerList.json -func ExampleServersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServersClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerListResult = armpostgresql.ServerListResult{ - // Value: []*armpostgresql.Server{ - // { - // Name: to.Ptr("pgtestsvc1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc1"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("testuser"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-04T21:01:55.149Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc1.postgres.database.azure.com"), - // MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS11), - // PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{ - // }, - // PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](10), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](5120), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine5), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("B_Gen4_1"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierBasic), - // }, - // }, - // { - // Name: to.Ptr("pgtestsvc2"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc2"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("testuser"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-07T21:01:55.149Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc2.postgres.database.azure.com"), - // MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS12), - // PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc2/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armpostgresql.ServerPrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.ServerPrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armpostgresql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](5120), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen4_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("pgtestsvc3"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg1/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc3"), - // Location: to.Ptr("westus"), - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("testuser"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-01T00:11:08.550Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc3.postgres.database.azure.com"), - // MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS10), - // PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc3/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armpostgresql.ServerPrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armpostgresql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armpostgresql.ServerPrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armpostgresql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armpostgresql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](35), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupEnabled), - // StorageMB: to.Ptr[int32](204800), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("GP_Gen4_4"), - // Capacity: to.Ptr[int32](4), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierGeneralPurpose), - // }, - // }, - // { - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "ElasticServer": to.Ptr("1"), - // }, - // Properties: &armpostgresql.ServerProperties{ - // AdministratorLogin: to.Ptr("cloudsa"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T21:08:24.637Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("pgtestsvc4.postgres.database.azure.com"), - // MinimalTLSVersion: to.Ptr(armpostgresql.MinimalTLSVersionEnumTLS10), - // PrivateEndpointConnections: []*armpostgresql.ServerPrivateEndpointConnection{ - // }, - // PublicNetworkAccess: to.Ptr(armpostgresql.PublicNetworkAccessEnumEnabled), - // SSLEnforcement: to.Ptr(armpostgresql.SSLEnforcementEnumEnabled), - // StorageProfile: &armpostgresql.StorageProfile{ - // BackupRetentionDays: to.Ptr[int32](7), - // GeoRedundantBackup: to.Ptr(armpostgresql.GeoRedundantBackupDisabled), - // StorageMB: to.Ptr[int32](128000), - // }, - // UserVisibleState: to.Ptr(armpostgresql.ServerStateReady), - // Version: to.Ptr(armpostgresql.ServerVersionNine6), - // }, - // SKU: &armpostgresql.SKU{ - // Name: to.Ptr("B_Gen4_2"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr(armpostgresql.SKUTierBasic), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerRestart.json -func ExampleServersClient_BeginRestart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginRestart(ctx, "TestGroup", "testserver", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/serversecurityalertpolicies_client.go b/sdk/resourcemanager/postgresql/armpostgresql/serversecurityalertpolicies_client.go index add840fbbb72..c0c2d76d2302 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/serversecurityalertpolicies_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/serversecurityalertpolicies_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -96,7 +93,7 @@ func (client *ServerSecurityAlertPoliciesClient) createOrUpdate(ctx context.Cont } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ServerSecurityAlertPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyName, parameters ServerSecurityAlertPolicy, options *ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ServerSecurityAlertPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyName, parameters ServerSecurityAlertPolicy, _ *ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -160,7 +157,7 @@ func (client *ServerSecurityAlertPoliciesClient) Get(ctx context.Context, resour } // getCreateRequest creates the Get request. -func (client *ServerSecurityAlertPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyName, options *ServerSecurityAlertPoliciesClientGetOptions) (*policy.Request, error) { +func (client *ServerSecurityAlertPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyName, _ *ServerSecurityAlertPoliciesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -229,7 +226,7 @@ func (client *ServerSecurityAlertPoliciesClient) NewListByServerPager(resourceGr } // listByServerCreateRequest creates the ListByServer request. -func (client *ServerSecurityAlertPoliciesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServerSecurityAlertPoliciesClientListByServerOptions) (*policy.Request, error) { +func (client *ServerSecurityAlertPoliciesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *ServerSecurityAlertPoliciesClientListByServerOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/securityAlertPolicies" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") diff --git a/sdk/resourcemanager/postgresql/armpostgresql/serversecurityalertpolicies_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/serversecurityalertpolicies_client_example_test.go deleted file mode 100644 index 2e2a832da058..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/serversecurityalertpolicies_client_example_test.go +++ /dev/null @@ -1,194 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresql_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/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerSecurityAlertsGet.json -func ExampleServerSecurityAlertPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerSecurityAlertPoliciesClient().Get(ctx, "securityalert-4799", "securityalert-6440", armpostgresql.SecurityAlertPolicyNameDefault, 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.ServerSecurityAlertPolicy = armpostgresql.ServerSecurityAlertPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforPostgreSQL/servers/securityalert-6440/securityAlertPolicies/default"), - // Properties: &armpostgresql.SecurityAlertPolicyProperties{ - // DisabledAlerts: []*string{ - // to.Ptr("Access_Anomaly")}, - // EmailAccountAdmins: to.Ptr(true), - // EmailAddresses: []*string{ - // to.Ptr("test@microsoft.com;user@microsoft.com")}, - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armpostgresql.ServerSecurityAlertPolicyStateDisabled), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerSecurityAlertsCreateMax.json -func ExampleServerSecurityAlertPoliciesClient_BeginCreateOrUpdate_updateAServersThreatDetectionPolicyWithAllParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerSecurityAlertPoliciesClient().BeginCreateOrUpdate(ctx, "securityalert-4799", "securityalert-6440", armpostgresql.SecurityAlertPolicyNameDefault, armpostgresql.ServerSecurityAlertPolicy{ - Properties: &armpostgresql.SecurityAlertPolicyProperties{ - DisabledAlerts: []*string{ - to.Ptr("Access_Anomaly"), - to.Ptr("Usage_Anomaly")}, - EmailAccountAdmins: to.Ptr(true), - EmailAddresses: []*string{ - to.Ptr("testSecurityAlert@microsoft.com")}, - RetentionDays: to.Ptr[int32](5), - State: to.Ptr(armpostgresql.ServerSecurityAlertPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.ServerSecurityAlertPolicy = armpostgresql.ServerSecurityAlertPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforPostgreSQL/servers/securityalert-6440/securityAlertPolicies/default"), - // Properties: &armpostgresql.SecurityAlertPolicyProperties{ - // DisabledAlerts: []*string{ - // to.Ptr("Access_Anomaly"), - // to.Ptr("Usage_Anomaly")}, - // EmailAccountAdmins: to.Ptr(true), - // EmailAddresses: []*string{ - // to.Ptr("testSecurityAlert@microsoft.com")}, - // RetentionDays: to.Ptr[int32](5), - // State: to.Ptr(armpostgresql.ServerSecurityAlertPolicyStateEnabled), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerSecurityAlertsCreateMin.json -func ExampleServerSecurityAlertPoliciesClient_BeginCreateOrUpdate_updateAServersThreatDetectionPolicyWithMinimalParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerSecurityAlertPoliciesClient().BeginCreateOrUpdate(ctx, "securityalert-4799", "securityalert-6440", armpostgresql.SecurityAlertPolicyNameDefault, armpostgresql.ServerSecurityAlertPolicy{ - Properties: &armpostgresql.SecurityAlertPolicyProperties{ - EmailAccountAdmins: to.Ptr(true), - State: to.Ptr(armpostgresql.ServerSecurityAlertPolicyStateDisabled), - }, - }, 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.ServerSecurityAlertPolicy = armpostgresql.ServerSecurityAlertPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforPostgreSQL/servers/securityalert-6440/securityAlertPolicies/default"), - // Properties: &armpostgresql.SecurityAlertPolicyProperties{ - // DisabledAlerts: []*string{ - // to.Ptr("")}, - // EmailAccountAdmins: to.Ptr(true), - // EmailAddresses: []*string{ - // to.Ptr("")}, - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armpostgresql.ServerSecurityAlertPolicyStateEnabled), - // StorageEndpoint: to.Ptr(""), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerSecurityAlertsListByServer.json -func ExampleServerSecurityAlertPoliciesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerSecurityAlertPoliciesClient().NewListByServerPager("securityalert-4799", "securityalert-6440", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerSecurityAlertPolicyListResult = armpostgresql.ServerSecurityAlertPolicyListResult{ - // Value: []*armpostgresql.ServerSecurityAlertPolicy{ - // { - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforPostgreSQL/servers/securityalert-6440/securityAlertPolicies"), - // Properties: &armpostgresql.SecurityAlertPolicyProperties{ - // DisabledAlerts: []*string{ - // to.Ptr("Access_Anomaly")}, - // EmailAccountAdmins: to.Ptr(true), - // EmailAddresses: []*string{ - // to.Ptr("test@microsoft.com;user@microsoft.com")}, - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armpostgresql.ServerSecurityAlertPolicyStateDisabled), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/time_rfc3339.go b/sdk/resourcemanager/postgresql/armpostgresql/time_rfc3339.go index 4bbbd5f411cc..8fe12e00fd88 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/time_rfc3339.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/time_rfc3339.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -19,12 +16,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +41,36 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + if len(data) == 0 { + return nil + } + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/postgresql/armpostgresql/virtualnetworkrules_client.go b/sdk/resourcemanager/postgresql/armpostgresql/virtualnetworkrules_client.go index 58b5d1f13886..99ed284939f2 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/virtualnetworkrules_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/virtualnetworkrules_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights 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. @@ -96,7 +93,7 @@ func (client *VirtualNetworkRulesClient) createOrUpdate(ctx context.Context, res } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualNetworkRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters VirtualNetworkRule, options *VirtualNetworkRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *VirtualNetworkRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters VirtualNetworkRule, _ *VirtualNetworkRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -180,7 +177,7 @@ func (client *VirtualNetworkRulesClient) deleteOperation(ctx context.Context, re } // deleteCreateRequest creates the Delete request. -func (client *VirtualNetworkRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, options *VirtualNetworkRulesClientBeginDeleteOptions) (*policy.Request, error) { +func (client *VirtualNetworkRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, _ *VirtualNetworkRulesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -239,7 +236,7 @@ func (client *VirtualNetworkRulesClient) Get(ctx context.Context, resourceGroupN } // getCreateRequest creates the Get request. -func (client *VirtualNetworkRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, options *VirtualNetworkRulesClientGetOptions) (*policy.Request, error) { +func (client *VirtualNetworkRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, _ *VirtualNetworkRulesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -308,7 +305,7 @@ func (client *VirtualNetworkRulesClient) NewListByServerPager(resourceGroupName } // listByServerCreateRequest creates the ListByServer request. -func (client *VirtualNetworkRulesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *VirtualNetworkRulesClientListByServerOptions) (*policy.Request, error) { +func (client *VirtualNetworkRulesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *VirtualNetworkRulesClientListByServerOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") diff --git a/sdk/resourcemanager/postgresql/armpostgresql/virtualnetworkrules_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresql/virtualnetworkrules_client_example_test.go deleted file mode 100644 index 547a41d821c9..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/virtualnetworkrules_client_example_test.go +++ /dev/null @@ -1,156 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresql_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/armpostgresql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/VirtualNetworkRulesGet.json -func ExampleVirtualNetworkRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkRulesClient().Get(ctx, "TestGroup", "vnet-test-svr", "vnet-firewall-rule", 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.VirtualNetworkRule = armpostgresql.VirtualNetworkRule{ - // Name: to.Ptr("vnet-firewall-rule"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/virtualNetworkRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/vnet-test-svr/virtualNetworkRules/vnet-firewall-rule"), - // Properties: &armpostgresql.VirtualNetworkRuleProperties{ - // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - // State: to.Ptr(armpostgresql.VirtualNetworkRuleStateReady), - // VirtualNetworkSubnetID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/VirtualNetworkRulesCreateOrUpdate.json -func ExampleVirtualNetworkRulesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkRulesClient().BeginCreateOrUpdate(ctx, "TestGroup", "vnet-test-svr", "vnet-firewall-rule", armpostgresql.VirtualNetworkRule{ - Properties: &armpostgresql.VirtualNetworkRuleProperties{ - IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - VirtualNetworkSubnetID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.VirtualNetworkRule = armpostgresql.VirtualNetworkRule{ - // Name: to.Ptr("vnet-firewall-rule"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/virtualNetworkRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/vnet-test-svr/virtualNetworkRules/vnet-firewall-rule"), - // Properties: &armpostgresql.VirtualNetworkRuleProperties{ - // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - // VirtualNetworkSubnetID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/VirtualNetworkRulesDelete.json -func ExampleVirtualNetworkRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkRulesClient().BeginDelete(ctx, "TestGroup", "vnet-test-svr", "vnet-firewall-rule", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/VirtualNetworkRulesList.json -func ExampleVirtualNetworkRulesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworkRulesClient().NewListByServerPager("TestGroup", "vnet-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.VirtualNetworkRuleListResult = armpostgresql.VirtualNetworkRuleListResult{ - // Value: []*armpostgresql.VirtualNetworkRule{ - // { - // Name: to.Ptr("vnet-firewall-rule"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/virtualNetworkRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/vnet-test-svr/virtualNetworkRules/vnet-firewall-rule"), - // Properties: &armpostgresql.VirtualNetworkRuleProperties{ - // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - // State: to.Ptr(armpostgresql.VirtualNetworkRuleStateReady), - // VirtualNetworkSubnetID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"), - // }, - // }, - // { - // Name: to.Ptr("vnet-firewall-rule"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/servers/virtualNetworkRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/servers/vnet-test-svr/virtualNetworkRules/vnet-firewall-rule"), - // Properties: &armpostgresql.VirtualNetworkRuleProperties{ - // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - // State: to.Ptr(armpostgresql.VirtualNetworkRuleStateReady), - // VirtualNetworkSubnetID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/CHANGELOG.md b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/CHANGELOG.md index 1dbfb4a7f26f..36457bfc58dc 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/CHANGELOG.md +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/CHANGELOG.md @@ -1,5 +1,73 @@ # Release History +## 5.0.0-beta.1 (2025-05-13) +### Breaking Changes + +- Function `*ClientFactory.NewPostgreSQLServerManagementClient` has been removed +- Function `NewPostgreSQLServerManagementClient` has been removed +- Function `*PostgreSQLServerManagementClient.CheckMigrationNameAvailability` has been removed +- Operation `*OperationsClient.List` has supported pagination, use `*OperationsClient.NewListPager` instead. + +### Features Added + +- New value `ServerStateInaccessible`, `ServerStateProvisioning`, `ServerStateRestarting` added to enum type `ServerState` +- New value `ServerVersionSeventeen` added to enum type `ServerVersion` +- New value `SourceTypeApsaraDBRDS`, `SourceTypeCrunchyPostgreSQL`, `SourceTypeDigitalOceanDroplets`, `SourceTypeDigitalOceanPostgreSQL`, `SourceTypeEDBOracleServer`, `SourceTypeEDBPostgreSQL`, `SourceTypeHerokuPostgreSQL`, `SourceTypeHuaweiCompute`, `SourceTypeHuaweiRDS`, `SourceTypePostgreSQLCosmosDB`, `SourceTypePostgreSQLFlexibleServer`, `SourceTypeSupabasePostgreSQL` added to enum type `SourceType` +- New value `StorageTypeUltraSSDLRS` added to enum type `StorageType` +- New enum type `RecommendationType` with values `RecommendationTypeCreateIndex`, `RecommendationTypeDropIndex` +- New enum type `RecommendationTypeEnum` with values `RecommendationTypeEnumCreateIndex`, `RecommendationTypeEnumDropIndex`, `RecommendationTypeEnumReIndex` +- New enum type `SupportedFeatureStatusEnum` with values `SupportedFeatureStatusEnumDisabled`, `SupportedFeatureStatusEnumEnabled` +- New enum type `TuningOptionEnum` with values `TuningOptionEnumConfiguration`, `TuningOptionEnumIndex` +- New function `*ClientFactory.NewPostgreSQLManagementClient() *PostgreSQLManagementClient` +- New function `*ClientFactory.NewQuotaUsagesClient() *QuotaUsagesClient` +- New function `*ClientFactory.NewTuningConfigurationClient() *TuningConfigurationClient` +- New function `*ClientFactory.NewTuningIndexClient() *TuningIndexClient` +- New function `*ClientFactory.NewTuningOptionsClient() *TuningOptionsClient` +- New function `NewPostgreSQLManagementClient(azcore.TokenCredential, *arm.ClientOptions) (*PostgreSQLManagementClient, error)` +- New function `*PostgreSQLManagementClient.CheckMigrationNameAvailability(context.Context, string, string, string, MigrationNameAvailabilityResource, *PostgreSQLManagementClientCheckMigrationNameAvailabilityOptions) (PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse, error)` +- New function `NewQuotaUsagesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*QuotaUsagesClient, error)` +- New function `*QuotaUsagesClient.NewListPager(string, *QuotaUsagesClientListOptions) *runtime.Pager[QuotaUsagesClientListResponse]` +- New function `NewTuningConfigurationClient(string, azcore.TokenCredential, *arm.ClientOptions) (*TuningConfigurationClient, error)` +- New function `*TuningConfigurationClient.BeginDisable(context.Context, string, string, TuningOptionEnum, *TuningConfigurationClientBeginDisableOptions) (*runtime.Poller[TuningConfigurationClientDisableResponse], error)` +- New function `*TuningConfigurationClient.BeginEnable(context.Context, string, string, TuningOptionEnum, *TuningConfigurationClientBeginEnableOptions) (*runtime.Poller[TuningConfigurationClientEnableResponse], error)` +- New function `*TuningConfigurationClient.NewListSessionDetailsPager(string, string, TuningOptionEnum, string, *TuningConfigurationClientListSessionDetailsOptions) *runtime.Pager[TuningConfigurationClientListSessionDetailsResponse]` +- New function `*TuningConfigurationClient.NewListSessionsPager(string, string, TuningOptionEnum, *TuningConfigurationClientListSessionsOptions) *runtime.Pager[TuningConfigurationClientListSessionsResponse]` +- New function `*TuningConfigurationClient.BeginStartSession(context.Context, string, string, TuningOptionEnum, ConfigTuningRequestParameter, *TuningConfigurationClientBeginStartSessionOptions) (*runtime.Poller[TuningConfigurationClientStartSessionResponse], error)` +- New function `*TuningConfigurationClient.BeginStopSession(context.Context, string, string, TuningOptionEnum, *TuningConfigurationClientBeginStopSessionOptions) (*runtime.Poller[TuningConfigurationClientStopSessionResponse], error)` +- New function `NewTuningIndexClient(string, azcore.TokenCredential, *arm.ClientOptions) (*TuningIndexClient, error)` +- New function `*TuningIndexClient.NewListRecommendationsPager(string, string, TuningOptionEnum, *TuningIndexClientListRecommendationsOptions) *runtime.Pager[TuningIndexClientListRecommendationsResponse]` +- New function `NewTuningOptionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*TuningOptionsClient, error)` +- New function `*TuningOptionsClient.Get(context.Context, string, string, TuningOptionEnum, *TuningOptionsClientGetOptions) (TuningOptionsClientGetResponse, error)` +- New function `*TuningOptionsClient.NewListByServerPager(string, string, *TuningOptionsClientListByServerOptions) *runtime.Pager[TuningOptionsClientListByServerResponse]` +- New struct `Cluster` +- New struct `ConfigTuningRequestParameter` +- New struct `DelegatedResources` +- New struct `ImpactRecord` +- New struct `IndexRecommendationDetails` +- New struct `IndexRecommendationListResult` +- New struct `IndexRecommendationResource` +- New struct `IndexRecommendationResourceProperties` +- New struct `IndexRecommendationResourcePropertiesAnalyzedWorkload` +- New struct `IndexRecommendationResourcePropertiesImplementationDetails` +- New struct `NameProperty` +- New struct `QuotaUsage` +- New struct `QuotaUsagesListResult` +- New struct `SessionDetailsListResult` +- New struct `SessionDetailsResource` +- New struct `SessionResource` +- New struct `SessionsListResult` +- New struct `SupportedFeature` +- New struct `TuningOptionsListResult` +- New struct `TuningOptionsResource` +- New field `GeoBackupDelegatedIdentityClientID`, `PrimaryDelegatedIdentityClientID` in struct `DataEncryption` +- New field `SupportedFeatures` in struct `FlexibleServerCapability` +- New field `Cluster` in struct `ServerProperties` +- New field `Cluster` in struct `ServerPropertiesForUpdate` +- New field `SecurityProfile`, `SupportedFeatures` in struct `ServerSKUCapability` +- New field `SupportedFeatures` in struct `ServerVersionCapability` +- New field `DelegatedResources` in struct `UserAssignedIdentity` + + ## 4.1.0 (2025-03-17) ### Features Added diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/README.md b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/README.md index dc7ffc16e8cc..73be890520e7 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/README.md +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/README.md @@ -18,7 +18,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure Database for PostgreSQL module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4 +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5 ``` ## Authorization diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administrators_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administrators_client.go index bb1d32bd6a87..fdeb2a9eb40c 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administrators_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administrators_client.go @@ -43,11 +43,11 @@ 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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. -// - parameters - The required parameters for adding an active directory administrator for a server. +// - parameters - The required parameters for adding an Microsoft Entra Administrator for a server. // - options - AdministratorsClientBeginCreateOptions contains the optional parameters for the AdministratorsClient.BeginCreate // method. func (client *AdministratorsClient) BeginCreate(ctx context.Context, resourceGroupName string, serverName string, objectID string, parameters ActiveDirectoryAdministratorAdd, options *AdministratorsClientBeginCreateOptions) (*runtime.Poller[AdministratorsClientCreateResponse], error) { @@ -71,7 +71,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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview 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" @@ -117,7 +117,7 @@ func (client *AdministratorsClient) createCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -126,10 +126,10 @@ func (client *AdministratorsClient) createCreateRequest(ctx context.Context, res return req, nil } -// BeginDelete - Deletes an Active Directory Administrator associated with the server. +// BeginDelete - Deletes an Microsoft Entra Administrator associated with the server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -153,10 +153,10 @@ func (client *AdministratorsClient) BeginDelete(ctx context.Context, resourceGro } } -// Delete - Deletes an Active Directory Administrator associated with the server. +// Delete - Deletes an Microsoft Entra Administrator associated with the server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview 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" @@ -202,7 +202,7 @@ func (client *AdministratorsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -211,7 +211,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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -262,7 +262,7 @@ func (client *AdministratorsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,7 +279,7 @@ func (client *AdministratorsClient) getHandleResponse(resp *http.Response) (Admi // NewListByServerPager - List all the AAD administrators for a given server. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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 @@ -327,7 +327,7 @@ func (client *AdministratorsClient) listByServerCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") 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 deleted file mode 100644 index e644df843d52..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/administrators_client_example_test.go +++ /dev/null @@ -1,159 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/AdministratorAdd.json -func ExampleAdministratorsClient_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.NewAdministratorsClient().BeginCreate(ctx, "testrg", "testserver", "oooooooo-oooo-oooo-oooo-oooooooooooo", armpostgresqlflexibleservers.ActiveDirectoryAdministratorAdd{ - Properties: &armpostgresqlflexibleservers.AdministratorPropertiesForAdd{ - PrincipalName: to.Ptr("testuser1@microsoft.com"), - PrincipalType: to.Ptr(armpostgresqlflexibleservers.PrincipalTypeUser), - TenantID: to.Ptr("tttttttt-tttt-tttt-tttt-tttttttttttt"), - }, - }, 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.ActiveDirectoryAdministrator = armpostgresqlflexibleservers.ActiveDirectoryAdministrator{ - // Name: to.Ptr("testuser1@microsoft.com"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/administrators/oooooooo-oooo-oooo-oooo-oooooooooooo"), - // Properties: &armpostgresqlflexibleservers.AdministratorProperties{ - // ObjectID: to.Ptr("oooooooo-oooo-oooo-oooo-oooooooooooo"), - // PrincipalName: to.Ptr("testuser1@microsoft.com"), - // PrincipalType: to.Ptr(armpostgresqlflexibleservers.PrincipalTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/AdministratorDelete.json -func ExampleAdministratorsClient_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.NewAdministratorsClient().BeginDelete(ctx, "testrg", "testserver", "oooooooo-oooo-oooo-oooo-oooooooooooo", 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/AdministratorGet.json -func ExampleAdministratorsClient_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.NewAdministratorsClient().Get(ctx, "testrg", "pgtestsvc1", "oooooooo-oooo-oooo-oooo-oooooooooooo", 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.ActiveDirectoryAdministrator = armpostgresqlflexibleservers.ActiveDirectoryAdministrator{ - // Name: to.Ptr("testuser1@microsoft.com"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc1/administrators/oooooooo-oooo-oooo-oooo-oooooooooooo"), - // Properties: &armpostgresqlflexibleservers.AdministratorProperties{ - // ObjectID: to.Ptr("oooooooo-oooo-oooo-oooo-oooooooooooo"), - // PrincipalName: to.Ptr("testuer1@microsoft.com"), - // PrincipalType: to.Ptr(armpostgresqlflexibleservers.PrincipalTypeUser), - // TenantID: to.Ptr("tttttttt-tttt-tttt-tttt-tttttttttttt"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/AdministratorsListByServer.json -func ExampleAdministratorsClient_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.NewAdministratorsClient().NewListByServerPager("testrg", "pgtestsvc1", 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.AdministratorListResult = armpostgresqlflexibleservers.AdministratorListResult{ - // Value: []*armpostgresqlflexibleservers.ActiveDirectoryAdministrator{ - // { - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc1/administrators/oooooooo-oooo-oooo-oooo-oooooooooooo"), - // Properties: &armpostgresqlflexibleservers.AdministratorProperties{ - // ObjectID: to.Ptr("oooooooo-oooo-oooo-oooo-oooooooooooo"), - // PrincipalName: to.Ptr("testuer1@microsoft.com"), - // PrincipalType: to.Ptr(armpostgresqlflexibleservers.PrincipalTypeUser), - // TenantID: to.Ptr("tttttttt-tttt-tttt-tttt-tttttttttttt"), - // }, - // }, - // { - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/administrators"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc1/administrators/gggggggg-gggg-gggg-gggg-gggggggggggg"), - // Properties: &armpostgresqlflexibleservers.AdministratorProperties{ - // ObjectID: to.Ptr("gggggggg-gggg-gggg-gggg-gggggggggggg"), - // PrincipalName: to.Ptr("testgroup1@microsoft.com"), - // PrincipalType: to.Ptr(armpostgresqlflexibleservers.PrincipalTypeGroup), - // TenantID: to.Ptr("tttttttt-tttt-tttt-tttt-tttttttttttt"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/autorest.md b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/autorest.md index 916c7c961c63..edd8aaa6af92 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/autorest.md +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/autorest.md @@ -5,10 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/postgresql/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/postgresql/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 4.1.0 +module-version: 5.0.0-beta.1 package-flexibleservers: true -tag: package-flexibleserver-2024-08-01 ``` \ 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 16dff00b7b9b..765be4900f99 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backups_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backups_client.go @@ -43,7 +43,7 @@ func NewBackupsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreate - Create a specific backup for PostgreSQL flexible server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - backupName - The name of the backup. @@ -69,7 +69,7 @@ func (client *BackupsClient) BeginCreate(ctx context.Context, resourceGroupName // Create - Create a specific backup for PostgreSQL flexible server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview func (client *BackupsClient) create(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *BackupsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "BackupsClient.BeginCreate" @@ -115,7 +115,7 @@ func (client *BackupsClient) createCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -124,7 +124,7 @@ func (client *BackupsClient) createCreateRequest(ctx context.Context, resourceGr // BeginDelete - Deletes a specific backup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - backupName - The name of the backup. @@ -150,7 +150,7 @@ func (client *BackupsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes a specific backup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview func (client *BackupsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, backupName string, options *BackupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "BackupsClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *BackupsClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,7 @@ func (client *BackupsClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Get specific backup for a given server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - backupName - The name of the backup. @@ -256,7 +256,7 @@ func (client *BackupsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -273,7 +273,7 @@ func (client *BackupsClient) getHandleResponse(resp *http.Response) (BackupsClie // NewListByServerPager - List all the backups for a given server. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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 @@ -321,7 +321,7 @@ func (client *BackupsClient) listByServerCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") 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 deleted file mode 100644 index 9803b8ada435..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/backups_client_example_test.go +++ /dev/null @@ -1,241 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupCreate.json -func ExampleBackupsClient_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.NewBackupsClient().BeginCreate(ctx, "TestGroup", "postgresqltestserver", "backup_20210615T160516", 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.ServerBackup = armpostgresqlflexibleservers.ServerBackup{ - // Name: to.Ptr("backup_20210615T160516"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/backup_20210615T160516"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginCustomerOnDemand), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T16:05:19.902Z"); return t}()), - // Source: to.Ptr("Customer Initiated"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupDelete.json -func ExampleBackupsClient_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.NewBackupsClient().BeginDelete(ctx, "TestGroup", "testserver", "backup_20210615T160516", 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupGet.json -func ExampleBackupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupsClient().Get(ctx, "TestGroup", "postgresqltestserver", "daily_20210615T160516", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerBackup = armpostgresqlflexibleservers.ServerBackup{ - // Name: to.Ptr("daily_20210615T160516"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/daily_20210615T160516"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T16:05:19.902Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/BackupListByServer.json -func ExampleBackupsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupsClient().NewListByServerPager("TestGroup", "postgresqltestserver", 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.ServerBackupListResult = armpostgresqlflexibleservers.ServerBackupListResult{ - // Value: []*armpostgresqlflexibleservers.ServerBackup{ - // { - // Name: to.Ptr("daily_20210615T160516"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/daily_20210615T160516"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T16:05:19.902Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // }, - // { - // Name: to.Ptr("daily_20210616T160520"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/daily_20210616T160520"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T16:05:23.924Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // }, - // { - // Name: to.Ptr("daily_20210617T160525"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/daily_20210617T160525"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T16:05:28.124Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // }, - // { - // Name: to.Ptr("daily_20210618T160529"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/daily_20210618T160529"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-18T16:05:32.273Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // }, - // { - // Name: to.Ptr("daily_20210619T160533"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/daily_20210619T160533"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-19T16:05:36.860Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // }, - // { - // Name: to.Ptr("daily_20210620T160538"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/daily_20210620T160538"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-20T16:05:41.920Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // }, - // { - // Name: to.Ptr("daily_20210621T160543"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/daily_20210621T160543"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-21T16:05:48.852Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // }, - // { - // Name: to.Ptr("daily_20210622T160803"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/daily_20210622T160803"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-22T16:08:06.312Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // }, - // { - // Name: to.Ptr("daily_20210622T210807"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/daily_20210622T210807"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-22T21:08:10.505Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // }, - // { - // Name: to.Ptr("daily_20210623T212413"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/daily_20210623T212413"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-23T21:24:16.940Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // }, - // { - // Name: to.Ptr("daily_20210624T061328"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/backups"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgresqltestserver/backups/daily_20210624T061328"), - // Properties: &armpostgresqlflexibleservers.ServerBackupProperties{ - // BackupType: to.Ptr(armpostgresqlflexibleservers.OriginFull), - // CompletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-24T06:13:31.496Z"); return t}()), - // Source: to.Ptr("Automatic"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailability_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailability_client.go index fc96808c013a..102612f373be 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailability_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailability_client.go @@ -43,7 +43,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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - nameAvailabilityRequest - The required parameters for checking if resource name is available. // - options - CheckNameAvailabilityClientExecuteOptions contains the optional parameters for the CheckNameAvailabilityClient.Execute // method. @@ -81,7 +81,7 @@ func (client *CheckNameAvailabilityClient) executeCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") 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 deleted file mode 100644 index a7bb73b8d8a9..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailability_client_example_test.go +++ /dev/null @@ -1,48 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/CheckNameAvailability.json -func ExampleCheckNameAvailabilityClient_Execute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCheckNameAvailabilityClient().Execute(ctx, armpostgresqlflexibleservers.CheckNameAvailabilityRequest{ - Name: to.Ptr("name1"), - Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - }, 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.NameAvailability = armpostgresqlflexibleservers.NameAvailability{ - // Message: to.Ptr(""), - // NameAvailable: to.Ptr(true), - // Name: to.Ptr("name1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client.go index c0cdef455f5b..190b29db73b6 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client.go @@ -43,7 +43,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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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 @@ -86,7 +86,7 @@ func (client *CheckNameAvailabilityWithLocationClient) executeCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") 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 deleted file mode 100644 index d1ee7fb96ac4..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/checknameavailabilitywithlocation_client_example_test.go +++ /dev/null @@ -1,48 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/CheckNameAvailabilityLocationBased.json -func ExampleCheckNameAvailabilityWithLocationClient_Execute() { - 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.NewCheckNameAvailabilityWithLocationClient().Execute(ctx, "westus", armpostgresqlflexibleservers.CheckNameAvailabilityRequest{ - Name: to.Ptr("name1"), - Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - }, 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.NameAvailability = armpostgresqlflexibleservers.NameAvailability{ - // Message: to.Ptr(""), - // NameAvailable: to.Ptr(true), - // Name: to.Ptr("name1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/client_factory.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/client_factory.go index e0a61dd9b5c4..26177f464220 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/client_factory.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/client_factory.go @@ -142,9 +142,9 @@ func (c *ClientFactory) NewOperationsClient() *OperationsClient { } } -// NewPostgreSQLServerManagementClient creates a new instance of PostgreSQLServerManagementClient. -func (c *ClientFactory) NewPostgreSQLServerManagementClient() *PostgreSQLServerManagementClient { - return &PostgreSQLServerManagementClient{ +// NewPostgreSQLManagementClient creates a new instance of PostgreSQLManagementClient. +func (c *ClientFactory) NewPostgreSQLManagementClient() *PostgreSQLManagementClient { + return &PostgreSQLManagementClient{ internal: c.internal, } } @@ -173,6 +173,14 @@ func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesCli } } +// NewQuotaUsagesClient creates a new instance of QuotaUsagesClient. +func (c *ClientFactory) NewQuotaUsagesClient() *QuotaUsagesClient { + return &QuotaUsagesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewReplicasClient creates a new instance of ReplicasClient. func (c *ClientFactory) NewReplicasClient() *ReplicasClient { return &ReplicasClient{ @@ -205,6 +213,30 @@ func (c *ClientFactory) NewServersClient() *ServersClient { } } +// NewTuningConfigurationClient creates a new instance of TuningConfigurationClient. +func (c *ClientFactory) NewTuningConfigurationClient() *TuningConfigurationClient { + return &TuningConfigurationClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewTuningIndexClient creates a new instance of TuningIndexClient. +func (c *ClientFactory) NewTuningIndexClient() *TuningIndexClient { + return &TuningIndexClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewTuningOptionsClient creates a new instance of TuningOptionsClient. +func (c *ClientFactory) NewTuningOptionsClient() *TuningOptionsClient { + return &TuningOptionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewVirtualEndpointsClient creates a new instance of VirtualEndpointsClient. func (c *ClientFactory) NewVirtualEndpointsClient() *VirtualEndpointsClient { return &VirtualEndpointsClient{ diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client.go index e029195dcd2f..08ef3bab6f5f 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client.go @@ -43,7 +43,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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -94,7 +94,7 @@ func (client *ConfigurationsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -111,7 +111,7 @@ func (client *ConfigurationsClient) getHandleResponse(resp *http.Response) (Conf // NewListByServerPager - List all the configurations in a given server. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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 @@ -159,7 +159,7 @@ func (client *ConfigurationsClient) listByServerCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -177,7 +177,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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -204,7 +204,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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview 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" @@ -250,7 +250,7 @@ func (client *ConfigurationsClient) putCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -262,7 +262,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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -290,7 +290,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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview 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" @@ -336,7 +336,7 @@ func (client *ConfigurationsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") 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 deleted file mode 100644 index fdff1e4667d9..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/configurations_client_example_test.go +++ /dev/null @@ -1,2007 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ConfigurationListByServer.json -func ExampleConfigurationsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConfigurationsClient().NewListByServerPager("testrg", "testserver", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ConfigurationListResult = armpostgresqlflexibleservers.ConfigurationListResult{ - // Value: []*armpostgresqlflexibleservers.Configuration{ - // { - // Name: to.Ptr("application_name"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/application_name"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the application name to be reported in statistics and logs."), - // AllowedValues: to.Ptr("[A-Za-z0-9._-]*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), - // DefaultValue: to.Ptr(""), - // Source: to.Ptr("system-default"), - // Value: to.Ptr(""), - // }, - // }, - // { - // Name: to.Ptr("array_nulls"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/array_nulls"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables input of NULL elements in arrays."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("autovacuum"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Starts the autovacuum subprocess."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("autovacuum_analyze_scale_factor"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_analyze_scale_factor"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Number of tuple inserts, updates, or deletes prior to analyze as a fraction of reltuples."), - // AllowedValues: to.Ptr("0-100"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("0.1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.1"), - // }, - // }, - // { - // Name: to.Ptr("autovacuum_analyze_threshold"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_analyze_threshold"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Minimum number of tuple inserts, updates, or deletes prior to analyze."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("50"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("50"), - // }, - // }, - // { - // Name: to.Ptr("autovacuum_naptime"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_naptime"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Time to sleep between autovacuum runs."), - // AllowedValues: to.Ptr("1-2147483"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("60"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("60"), - // }, - // }, - // { - // Name: to.Ptr("autovacuum_vacuum_cost_delay"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_vacuum_cost_delay"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Vacuum cost delay in milliseconds, for autovacuum."), - // AllowedValues: to.Ptr("-1-100"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("2"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("2"), - // }, - // }, - // { - // Name: to.Ptr("autovacuum_vacuum_cost_limit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_vacuum_cost_limit"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Vacuum cost amount available before napping, for autovacuum."), - // AllowedValues: to.Ptr("-1-10000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("-1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("-1"), - // }, - // }, - // { - // Name: to.Ptr("autovacuum_vacuum_scale_factor"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_vacuum_scale_factor"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Number of tuple updates or deletes prior to vacuum as a fraction of reltuples."), - // AllowedValues: to.Ptr("0-100"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("0.2"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.2"), - // }, - // }, - // { - // Name: to.Ptr("autovacuum_vacuum_threshold"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_vacuum_threshold"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Minimum number of tuple updates or deletes prior to vacuum."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("50"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("50"), - // }, - // }, - // { - // Name: to.Ptr("autovacuum_work_mem"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/autovacuum_work_mem"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum memory to be used by each autovacuum worker process."), - // AllowedValues: to.Ptr("-1-2097151"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("-1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("-1"), - // }, - // }, - // { - // Name: to.Ptr("backend_flush_after"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/backend_flush_after"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Number of pages after which previously performed writes are flushed to disk."), - // AllowedValues: to.Ptr("0-256"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("backslash_quote"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/backslash_quote"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets whether \"\\'\" is allowed in string literals."), - // AllowedValues: to.Ptr("safe_encoding,on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("safe_encoding"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("safe_encoding"), - // }, - // }, - // { - // Name: to.Ptr("bgwriter_delay"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/bgwriter_delay"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Background writer sleep time between rounds."), - // AllowedValues: to.Ptr("10-10000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("200"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("200"), - // }, - // }, - // { - // Name: to.Ptr("bgwriter_flush_after"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/bgwriter_flush_after"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Number of pages after which previously performed writes are flushed to disk."), - // AllowedValues: to.Ptr("0-256"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("64"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("64"), - // }, - // }, - // { - // Name: to.Ptr("bgwriter_lru_maxpages"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/bgwriter_lru_maxpages"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Background writer maximum number of LRU pages to flush per round."), - // AllowedValues: to.Ptr("0-1073741823"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("100"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("100"), - // }, - // }, - // { - // Name: to.Ptr("bgwriter_lru_multiplier"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/bgwriter_lru_multiplier"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Multiple of the average buffer usage to free per round."), - // AllowedValues: to.Ptr("0-10"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("2"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("2"), - // }, - // }, - // { - // Name: to.Ptr("bytea_output"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/bytea_output"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the output format for bytea."), - // AllowedValues: to.Ptr("escape,hex"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("hex"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("hex"), - // }, - // }, - // { - // Name: to.Ptr("check_function_bodies"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/check_function_bodies"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Checks function bodies during CREATE FUNCTION."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("checkpoint_completion_target"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/checkpoint_completion_target"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Time spent flushing dirty buffers during checkpoint, as fraction of checkpoint interval."), - // AllowedValues: to.Ptr("0-1"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("0.5"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.5"), - // }, - // }, - // { - // Name: to.Ptr("checkpoint_timeout"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/checkpoint_timeout"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum time between automatic WAL checkpoints."), - // AllowedValues: to.Ptr("30-86400"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("300"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("300"), - // }, - // }, - // { - // Name: to.Ptr("checkpoint_warning"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/checkpoint_warning"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables warnings if checkpoint segments are filled more frequently than this."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("30"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("30"), - // }, - // }, - // { - // Name: to.Ptr("client_encoding"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/client_encoding"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the client's character set encoding."), - // AllowedValues: to.Ptr("BIG5,EUC_CN,EUC_JP,EUC_JIS_2004,EUC_KR,EUC_TW,GB18030,GBK,ISO_8859_5,ISO_8859_6,ISO_8859_7,ISO_8859_8,JOHAB,KOI8R,KOI8U,LATIN1,LATIN2,LATIN3,LATIN4,LATIN5,LATIN6,LATIN7,LATIN8,LATIN9,LATIN10,MULE_INTERNAL,SJIS,SHIFT_JIS_2004,SQL_ASCII,UHC,UTF8,WIN866,WIN874,WIN1250,WIN1251,WIN1252,WIN1253,WIN1254,WIN1255,WIN1256,WIN1257,WIN1258"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("sql_ascii"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("sql_ascii"), - // }, - // }, - // { - // Name: to.Ptr("client_min_messages"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/client_min_messages"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the message levels that are sent to the client."), - // AllowedValues: to.Ptr("debug5,debug4,debug3,debug2,debug1,log,notice,warning,error"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("notice"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("notice"), - // }, - // }, - // { - // Name: to.Ptr("commit_delay"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/commit_delay"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the delay in microseconds between transaction commit and flushing WAL to disk."), - // AllowedValues: to.Ptr("0-100000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("commit_siblings"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/commit_siblings"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the minimum concurrent open transactions before performing commit_delay."), - // AllowedValues: to.Ptr("0-1000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("5"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("5"), - // }, - // }, - // { - // Name: to.Ptr("constraint_exclusion"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/constraint_exclusion"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner to use constraints to optimize queries."), - // AllowedValues: to.Ptr("partition,on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("partition"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("partition"), - // }, - // }, - // { - // Name: to.Ptr("cpu_index_tuple_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/cpu_index_tuple_cost"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of processing each index entry during an index scan."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("0.005"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.005"), - // }, - // }, - // { - // Name: to.Ptr("cpu_operator_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/cpu_operator_cost"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of processing each operator or function call."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("0.0025"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.0025"), - // }, - // }, - // { - // Name: to.Ptr("cpu_tuple_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/cpu_tuple_cost"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of processing each tuple (row)."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("0.01"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.01"), - // }, - // }, - // { - // Name: to.Ptr("cursor_tuple_fraction"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/cursor_tuple_fraction"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the fraction of a cursor's rows that will be retrieved."), - // AllowedValues: to.Ptr("0-1"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("0.1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.1"), - // }, - // }, - // { - // Name: to.Ptr("DateStyle"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/DateStyle"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the display format for date and time values."), - // AllowedValues: to.Ptr("(ISO|POSTGRES|SQL|GERMAN)(, (DMY|MDY|YMD))?"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), - // DefaultValue: to.Ptr("ISO, MDY"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("ISO, MDY"), - // }, - // }, - // { - // Name: to.Ptr("deadlock_timeout"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/deadlock_timeout"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the amount of time, in milliseconds, to wait on a lock before checking for deadlock."), - // AllowedValues: to.Ptr("1-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("1000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1000"), - // }, - // }, - // { - // Name: to.Ptr("debug_pretty_print"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/debug_pretty_print"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Indents parse and plan tree displays."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("debug_print_parse"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/debug_print_parse"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Logs each query's parse tree."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("debug_print_plan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/debug_print_plan"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Logs each query's execution plan."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("debug_print_rewritten"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/debug_print_rewritten"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Logs each query's rewritten parse tree."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("default_statistics_target"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/default_statistics_target"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the default statistics target."), - // AllowedValues: to.Ptr("1-10000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("100"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("100"), - // }, - // }, - // { - // Name: to.Ptr("default_tablespace"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/default_tablespace"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the default tablespace to create tables and indexes in."), - // AllowedValues: to.Ptr("[A-Za-z._]*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), - // DefaultValue: to.Ptr(""), - // Source: to.Ptr("system-default"), - // Value: to.Ptr(""), - // }, - // }, - // { - // Name: to.Ptr("default_text_search_config"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/default_text_search_config"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets default text search configuration."), - // AllowedValues: to.Ptr("[A-Za-z._]+"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), - // DefaultValue: to.Ptr("pg_catalog.english"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("pg_catalog.english"), - // }, - // }, - // { - // Name: to.Ptr("default_transaction_deferrable"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/default_transaction_deferrable"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the default deferrable status of new transactions."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("default_transaction_isolation"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/default_transaction_isolation"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the transaction isolation level of each new transaction."), - // AllowedValues: to.Ptr("serializable,repeatable read,read committed,read uncommitted"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("read committed"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("read committed"), - // }, - // }, - // { - // Name: to.Ptr("default_transaction_read_only"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/default_transaction_read_only"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the default read-only status of new transactions."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("default_with_oids"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/default_with_oids"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Creates new tables with OIDs by default."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("effective_cache_size"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/effective_cache_size"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's assumption about the size of the disk cache."), - // AllowedValues: to.Ptr("1-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("3145728"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("3145728"), - // }, - // }, - // { - // Name: to.Ptr("enable_bitmapscan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_bitmapscan"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of bitmap-scan plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_gathermerge"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_gathermerge"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of gather merge plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_hashagg"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_hashagg"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of hashed aggregation plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_hashjoin"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_hashjoin"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of hash join plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_indexonlyscan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_indexonlyscan"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of index-only-scan plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_indexscan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_indexscan"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of index-scan plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_material"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_material"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of materialization."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_mergejoin"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_mergejoin"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of merge join plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_nestloop"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_nestloop"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of nested loop join plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_seqscan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_seqscan"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of sequential-scan plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_sort"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_sort"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of explicit sort steps."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("enable_tidscan"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/enable_tidscan"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables the planner's use of TID scan plans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("escape_string_warning"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/escape_string_warning"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Warns about backslash escapes in ordinary string literals."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("exit_on_error"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/exit_on_error"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Terminates session on any error."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("extra_float_digits"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/extra_float_digits"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the number of digits displayed for floating-point values."), - // AllowedValues: to.Ptr("-15-3"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1"), - // }, - // }, - // { - // Name: to.Ptr("force_parallel_mode"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/force_parallel_mode"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Forces use of parallel query facilities."), - // AllowedValues: to.Ptr("off,on,regress"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("from_collapse_limit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/from_collapse_limit"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the FROM-list size beyond which subqueries are not collapsed."), - // AllowedValues: to.Ptr("1-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("8"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("8"), - // }, - // }, - // { - // Name: to.Ptr("geqo"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/geqo"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables genetic query optimization."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("geqo_effort"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/geqo_effort"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("GEQO: effort is used to set the default for other GEQO parameters."), - // AllowedValues: to.Ptr("1-10"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("5"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("5"), - // }, - // }, - // { - // Name: to.Ptr("geqo_generations"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/geqo_generations"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("GEQO: number of iterations of the algorithm."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("geqo_pool_size"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/geqo_pool_size"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("GEQO: number of individuals in the population."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("geqo_seed"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/geqo_seed"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("GEQO: seed for random path selection."), - // AllowedValues: to.Ptr("0-1"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("geqo_selection_bias"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/geqo_selection_bias"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("GEQO: selective pressure within the population."), - // AllowedValues: to.Ptr("1.5-2"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("2"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("2"), - // }, - // }, - // { - // Name: to.Ptr("geqo_threshold"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/geqo_threshold"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the threshold of FROM items beyond which GEQO is used."), - // AllowedValues: to.Ptr("2-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("12"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("12"), - // }, - // }, - // { - // Name: to.Ptr("gin_fuzzy_search_limit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/gin_fuzzy_search_limit"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum allowed result for exact search by GIN."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("gin_pending_list_limit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/gin_pending_list_limit"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum size of the pending list for GIN index."), - // AllowedValues: to.Ptr("64-2097151"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("4096"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("4096"), - // }, - // }, - // { - // Name: to.Ptr("idle_in_transaction_session_timeout"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/idle_in_transaction_session_timeout"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum allowed duration of any idling transaction."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("IntervalStyle"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/IntervalStyle"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the display format for interval values."), - // AllowedValues: to.Ptr("postgres,postgres_verbose,sql_standard,iso_8601"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("postgres"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("postgres"), - // }, - // }, - // { - // Name: to.Ptr("join_collapse_limit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/join_collapse_limit"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the FROM-list size beyond which JOIN constructs are not flattened."), - // AllowedValues: to.Ptr("1-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("8"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("8"), - // }, - // }, - // { - // Name: to.Ptr("lc_monetary"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/lc_monetary"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the locale for formatting monetary amounts."), - // AllowedValues: to.Ptr("[A-Za-z0-9._ -]+"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), - // DefaultValue: to.Ptr("en_US.utf-8"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("en_US.utf-8"), - // }, - // }, - // { - // Name: to.Ptr("lc_numeric"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/lc_numeric"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the locale for formatting numbers."), - // AllowedValues: to.Ptr("[A-Za-z0-9._ -]+"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), - // DefaultValue: to.Ptr("en_US.utf-8"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("en_US.utf-8"), - // }, - // }, - // { - // Name: to.Ptr("lo_compat_privileges"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/lo_compat_privileges"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables backward compatibility mode for privilege checks on large objects."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("lock_timeout"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/lock_timeout"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum allowed duration (in milliseconds) of any wait for a lock. 0 turns this off."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("log_autovacuum_min_duration"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_autovacuum_min_duration"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the minimum execution time above which autovacuum actions will be logged."), - // AllowedValues: to.Ptr("-1-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("-1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("-1"), - // }, - // }, - // { - // Name: to.Ptr("log_checkpoints"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_checkpoints"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Logs each checkpoint."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("log_connections"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_connections"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Logs each successful connection."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("log_destination"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_destination"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the destination for server log output."), - // AllowedValues: to.Ptr("stderr,csvlog"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("stderr"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("stderr"), - // }, - // }, - // { - // Name: to.Ptr("log_disconnections"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_disconnections"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Logs end of a session, including duration."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("log_duration"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_duration"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Logs the duration of each completed SQL statement."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("log_error_verbosity"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_error_verbosity"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the verbosity of logged messages."), - // AllowedValues: to.Ptr("terse,default,verbose"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("default"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("default"), - // }, - // }, - // { - // Name: to.Ptr("log_lock_waits"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_lock_waits"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Logs long lock waits."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("log_min_duration_statement"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_min_duration_statement"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the minimum execution time (in milliseconds) above which statements will be logged. -1 disables logging statement durations."), - // AllowedValues: to.Ptr("-1-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("-1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("-1"), - // }, - // }, - // { - // Name: to.Ptr("log_min_error_statement"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_min_error_statement"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Causes all statements generating error at or above this level to be logged."), - // AllowedValues: to.Ptr("debug5,debug4,debug3,debug2,debug1,info,notice,warning,error,log,fatal,panic"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("error"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("error"), - // }, - // }, - // { - // Name: to.Ptr("log_min_messages"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_min_messages"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the message levels that are logged."), - // AllowedValues: to.Ptr("debug5,debug4,debug3,debug2,debug1,info,notice,warning,error,log,fatal,panic"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("warning"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("warning"), - // }, - // }, - // { - // Name: to.Ptr("log_replication_commands"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_replication_commands"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Logs each replication command."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("log_statement"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_statement"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the type of statements logged."), - // AllowedValues: to.Ptr("none,ddl,mod,all"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("none"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("none"), - // }, - // }, - // { - // Name: to.Ptr("log_statement_stats"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_statement_stats"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("For each query, writes cumulative performance statistics to the server log."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("log_temp_files"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/log_temp_files"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Logs the use of temporary files larger than this number of kilobytes."), - // AllowedValues: to.Ptr("-1-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("-1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("-1"), - // }, - // }, - // { - // Name: to.Ptr("maintenance_work_mem"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/maintenance_work_mem"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum memory to be used for maintenance operations."), - // AllowedValues: to.Ptr("1024-2097151"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("332800"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("332800"), - // }, - // }, - // { - // Name: to.Ptr("max_parallel_workers"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_parallel_workers"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum number of parallel workers than can be active at one time."), - // AllowedValues: to.Ptr("0-1024"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("8"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("8"), - // }, - // }, - // { - // Name: to.Ptr("max_parallel_workers_per_gather"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_parallel_workers_per_gather"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum number of parallel processes per executor node."), - // AllowedValues: to.Ptr("0-1024"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("2"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("2"), - // }, - // }, - // { - // Name: to.Ptr("max_pred_locks_per_page"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_pred_locks_per_page"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum number of predicate-locked tuples per page."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("2"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("2"), - // }, - // }, - // { - // Name: to.Ptr("max_pred_locks_per_relation"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_pred_locks_per_relation"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum number of predicate-locked pages and tuples per relation."), - // AllowedValues: to.Ptr("-2147483648-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("-2"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("-2"), - // }, - // }, - // { - // Name: to.Ptr("max_standby_archive_delay"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_standby_archive_delay"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum delay before canceling queries when a hot standby server is processing archived WAL data."), - // AllowedValues: to.Ptr("-1-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("30000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("30000"), - // }, - // }, - // { - // Name: to.Ptr("max_standby_streaming_delay"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_standby_streaming_delay"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum delay before canceling queries when a hot standby server is processing streamed WAL data."), - // AllowedValues: to.Ptr("-1-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("30000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("30000"), - // }, - // }, - // { - // Name: to.Ptr("max_sync_workers_per_subscription"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_sync_workers_per_subscription"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Maximum number of table synchronization workers per subscription."), - // AllowedValues: to.Ptr("0-262143"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("2"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("2"), - // }, - // }, - // { - // Name: to.Ptr("max_wal_size"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/max_wal_size"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the WAL size that triggers a checkpoint."), - // AllowedValues: to.Ptr("2-2097151"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("1024"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1024"), - // }, - // }, - // { - // Name: to.Ptr("min_parallel_index_scan_size"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/min_parallel_index_scan_size"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the minimum amount of index data for a parallel scan."), - // AllowedValues: to.Ptr("0-715827882"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("64"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("64"), - // }, - // }, - // { - // Name: to.Ptr("min_parallel_table_scan_size"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/min_parallel_table_scan_size"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the minimum amount of table data for a parallel scan."), - // AllowedValues: to.Ptr("0-715827882"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("1024"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1024"), - // }, - // }, - // { - // Name: to.Ptr("min_wal_size"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/min_wal_size"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the minimum size to shrink the WAL to."), - // AllowedValues: to.Ptr("2-2097151"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("80"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("80"), - // }, - // }, - // { - // Name: to.Ptr("operator_precedence_warning"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/operator_precedence_warning"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Emits a warning for constructs that changed meaning since PostgreSQL 9.4."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("parallel_setup_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/parallel_setup_cost"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of starting up worker processes for parallel query."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("1000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1000"), - // }, - // }, - // { - // Name: to.Ptr("parallel_tuple_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/parallel_tuple_cost"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of passing each tuple (row) from worker to master backend."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("0.1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0.1"), - // }, - // }, - // { - // Name: to.Ptr("quote_all_identifiers"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/quote_all_identifiers"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("When generating SQL fragments, quotes all identifiers."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("random_page_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/random_page_cost"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of a nonsequentially fetched disk page."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("4"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("4"), - // }, - // }, - // { - // Name: to.Ptr("row_security"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/row_security"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables row security."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("search_path"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/search_path"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the schema search order for names that are not schema-qualified."), - // AllowedValues: to.Ptr("[A-Za-z.\"$, ]+"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), - // DefaultValue: to.Ptr("\"$user\", public"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("\"$user\", public"), - // }, - // }, - // { - // Name: to.Ptr("seq_page_cost"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/seq_page_cost"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the planner's estimate of the cost of a sequentially fetched disk page."), - // AllowedValues: to.Ptr("0-1.79769e+308"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeNumeric), - // DefaultValue: to.Ptr("1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1"), - // }, - // }, - // { - // Name: to.Ptr("session_replication_role"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/session_replication_role"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the session's behavior for triggers and rewrite rules."), - // AllowedValues: to.Ptr("origin,replica,local"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("origin"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("origin"), - // }, - // }, - // { - // Name: to.Ptr("standard_conforming_strings"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/standard_conforming_strings"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Causes '...' strings to treat backslashes literally."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("statement_timeout"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/statement_timeout"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum allowed duration (in milliseconds) of any statement. 0 turns this off."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("synchronize_seqscans"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/synchronize_seqscans"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enables synchronized sequential scans."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("synchronous_commit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/synchronous_commit"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the current transaction's synchronization level."), - // AllowedValues: to.Ptr("local,remote_write,on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("tcp_keepalives_count"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/tcp_keepalives_count"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Maximum number of TCP keepalive retransmits."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("9"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("9"), - // }, - // }, - // { - // Name: to.Ptr("tcp_keepalives_idle"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/tcp_keepalives_idle"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Time between issuing TCP keepalives."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("120"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("120"), - // }, - // }, - // { - // Name: to.Ptr("tcp_keepalives_interval"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/tcp_keepalives_interval"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Time between TCP keepalive retransmits."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("30"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("30"), - // }, - // }, - // { - // Name: to.Ptr("temp_buffers"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/temp_buffers"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum number of temporary buffers used by each database session."), - // AllowedValues: to.Ptr("100-1073741823"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("1024"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1024"), - // }, - // }, - // { - // Name: to.Ptr("temp_tablespaces"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/temp_tablespaces"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the tablespace(s) to use for temporary tables and sort files."), - // AllowedValues: to.Ptr("[A-Za-z._]*"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), - // DefaultValue: to.Ptr(""), - // Source: to.Ptr("system-default"), - // Value: to.Ptr(""), - // }, - // }, - // { - // Name: to.Ptr("TimeZone"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/TimeZone"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the time zone for displaying and interpreting time stamps."), - // AllowedValues: to.Ptr("[A-Za-z0-9/+_-]+"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataType("String")), - // DefaultValue: to.Ptr("UTC"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("UTC"), - // }, - // }, - // { - // Name: to.Ptr("track_activities"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/track_activities"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Collects information about executing commands."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("track_counts"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/track_counts"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Collects statistics on database activity."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // }, - // { - // Name: to.Ptr("track_functions"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/track_functions"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Collects function-level statistics on database activity."), - // AllowedValues: to.Ptr("none,pl,all"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("none"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("none"), - // }, - // }, - // { - // Name: to.Ptr("track_io_timing"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/track_io_timing"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Collects timing statistics for database I/O activity."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("transform_null_equals"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/transform_null_equals"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Treats \"expr=NULL\" as \"expr IS NULL\"."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("off"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("off"), - // }, - // }, - // { - // Name: to.Ptr("vacuum_cost_delay"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_cost_delay"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Vacuum cost delay in milliseconds."), - // AllowedValues: to.Ptr("0-100"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("vacuum_cost_limit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_cost_limit"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Vacuum cost amount available before napping."), - // AllowedValues: to.Ptr("1-10000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("200"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("200"), - // }, - // }, - // { - // Name: to.Ptr("vacuum_cost_page_dirty"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_cost_page_dirty"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Vacuum cost for a page dirtied by vacuum."), - // AllowedValues: to.Ptr("0-10000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("20"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("20"), - // }, - // }, - // { - // Name: to.Ptr("vacuum_cost_page_hit"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_cost_page_hit"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Vacuum cost for a page found in the buffer cache."), - // AllowedValues: to.Ptr("0-10000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("1"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("1"), - // }, - // }, - // { - // Name: to.Ptr("vacuum_cost_page_miss"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_cost_page_miss"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Vacuum cost for a page not found in the buffer cache."), - // AllowedValues: to.Ptr("0-10000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("10"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("10"), - // }, - // }, - // { - // Name: to.Ptr("vacuum_defer_cleanup_age"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_defer_cleanup_age"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Number of transactions by which VACUUM and HOT cleanup should be deferred, if any."), - // AllowedValues: to.Ptr("0-1000000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("0"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("0"), - // }, - // }, - // { - // Name: to.Ptr("vacuum_freeze_min_age"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_freeze_min_age"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Minimum age at which VACUUM should freeze a table row."), - // AllowedValues: to.Ptr("0-1000000000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("50000000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("50000000"), - // }, - // }, - // { - // Name: to.Ptr("vacuum_freeze_table_age"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_freeze_table_age"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Age at which VACUUM should scan whole table to freeze tuples."), - // AllowedValues: to.Ptr("0-2000000000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("150000000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("150000000"), - // }, - // }, - // { - // Name: to.Ptr("vacuum_multixact_freeze_min_age"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_multixact_freeze_min_age"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Minimum age at which VACUUM should freeze a MultiXactId in a table row."), - // AllowedValues: to.Ptr("0-1000000000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("5000000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("5000000"), - // }, - // }, - // { - // Name: to.Ptr("vacuum_multixact_freeze_table_age"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/vacuum_multixact_freeze_table_age"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Multixact age at which VACUUM should scan whole table to freeze tuples."), - // AllowedValues: to.Ptr("0-2000000000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("150000000"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("150000000"), - // }, - // }, - // { - // Name: to.Ptr("wal_receiver_status_interval"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/wal_receiver_status_interval"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the maximum interval between WAL receiver status reports to the primary."), - // AllowedValues: to.Ptr("0-2147483"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("10"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("10"), - // }, - // }, - // { - // Name: to.Ptr("wal_writer_delay"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/wal_writer_delay"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Time between WAL flushes performed in the WAL writer."), - // AllowedValues: to.Ptr("1-10000"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("200"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("200"), - // }, - // }, - // { - // Name: to.Ptr("wal_writer_flush_after"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/wal_writer_flush_after"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Amount of WAL written out by WAL writer that triggers a flush."), - // AllowedValues: to.Ptr("0-2147483647"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("128"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("128"), - // }, - // }, - // { - // Name: to.Ptr("work_mem"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/work_mem"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets the amount of memory to be used by internal sort operations and hash tables before writing to temporary disk files."), - // AllowedValues: to.Ptr("4096-2097151"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeInteger), - // DefaultValue: to.Ptr("115712"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("115712"), - // }, - // }, - // { - // Name: to.Ptr("xmlbinary"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/xmlbinary"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets how binary values are to be encoded in XML."), - // AllowedValues: to.Ptr("base64,hex"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("base64"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("base64"), - // }, - // }, - // { - // Name: to.Ptr("xmloption"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/xmloption"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Sets whether XML data in implicit parsing and serialization operations is to be considered as documents or content fragments."), - // AllowedValues: to.Ptr("content,document"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("content"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("content"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ConfigurationGet.json -func ExampleConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConfigurationsClient().Get(ctx, "testrg", "testserver", "array_nulls", 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.Configuration = armpostgresqlflexibleservers.Configuration{ - // Name: to.Ptr("array_nulls"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/array_nulls"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Enable input of NULL elements in arrays."), - // AllowedValues: to.Ptr("on,off"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeBoolean), - // DefaultValue: to.Ptr("on"), - // Source: to.Ptr("system-default"), - // Value: to.Ptr("on"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ConfigurationUpdate.json -func ExampleConfigurationsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationsClient().BeginUpdate(ctx, "testrg", "testserver", "event_scheduler", armpostgresqlflexibleservers.ConfigurationForUpdate{ - Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - Source: to.Ptr("user-override"), - Value: to.Ptr("on"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Configuration = armpostgresqlflexibleservers.Configuration{ - // Name: to.Ptr("event_scheduler"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/configurations"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/configurations/event_scheduler"), - // Properties: &armpostgresqlflexibleservers.ConfigurationProperties{ - // Description: to.Ptr("Indicates the status of the Event Scheduler."), - // AllowedValues: to.Ptr("ON,OFF,DISABLED"), - // DataType: to.Ptr(armpostgresqlflexibleservers.ConfigurationDataTypeEnumeration), - // DefaultValue: to.Ptr("OFF"), - // Source: to.Ptr("user-override"), - // Value: to.Ptr("ON"), - // }, - // } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/constants.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/constants.go index 8c7a0847c62d..74cddca71f86 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/constants.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/constants.go @@ -7,10 +7,10 @@ package armpostgresqlflexibleservers const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers" - moduleVersion = "v4.1.0" + moduleVersion = "v5.0.0-beta.1" ) -// ActiveDirectoryAuthEnum - If Enabled, Azure Active Directory authentication is enabled. +// ActiveDirectoryAuthEnum - If Enabled, Microsoft Entra authentication is enabled. type ActiveDirectoryAuthEnum string const ( @@ -257,7 +257,8 @@ 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. +// is supported. "Disabled" stands for fast provisioning is not supported. Will be deprecated in future, +// please look to Supported Features for "FastProvisioning". type FastProvisioningSupportedEnum string const ( @@ -274,7 +275,8 @@ func PossibleFastProvisioningSupportedEnumValues() []FastProvisioningSupportedEn } // GeoBackupSupportedEnum - Determines if geo-backup is supported in this region. "Enabled" means geo-backup is supported. -// "Disabled" stands for geo-back is not supported. +// "Disabled" stands for geo-back is not supported. Will be deprecated in future, please look to Supported +// Features for "GeoBackup". type GeoBackupSupportedEnum string const ( @@ -561,7 +563,7 @@ func PossibleMigrationSubStateValues() []MigrationSubState { // 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. +// supported. Will be deprecated in future, please look to Supported Features for "OnlineResize". type OnlineResizeSupportedEnum string const ( @@ -645,7 +647,7 @@ func PossiblePasswordAuthEnumValues() []PasswordAuthEnum { } } -// PrincipalType - The principal type used to represent the type of Active Directory Administrator. +// PrincipalType - The principal type used to represent the type of Microsoft Entra Administrator. type PrincipalType string const ( @@ -719,6 +721,39 @@ func PossibleReadReplicaPromoteModeValues() []ReadReplicaPromoteMode { } } +type RecommendationType string + +const ( + RecommendationTypeCreateIndex RecommendationType = "CreateIndex" + RecommendationTypeDropIndex RecommendationType = "DropIndex" +) + +// PossibleRecommendationTypeValues returns the possible values for the RecommendationType const type. +func PossibleRecommendationTypeValues() []RecommendationType { + return []RecommendationType{ + RecommendationTypeCreateIndex, + RecommendationTypeDropIndex, + } +} + +// RecommendationTypeEnum - Type for this recommendation. +type RecommendationTypeEnum string + +const ( + RecommendationTypeEnumCreateIndex RecommendationTypeEnum = "CreateIndex" + RecommendationTypeEnumDropIndex RecommendationTypeEnum = "DropIndex" + RecommendationTypeEnumReIndex RecommendationTypeEnum = "ReIndex" +) + +// PossibleRecommendationTypeEnumValues returns the possible values for the RecommendationTypeEnum const type. +func PossibleRecommendationTypeEnumValues() []RecommendationTypeEnum { + return []RecommendationTypeEnum{ + RecommendationTypeEnumCreateIndex, + RecommendationTypeEnumDropIndex, + RecommendationTypeEnumReIndex, + } +} + // ReplicationPromoteOption - Sets the promote options for a replica server. This is a write only property. type ReplicationPromoteOption string @@ -781,7 +816,8 @@ func PossibleReplicationStateValues() []ReplicationState { } // RestrictedEnum - A value indicating whether this region is restricted. "Enabled" means region is restricted. "Disabled" -// stands for region is not restricted. +// stands for region is not restricted. Will be deprecated in future, please look to Supported +// Features for "Restricted". type RestrictedEnum string const ( @@ -880,13 +916,16 @@ func PossibleServerPublicNetworkAccessStateValues() []ServerPublicNetworkAccessS type ServerState string const ( - ServerStateDisabled ServerState = "Disabled" - ServerStateDropping ServerState = "Dropping" - ServerStateReady ServerState = "Ready" - ServerStateStarting ServerState = "Starting" - ServerStateStopped ServerState = "Stopped" - ServerStateStopping ServerState = "Stopping" - ServerStateUpdating ServerState = "Updating" + ServerStateDisabled ServerState = "Disabled" + ServerStateDropping ServerState = "Dropping" + ServerStateInaccessible ServerState = "Inaccessible" + ServerStateProvisioning ServerState = "Provisioning" + ServerStateReady ServerState = "Ready" + ServerStateRestarting ServerState = "Restarting" + ServerStateStarting ServerState = "Starting" + ServerStateStopped ServerState = "Stopped" + ServerStateStopping ServerState = "Stopping" + ServerStateUpdating ServerState = "Updating" ) // PossibleServerStateValues returns the possible values for the ServerState const type. @@ -894,7 +933,10 @@ func PossibleServerStateValues() []ServerState { return []ServerState{ ServerStateDisabled, ServerStateDropping, + ServerStateInaccessible, + ServerStateProvisioning, ServerStateReady, + ServerStateRestarting, ServerStateStarting, ServerStateStopped, ServerStateStopping, @@ -906,12 +948,13 @@ func PossibleServerStateValues() []ServerState { type ServerVersion string const ( - ServerVersionEleven ServerVersion = "11" - ServerVersionFifteen ServerVersion = "15" - ServerVersionFourteen ServerVersion = "14" - ServerVersionSixteen ServerVersion = "16" - ServerVersionThirteen ServerVersion = "13" - ServerVersionTwelve ServerVersion = "12" + ServerVersionEleven ServerVersion = "11" + ServerVersionFifteen ServerVersion = "15" + ServerVersionFourteen ServerVersion = "14" + ServerVersionSeventeen ServerVersion = "17" + ServerVersionSixteen ServerVersion = "16" + ServerVersionThirteen ServerVersion = "13" + ServerVersionTwelve ServerVersion = "12" ) // PossibleServerVersionValues returns the possible values for the ServerVersion const type. @@ -920,6 +963,7 @@ func PossibleServerVersionValues() []ServerVersion { ServerVersionEleven, ServerVersionFifteen, ServerVersionFourteen, + ServerVersionSeventeen, ServerVersionSixteen, ServerVersionThirteen, ServerVersionTwelve, @@ -927,22 +971,36 @@ func PossibleServerVersionValues() []ServerVersion { } // SourceType - Migration source server type : OnPremises, AWS, GCP, AzureVM, PostgreSQLSingleServer, AWSRDS, AWSAURORA, AWSEC2, -// GCPCloudSQL, GCPAlloyDB, GCPCompute, or EDB +// GCPCloudSQL, GCPAlloyDB, GCPCompute, EDB, EDBOracleServer, EDBPostgreSQL, +// PostgreSQLFlexibleServer, PostgreSQLCosmosDB, HuaweiRDS, HuaweiCompute, HerokuPostgreSQL, CrunchyPostgreSQL, ApsaraDBRDS, +// DigitalOceanDroplets, DigitalOceanPostgreSQL, or Supabase_PostgreSQL type SourceType string const ( - SourceTypeAWS SourceType = "AWS" - SourceTypeAWSAURORA SourceType = "AWS_AURORA" - SourceTypeAWSEC2 SourceType = "AWS_EC2" - SourceTypeAWSRDS SourceType = "AWS_RDS" - SourceTypeAzureVM SourceType = "AzureVM" - SourceTypeEDB SourceType = "EDB" - SourceTypeGCP SourceType = "GCP" - SourceTypeGCPAlloyDB SourceType = "GCP_AlloyDB" - SourceTypeGCPCloudSQL SourceType = "GCP_CloudSQL" - SourceTypeGCPCompute SourceType = "GCP_Compute" - SourceTypeOnPremises SourceType = "OnPremises" - SourceTypePostgreSQLSingleServer SourceType = "PostgreSQLSingleServer" + SourceTypeAWS SourceType = "AWS" + SourceTypeAWSAURORA SourceType = "AWS_AURORA" + SourceTypeAWSEC2 SourceType = "AWS_EC2" + SourceTypeAWSRDS SourceType = "AWS_RDS" + SourceTypeApsaraDBRDS SourceType = "ApsaraDB_RDS" + SourceTypeAzureVM SourceType = "AzureVM" + SourceTypeCrunchyPostgreSQL SourceType = "Crunchy_PostgreSQL" + SourceTypeDigitalOceanDroplets SourceType = "Digital_Ocean_Droplets" + SourceTypeDigitalOceanPostgreSQL SourceType = "Digital_Ocean_PostgreSQL" + SourceTypeEDB SourceType = "EDB" + SourceTypeEDBOracleServer SourceType = "EDB_Oracle_Server" + SourceTypeEDBPostgreSQL SourceType = "EDB_PostgreSQL" + SourceTypeGCP SourceType = "GCP" + SourceTypeGCPAlloyDB SourceType = "GCP_AlloyDB" + SourceTypeGCPCloudSQL SourceType = "GCP_CloudSQL" + SourceTypeGCPCompute SourceType = "GCP_Compute" + SourceTypeHerokuPostgreSQL SourceType = "Heroku_PostgreSQL" + SourceTypeHuaweiCompute SourceType = "Huawei_Compute" + SourceTypeHuaweiRDS SourceType = "Huawei_RDS" + SourceTypeOnPremises SourceType = "OnPremises" + SourceTypePostgreSQLCosmosDB SourceType = "PostgreSQLCosmosDB" + SourceTypePostgreSQLFlexibleServer SourceType = "PostgreSQLFlexibleServer" + SourceTypePostgreSQLSingleServer SourceType = "PostgreSQLSingleServer" + SourceTypeSupabasePostgreSQL SourceType = "Supabase_PostgreSQL" ) // PossibleSourceTypeValues returns the possible values for the SourceType const type. @@ -952,14 +1010,26 @@ func PossibleSourceTypeValues() []SourceType { SourceTypeAWSAURORA, SourceTypeAWSEC2, SourceTypeAWSRDS, + SourceTypeApsaraDBRDS, SourceTypeAzureVM, + SourceTypeCrunchyPostgreSQL, + SourceTypeDigitalOceanDroplets, + SourceTypeDigitalOceanPostgreSQL, SourceTypeEDB, + SourceTypeEDBOracleServer, + SourceTypeEDBPostgreSQL, SourceTypeGCP, SourceTypeGCPAlloyDB, SourceTypeGCPCloudSQL, SourceTypeGCPCompute, + SourceTypeHerokuPostgreSQL, + SourceTypeHuaweiCompute, + SourceTypeHuaweiRDS, SourceTypeOnPremises, + SourceTypePostgreSQLCosmosDB, + SourceTypePostgreSQLFlexibleServer, SourceTypePostgreSQLSingleServer, + SourceTypeSupabasePostgreSQL, } } @@ -996,7 +1066,8 @@ func PossibleStorageAutoGrowValues() []StorageAutoGrow { } // 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. +// storage auto-grow is supported. "Disabled" stands for storage auto-grow is not supported. Will be deprecated +// in future, please look to Supported Features for "StorageAutoGrowth". type StorageAutoGrowthSupportedEnum string const ( @@ -1012,13 +1083,14 @@ func PossibleStorageAutoGrowthSupportedEnumValues() []StorageAutoGrowthSupported } } -// StorageType - Storage type for the server. Allowed values are PremiumLRS and PremiumV2LRS, and default is Premium_LRS if -// not specified +// StorageType - Storage type for the server. Allowed values are PremiumLRS, PremiumV2LRS, and UltraSSDLRS. Default is PremiumLRS +// if not specified type StorageType string const ( StorageTypePremiumLRS StorageType = "Premium_LRS" StorageTypePremiumV2LRS StorageType = "PremiumV2_LRS" + StorageTypeUltraSSDLRS StorageType = "UltraSSD_LRS" ) // PossibleStorageTypeValues returns the possible values for the StorageType const type. @@ -1026,6 +1098,23 @@ func PossibleStorageTypeValues() []StorageType { return []StorageType{ StorageTypePremiumLRS, StorageTypePremiumV2LRS, + StorageTypeUltraSSDLRS, + } +} + +// SupportedFeatureStatusEnum - Status of feature +type SupportedFeatureStatusEnum string + +const ( + SupportedFeatureStatusEnumDisabled SupportedFeatureStatusEnum = "Disabled" + SupportedFeatureStatusEnumEnabled SupportedFeatureStatusEnum = "Enabled" +) + +// PossibleSupportedFeatureStatusEnumValues returns the possible values for the SupportedFeatureStatusEnum const type. +func PossibleSupportedFeatureStatusEnumValues() []SupportedFeatureStatusEnum { + return []SupportedFeatureStatusEnum{ + SupportedFeatureStatusEnumDisabled, + SupportedFeatureStatusEnumEnabled, } } @@ -1075,6 +1164,21 @@ func PossibleTriggerCutoverEnumValues() []TriggerCutoverEnum { } } +type TuningOptionEnum string + +const ( + TuningOptionEnumConfiguration TuningOptionEnum = "configuration" + TuningOptionEnumIndex TuningOptionEnum = "index" +) + +// PossibleTuningOptionEnumValues returns the possible values for the TuningOptionEnum const type. +func PossibleTuningOptionEnumValues() []TuningOptionEnum { + return []TuningOptionEnum{ + TuningOptionEnumConfiguration, + TuningOptionEnumIndex, + } +} + // ValidationState - Validation status for migration type ValidationState string @@ -1109,7 +1213,7 @@ func PossibleVirtualEndpointTypeValues() []VirtualEndpointType { // 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. +// geo-backup is not supported. Will be deprecated in future, please look to Supported Features for "ZoneRedundantHaAndGeoBackup". type ZoneRedundantHaAndGeoBackupSupportedEnum string const ( @@ -1126,7 +1230,8 @@ func PossibleZoneRedundantHaAndGeoBackupSupportedEnumValues() []ZoneRedundantHaA } // 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. +// zone redundant HA is supported. "Disabled" stands for zone redundant HA is not supported. Will be deprecated +// in future, please look to Supported Features for "ZoneRedundantHa". type ZoneRedundantHaSupportedEnum string const ( diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client.go index 67e33c240f00..8519291bc0b6 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client.go @@ -43,7 +43,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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - databaseName - The name of the database. @@ -70,7 +70,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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview 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" @@ -116,7 +116,7 @@ func (client *DatabasesClient) createCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - databaseName - The name of the database. @@ -154,7 +154,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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview 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" @@ -200,7 +200,7 @@ func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - databaseName - The name of the database. @@ -260,7 +260,7 @@ func (client *DatabasesClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -277,7 +277,7 @@ func (client *DatabasesClient) getHandleResponse(resp *http.Response) (Databases // NewListByServerPager - List all the databases in a given server. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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 @@ -325,7 +325,7 @@ func (client *DatabasesClient) listByServerCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") 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 deleted file mode 100644 index 55a686687ee6..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/databases_client_example_test.go +++ /dev/null @@ -1,153 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/DatabaseCreate.json -func ExampleDatabasesClient_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.NewDatabasesClient().BeginCreate(ctx, "TestGroup", "testserver", "db1", armpostgresqlflexibleservers.Database{ - Properties: &armpostgresqlflexibleservers.DatabaseProperties{ - Charset: to.Ptr("utf8"), - Collation: to.Ptr("en_US.utf8"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armpostgresqlflexibleservers.Database{ - // Name: to.Ptr("db1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/databases/db1"), - // Properties: &armpostgresqlflexibleservers.DatabaseProperties{ - // Charset: to.Ptr("utf8"), - // Collation: to.Ptr("en_US.utf8"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/DatabaseDelete.json -func ExampleDatabasesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginDelete(ctx, "TestGroup", "testserver", "db1", 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/DatabaseGet.json -func ExampleDatabasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabasesClient().Get(ctx, "TestGroup", "testserver", "db1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armpostgresqlflexibleservers.Database{ - // Name: to.Ptr("db1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/databases/db1"), - // Properties: &armpostgresqlflexibleservers.DatabaseProperties{ - // Charset: to.Ptr("utf8"), - // Collation: to.Ptr("en_US.utf8"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/DatabasesListByServer.json -func ExampleDatabasesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabasesClient().NewListByServerPager("TestGroup", "testserver", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DatabaseListResult = armpostgresqlflexibleservers.DatabaseListResult{ - // Value: []*armpostgresqlflexibleservers.Database{ - // { - // Name: to.Ptr("db1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/databases/db1"), - // Properties: &armpostgresqlflexibleservers.DatabaseProperties{ - // Charset: to.Ptr("utf8"), - // Collation: to.Ptr("en_US.utf8"), - // }, - // }, - // { - // Name: to.Ptr("db2"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/databases"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/databases/db2"), - // Properties: &armpostgresqlflexibleservers.DatabaseProperties{ - // Charset: to.Ptr("utf8"), - // Collation: to.Ptr("en_US.utf8"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/administrators_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/administrators_server.go index 2a1d96bcb9a6..dc2c1647ad2a 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/administrators_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/administrators_server.go @@ -13,7 +13,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/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "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 606f2fcf0c84..11555e297a8e 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/backups_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/backups_server.go @@ -13,7 +13,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/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "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 660f858f8155..23173a398818 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/checknameavailability_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/checknameavailability_server.go @@ -12,7 +12,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/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "net/http" "regexp" ) diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/checknameavailabilitywithlocation_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/checknameavailabilitywithlocation_server.go index 283747f0fc19..423255e7a6f5 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/checknameavailabilitywithlocation_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/checknameavailabilitywithlocation_server.go @@ -12,7 +12,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/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "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 d989f8b6c96d..43b4ac755103 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/configurations_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/configurations_server.go @@ -13,7 +13,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/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "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 f8baef40d5b9..4b66424f57e3 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/databases_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/databases_server.go @@ -13,7 +13,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/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "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 740ce447586f..3d5a25d7fbfa 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/firewallrules_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/firewallrules_server.go @@ -13,7 +13,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/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "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 index ce6e97ffe521..9dcf1e6b2a0a 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/flexibleserver_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/flexibleserver_server.go @@ -12,7 +12,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/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/getprivatednszonesuffix_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/getprivatednszonesuffix_server.go index 1a20a0fce75e..3fc37a30a279 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/getprivatednszonesuffix_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/getprivatednszonesuffix_server.go @@ -12,7 +12,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/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "net/http" ) diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/locationbasedcapabilities_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/locationbasedcapabilities_server.go index d284d0b21419..31bf420dd923 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/locationbasedcapabilities_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/locationbasedcapabilities_server.go @@ -12,7 +12,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/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "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 index 875efcaad35a..b9e396385c33 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/logfiles_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/logfiles_server.go @@ -12,7 +12,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/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/ltrbackupoperations_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/ltrbackupoperations_server.go index 88d4c58648b9..b17b97102512 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/ltrbackupoperations_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/ltrbackupoperations_server.go @@ -13,7 +13,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/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/migrations_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/migrations_server.go index 8c99dc2166e2..6e1e47cd365d 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/migrations_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/migrations_server.go @@ -13,7 +13,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/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/operations_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/operations_server.go index a6e9b114dc1e..e107ec2660d5 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/operations_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/operations_server.go @@ -6,34 +6,38 @@ 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" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "net/http" ) // OperationsServer is a fake server for instances of the armpostgresqlflexibleservers.OperationsClient type. type OperationsServer struct { - // List is the fake for method OperationsClient.List + // NewListPager is the fake for method OperationsClient.NewListPager // HTTP status codes to indicate success: http.StatusOK - List func(ctx context.Context, options *armpostgresqlflexibleservers.OperationsClientListOptions) (resp azfake.Responder[armpostgresqlflexibleservers.OperationsClientListResponse], errResp azfake.ErrorResponder) + NewListPager func(options *armpostgresqlflexibleservers.OperationsClientListOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.OperationsClientListResponse]) } // NewOperationsServerTransport creates a new instance of OperationsServerTransport with the provided implementation. // The returned OperationsServerTransport instance is connected to an instance of armpostgresqlflexibleservers.OperationsClient via the // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewOperationsServerTransport(srv *OperationsServer) *OperationsServerTransport { - return &OperationsServerTransport{srv: srv} + return &OperationsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.OperationsClientListResponse]](), + } } // OperationsServerTransport connects instances of armpostgresqlflexibleservers.OperationsClient to instances of OperationsServer. // Don't use this type directly, use NewOperationsServerTransport instead. type OperationsServerTransport struct { - srv *OperationsServer + srv *OperationsServer + newListPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.OperationsClientListResponse]] } // Do implements the policy.Transporter interface for OperationsServerTransport. @@ -59,8 +63,8 @@ func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, meth } if !intercepted { switch method { - case "OperationsClient.List": - res.resp, res.err = o.dispatchList(req) + case "OperationsClient.NewListPager": + res.resp, res.err = o.dispatchNewListPager(req) default: res.err = fmt.Errorf("unhandled API %s", method) } @@ -80,22 +84,30 @@ func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, meth } } -func (o *OperationsServerTransport) dispatchList(req *http.Request) (*http.Response, error) { - if o.srv.List == nil { - return nil, &nonRetriableError{errors.New("fake for method List not implemented")} - } - respr, errRespr := o.srv.List(req.Context(), nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr +func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if o.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - 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)} + newListPager := o.newListPager.get(req) + if newListPager == nil { + resp := o.srv.NewListPager(nil) + newListPager = &resp + o.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armpostgresqlflexibleservers.OperationsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).OperationListResult, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + o.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + o.newListPager.remove(req) + } return resp, nil } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/postgresqlservermanagement_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/postgresqlmanagement_server.go similarity index 65% rename from sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/postgresqlservermanagement_server.go rename to sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/postgresqlmanagement_server.go index f95b82c08c55..2267ba6c8bed 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/postgresqlservermanagement_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/postgresqlmanagement_server.go @@ -12,34 +12,34 @@ 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/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "net/http" "net/url" "regexp" ) -// PostgreSQLServerManagementServer is a fake server for instances of the armpostgresqlflexibleservers.PostgreSQLServerManagementClient type. -type PostgreSQLServerManagementServer struct { - // CheckMigrationNameAvailability is the fake for method PostgreSQLServerManagementClient.CheckMigrationNameAvailability +// 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.PostgreSQLServerManagementClientCheckMigrationNameAvailabilityOptions) (resp azfake.Responder[armpostgresqlflexibleservers.PostgreSQLServerManagementClientCheckMigrationNameAvailabilityResponse], errResp azfake.ErrorResponder) + 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) } -// NewPostgreSQLServerManagementServerTransport creates a new instance of PostgreSQLServerManagementServerTransport with the provided implementation. -// The returned PostgreSQLServerManagementServerTransport instance is connected to an instance of armpostgresqlflexibleservers.PostgreSQLServerManagementClient via the +// 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 NewPostgreSQLServerManagementServerTransport(srv *PostgreSQLServerManagementServer) *PostgreSQLServerManagementServerTransport { - return &PostgreSQLServerManagementServerTransport{srv: srv} +func NewPostgreSQLManagementServerTransport(srv *PostgreSQLManagementServer) *PostgreSQLManagementServerTransport { + return &PostgreSQLManagementServerTransport{srv: srv} } -// PostgreSQLServerManagementServerTransport connects instances of armpostgresqlflexibleservers.PostgreSQLServerManagementClient to instances of PostgreSQLServerManagementServer. -// Don't use this type directly, use NewPostgreSQLServerManagementServerTransport instead. -type PostgreSQLServerManagementServerTransport struct { - srv *PostgreSQLServerManagementServer +// 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 PostgreSQLServerManagementServerTransport. -func (p *PostgreSQLServerManagementServerTransport) Do(req *http.Request) (*http.Response, error) { +// 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 { @@ -49,19 +49,19 @@ func (p *PostgreSQLServerManagementServerTransport) Do(req *http.Request) (*http return p.dispatchToMethodFake(req, method) } -func (p *PostgreSQLServerManagementServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { +func (p *PostgreSQLManagementServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { resultChan := make(chan result) defer close(resultChan) go func() { var intercepted bool var res result - if postgreSqlServerManagementServerTransportInterceptor != nil { - res.resp, res.err, intercepted = postgreSqlServerManagementServerTransportInterceptor.Do(req) + if postgreSqlManagementServerTransportInterceptor != nil { + res.resp, res.err, intercepted = postgreSqlManagementServerTransportInterceptor.Do(req) } if !intercepted { switch method { - case "PostgreSQLServerManagementClient.CheckMigrationNameAvailability": + case "PostgreSQLManagementClient.CheckMigrationNameAvailability": res.resp, res.err = p.dispatchCheckMigrationNameAvailability(req) default: res.err = fmt.Errorf("unhandled API %s", method) @@ -82,7 +82,7 @@ func (p *PostgreSQLServerManagementServerTransport) dispatchToMethodFake(req *ht } } -func (p *PostgreSQLServerManagementServerTransport) dispatchCheckMigrationNameAvailability(req *http.Request) (*http.Response, error) { +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")} } @@ -123,8 +123,8 @@ func (p *PostgreSQLServerManagementServerTransport) dispatchCheckMigrationNameAv return resp, nil } -// set this to conditionally intercept incoming requests to PostgreSQLServerManagementServerTransport -var postgreSqlServerManagementServerTransportInterceptor interface { +// set this to conditionally intercept incoming requests to PostgreSQLManagementServerTransport +var postgreSqlManagementServerTransportInterceptor interface { // Do returns true if the server transport should use the returned response/error Do(*http.Request) (*http.Response, error, bool) } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privateendpointconnection_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privateendpointconnection_server.go index 31052b4bcc25..92e33845f55a 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privateendpointconnection_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privateendpointconnection_server.go @@ -12,7 +12,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/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privateendpointconnections_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privateendpointconnections_server.go index 0839bb80672e..35286904b769 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privateendpointconnections_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privateendpointconnections_server.go @@ -13,7 +13,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/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privatelinkresources_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privatelinkresources_server.go index 0bef55024dc2..bc3601ff251d 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privatelinkresources_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/privatelinkresources_server.go @@ -13,7 +13,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/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "net/http" "net/url" "regexp" 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..cfe6367066f6 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/quotausages_server.go @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights 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/v5" + "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")} + } + + return q.dispatchToMethodFake(req, method) +} + +func (q *QuotaUsagesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if quotaUsagesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = quotaUsagesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "QuotaUsagesClient.NewListPager": + res.resp, res.err = q.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (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 +} + +// set this to conditionally intercept incoming requests to QuotaUsagesServerTransport +var quotaUsagesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/replicas_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/replicas_server.go index f52b8e8a22c6..5a1e314fa3f2 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/replicas_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/replicas_server.go @@ -11,7 +11,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/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "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 5e8af8b2d5ae..1d283c438e82 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/server_factory.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/server_factory.go @@ -58,8 +58,8 @@ type ServerFactory struct { // OperationsServer contains the fakes for client OperationsClient OperationsServer OperationsServer - // PostgreSQLServerManagementServer contains the fakes for client PostgreSQLServerManagementClient - PostgreSQLServerManagementServer PostgreSQLServerManagementServer + // PostgreSQLManagementServer contains the fakes for client PostgreSQLManagementClient + PostgreSQLManagementServer PostgreSQLManagementServer // PrivateEndpointConnectionServer contains the fakes for client PrivateEndpointConnectionClient PrivateEndpointConnectionServer PrivateEndpointConnectionServer @@ -70,6 +70,9 @@ type ServerFactory struct { // PrivateLinkResourcesServer contains the fakes for client PrivateLinkResourcesClient PrivateLinkResourcesServer PrivateLinkResourcesServer + // QuotaUsagesServer contains the fakes for client QuotaUsagesClient + QuotaUsagesServer QuotaUsagesServer + // ReplicasServer contains the fakes for client ReplicasClient ReplicasServer ReplicasServer @@ -82,6 +85,15 @@ type ServerFactory struct { // ServersServer contains the fakes for client ServersClient ServersServer ServersServer + // TuningConfigurationServer contains the fakes for client TuningConfigurationClient + TuningConfigurationServer TuningConfigurationServer + + // TuningIndexServer contains the fakes for client TuningIndexClient + TuningIndexServer TuningIndexServer + + // TuningOptionsServer contains the fakes for client TuningOptionsClient + TuningOptionsServer TuningOptionsServer + // VirtualEndpointsServer contains the fakes for client VirtualEndpointsClient VirtualEndpointsServer VirtualEndpointsServer @@ -117,14 +129,18 @@ type ServerFactoryTransport struct { trLtrBackupOperationsServer *LtrBackupOperationsServerTransport trMigrationsServer *MigrationsServerTransport trOperationsServer *OperationsServerTransport - trPostgreSQLServerManagementServer *PostgreSQLServerManagementServerTransport + trPostgreSQLManagementServer *PostgreSQLManagementServerTransport trPrivateEndpointConnectionServer *PrivateEndpointConnectionServerTransport trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport + trQuotaUsagesServer *QuotaUsagesServerTransport trReplicasServer *ReplicasServerTransport trServerCapabilitiesServer *ServerCapabilitiesServerTransport trServerThreatProtectionSettingsServer *ServerThreatProtectionSettingsServerTransport trServersServer *ServersServerTransport + trTuningConfigurationServer *TuningConfigurationServerTransport + trTuningIndexServer *TuningIndexServerTransport + trTuningOptionsServer *TuningOptionsServerTransport trVirtualEndpointsServer *VirtualEndpointsServerTransport trVirtualNetworkSubnetUsageServer *VirtualNetworkSubnetUsageServerTransport } @@ -202,11 +218,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "OperationsClient": initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) resp, err = s.trOperationsServer.Do(req) - case "PostgreSQLServerManagementClient": - initServer(s, &s.trPostgreSQLServerManagementServer, func() *PostgreSQLServerManagementServerTransport { - return NewPostgreSQLServerManagementServerTransport(&s.srv.PostgreSQLServerManagementServer) + case "PostgreSQLManagementClient": + initServer(s, &s.trPostgreSQLManagementServer, func() *PostgreSQLManagementServerTransport { + return NewPostgreSQLManagementServerTransport(&s.srv.PostgreSQLManagementServer) }) - resp, err = s.trPostgreSQLServerManagementServer.Do(req) + resp, err = s.trPostgreSQLManagementServer.Do(req) case "PrivateEndpointConnectionClient": initServer(s, &s.trPrivateEndpointConnectionServer, func() *PrivateEndpointConnectionServerTransport { return NewPrivateEndpointConnectionServerTransport(&s.srv.PrivateEndpointConnectionServer) @@ -222,6 +238,9 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { 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) @@ -238,6 +257,19 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "ServersClient": initServer(s, &s.trServersServer, func() *ServersServerTransport { return NewServersServerTransport(&s.srv.ServersServer) }) resp, err = s.trServersServer.Do(req) + case "TuningConfigurationClient": + initServer(s, &s.trTuningConfigurationServer, func() *TuningConfigurationServerTransport { + return NewTuningConfigurationServerTransport(&s.srv.TuningConfigurationServer) + }) + resp, err = s.trTuningConfigurationServer.Do(req) + case "TuningIndexClient": + initServer(s, &s.trTuningIndexServer, func() *TuningIndexServerTransport { return NewTuningIndexServerTransport(&s.srv.TuningIndexServer) }) + resp, err = s.trTuningIndexServer.Do(req) + case "TuningOptionsClient": + initServer(s, &s.trTuningOptionsServer, func() *TuningOptionsServerTransport { + return NewTuningOptionsServerTransport(&s.srv.TuningOptionsServer) + }) + resp, err = s.trTuningOptionsServer.Do(req) case "VirtualEndpointsClient": initServer(s, &s.trVirtualEndpointsServer, func() *VirtualEndpointsServerTransport { return NewVirtualEndpointsServerTransport(&s.srv.VirtualEndpointsServer) diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/servercapabilities_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/servercapabilities_server.go index 08eb2a88be2c..c32e2f8af470 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/servercapabilities_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/servercapabilities_server.go @@ -12,7 +12,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/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/servers_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/servers_server.go index 5d4129fb500e..57dc041f682b 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/servers_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/servers_server.go @@ -13,7 +13,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/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "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 index 8aaa9cc20e86..8109e5826182 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/serverthreatprotectionsettings_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/serverthreatprotectionsettings_server.go @@ -13,7 +13,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/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/time_rfc3339.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/time_rfc3339.go deleted file mode 100644 index 7691a451714b..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/time_rfc3339.go +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) - -const ( - utcDateTime = "2006-01-02T15:04:05.999999999" - utcDateTimeJSON = `"` + utcDateTime + `"` - utcDateTimeNoT = "2006-01-02 15:04:05.999999999" - utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` - dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` - dateTimeJSON = `"` + time.RFC3339Nano + `"` - dateTimeJSONNoT = `"` + dateTimeNoT + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = dateTimeJSON - } else if tzOffset { - layout = dateTimeJSONNoT - } else if hasT { - layout = utcDateTimeJSON - } else { - layout = utcDateTimeJSONNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - if len(data) == 0 { - return nil - } - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = time.RFC3339Nano - } else if tzOffset { - layout = dateTimeNoT - } else if hasT { - layout = utcDateTime - } else { - layout = utcDateTimeNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func (t dateTimeRFC3339) String() string { - return time.Time(t).Format(time.RFC3339Nano) -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || string(data) == "null" { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/tuningconfiguration_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/tuningconfiguration_server.go new file mode 100644 index 000000000000..80c095050475 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/tuningconfiguration_server.go @@ -0,0 +1,461 @@ +// Copyright (c) Microsoft Corporation. All rights 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/v5" + "net/http" + "net/url" + "regexp" +) + +// TuningConfigurationServer is a fake server for instances of the armpostgresqlflexibleservers.TuningConfigurationClient type. +type TuningConfigurationServer struct { + // BeginDisable is the fake for method TuningConfigurationClient.BeginDisable + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDisable func(ctx context.Context, resourceGroupName string, serverName string, tuningOption armpostgresqlflexibleservers.TuningOptionEnum, options *armpostgresqlflexibleservers.TuningConfigurationClientBeginDisableOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.TuningConfigurationClientDisableResponse], errResp azfake.ErrorResponder) + + // BeginEnable is the fake for method TuningConfigurationClient.BeginEnable + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginEnable func(ctx context.Context, resourceGroupName string, serverName string, tuningOption armpostgresqlflexibleservers.TuningOptionEnum, options *armpostgresqlflexibleservers.TuningConfigurationClientBeginEnableOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.TuningConfigurationClientEnableResponse], errResp azfake.ErrorResponder) + + // NewListSessionDetailsPager is the fake for method TuningConfigurationClient.NewListSessionDetailsPager + // HTTP status codes to indicate success: http.StatusOK + NewListSessionDetailsPager func(resourceGroupName string, serverName string, tuningOption armpostgresqlflexibleservers.TuningOptionEnum, sessionID string, options *armpostgresqlflexibleservers.TuningConfigurationClientListSessionDetailsOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.TuningConfigurationClientListSessionDetailsResponse]) + + // NewListSessionsPager is the fake for method TuningConfigurationClient.NewListSessionsPager + // HTTP status codes to indicate success: http.StatusOK + NewListSessionsPager func(resourceGroupName string, serverName string, tuningOption armpostgresqlflexibleservers.TuningOptionEnum, options *armpostgresqlflexibleservers.TuningConfigurationClientListSessionsOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.TuningConfigurationClientListSessionsResponse]) + + // BeginStartSession is the fake for method TuningConfigurationClient.BeginStartSession + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginStartSession func(ctx context.Context, resourceGroupName string, serverName string, tuningOption armpostgresqlflexibleservers.TuningOptionEnum, configTuningRequest armpostgresqlflexibleservers.ConfigTuningRequestParameter, options *armpostgresqlflexibleservers.TuningConfigurationClientBeginStartSessionOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.TuningConfigurationClientStartSessionResponse], errResp azfake.ErrorResponder) + + // BeginStopSession is the fake for method TuningConfigurationClient.BeginStopSession + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginStopSession func(ctx context.Context, resourceGroupName string, serverName string, tuningOption armpostgresqlflexibleservers.TuningOptionEnum, options *armpostgresqlflexibleservers.TuningConfigurationClientBeginStopSessionOptions) (resp azfake.PollerResponder[armpostgresqlflexibleservers.TuningConfigurationClientStopSessionResponse], errResp azfake.ErrorResponder) +} + +// NewTuningConfigurationServerTransport creates a new instance of TuningConfigurationServerTransport with the provided implementation. +// The returned TuningConfigurationServerTransport instance is connected to an instance of armpostgresqlflexibleservers.TuningConfigurationClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewTuningConfigurationServerTransport(srv *TuningConfigurationServer) *TuningConfigurationServerTransport { + return &TuningConfigurationServerTransport{ + srv: srv, + beginDisable: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.TuningConfigurationClientDisableResponse]](), + beginEnable: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.TuningConfigurationClientEnableResponse]](), + newListSessionDetailsPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.TuningConfigurationClientListSessionDetailsResponse]](), + newListSessionsPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.TuningConfigurationClientListSessionsResponse]](), + beginStartSession: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.TuningConfigurationClientStartSessionResponse]](), + beginStopSession: newTracker[azfake.PollerResponder[armpostgresqlflexibleservers.TuningConfigurationClientStopSessionResponse]](), + } +} + +// TuningConfigurationServerTransport connects instances of armpostgresqlflexibleservers.TuningConfigurationClient to instances of TuningConfigurationServer. +// Don't use this type directly, use NewTuningConfigurationServerTransport instead. +type TuningConfigurationServerTransport struct { + srv *TuningConfigurationServer + beginDisable *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.TuningConfigurationClientDisableResponse]] + beginEnable *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.TuningConfigurationClientEnableResponse]] + newListSessionDetailsPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.TuningConfigurationClientListSessionDetailsResponse]] + newListSessionsPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.TuningConfigurationClientListSessionsResponse]] + beginStartSession *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.TuningConfigurationClientStartSessionResponse]] + beginStopSession *tracker[azfake.PollerResponder[armpostgresqlflexibleservers.TuningConfigurationClientStopSessionResponse]] +} + +// Do implements the policy.Transporter interface for TuningConfigurationServerTransport. +func (t *TuningConfigurationServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return t.dispatchToMethodFake(req, method) +} + +func (t *TuningConfigurationServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if tuningConfigurationServerTransportInterceptor != nil { + res.resp, res.err, intercepted = tuningConfigurationServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "TuningConfigurationClient.BeginDisable": + res.resp, res.err = t.dispatchBeginDisable(req) + case "TuningConfigurationClient.BeginEnable": + res.resp, res.err = t.dispatchBeginEnable(req) + case "TuningConfigurationClient.NewListSessionDetailsPager": + res.resp, res.err = t.dispatchNewListSessionDetailsPager(req) + case "TuningConfigurationClient.NewListSessionsPager": + res.resp, res.err = t.dispatchNewListSessionsPager(req) + case "TuningConfigurationClient.BeginStartSession": + res.resp, res.err = t.dispatchBeginStartSession(req) + case "TuningConfigurationClient.BeginStopSession": + res.resp, res.err = t.dispatchBeginStopSession(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (t *TuningConfigurationServerTransport) dispatchBeginDisable(req *http.Request) (*http.Response, error) { + if t.srv.BeginDisable == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDisable not implemented")} + } + beginDisable := t.beginDisable.get(req) + if beginDisable == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tuningOptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/disable` + 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 + } + tuningOptionParam, err := parseWithCast(matches[regex.SubexpIndex("tuningOption")], func(v string) (armpostgresqlflexibleservers.TuningOptionEnum, error) { + p, unescapeErr := url.PathUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armpostgresqlflexibleservers.TuningOptionEnum(p), nil + }) + if err != nil { + return nil, err + } + respr, errRespr := t.srv.BeginDisable(req.Context(), resourceGroupNameParam, serverNameParam, tuningOptionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDisable = &respr + t.beginDisable.add(req, beginDisable) + } + + resp, err := server.PollerResponderNext(beginDisable, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + t.beginDisable.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDisable) { + t.beginDisable.remove(req) + } + + return resp, nil +} + +func (t *TuningConfigurationServerTransport) dispatchBeginEnable(req *http.Request) (*http.Response, error) { + if t.srv.BeginEnable == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginEnable not implemented")} + } + beginEnable := t.beginEnable.get(req) + if beginEnable == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tuningOptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/enable` + 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 + } + tuningOptionParam, err := parseWithCast(matches[regex.SubexpIndex("tuningOption")], func(v string) (armpostgresqlflexibleservers.TuningOptionEnum, error) { + p, unescapeErr := url.PathUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armpostgresqlflexibleservers.TuningOptionEnum(p), nil + }) + if err != nil { + return nil, err + } + respr, errRespr := t.srv.BeginEnable(req.Context(), resourceGroupNameParam, serverNameParam, tuningOptionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginEnable = &respr + t.beginEnable.add(req, beginEnable) + } + + resp, err := server.PollerResponderNext(beginEnable, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + t.beginEnable.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginEnable) { + t.beginEnable.remove(req) + } + + return resp, nil +} + +func (t *TuningConfigurationServerTransport) dispatchNewListSessionDetailsPager(req *http.Request) (*http.Response, error) { + if t.srv.NewListSessionDetailsPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListSessionDetailsPager not implemented")} + } + newListSessionDetailsPager := t.newListSessionDetailsPager.get(req) + if newListSessionDetailsPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tuningOptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sessionDetails` + 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) + } + qp := req.URL.Query() + 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 + } + tuningOptionParam, err := parseWithCast(matches[regex.SubexpIndex("tuningOption")], func(v string) (armpostgresqlflexibleservers.TuningOptionEnum, error) { + p, unescapeErr := url.PathUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armpostgresqlflexibleservers.TuningOptionEnum(p), nil + }) + if err != nil { + return nil, err + } + sessionIDParam, err := url.QueryUnescape(qp.Get("sessionId")) + if err != nil { + return nil, err + } + resp := t.srv.NewListSessionDetailsPager(resourceGroupNameParam, serverNameParam, tuningOptionParam, sessionIDParam, nil) + newListSessionDetailsPager = &resp + t.newListSessionDetailsPager.add(req, newListSessionDetailsPager) + server.PagerResponderInjectNextLinks(newListSessionDetailsPager, req, func(page *armpostgresqlflexibleservers.TuningConfigurationClientListSessionDetailsResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListSessionDetailsPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + t.newListSessionDetailsPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListSessionDetailsPager) { + t.newListSessionDetailsPager.remove(req) + } + return resp, nil +} + +func (t *TuningConfigurationServerTransport) dispatchNewListSessionsPager(req *http.Request) (*http.Response, error) { + if t.srv.NewListSessionsPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListSessionsPager not implemented")} + } + newListSessionsPager := t.newListSessionsPager.get(req) + if newListSessionsPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tuningOptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sessions` + 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 + } + tuningOptionParam, err := parseWithCast(matches[regex.SubexpIndex("tuningOption")], func(v string) (armpostgresqlflexibleservers.TuningOptionEnum, error) { + p, unescapeErr := url.PathUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armpostgresqlflexibleservers.TuningOptionEnum(p), nil + }) + if err != nil { + return nil, err + } + resp := t.srv.NewListSessionsPager(resourceGroupNameParam, serverNameParam, tuningOptionParam, nil) + newListSessionsPager = &resp + t.newListSessionsPager.add(req, newListSessionsPager) + server.PagerResponderInjectNextLinks(newListSessionsPager, req, func(page *armpostgresqlflexibleservers.TuningConfigurationClientListSessionsResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListSessionsPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + t.newListSessionsPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListSessionsPager) { + t.newListSessionsPager.remove(req) + } + return resp, nil +} + +func (t *TuningConfigurationServerTransport) dispatchBeginStartSession(req *http.Request) (*http.Response, error) { + if t.srv.BeginStartSession == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginStartSession not implemented")} + } + beginStartSession := t.beginStartSession.get(req) + if beginStartSession == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tuningOptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/startSession` + 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.ConfigTuningRequestParameter](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 + } + tuningOptionParam, err := parseWithCast(matches[regex.SubexpIndex("tuningOption")], func(v string) (armpostgresqlflexibleservers.TuningOptionEnum, error) { + p, unescapeErr := url.PathUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armpostgresqlflexibleservers.TuningOptionEnum(p), nil + }) + if err != nil { + return nil, err + } + respr, errRespr := t.srv.BeginStartSession(req.Context(), resourceGroupNameParam, serverNameParam, tuningOptionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginStartSession = &respr + t.beginStartSession.add(req, beginStartSession) + } + + resp, err := server.PollerResponderNext(beginStartSession, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + t.beginStartSession.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginStartSession) { + t.beginStartSession.remove(req) + } + + return resp, nil +} + +func (t *TuningConfigurationServerTransport) dispatchBeginStopSession(req *http.Request) (*http.Response, error) { + if t.srv.BeginStopSession == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginStopSession not implemented")} + } + beginStopSession := t.beginStopSession.get(req) + if beginStopSession == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tuningOptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/stopSession` + 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 + } + tuningOptionParam, err := parseWithCast(matches[regex.SubexpIndex("tuningOption")], func(v string) (armpostgresqlflexibleservers.TuningOptionEnum, error) { + p, unescapeErr := url.PathUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armpostgresqlflexibleservers.TuningOptionEnum(p), nil + }) + if err != nil { + return nil, err + } + respr, errRespr := t.srv.BeginStopSession(req.Context(), resourceGroupNameParam, serverNameParam, tuningOptionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginStopSession = &respr + t.beginStopSession.add(req, beginStopSession) + } + + resp, err := server.PollerResponderNext(beginStopSession, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + t.beginStopSession.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginStopSession) { + t.beginStopSession.remove(req) + } + + return resp, nil +} + +// set this to conditionally intercept incoming requests to TuningConfigurationServerTransport +var tuningConfigurationServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/tuningindex_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/tuningindex_server.go new file mode 100644 index 000000000000..9c3c95754c00 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/tuningindex_server.go @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights 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/v5" + "net/http" + "net/url" + "regexp" +) + +// TuningIndexServer is a fake server for instances of the armpostgresqlflexibleservers.TuningIndexClient type. +type TuningIndexServer struct { + // NewListRecommendationsPager is the fake for method TuningIndexClient.NewListRecommendationsPager + // HTTP status codes to indicate success: http.StatusOK + NewListRecommendationsPager func(resourceGroupName string, serverName string, tuningOption armpostgresqlflexibleservers.TuningOptionEnum, options *armpostgresqlflexibleservers.TuningIndexClientListRecommendationsOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.TuningIndexClientListRecommendationsResponse]) +} + +// NewTuningIndexServerTransport creates a new instance of TuningIndexServerTransport with the provided implementation. +// The returned TuningIndexServerTransport instance is connected to an instance of armpostgresqlflexibleservers.TuningIndexClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewTuningIndexServerTransport(srv *TuningIndexServer) *TuningIndexServerTransport { + return &TuningIndexServerTransport{ + srv: srv, + newListRecommendationsPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.TuningIndexClientListRecommendationsResponse]](), + } +} + +// TuningIndexServerTransport connects instances of armpostgresqlflexibleservers.TuningIndexClient to instances of TuningIndexServer. +// Don't use this type directly, use NewTuningIndexServerTransport instead. +type TuningIndexServerTransport struct { + srv *TuningIndexServer + newListRecommendationsPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.TuningIndexClientListRecommendationsResponse]] +} + +// Do implements the policy.Transporter interface for TuningIndexServerTransport. +func (t *TuningIndexServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return t.dispatchToMethodFake(req, method) +} + +func (t *TuningIndexServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if tuningIndexServerTransportInterceptor != nil { + res.resp, res.err, intercepted = tuningIndexServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "TuningIndexClient.NewListRecommendationsPager": + res.resp, res.err = t.dispatchNewListRecommendationsPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (t *TuningIndexServerTransport) dispatchNewListRecommendationsPager(req *http.Request) (*http.Response, error) { + if t.srv.NewListRecommendationsPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListRecommendationsPager not implemented")} + } + newListRecommendationsPager := t.newListRecommendationsPager.get(req) + if newListRecommendationsPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DBforPostgreSQL/flexibleServers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tuningOptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/recommendations` + 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) + } + qp := req.URL.Query() + 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 + } + tuningOptionParam, err := parseWithCast(matches[regex.SubexpIndex("tuningOption")], func(v string) (armpostgresqlflexibleservers.TuningOptionEnum, error) { + p, unescapeErr := url.PathUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armpostgresqlflexibleservers.TuningOptionEnum(p), nil + }) + if err != nil { + return nil, err + } + recommendationTypeUnescaped, err := url.QueryUnescape(qp.Get("recommendationType")) + if err != nil { + return nil, err + } + recommendationTypeParam := getOptional(armpostgresqlflexibleservers.RecommendationType(recommendationTypeUnescaped)) + var options *armpostgresqlflexibleservers.TuningIndexClientListRecommendationsOptions + if recommendationTypeParam != nil { + options = &armpostgresqlflexibleservers.TuningIndexClientListRecommendationsOptions{ + RecommendationType: recommendationTypeParam, + } + } + resp := t.srv.NewListRecommendationsPager(resourceGroupNameParam, serverNameParam, tuningOptionParam, options) + newListRecommendationsPager = &resp + t.newListRecommendationsPager.add(req, newListRecommendationsPager) + server.PagerResponderInjectNextLinks(newListRecommendationsPager, req, func(page *armpostgresqlflexibleservers.TuningIndexClientListRecommendationsResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListRecommendationsPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + t.newListRecommendationsPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListRecommendationsPager) { + t.newListRecommendationsPager.remove(req) + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to TuningIndexServerTransport +var tuningIndexServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/tuningoptions_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/tuningoptions_server.go new file mode 100644 index 000000000000..8dd010745450 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/tuningoptions_server.go @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) 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/v5" + "net/http" + "net/url" + "regexp" +) + +// TuningOptionsServer is a fake server for instances of the armpostgresqlflexibleservers.TuningOptionsClient type. +type TuningOptionsServer struct { + // Get is the fake for method TuningOptionsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, serverName string, tuningOption armpostgresqlflexibleservers.TuningOptionEnum, options *armpostgresqlflexibleservers.TuningOptionsClientGetOptions) (resp azfake.Responder[armpostgresqlflexibleservers.TuningOptionsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByServerPager is the fake for method TuningOptionsClient.NewListByServerPager + // HTTP status codes to indicate success: http.StatusOK + NewListByServerPager func(resourceGroupName string, serverName string, options *armpostgresqlflexibleservers.TuningOptionsClientListByServerOptions) (resp azfake.PagerResponder[armpostgresqlflexibleservers.TuningOptionsClientListByServerResponse]) +} + +// NewTuningOptionsServerTransport creates a new instance of TuningOptionsServerTransport with the provided implementation. +// The returned TuningOptionsServerTransport instance is connected to an instance of armpostgresqlflexibleservers.TuningOptionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewTuningOptionsServerTransport(srv *TuningOptionsServer) *TuningOptionsServerTransport { + return &TuningOptionsServerTransport{ + srv: srv, + newListByServerPager: newTracker[azfake.PagerResponder[armpostgresqlflexibleservers.TuningOptionsClientListByServerResponse]](), + } +} + +// TuningOptionsServerTransport connects instances of armpostgresqlflexibleservers.TuningOptionsClient to instances of TuningOptionsServer. +// Don't use this type directly, use NewTuningOptionsServerTransport instead. +type TuningOptionsServerTransport struct { + srv *TuningOptionsServer + newListByServerPager *tracker[azfake.PagerResponder[armpostgresqlflexibleservers.TuningOptionsClientListByServerResponse]] +} + +// Do implements the policy.Transporter interface for TuningOptionsServerTransport. +func (t *TuningOptionsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return t.dispatchToMethodFake(req, method) +} + +func (t *TuningOptionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if tuningOptionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = tuningOptionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "TuningOptionsClient.Get": + res.resp, res.err = t.dispatchGet(req) + case "TuningOptionsClient.NewListByServerPager": + res.resp, res.err = t.dispatchNewListByServerPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (t *TuningOptionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if t.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~%@]+)/tuningOptions/(?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 + } + tuningOptionParam, err := parseWithCast(matches[regex.SubexpIndex("tuningOption")], func(v string) (armpostgresqlflexibleservers.TuningOptionEnum, error) { + p, unescapeErr := url.PathUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armpostgresqlflexibleservers.TuningOptionEnum(p), nil + }) + if err != nil { + return nil, err + } + respr, errRespr := t.srv.Get(req.Context(), resourceGroupNameParam, serverNameParam, tuningOptionParam, 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).TuningOptionsResource, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (t *TuningOptionsServerTransport) dispatchNewListByServerPager(req *http.Request) (*http.Response, error) { + if t.srv.NewListByServerPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByServerPager not implemented")} + } + newListByServerPager := t.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~%@]+)/tuningOptions` + 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 := t.srv.NewListByServerPager(resourceGroupNameParam, serverNameParam, nil) + newListByServerPager = &resp + t.newListByServerPager.add(req, newListByServerPager) + server.PagerResponderInjectNextLinks(newListByServerPager, req, func(page *armpostgresqlflexibleservers.TuningOptionsClientListByServerResponse, 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) { + t.newListByServerPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByServerPager) { + t.newListByServerPager.remove(req) + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to TuningOptionsServerTransport +var tuningOptionsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/virtualendpoints_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/virtualendpoints_server.go index 34803d6ec712..b52446bed10a 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/virtualendpoints_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/virtualendpoints_server.go @@ -13,7 +13,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/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/virtualnetworksubnetusage_server.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/virtualnetworksubnetusage_server.go index 6bed63b86988..d9f0d58c3b98 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/virtualnetworksubnetusage_server.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/fake/virtualnetworksubnetusage_server.go @@ -12,7 +12,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/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client.go index 934de7490c2b..bb78236b91bf 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client.go @@ -43,7 +43,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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -71,7 +71,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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview 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" @@ -117,7 +117,7 @@ func (client *FirewallRulesClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -129,7 +129,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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -156,7 +156,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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview 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" @@ -202,7 +202,7 @@ func (client *FirewallRulesClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -211,7 +211,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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -262,7 +262,7 @@ func (client *FirewallRulesClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,7 +279,7 @@ func (client *FirewallRulesClient) getHandleResponse(resp *http.Response) (Firew // NewListByServerPager - List all the firewall rules in a given PostgreSQL server. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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 @@ -327,7 +327,7 @@ func (client *FirewallRulesClient) listByServerCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") 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 deleted file mode 100644 index 550a6222aad4..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/firewallrules_client_example_test.go +++ /dev/null @@ -1,153 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/FirewallRuleCreate.json -func ExampleFirewallRulesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallRulesClient().BeginCreateOrUpdate(ctx, "testrg", "testserver", "rule1", armpostgresqlflexibleservers.FirewallRule{ - Properties: &armpostgresqlflexibleservers.FirewallRuleProperties{ - EndIPAddress: to.Ptr("255.255.255.255"), - StartIPAddress: to.Ptr("0.0.0.0"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallRule = armpostgresqlflexibleservers.FirewallRule{ - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/testserver/firewallRules/rule1"), - // Properties: &armpostgresqlflexibleservers.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.255.255.255"), - // StartIPAddress: to.Ptr("0.0.0.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/FirewallRuleDelete.json -func ExampleFirewallRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallRulesClient().BeginDelete(ctx, "testrg", "testserver", "rule1", 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/FirewallRuleGet.json -func ExampleFirewallRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallRulesClient().Get(ctx, "testrg", "testserver", "rule1", 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.FirewallRule = armpostgresqlflexibleservers.FirewallRule{ - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/testserver/firewallRules/rule1"), - // Properties: &armpostgresqlflexibleservers.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.255.255.255"), - // StartIPAddress: to.Ptr("0.0.0.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/FirewallRuleListByServer.json -func ExampleFirewallRulesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFirewallRulesClient().NewListByServerPager("testrg", "testserver", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FirewallRuleListResult = armpostgresqlflexibleservers.FirewallRuleListResult{ - // Value: []*armpostgresqlflexibleservers.FirewallRule{ - // { - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/firewallRules/rule1"), - // Properties: &armpostgresqlflexibleservers.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.255.255.255"), - // StartIPAddress: to.Ptr("0.0.0.0"), - // }, - // }, - // { - // Name: to.Ptr("rule2"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/firewallRules"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/firewallRules/rule2"), - // Properties: &armpostgresqlflexibleservers.FirewallRuleProperties{ - // EndIPAddress: to.Ptr("255.0.0.0"), - // StartIPAddress: to.Ptr("1.0.0.0"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client.go index c6ee58f30982..b152cd7e9e16 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client.go @@ -43,7 +43,7 @@ func NewFlexibleServerClient(subscriptionID string, credential azcore.TokenCrede // BeginStartLtrBackup - Start the Long Term Retention Backup operation // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - parameters - Request body for operation @@ -70,7 +70,7 @@ func (client *FlexibleServerClient) BeginStartLtrBackup(ctx context.Context, res // StartLtrBackup - Start the Long Term Retention Backup operation // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview 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" @@ -112,7 +112,7 @@ func (client *FlexibleServerClient) startLtrBackupCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *FlexibleServerClient) startLtrBackupCreateRequest(ctx context.Cont // backup operation to succeed. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - parameters - Request body for operation @@ -173,7 +173,7 @@ func (client *FlexibleServerClient) triggerLtrPreBackupCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") 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/flexibleserver_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client_example_test.go deleted file mode 100644 index 7c1020cd89b4..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/flexibleserver_client_example_test.go +++ /dev/null @@ -1,91 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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 8f9a17e689ed..3c25081cf4e8 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/getprivatednszonesuffix_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/getprivatednszonesuffix_client.go @@ -37,7 +37,7 @@ func NewGetPrivateDNSZoneSuffixClient(credential azcore.TokenCredential, options // Execute - Get private DNS zone suffix in the cloud // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - options - GetPrivateDNSZoneSuffixClientExecuteOptions contains the optional parameters for the GetPrivateDNSZoneSuffixClient.Execute // method. func (client *GetPrivateDNSZoneSuffixClient) Execute(ctx context.Context, options *GetPrivateDNSZoneSuffixClientExecuteOptions) (GetPrivateDNSZoneSuffixClientExecuteResponse, error) { @@ -70,7 +70,7 @@ func (client *GetPrivateDNSZoneSuffixClient) executeCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") 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 deleted file mode 100644 index 5f577e71d3e5..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/getprivatednszonesuffix_client_example_test.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/GetPrivateDnsZoneSuffix.json -func ExampleGetPrivateDNSZoneSuffixClient_Execute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGetPrivateDNSZoneSuffixClient().Execute(ctx, 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.Value = "postgres.database.azure.com" -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/go.mod b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/go.mod index 0641fbfc1e13..2522e1c28445 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/v4 +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5 go 1.23.0 diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client.go index 2433e53769dc..ea3e718f6bf8 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client.go @@ -42,7 +42,7 @@ func NewLocationBasedCapabilitiesClient(subscriptionID string, credential azcore // NewExecutePager - Get capabilities at specified location in a given subscription. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - locationName - The name of the location. // - options - LocationBasedCapabilitiesClientExecuteOptions contains the optional parameters for the LocationBasedCapabilitiesClient.NewExecutePager // method. @@ -85,7 +85,7 @@ func (client *LocationBasedCapabilitiesClient) executeCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") 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 deleted file mode 100644 index 2e117a256146..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/locationbasedcapabilities_client_example_test.go +++ /dev/null @@ -1,1984 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/CapabilitiesByLocation.json -func ExampleLocationBasedCapabilitiesClient_NewExecutePager() { - 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.NewLocationBasedCapabilitiesClient().NewExecutePager("eastus", 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.OnlineResizeSupportedEnumEnabled), - // 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](0), - // 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](1920), - // 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_B4ms"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](2880), - // 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_B8ms"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](4320), - // 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_B12ms"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](4320), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // 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](4320), - // 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_B20ms"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](4320), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // 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](4193280), - // SupportedIops: to.Ptr[int32](7500), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // 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](32768), - // 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](1200), - // SupportedThroughput: to.Ptr[int32](125), - // }}, - // }}, - // }, - // { - // Name: to.Ptr("GeneralPurpose"), - // DefaultSKUName: to.Ptr("Standard_D4ads_v5"), - // 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](25600), - // 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](51200), - // 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](76800), - // 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](80000), - // 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](25600), - // 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](51200), - // 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](76800), - // 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](80000), - // 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](25600), - // 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](51200), - // 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](76800), - // 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](80000), - // 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](80000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](96), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](3750), - // 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_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_D8ds_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_D16ds_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](25600), - // 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_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](51200), - // 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_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](76800), - // 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_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](80000), - // 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_D96ds_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](80000), - // 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](4193280), - // SupportedIops: to.Ptr[int32](7500), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // 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](1200), - // SupportedThroughput: to.Ptr[int32](125), - // }}, - // }}, - // }, - // { - // Name: to.Ptr("MemoryOptimized"), - // DefaultSKUName: to.Ptr("Standard_E4ads_v5"), - // 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](25600), - // 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](32000), - // 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](51200), - // 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](76800), - // 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](25600), - // 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](32000), - // 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](51200), - // 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](76800), - // 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](80000), - // 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](3750), - // 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](25600), - // 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_E20ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](32000), - // 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_E32ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](51200), - // 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](76800), - // 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](80000), - // 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](80000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](7168), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](96), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](3750), - // 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_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_E8ds_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_E16ds_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](25600), - // 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_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](32000), - // 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_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](51200), - // 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_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](76800), - // 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_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](80000), - // 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_E96ds_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](80000), - // 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](4193280), - // SupportedIops: to.Ptr[int32](7500), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // 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](131072), - // 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](1200), - // 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"), - // to.Ptr("16")}, - // }, - // { - // Name: to.Ptr("12"), - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("13"), - // to.Ptr("14"), - // to.Ptr("15"), - // to.Ptr("16")}, - // }, - // { - // Name: to.Ptr("13"), - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("14"), - // to.Ptr("15"), - // to.Ptr("16")}, - // }, - // { - // Name: to.Ptr("14"), - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("15"), - // to.Ptr("16")}, - // }, - // { - // Name: to.Ptr("15"), - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("16")}, - // }, - // { - // Name: to.Ptr("16"), - // SupportedVersionsToUpgrade: []*string{ - // }, - // }}, - // 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 index adc2a23c86e8..99400a11b2e6 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/logfiles_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/logfiles_client.go @@ -42,7 +42,7 @@ func NewLogFilesClient(subscriptionID string, credential azcore.TokenCredential, // NewListByServerPager - List all the server log files in a given server. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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 @@ -90,7 +90,7 @@ func (client *LogFilesClient) listByServerCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/logfiles_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/logfiles_client_example_test.go deleted file mode 100644 index ccb77bc1b92f..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/logfiles_client_example_test.go +++ /dev/null @@ -1,58 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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 index cdbd16d9cdf4..2517acd022d0 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_client.go @@ -43,7 +43,7 @@ func NewLtrBackupOperationsClient(subscriptionID string, credential azcore.Token // 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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serverName - The name of the server. // - backupName - The name of the backup. @@ -94,7 +94,7 @@ func (client *LtrBackupOperationsClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -111,7 +111,7 @@ func (client *LtrBackupOperationsClient) getHandleResponse(resp *http.Response) // NewListByServerPager - Gets the result of the give long term retention backup operations for the flexible server. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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 @@ -159,7 +159,7 @@ func (client *LtrBackupOperationsClient) listByServerCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_client_example_test.go deleted file mode 100644 index 49df22766601..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/ltrbackupoperations_client_example_test.go +++ /dev/null @@ -1,96 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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 index 9174ec3da990..bc7d87db55ff 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client.go @@ -40,7 +40,7 @@ func NewMigrationsClient(credential azcore.TokenCredential, options *arm.ClientO // Create - Creates a new migration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -93,7 +93,7 @@ func (client *MigrationsClient) createCreateRequest(ctx context.Context, subscri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -114,7 +114,7 @@ func (client *MigrationsClient) createHandleResponse(resp *http.Response) (Migra // Delete - Deletes a migration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -165,7 +165,7 @@ func (client *MigrationsClient) deleteCreateRequest(ctx context.Context, subscri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -174,7 +174,7 @@ func (client *MigrationsClient) deleteCreateRequest(ctx context.Context, subscri // Get - Gets details of a migration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -226,7 +226,7 @@ func (client *MigrationsClient) getCreateRequest(ctx context.Context, subscripti return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -243,7 +243,7 @@ func (client *MigrationsClient) getHandleResponse(resp *http.Response) (Migratio // NewListByTargetServerPager - List all the migrations on a given target server. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -292,7 +292,7 @@ func (client *MigrationsClient) listByTargetServerCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") if options != nil && options.MigrationListFilter != nil { reqQP.Set("migrationListFilter", string(*options.MigrationListFilter)) } @@ -314,7 +314,7 @@ func (client *MigrationsClient) listByTargetServerHandleResponse(resp *http.Resp // migration definition. Certain property updates initiate migration state transitions. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -367,7 +367,7 @@ func (client *MigrationsClient) updateCreateRequest(ctx context.Context, subscri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") 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/migrations_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client_example_test.go deleted file mode 100644 index 4adb15cb877f..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/migrations_client_example_test.go +++ /dev/null @@ -1,1230 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Create_With_PrivateEndpoint_Servers.json -func ExampleMigrationsClient_Create_migrationsCreateWithPrivateEndpoint() { - 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")}, - MigrationInstanceResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testsourcemigration"), - 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")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), - // MigrationInstanceResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testsourcemigration"), - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/Migrations_Create_With_Roles.json -func ExampleMigrationsClient_Create_migrationsCreateWithRoles() { - 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")}, - MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumTrue), - 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")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumTrue), - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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")}, - MigrationInstanceResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testsourcemigration"), - 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")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"), - // MigrationInstanceResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testsourcemigration"), - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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")}, - // MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesEnumFalse), - // 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 2f608e17b0e6..fe5327cf1253 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models.go @@ -7,9 +7,9 @@ package armpostgresqlflexibleservers import "time" -// ActiveDirectoryAdministrator - Represents an Active Directory administrator. +// ActiveDirectoryAdministrator - Represents an Microsoft Entra Administrator. type ActiveDirectoryAdministrator struct { - // REQUIRED; Properties of the active directory administrator. + // REQUIRED; Properties of the Microsoft Entra Administrator. Properties *AdministratorProperties // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" @@ -25,9 +25,9 @@ type ActiveDirectoryAdministrator struct { Type *string } -// ActiveDirectoryAdministratorAdd - Represents an Active Directory administrator. +// ActiveDirectoryAdministratorAdd - Represents an Microsoft Entra Administrator. type ActiveDirectoryAdministratorAdd struct { - // Properties of the active directory administrator. + // Properties of the Microsoft Entra Administrator. Properties *AdministratorPropertiesForAdd } @@ -40,45 +40,45 @@ type AdminCredentials struct { TargetServerPassword *string } -// AdministratorListResult - A list of active directory administrators. +// AdministratorListResult - A list of Microsoft Entra Administrators. type AdministratorListResult struct { - // The link used to get the next page of active directory. + // The link used to get the next page of Microsoft Entra administrators. NextLink *string - // The list of active directory administrators + // The list of Microsoft Entra Administrators Value []*ActiveDirectoryAdministrator } -// AdministratorProperties - The properties of an Active Directory administrator. +// AdministratorProperties - The properties of an Microsoft Entra Administrator. type AdministratorProperties struct { - // The objectId of the Active Directory administrator. + // The objectId of the Microsoft Entra Administrator. ObjectID *string - // Active Directory administrator principal name. + // Microsoft Entra Administrator principal name. PrincipalName *string - // The principal type used to represent the type of Active Directory Administrator. + // The principal type used to represent the type of Microsoft Entra Administrator. PrincipalType *PrincipalType - // The tenantId of the Active Directory administrator. + // The tenantId of the Microsoft Entra Administrator. TenantID *string } -// AdministratorPropertiesForAdd - The properties of an Active Directory administrator. +// AdministratorPropertiesForAdd - The properties of an Microsoft Entra Administrator. type AdministratorPropertiesForAdd struct { - // Active Directory administrator principal name. + // Microsoft Entra Administrator principal name. PrincipalName *string - // The principal type used to represent the type of Active Directory Administrator. + // The principal type used to represent the type of Microsoft Entra Administrator. PrincipalType *PrincipalType - // The tenantId of the Active Directory administrator. + // The tenantId of the Microsoft Entra Administrator. TenantID *string } // AuthConfig - Authentication configuration properties of a server type AuthConfig struct { - // If Enabled, Azure Active Directory authentication is enabled. + // If Enabled, Microsoft Entra authentication is enabled. ActiveDirectoryAuth *ActiveDirectoryAuthEnum // If Enabled, Password authentication is enabled. @@ -130,6 +130,27 @@ type CheckNameAvailabilityRequest struct { Type *string } +// Cluster properties of a server. +type Cluster struct { + // The node count for the cluster. + ClusterSize *int32 +} + +// ConfigTuningRequestParameter - Config tuning request parameters. +type ConfigTuningRequestParameter struct { + // Indicates whether PG should be restarted during a tuning session. + AllowServerRestarts *bool + + // The mode with which the feature will be enabled. + ConfigTuningUsageMode *bool + + // The name of server. + ServerName *string + + // The target metric the tuning session is trying to improve. + TargetImprovementMetric *string +} + // Configuration - Represents a Configuration. type Configuration struct { // The properties of a configuration. @@ -201,6 +222,9 @@ type ConfigurationProperties struct { // DataEncryption - Data encryption properties of a server type DataEncryption struct { + // Client Id for the User assigned identity to be used for data encryption for geo-backup of server. + GeoBackupDelegatedIdentityClientID *string + // Geo-backup encryption key status for Data encryption enabled server. GeoBackupEncryptionKeyStatus *KeyStatusEnum @@ -210,6 +234,9 @@ type DataEncryption struct { // Resource Id for the User assigned identity to be used for data encryption for geo-backup of server. GeoBackupUserAssignedIdentityID *string + // Client Id for the User assigned identity to be used for data encryption of the primary server. + PrimaryDelegatedIdentityClientID *string + // Primary encryption key status for Data encryption enabled server. PrimaryEncryptionKeyStatus *KeyStatusEnum @@ -340,6 +367,21 @@ type DbServerMetadata struct { Location *string } +// DelegatedResources - Defines delegated resources. +type DelegatedResources struct { + // the location of the delegated resource. + Location *string + + // the referral resource of the delegated resource. + ReferralResource *string + + // the resource id of the delegated resource. + ResourceID *string + + // the tenant id of the delegated resource. + TenantID *string +} + // DelegatedSubnetUsage - Delegated subnet usage data. type DelegatedSubnetUsage struct { // READ-ONLY; Name of the delegated subnet for which IP addresses are in use @@ -415,35 +457,42 @@ type FlexibleServerCapability struct { 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. + // "Disabled" stands for fast provisioning is not supported. Will be deprecated in future, + // please look to Supported Features for "FastProvisioning". 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. + // for geo-back is not supported. Will be deprecated in future, please look to Supported + // Features for "GeoBackup". 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. + // supported. Will be deprecated in future, please look to Supported Features for "OnlineResize". 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. + // for region is not restricted. Will be deprecated in future, please look to Supported + // Features for "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. + // is supported. "Disabled" stands for storage auto-grow is not supported. Will be deprecated + // in future, please look to Supported Features for "StorageAutoGrowth". StorageAutoGrowthSupported *StorageAutoGrowthSupportedEnum // READ-ONLY; List of supported server editions for fast provisioning SupportedFastProvisioningEditions []*FastProvisioningEditionCapability + // READ-ONLY; The supported features. + SupportedFeatures []*SupportedFeature + // READ-ONLY; List of supported flexible server editions SupportedServerEditions []*FlexibleServerEditionCapability @@ -452,11 +501,12 @@ type FlexibleServerCapability struct { // 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. + // geo-backup is not supported. Will be deprecated in future, please look to Supported Features for "ZoneRedundantHaAndGeoBackup". 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. + // is supported. "Disabled" stands for zone redundant HA is not supported. Will be deprecated + // in future, please look to Supported Features for "ZoneRedundantHa". ZoneRedundantHaSupported *ZoneRedundantHaSupportedEnum } @@ -493,6 +543,126 @@ type HighAvailability struct { State *ServerHAState } +// ImpactRecord - Stores property that features impact on some metric if this recommended action is applied. +type ImpactRecord struct { + // Absolute value + AbsoluteValue *float64 + + // Dimension name + DimensionName *string + + // Optional property that can be used to store the QueryId if the metric is for a specific query. + QueryID *int64 + + // Dimension unit + Unit *string +} + +// IndexRecommendationDetails - Recommendation details for the recommended action. +type IndexRecommendationDetails struct { + // Database name. + DatabaseName *string + + // Index included columns. + IncludedColumns []*string + + // Index columns. + IndexColumns []*string + + // Index name. + IndexName *string + + // Index type. + IndexType *string + + // Schema name. + Schema *string + + // Table name. + Table *string +} + +// IndexRecommendationListResult - A list of available index recommendations. +type IndexRecommendationListResult struct { + // URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. + NextLink *string + + // A list of available index recommendations. + Value []*IndexRecommendationResource +} + +// IndexRecommendationResource - Index recommendation properties. +type IndexRecommendationResource struct { + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Properties of IndexRecommendationResource. + Properties *IndexRecommendationResourceProperties + + // 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 +} + +// IndexRecommendationResourceProperties - Index recommendation properties. +type IndexRecommendationResourceProperties struct { + // Stores workload information for the recommended action. + AnalyzedWorkload *IndexRecommendationResourcePropertiesAnalyzedWorkload + + // Stores implementation details for the recommended action. + ImplementationDetails *IndexRecommendationResourcePropertiesImplementationDetails + + // The ImprovedQueryIds. The list will only be populated for CREATE INDEX recommendations. + ImprovedQueryIDs []*int64 + + // Creation time of this recommendation in UTC date-time string format. + InitialRecommendedTime *time.Time + + // The last refresh of this recommendation in UTC date-time string format. + LastRecommendedTime *time.Time + + // Reason for this recommendation. + RecommendationReason *string + + // Type for this recommendation. + RecommendationType *RecommendationTypeEnum + + // The number of times this recommendation has encountered. + TimesRecommended *int32 + + // READ-ONLY; Stores recommendation details for the recommended action. + Details *IndexRecommendationDetails + + // READ-ONLY; The estimated impact of this recommended action + EstimatedImpact []*ImpactRecord +} + +// IndexRecommendationResourcePropertiesAnalyzedWorkload - Stores workload information for the recommended action. +type IndexRecommendationResourcePropertiesAnalyzedWorkload struct { + // Workload end time in UTC date-time string format. + EndTime *time.Time + + // Workload query examined count. For DROP INDEX will be 0. + QueryCount *int32 + + // Workload start time in UTC date-time string format. + StartTime *time.Time +} + +// IndexRecommendationResourcePropertiesImplementationDetails - Stores implementation details for the recommended action. +type IndexRecommendationResourcePropertiesImplementationDetails struct { + // Method of implementation for recommended action + Method *string + + // Implementation script for the recommended action + Script *string +} + // LogFile - Represents a logFile. type LogFile struct { // The properties of a logFile. @@ -763,7 +933,9 @@ type MigrationResourceProperties struct { SourceDbServerResourceID *string // migration source server type : OnPremises, AWS, GCP, AzureVM, PostgreSQLSingleServer, AWSRDS, AWSAURORA, AWSEC2, GCPCloudSQL, - // GCPAlloyDB, GCPCompute, or EDB + // GCPAlloyDB, GCPCompute, EDB, EDBOracleServer, EDBPostgreSQL, + // PostgreSQLFlexibleServer, PostgreSQLCosmosDB, HuaweiRDS, HuaweiCompute, HerokuPostgreSQL, CrunchyPostgreSQL, ApsaraDBRDS, + // DigitalOceanDroplets, DigitalOceanPostgreSQL, or Supabase_PostgreSQL SourceType *SourceType // Indicates whether the data migration should start right away @@ -898,6 +1070,15 @@ type NameAvailability struct { Type *string } +// 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. This is required to be passed during create, in case we want the server to be VNET injected, @@ -1056,6 +1237,33 @@ type PrivateLinkServiceConnectionState struct { 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. @@ -1204,6 +1412,9 @@ type ServerProperties struct { // Backup properties of a server. Backup *Backup + // Cluster properties of a server. + Cluster *Cluster + // The mode to create a new PostgreSQL server. CreateMode *CreateMode @@ -1271,6 +1482,9 @@ type ServerPropertiesForUpdate struct { // Backup properties of a server. Backup *Backup + // Cluster properties of a server. + Cluster *Cluster + // The mode to update a new PostgreSQL server. CreateMode *CreateModeForUpdate @@ -1295,7 +1509,7 @@ type ServerPropertiesForUpdate struct { // Storage properties of a server. Storage *Storage - // PostgreSQL Server version. Version 16 is currently not supported for MVU. + // PostgreSQL Server version. Version 17 is currently not supported for MVU. Version *ServerVersion } @@ -1316,9 +1530,15 @@ type ServerSKUCapability struct { // READ-ONLY; The reason for the capability not being available. Reason *string + // READ-ONLY; The value of security profile indicating if its confidential vm + SecurityProfile *string + // READ-ONLY; The status of the capability. Status *CapabilityStatus + // READ-ONLY; The supported features. + SupportedFeatures []*SupportedFeature + // READ-ONLY; Supported high availability mode SupportedHaMode []*HaMode @@ -1383,28 +1603,95 @@ type ServerVersionCapability struct { // READ-ONLY; The status of the capability. Status *CapabilityStatus + // READ-ONLY; The supported features. + SupportedFeatures []*SupportedFeature + // READ-ONLY; Supported servers versions to upgrade SupportedVersionsToUpgrade []*string } +// SessionDetailsListResult - A list of tuning configuration sessions. +type SessionDetailsListResult struct { + // URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. + NextLink *string + + // A list of details of the session. + Value []*SessionDetailsResource +} + +// SessionDetailsResource - Session details properties. +type SessionDetailsResource struct { + // Applied configuration for the iteration. + AppliedConfiguration *string + + // The aqr for the iteration. + AverageQueryRuntimeMs *string + + // Iteration id. + IterationID *string + + // Iteration start time. + IterationStartTime *string + + // Session id. + SessionID *string + + // The tps for the iteration. + TransactionsPerSecond *string +} + +// SessionResource - Session resource properties. +type SessionResource struct { + // The post tuning aqr. + PostTuningAqr *string + + // The post tuning tps. + PostTuningTps *string + + // The pre tuning aqr. + PreTuningAqr *string + + // The pre tuning tps. + PreTuningTps *string + + // Session id. + SessionID *string + + // the tuning session start time. + SessionStartTime *string + + // The status of the tuning session. + Status *string +} + +// SessionsListResult - A list of tuning configuration sessions. +type SessionsListResult struct { + // URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. + NextLink *string + + // A list of tuning configuration sessions. + Value []*SessionResource +} + // 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 + // Storage IOPS quantity. This property is required to be set for storage Type PremiumV2LRS and UltraSSDLRS. 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 + // Storage throughput for the server. This is required to be set for storage Type PremiumV2LRS and UltraSSDLRS. 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 + // Storage type for the server. Allowed values are PremiumLRS, PremiumV2LRS, and UltraSSDLRS. Default is PremiumLRS if not + // specified Type *StorageType } @@ -1474,6 +1761,15 @@ type StorageTierCapability struct { Status *CapabilityStatus } +// SupportedFeature - The supported features. +type SupportedFeature struct { + // READ-ONLY; Name of feature + Name *string + + // READ-ONLY; Status of feature + Status *SupportedFeatureStatusEnum +} + // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). @@ -1495,11 +1791,38 @@ type SystemData struct { LastModifiedByType *CreatedByType } +// TuningOptionsListResult - A list of server tuning options. +type TuningOptionsListResult struct { + // URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. + NextLink *string + + // A list of available tuning options. + Value []*TuningOptionsResource +} + +// TuningOptionsResource - Stores property that features impact on some metric if this recommended action is applied. +type TuningOptionsResource struct { + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + // UserAssignedIdentity - Information describing the identities associated with this application. type UserAssignedIdentity struct { // REQUIRED; the types of identities associated with this resource Type *IdentityType + // represents delegated resources. + DelegatedResources map[string]*DelegatedResources + // the identity principal Id of the server. PrincipalID *string diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models_serde.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models_serde.go index 205b2a5b7caf..bca3fc40fe9c 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models_serde.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/models_serde.go @@ -404,6 +404,72 @@ func (c *CheckNameAvailabilityRequest) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type Cluster. +func (c Cluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clusterSize", c.ClusterSize) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Cluster. +func (c *Cluster) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clusterSize": + err = unpopulate(val, "ClusterSize", &c.ClusterSize) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConfigTuningRequestParameter. +func (c ConfigTuningRequestParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowServerRestarts", c.AllowServerRestarts) + populate(objectMap, "configTuningUsageMode", c.ConfigTuningUsageMode) + populate(objectMap, "serverName", c.ServerName) + populate(objectMap, "targetImprovementMetric", c.TargetImprovementMetric) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigTuningRequestParameter. +func (c *ConfigTuningRequestParameter) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowServerRestarts": + err = unpopulate(val, "AllowServerRestarts", &c.AllowServerRestarts) + delete(rawMsg, key) + case "configTuningUsageMode": + err = unpopulate(val, "ConfigTuningUsageMode", &c.ConfigTuningUsageMode) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &c.ServerName) + delete(rawMsg, key) + case "targetImprovementMetric": + err = unpopulate(val, "TargetImprovementMetric", &c.TargetImprovementMetric) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Configuration. func (c Configuration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -575,9 +641,11 @@ 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, "geoBackupDelegatedIdentityClientId", d.GeoBackupDelegatedIdentityClientID) populate(objectMap, "geoBackupEncryptionKeyStatus", d.GeoBackupEncryptionKeyStatus) populate(objectMap, "geoBackupKeyURI", d.GeoBackupKeyURI) populate(objectMap, "geoBackupUserAssignedIdentityId", d.GeoBackupUserAssignedIdentityID) + populate(objectMap, "primaryDelegatedIdentityClientId", d.PrimaryDelegatedIdentityClientID) populate(objectMap, "primaryEncryptionKeyStatus", d.PrimaryEncryptionKeyStatus) populate(objectMap, "primaryKeyURI", d.PrimaryKeyURI) populate(objectMap, "primaryUserAssignedIdentityId", d.PrimaryUserAssignedIdentityID) @@ -594,6 +662,9 @@ func (d *DataEncryption) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "geoBackupDelegatedIdentityClientId": + err = unpopulate(val, "GeoBackupDelegatedIdentityClientID", &d.GeoBackupDelegatedIdentityClientID) + delete(rawMsg, key) case "geoBackupEncryptionKeyStatus": err = unpopulate(val, "GeoBackupEncryptionKeyStatus", &d.GeoBackupEncryptionKeyStatus) delete(rawMsg, key) @@ -603,6 +674,9 @@ func (d *DataEncryption) UnmarshalJSON(data []byte) error { case "geoBackupUserAssignedIdentityId": err = unpopulate(val, "GeoBackupUserAssignedIdentityID", &d.GeoBackupUserAssignedIdentityID) delete(rawMsg, key) + case "primaryDelegatedIdentityClientId": + err = unpopulate(val, "PrimaryDelegatedIdentityClientID", &d.PrimaryDelegatedIdentityClientID) + delete(rawMsg, key) case "primaryEncryptionKeyStatus": err = unpopulate(val, "PrimaryEncryptionKeyStatus", &d.PrimaryEncryptionKeyStatus) delete(rawMsg, key) @@ -893,6 +967,45 @@ func (d *DbServerMetadata) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DelegatedResources. +func (d DelegatedResources) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "location", d.Location) + populate(objectMap, "referralResource", d.ReferralResource) + populate(objectMap, "resourceId", d.ResourceID) + populate(objectMap, "tenantId", d.TenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DelegatedResources. +func (d *DelegatedResources) UnmarshalJSON(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 "referralResource": + err = unpopulate(val, "ReferralResource", &d.ReferralResource) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &d.ResourceID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &d.TenantID) + 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) @@ -1092,6 +1205,7 @@ func (f FlexibleServerCapability) MarshalJSON() ([]byte, error) { populate(objectMap, "status", f.Status) populate(objectMap, "storageAutoGrowthSupported", f.StorageAutoGrowthSupported) populate(objectMap, "supportedFastProvisioningEditions", f.SupportedFastProvisioningEditions) + populate(objectMap, "supportedFeatures", f.SupportedFeatures) populate(objectMap, "supportedServerEditions", f.SupportedServerEditions) populate(objectMap, "supportedServerVersions", f.SupportedServerVersions) populate(objectMap, "zoneRedundantHaAndGeoBackupSupported", f.ZoneRedundantHaAndGeoBackupSupported) @@ -1135,6 +1249,9 @@ func (f *FlexibleServerCapability) UnmarshalJSON(data []byte) error { case "supportedFastProvisioningEditions": err = unpopulate(val, "SupportedFastProvisioningEditions", &f.SupportedFastProvisioningEditions) delete(rawMsg, key) + case "supportedFeatures": + err = unpopulate(val, "SupportedFeatures", &f.SupportedFeatures) + delete(rawMsg, key) case "supportedServerEditions": err = unpopulate(val, "SupportedServerEditions", &f.SupportedServerEditions) delete(rawMsg, key) @@ -1237,6 +1354,299 @@ func (h *HighAvailability) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ImpactRecord. +func (i ImpactRecord) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "absoluteValue", i.AbsoluteValue) + populate(objectMap, "dimensionName", i.DimensionName) + populate(objectMap, "queryId", i.QueryID) + populate(objectMap, "unit", i.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImpactRecord. +func (i *ImpactRecord) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "absoluteValue": + err = unpopulate(val, "AbsoluteValue", &i.AbsoluteValue) + delete(rawMsg, key) + case "dimensionName": + err = unpopulate(val, "DimensionName", &i.DimensionName) + delete(rawMsg, key) + case "queryId": + err = unpopulate(val, "QueryID", &i.QueryID) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &i.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IndexRecommendationDetails. +func (i IndexRecommendationDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databaseName", i.DatabaseName) + populate(objectMap, "includedColumns", i.IncludedColumns) + populate(objectMap, "indexColumns", i.IndexColumns) + populate(objectMap, "indexName", i.IndexName) + populate(objectMap, "indexType", i.IndexType) + populate(objectMap, "schema", i.Schema) + populate(objectMap, "table", i.Table) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IndexRecommendationDetails. +func (i *IndexRecommendationDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databaseName": + err = unpopulate(val, "DatabaseName", &i.DatabaseName) + delete(rawMsg, key) + case "includedColumns": + err = unpopulate(val, "IncludedColumns", &i.IncludedColumns) + delete(rawMsg, key) + case "indexColumns": + err = unpopulate(val, "IndexColumns", &i.IndexColumns) + delete(rawMsg, key) + case "indexName": + err = unpopulate(val, "IndexName", &i.IndexName) + delete(rawMsg, key) + case "indexType": + err = unpopulate(val, "IndexType", &i.IndexType) + delete(rawMsg, key) + case "schema": + err = unpopulate(val, "Schema", &i.Schema) + delete(rawMsg, key) + case "table": + err = unpopulate(val, "Table", &i.Table) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IndexRecommendationListResult. +func (i IndexRecommendationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IndexRecommendationListResult. +func (i *IndexRecommendationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IndexRecommendationResource. +func (i IndexRecommendationResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", i.ID) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "systemData", i.SystemData) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IndexRecommendationResource. +func (i *IndexRecommendationResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &i.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IndexRecommendationResourceProperties. +func (i IndexRecommendationResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "analyzedWorkload", i.AnalyzedWorkload) + populate(objectMap, "details", i.Details) + populate(objectMap, "estimatedImpact", i.EstimatedImpact) + populate(objectMap, "implementationDetails", i.ImplementationDetails) + populate(objectMap, "improvedQueryIds", i.ImprovedQueryIDs) + populateDateTimeRFC3339(objectMap, "initialRecommendedTime", i.InitialRecommendedTime) + populateDateTimeRFC3339(objectMap, "lastRecommendedTime", i.LastRecommendedTime) + populate(objectMap, "recommendationReason", i.RecommendationReason) + populate(objectMap, "recommendationType", i.RecommendationType) + populate(objectMap, "timesRecommended", i.TimesRecommended) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IndexRecommendationResourceProperties. +func (i *IndexRecommendationResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "analyzedWorkload": + err = unpopulate(val, "AnalyzedWorkload", &i.AnalyzedWorkload) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &i.Details) + delete(rawMsg, key) + case "estimatedImpact": + err = unpopulate(val, "EstimatedImpact", &i.EstimatedImpact) + delete(rawMsg, key) + case "implementationDetails": + err = unpopulate(val, "ImplementationDetails", &i.ImplementationDetails) + delete(rawMsg, key) + case "improvedQueryIds": + err = unpopulate(val, "ImprovedQueryIDs", &i.ImprovedQueryIDs) + delete(rawMsg, key) + case "initialRecommendedTime": + err = unpopulateDateTimeRFC3339(val, "InitialRecommendedTime", &i.InitialRecommendedTime) + delete(rawMsg, key) + case "lastRecommendedTime": + err = unpopulateDateTimeRFC3339(val, "LastRecommendedTime", &i.LastRecommendedTime) + delete(rawMsg, key) + case "recommendationReason": + err = unpopulate(val, "RecommendationReason", &i.RecommendationReason) + delete(rawMsg, key) + case "recommendationType": + err = unpopulate(val, "RecommendationType", &i.RecommendationType) + delete(rawMsg, key) + case "timesRecommended": + err = unpopulate(val, "TimesRecommended", &i.TimesRecommended) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IndexRecommendationResourcePropertiesAnalyzedWorkload. +func (i IndexRecommendationResourcePropertiesAnalyzedWorkload) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "endTime", i.EndTime) + populate(objectMap, "queryCount", i.QueryCount) + populateDateTimeRFC3339(objectMap, "startTime", i.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IndexRecommendationResourcePropertiesAnalyzedWorkload. +func (i *IndexRecommendationResourcePropertiesAnalyzedWorkload) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulateDateTimeRFC3339(val, "EndTime", &i.EndTime) + delete(rawMsg, key) + case "queryCount": + err = unpopulate(val, "QueryCount", &i.QueryCount) + delete(rawMsg, key) + case "startTime": + err = unpopulateDateTimeRFC3339(val, "StartTime", &i.StartTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IndexRecommendationResourcePropertiesImplementationDetails. +func (i IndexRecommendationResourcePropertiesImplementationDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "method", i.Method) + populate(objectMap, "script", i.Script) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IndexRecommendationResourcePropertiesImplementationDetails. +func (i *IndexRecommendationResourcePropertiesImplementationDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "method": + err = unpopulate(val, "Method", &i.Method) + delete(rawMsg, key) + case "script": + err = unpopulate(val, "Script", &i.Script) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type LogFile. func (l LogFile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2179,6 +2589,37 @@ func (n *NameAvailability) UnmarshalJSON(data []byte) error { 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) @@ -2611,6 +3052,80 @@ func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type QuotaUsage. +func (q QuotaUsage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "currentValue": + err = unpopulate(val, "CurrentValue", &q.CurrentValue) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &q.ID) + delete(rawMsg, key) + case "limit": + err = unpopulate(val, "Limit", &q.Limit) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &q.Name) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &q.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QuotaUsagesListResult. +func (q QuotaUsagesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", q.NextLink) + populate(objectMap, "value", q.Value) + return json.Marshal(objectMap) +} + +// 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", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &q.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &q.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Replica. func (r Replica) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2962,6 +3477,7 @@ func (s ServerProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "authConfig", s.AuthConfig) populate(objectMap, "availabilityZone", s.AvailabilityZone) populate(objectMap, "backup", s.Backup) + populate(objectMap, "cluster", s.Cluster) populate(objectMap, "createMode", s.CreateMode) populate(objectMap, "dataEncryption", s.DataEncryption) populate(objectMap, "fullyQualifiedDomainName", s.FullyQualifiedDomainName) @@ -3005,6 +3521,9 @@ func (s *ServerProperties) UnmarshalJSON(data []byte) error { case "backup": err = unpopulate(val, "Backup", &s.Backup) delete(rawMsg, key) + case "cluster": + err = unpopulate(val, "Cluster", &s.Cluster) + delete(rawMsg, key) case "createMode": err = unpopulate(val, "CreateMode", &s.CreateMode) delete(rawMsg, key) @@ -3068,6 +3587,7 @@ func (s ServerPropertiesForUpdate) MarshalJSON() ([]byte, error) { populate(objectMap, "administratorLoginPassword", s.AdministratorLoginPassword) populate(objectMap, "authConfig", s.AuthConfig) populate(objectMap, "backup", s.Backup) + populate(objectMap, "cluster", s.Cluster) populate(objectMap, "createMode", s.CreateMode) populate(objectMap, "dataEncryption", s.DataEncryption) populate(objectMap, "highAvailability", s.HighAvailability) @@ -3101,6 +3621,9 @@ func (s *ServerPropertiesForUpdate) UnmarshalJSON(data []byte) error { case "backup": err = unpopulate(val, "Backup", &s.Backup) delete(rawMsg, key) + case "cluster": + err = unpopulate(val, "Cluster", &s.Cluster) + delete(rawMsg, key) case "createMode": err = unpopulate(val, "CreateMode", &s.CreateMode) delete(rawMsg, key) @@ -3172,7 +3695,9 @@ func (s ServerSKUCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "name", s.Name) populate(objectMap, "reason", s.Reason) + populate(objectMap, "securityProfile", s.SecurityProfile) populate(objectMap, "status", s.Status) + populate(objectMap, "supportedFeatures", s.SupportedFeatures) populate(objectMap, "supportedHaMode", s.SupportedHaMode) populate(objectMap, "supportedIops", s.SupportedIops) populate(objectMap, "supportedMemoryPerVcoreMb", s.SupportedMemoryPerVcoreMb) @@ -3196,9 +3721,15 @@ func (s *ServerSKUCapability) UnmarshalJSON(data []byte) error { case "reason": err = unpopulate(val, "Reason", &s.Reason) delete(rawMsg, key) + case "securityProfile": + err = unpopulate(val, "SecurityProfile", &s.SecurityProfile) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) + case "supportedFeatures": + err = unpopulate(val, "SupportedFeatures", &s.SupportedFeatures) + delete(rawMsg, key) case "supportedHaMode": err = unpopulate(val, "SupportedHaMode", &s.SupportedHaMode) delete(rawMsg, key) @@ -3333,6 +3864,7 @@ func (s ServerVersionCapability) MarshalJSON() ([]byte, error) { populate(objectMap, "name", s.Name) populate(objectMap, "reason", s.Reason) populate(objectMap, "status", s.Status) + populate(objectMap, "supportedFeatures", s.SupportedFeatures) populate(objectMap, "supportedVersionsToUpgrade", s.SupportedVersionsToUpgrade) return json.Marshal(objectMap) } @@ -3355,6 +3887,9 @@ func (s *ServerVersionCapability) UnmarshalJSON(data []byte) error { case "status": err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) + case "supportedFeatures": + err = unpopulate(val, "SupportedFeatures", &s.SupportedFeatures) + delete(rawMsg, key) case "supportedVersionsToUpgrade": err = unpopulate(val, "SupportedVersionsToUpgrade", &s.SupportedVersionsToUpgrade) delete(rawMsg, key) @@ -3366,6 +3901,166 @@ func (s *ServerVersionCapability) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SessionDetailsListResult. +func (s SessionDetailsListResult) 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 SessionDetailsListResult. +func (s *SessionDetailsListResult) UnmarshalJSON(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 SessionDetailsResource. +func (s SessionDetailsResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "appliedConfiguration", s.AppliedConfiguration) + populate(objectMap, "averageQueryRuntimeMs", s.AverageQueryRuntimeMs) + populate(objectMap, "iterationId", s.IterationID) + populate(objectMap, "iterationStartTime", s.IterationStartTime) + populate(objectMap, "sessionId", s.SessionID) + populate(objectMap, "transactionsPerSecond", s.TransactionsPerSecond) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionDetailsResource. +func (s *SessionDetailsResource) UnmarshalJSON(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 "appliedConfiguration": + err = unpopulate(val, "AppliedConfiguration", &s.AppliedConfiguration) + delete(rawMsg, key) + case "averageQueryRuntimeMs": + err = unpopulate(val, "AverageQueryRuntimeMs", &s.AverageQueryRuntimeMs) + delete(rawMsg, key) + case "iterationId": + err = unpopulate(val, "IterationID", &s.IterationID) + delete(rawMsg, key) + case "iterationStartTime": + err = unpopulate(val, "IterationStartTime", &s.IterationStartTime) + delete(rawMsg, key) + case "sessionId": + err = unpopulate(val, "SessionID", &s.SessionID) + delete(rawMsg, key) + case "transactionsPerSecond": + err = unpopulate(val, "TransactionsPerSecond", &s.TransactionsPerSecond) + 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 SessionResource. +func (s SessionResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "postTuningAqr", s.PostTuningAqr) + populate(objectMap, "postTuningTps", s.PostTuningTps) + populate(objectMap, "preTuningAqr", s.PreTuningAqr) + populate(objectMap, "preTuningTps", s.PreTuningTps) + populate(objectMap, "sessionId", s.SessionID) + populate(objectMap, "sessionStartTime", s.SessionStartTime) + populate(objectMap, "status", s.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionResource. +func (s *SessionResource) UnmarshalJSON(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 "postTuningAqr": + err = unpopulate(val, "PostTuningAqr", &s.PostTuningAqr) + delete(rawMsg, key) + case "postTuningTps": + err = unpopulate(val, "PostTuningTps", &s.PostTuningTps) + delete(rawMsg, key) + case "preTuningAqr": + err = unpopulate(val, "PreTuningAqr", &s.PreTuningAqr) + delete(rawMsg, key) + case "preTuningTps": + err = unpopulate(val, "PreTuningTps", &s.PreTuningTps) + delete(rawMsg, key) + case "sessionId": + err = unpopulate(val, "SessionID", &s.SessionID) + delete(rawMsg, key) + case "sessionStartTime": + err = unpopulate(val, "SessionStartTime", &s.SessionStartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + 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 SessionsListResult. +func (s SessionsListResult) 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 SessionsListResult. +func (s *SessionsListResult) UnmarshalJSON(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 Storage. func (s Storage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3558,6 +4253,37 @@ func (s *StorageTierCapability) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SupportedFeature. +func (s SupportedFeature) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", s.Name) + populate(objectMap, "status", s.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SupportedFeature. +func (s *SupportedFeature) UnmarshalJSON(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 "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3605,9 +4331,80 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type TuningOptionsListResult. +func (t TuningOptionsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TuningOptionsListResult. +func (t *TuningOptionsListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &t.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &t.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TuningOptionsResource. +func (t TuningOptionsResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", t.ID) + populate(objectMap, "name", t.Name) + populate(objectMap, "systemData", t.SystemData) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TuningOptionsResource. +func (t *TuningOptionsResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &t.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity. func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "delegatedResources", u.DelegatedResources) populate(objectMap, "principalId", u.PrincipalID) populate(objectMap, "tenantId", u.TenantID) populate(objectMap, "type", u.Type) @@ -3624,6 +4421,9 @@ func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "delegatedResources": + err = unpopulate(val, "DelegatedResources", &u.DelegatedResources) + delete(rawMsg, key) case "principalId": err = unpopulate(val, "PrincipalID", &u.PrincipalID) delete(rawMsg, key) diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client.go index 8e97b94f7a80..75bf885f9b42 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client.go @@ -34,31 +34,31 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO return client, nil } -// List - Lists all of the available REST API operations. -// If the operation fails it returns an *azcore.ResponseError type. +// NewListPager - Lists all of the available REST API operations. // -// Generated from API version 2024-08-01 -// - 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 - const operationName = "OperationsClient.List" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listCreateRequest(ctx, options) - if err != nil { - return OperationsClientListResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return OperationsClientListResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return OperationsClientListResponse{}, err - } - resp, err := client.listHandleResponse(httpResp) - return resp, err +// Generated from API version 2025-03-15-privatepreview +// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ + More: func(page OperationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "OperationsClient.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, options) + }, nil) + if err != nil { + return OperationsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) } // listCreateRequest creates the List request. @@ -69,7 +69,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *Operat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") 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 deleted file mode 100644 index 6a83d32a4173..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_client_example_test.go +++ /dev/null @@ -1,204 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/OperationList.json -func ExampleOperationsClient_List() { - 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.NewOperationsClient().List(ctx, 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.OperationListResult = armpostgresqlflexibleservers.OperationListResult{ - // Value: []*armpostgresqlflexibleservers.Operation{ - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/read"), - // Display: &armpostgresqlflexibleservers.OperationDisplay{ - // Description: to.Ptr("Return the list of servers or gets the properties for the specified server."), - // Operation: to.Ptr("List/Get PostgreSQL Servers"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("PostgreSQL Server"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/write"), - // Display: &armpostgresqlflexibleservers.OperationDisplay{ - // Description: to.Ptr("Creates a server with the specified parameters or update the properties or tags for the specified server."), - // Operation: to.Ptr("Create/Update PostgreSQL Server"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("PostgreSQL Server"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/delete"), - // Display: &armpostgresqlflexibleservers.OperationDisplay{ - // Description: to.Ptr("Deletes an existing server."), - // Operation: to.Ptr("Delete PostgreSQL Server"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("PostgreSQL Server"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/firewallRules/read"), - // Display: &armpostgresqlflexibleservers.OperationDisplay{ - // Description: to.Ptr("Return the list of firewall rules for a server or gets the properties for the specified firewall rule."), - // Operation: to.Ptr("List/Get Firewall Rules"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Firewall Rules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/firewallRules/write"), - // Display: &armpostgresqlflexibleservers.OperationDisplay{ - // Description: to.Ptr("Creates a firewall rule with the specified parameters or update an existing rule."), - // Operation: to.Ptr("Create/Update Firewall Rule"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Firewall Rules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/firewallRules/delete"), - // Display: &armpostgresqlflexibleservers.OperationDisplay{ - // Description: to.Ptr("Deletes an existing firewall rule."), - // Operation: to.Ptr("Delete Firewall Rule"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Firewall Rules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/providers/Microsoft.Insights/metricDefinitions/read"), - // Display: &armpostgresqlflexibleservers.OperationDisplay{ - // Description: to.Ptr("Return types of metrics that are available for databases"), - // Operation: to.Ptr("Get database metric definitions"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Database Metric Definition"), - // }, - // Properties: map[string]any{ - // "serviceSpecification": map[string]any{ - // "metricSpecifications":[]any{ - // map[string]any{ - // "name": "cpu_percent", - // "aggregationType": "Average", - // "displayDescription": "CPU percent", - // "displayName": "CPU percent", - // "fillGapWithZero": true, - // "unit": "Percent", - // }, - // map[string]any{ - // "name": "compute_limit", - // "aggregationType": "Average", - // "displayDescription": "Compute Unit limit", - // "displayName": "Compute Unit limit", - // "unit": "Count", - // }, - // map[string]any{ - // "name": "compute_consumption_percent", - // "aggregationType": "Average", - // "displayDescription": "Compute Unit percentage", - // "displayName": "Compute Unit percentage", - // "fillGapWithZero": true, - // "unit": "Percent", - // }, - // map[string]any{ - // "name": "memory_percent", - // "aggregationType": "Average", - // "displayDescription": "Memory percent", - // "displayName": "Memory percent", - // "fillGapWithZero": true, - // "unit": "Percent", - // }, - // map[string]any{ - // "name": "io_consumption_percent", - // "aggregationType": "Average", - // "displayDescription": "IO percent", - // "displayName": "IO percent", - // "fillGapWithZero": true, - // "unit": "Percent", - // }, - // map[string]any{ - // "name": "storage_percent", - // "aggregationType": "Average", - // "displayDescription": "Storage percentage", - // "displayName": "Storage percentage", - // "unit": "Percent", - // }, - // map[string]any{ - // "name": "storage_used", - // "aggregationType": "Average", - // "displayDescription": "Storage used", - // "displayName": "Storage used", - // "unit": "Bytes", - // }, - // map[string]any{ - // "name": "storage_limit", - // "aggregationType": "Average", - // "displayDescription": "Storage limit", - // "displayName": "Storage limit", - // "unit": "Bytes", - // }, - // map[string]any{ - // "name": "active_connections", - // "aggregationType": "Average", - // "displayDescription": "Total active connections", - // "displayName": "Total active connections", - // "fillGapWithZero": true, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "connections_failed", - // "aggregationType": "Average", - // "displayDescription": "Total failed connections", - // "displayName": "Total failed connections", - // "fillGapWithZero": true, - // "unit": "Count", - // }, - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/providers/Microsoft.Insights/diagnosticSettings/read"), - // Display: &armpostgresqlflexibleservers.OperationDisplay{ - // Description: to.Ptr("Gets the disagnostic setting for the resource"), - // Operation: to.Ptr("Read diagnostic setting"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Database Metric Definition"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/providers/Microsoft.Insights/diagnosticSettings/write"), - // Display: &armpostgresqlflexibleservers.OperationDisplay{ - // Description: to.Ptr("Creates or updates the diagnostic setting for the resource"), - // Operation: to.Ptr("Write diagnostic setting"), - // Provider: to.Ptr("Microsoft DB for PostgreSQL"), - // Resource: to.Ptr("Database Metric Definition"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_live_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_live_test.go index e02997e5faf7..584ffef61e00 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_live_test.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/operations_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/options.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/options.go index 1fbb7b9dfe46..a916ff1c4148 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/options.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/options.go @@ -199,14 +199,14 @@ type MigrationsClientUpdateOptions struct { // placeholder for future optional parameters } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters } -// PostgreSQLServerManagementClientCheckMigrationNameAvailabilityOptions contains the optional parameters for the PostgreSQLServerManagementClient.CheckMigrationNameAvailability +// PostgreSQLManagementClientCheckMigrationNameAvailabilityOptions contains the optional parameters for the PostgreSQLManagementClient.CheckMigrationNameAvailability // method. -type PostgreSQLServerManagementClientCheckMigrationNameAvailabilityOptions struct { +type PostgreSQLManagementClientCheckMigrationNameAvailabilityOptions struct { // placeholder for future optional parameters } @@ -247,6 +247,11 @@ 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 @@ -331,6 +336,64 @@ type ServersClientListOptions struct { // placeholder for future optional parameters } +// TuningConfigurationClientBeginDisableOptions contains the optional parameters for the TuningConfigurationClient.BeginDisable +// method. +type TuningConfigurationClientBeginDisableOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// TuningConfigurationClientBeginEnableOptions contains the optional parameters for the TuningConfigurationClient.BeginEnable +// method. +type TuningConfigurationClientBeginEnableOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// TuningConfigurationClientBeginStartSessionOptions contains the optional parameters for the TuningConfigurationClient.BeginStartSession +// method. +type TuningConfigurationClientBeginStartSessionOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// TuningConfigurationClientBeginStopSessionOptions contains the optional parameters for the TuningConfigurationClient.BeginStopSession +// method. +type TuningConfigurationClientBeginStopSessionOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// TuningConfigurationClientListSessionDetailsOptions contains the optional parameters for the TuningConfigurationClient.NewListSessionDetailsPager +// method. +type TuningConfigurationClientListSessionDetailsOptions struct { + // placeholder for future optional parameters +} + +// TuningConfigurationClientListSessionsOptions contains the optional parameters for the TuningConfigurationClient.NewListSessionsPager +// method. +type TuningConfigurationClientListSessionsOptions struct { + // placeholder for future optional parameters +} + +// TuningIndexClientListRecommendationsOptions contains the optional parameters for the TuningIndexClient.NewListRecommendationsPager +// method. +type TuningIndexClientListRecommendationsOptions struct { + // Recommendations list filter. Retrieves recommendations based on type. + RecommendationType *RecommendationType +} + +// TuningOptionsClientGetOptions contains the optional parameters for the TuningOptionsClient.Get method. +type TuningOptionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// TuningOptionsClientListByServerOptions contains the optional parameters for the TuningOptionsClient.NewListByServerPager +// method. +type TuningOptionsClientListByServerOptions struct { + // placeholder for future optional parameters +} + // VirtualEndpointsClientBeginCreateOptions contains the optional parameters for the VirtualEndpointsClient.BeginCreate method. type VirtualEndpointsClientBeginCreateOptions struct { // Resumes the long-running operation from the provided token. diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlservermanagement_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlmanagement_client.go similarity index 61% rename from sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlservermanagement_client.go rename to sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlmanagement_client.go index 8b48c9ed684a..a028dfe5774c 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlservermanagement_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlmanagement_client.go @@ -17,21 +17,21 @@ import ( "strings" ) -// PostgreSQLServerManagementClient contains the methods for the PostgreSQLServerManagementClient group. -// Don't use this type directly, use NewPostgreSQLServerManagementClient() instead. -type PostgreSQLServerManagementClient struct { +// PostgreSQLManagementClient contains the methods for the PostgreSQLManagementClient group. +// Don't use this type directly, use NewPostgreSQLManagementClient() instead. +type PostgreSQLManagementClient struct { internal *arm.Client } -// NewPostgreSQLServerManagementClient creates a new instance of PostgreSQLServerManagementClient with the specified values. +// 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 NewPostgreSQLServerManagementClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*PostgreSQLServerManagementClient, error) { +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 := &PostgreSQLServerManagementClient{ + client := &PostgreSQLManagementClient{ internal: cl, } return client, nil @@ -40,37 +40,37 @@ func NewPostgreSQLServerManagementClient(credential azcore.TokenCredential, opti // 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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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 - PostgreSQLServerManagementClientCheckMigrationNameAvailabilityOptions contains the optional parameters for the -// PostgreSQLServerManagementClient.CheckMigrationNameAvailability method. -func (client *PostgreSQLServerManagementClient) CheckMigrationNameAvailability(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, parameters MigrationNameAvailabilityResource, options *PostgreSQLServerManagementClientCheckMigrationNameAvailabilityOptions) (PostgreSQLServerManagementClientCheckMigrationNameAvailabilityResponse, error) { +// - 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 = "PostgreSQLServerManagementClient.CheckMigrationNameAvailability" + 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 PostgreSQLServerManagementClientCheckMigrationNameAvailabilityResponse{}, err + return PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse{}, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return PostgreSQLServerManagementClientCheckMigrationNameAvailabilityResponse{}, err + return PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse{}, err } if !runtime.HasStatusCode(httpResp, http.StatusOK) { err = runtime.NewResponseError(httpResp) - return PostgreSQLServerManagementClientCheckMigrationNameAvailabilityResponse{}, err + return PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse{}, err } resp, err := client.checkMigrationNameAvailabilityHandleResponse(httpResp) return resp, err } // checkMigrationNameAvailabilityCreateRequest creates the CheckMigrationNameAvailability request. -func (client *PostgreSQLServerManagementClient) checkMigrationNameAvailabilityCreateRequest(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, parameters MigrationNameAvailabilityResource, _ *PostgreSQLServerManagementClientCheckMigrationNameAvailabilityOptions) (*policy.Request, error) { +func (client *PostgreSQLManagementClient) checkMigrationNameAvailabilityCreateRequest(ctx context.Context, subscriptionID string, resourceGroupName string, targetDbServerName string, parameters MigrationNameAvailabilityResource, _ *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") @@ -89,7 +89,7 @@ func (client *PostgreSQLServerManagementClient) checkMigrationNameAvailabilityCr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -99,10 +99,10 @@ func (client *PostgreSQLServerManagementClient) checkMigrationNameAvailabilityCr } // checkMigrationNameAvailabilityHandleResponse handles the CheckMigrationNameAvailability response. -func (client *PostgreSQLServerManagementClient) checkMigrationNameAvailabilityHandleResponse(resp *http.Response) (PostgreSQLServerManagementClientCheckMigrationNameAvailabilityResponse, error) { - result := PostgreSQLServerManagementClientCheckMigrationNameAvailabilityResponse{} +func (client *PostgreSQLManagementClient) checkMigrationNameAvailabilityHandleResponse(resp *http.Response) (PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse, error) { + result := PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.MigrationNameAvailabilityResource); err != nil { - return PostgreSQLServerManagementClientCheckMigrationNameAvailabilityResponse{}, err + return PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse{}, err } return result, nil } diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlservermanagement_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlservermanagement_client_example_test.go deleted file mode 100644 index d2c70d67d866..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/postgresqlservermanagement_client_example_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/CheckMigrationNameAvailability.json -func ExamplePostgreSQLServerManagementClient_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.NewPostgreSQLServerManagementClient().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 index 4dca88042026..b72391f6dd98 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnection_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnection_client.go @@ -43,7 +43,7 @@ func NewPrivateEndpointConnectionClient(subscriptionID string, credential azcore // BeginDelete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -70,7 +70,7 @@ func (client *PrivateEndpointConnectionClient) BeginDelete(ctx context.Context, // Delete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview 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" @@ -116,7 +116,7 @@ func (client *PrivateEndpointConnectionClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -125,7 +125,7 @@ func (client *PrivateEndpointConnectionClient) deleteCreateRequest(ctx context.C // 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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -152,7 +152,7 @@ func (client *PrivateEndpointConnectionClient) BeginUpdate(ctx context.Context, // 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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview 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" @@ -198,7 +198,7 @@ func (client *PrivateEndpointConnectionClient) updateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") 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/privateendpointconnection_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnection_client_example_test.go deleted file mode 100644 index fdbdfc7c5ce0..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnection_client_example_test.go +++ /dev/null @@ -1,89 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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 index f3d1285a94fe..fbdee161ce26 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client.go @@ -43,7 +43,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // Get - Gets a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -95,7 +95,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -112,7 +112,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListByServerPager - Gets all private endpoint connections on a server. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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 @@ -160,7 +160,7 @@ func (client *PrivateEndpointConnectionsClient) listByServerCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client_example_test.go deleted file mode 100644 index 8da7a005551b..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,120 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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 index 1efd3065ba95..9b573f0d37c8 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client.go @@ -43,7 +43,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Gets a private link resource for PostgreSQL server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -95,7 +95,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -112,7 +112,7 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) // NewListByServerPager - Gets the private link resources for PostgreSQL server. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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 @@ -160,7 +160,7 @@ func (client *PrivateLinkResourcesClient) listByServerCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client_example_test.go deleted file mode 100644 index 0cb8308442fc..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,90 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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..9775eba9ef57 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/quotausages_client.go @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights 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 2025-03-15-privatepreview +// - 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, _ *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", "2025-03-15-privatepreview") + 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/replicas_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client.go index ffa5161ae2d9..c1dbb665b9fe 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client.go @@ -42,7 +42,7 @@ func NewReplicasClient(subscriptionID string, credential azcore.TokenCredential, // NewListByServerPager - List all the replicas for a given server. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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 @@ -91,7 +91,7 @@ func (client *ReplicasClient) listByServerCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") 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 deleted file mode 100644 index 62b3a134b184..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/replicas_client_example_test.go +++ /dev/null @@ -1,105 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ReplicasListByServer.json -func ExampleReplicasClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicasClient().NewListByServerPager("testrg", "sourcepgservername", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerListResult = armpostgresqlflexibleservers.ServerListResult{ - // Value: []*armpostgresqlflexibleservers.Server{ - // { - // Name: to.Ptr("pgtestsvc5rep"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5rep"), - // 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), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc5rep.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), - // }, - // 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), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/responses.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/responses.go index 9d020e015aba..419ed6ca67cb 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/responses.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/responses.go @@ -7,7 +7,7 @@ package armpostgresqlflexibleservers // AdministratorsClientCreateResponse contains the response from method AdministratorsClient.BeginCreate. type AdministratorsClientCreateResponse struct { - // Represents an Active Directory administrator. + // Represents an Microsoft Entra Administrator. ActiveDirectoryAdministrator } @@ -18,13 +18,13 @@ type AdministratorsClientDeleteResponse struct { // AdministratorsClientGetResponse contains the response from method AdministratorsClient.Get. type AdministratorsClientGetResponse struct { - // Represents an Active Directory administrator. + // Represents an Microsoft Entra Administrator. ActiveDirectoryAdministrator } // AdministratorsClientListByServerResponse contains the response from method AdministratorsClient.NewListByServerPager. type AdministratorsClientListByServerResponse struct { - // A list of active directory administrators. + // A list of Microsoft Entra Administrators. AdministratorListResult } @@ -207,14 +207,14 @@ type MigrationsClientUpdateResponse struct { MigrationResource } -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { // A list of resource provider operations. OperationListResult } -// PostgreSQLServerManagementClientCheckMigrationNameAvailabilityResponse contains the response from method PostgreSQLServerManagementClient.CheckMigrationNameAvailability. -type PostgreSQLServerManagementClientCheckMigrationNameAvailabilityResponse struct { +// PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse contains the response from method PostgreSQLManagementClient.CheckMigrationNameAvailability. +type PostgreSQLManagementClientCheckMigrationNameAvailabilityResponse struct { // Represents a migration name's availability. MigrationNameAvailabilityResource } @@ -254,6 +254,12 @@ type PrivateLinkResourcesClientListByServerResponse struct { 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. @@ -334,6 +340,56 @@ type ServersClientUpdateResponse struct { Server } +// TuningConfigurationClientDisableResponse contains the response from method TuningConfigurationClient.BeginDisable. +type TuningConfigurationClientDisableResponse struct { + // placeholder for future response values +} + +// TuningConfigurationClientEnableResponse contains the response from method TuningConfigurationClient.BeginEnable. +type TuningConfigurationClientEnableResponse struct { + // placeholder for future response values +} + +// TuningConfigurationClientListSessionDetailsResponse contains the response from method TuningConfigurationClient.NewListSessionDetailsPager. +type TuningConfigurationClientListSessionDetailsResponse struct { + // A list of tuning configuration sessions. + SessionDetailsListResult +} + +// TuningConfigurationClientListSessionsResponse contains the response from method TuningConfigurationClient.NewListSessionsPager. +type TuningConfigurationClientListSessionsResponse struct { + // A list of tuning configuration sessions. + SessionsListResult +} + +// TuningConfigurationClientStartSessionResponse contains the response from method TuningConfigurationClient.BeginStartSession. +type TuningConfigurationClientStartSessionResponse struct { + // placeholder for future response values +} + +// TuningConfigurationClientStopSessionResponse contains the response from method TuningConfigurationClient.BeginStopSession. +type TuningConfigurationClientStopSessionResponse struct { + // placeholder for future response values +} + +// TuningIndexClientListRecommendationsResponse contains the response from method TuningIndexClient.NewListRecommendationsPager. +type TuningIndexClientListRecommendationsResponse struct { + // A list of available index recommendations. + IndexRecommendationListResult +} + +// TuningOptionsClientGetResponse contains the response from method TuningOptionsClient.Get. +type TuningOptionsClientGetResponse struct { + // Stores property that features impact on some metric if this recommended action is applied. + TuningOptionsResource +} + +// TuningOptionsClientListByServerResponse contains the response from method TuningOptionsClient.NewListByServerPager. +type TuningOptionsClientListByServerResponse struct { + // A list of server tuning options. + TuningOptionsListResult +} + // VirtualEndpointsClientCreateResponse contains the response from method VirtualEndpointsClient.BeginCreate. type VirtualEndpointsClientCreateResponse struct { // Represents a virtual endpoint for a server. diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client.go index ce23e923d997..14d7e7199378 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client.go @@ -42,7 +42,7 @@ func NewServerCapabilitiesClient(subscriptionID string, credential azcore.TokenC // NewListPager - Get capabilities for a flexible server. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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 @@ -90,7 +90,7 @@ func (client *ServerCapabilitiesClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client_example_test.go deleted file mode 100644 index a41636324c0e..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servercapabilities_client_example_test.go +++ /dev/null @@ -1,1984 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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.OnlineResizeSupportedEnumEnabled), - // 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](0), - // 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](1920), - // 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_B4ms"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](2880), - // 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_B8ms"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](4320), - // 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_B12ms"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](4320), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // 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](4320), - // 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_B20ms"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](4320), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // 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](4193280), - // SupportedIops: to.Ptr[int32](7500), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // 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](32768), - // 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](1200), - // SupportedThroughput: to.Ptr[int32](125), - // }}, - // }}, - // }, - // { - // Name: to.Ptr("GeneralPurpose"), - // DefaultSKUName: to.Ptr("Standard_D4ads_v5"), - // 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](25600), - // 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](51200), - // 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](76800), - // 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](80000), - // 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](25600), - // 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](51200), - // 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](76800), - // 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](80000), - // 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](25600), - // 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](51200), - // 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](76800), - // 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](80000), - // 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](80000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](4096), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](96), - // }, - // { - // Name: to.Ptr("Standard_D2ds_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](3750), - // 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_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_D8ds_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_D16ds_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](25600), - // 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_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](51200), - // 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_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](76800), - // 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_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](80000), - // 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_D96ds_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](80000), - // 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](4193280), - // SupportedIops: to.Ptr[int32](7500), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // 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](1200), - // SupportedThroughput: to.Ptr[int32](125), - // }}, - // }}, - // }, - // { - // Name: to.Ptr("MemoryOptimized"), - // DefaultSKUName: to.Ptr("Standard_E4ads_v5"), - // 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](25600), - // 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](32000), - // 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](51200), - // 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](76800), - // 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](25600), - // 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](32000), - // 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](51200), - // 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](76800), - // 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](80000), - // 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](3750), - // 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](25600), - // 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_E20ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](32000), - // 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_E32ads_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](51200), - // 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](76800), - // 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](80000), - // 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](80000), - // SupportedMemoryPerVcoreMb: to.Ptr[int64](7168), - // SupportedZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // VCores: to.Ptr[int32](96), - // }, - // { - // Name: to.Ptr("Standard_E2ds_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](3750), - // 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_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_E8ds_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_E16ds_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](25600), - // 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_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](32000), - // 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_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](51200), - // 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_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](76800), - // 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_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](80000), - // 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_E96ds_v5"), - // SupportedHaMode: []*armpostgresqlflexibleservers.HaMode{ - // to.Ptr(armpostgresqlflexibleservers.HaModeSameZone), - // to.Ptr(armpostgresqlflexibleservers.HaModeZoneRedundant)}, - // SupportedIops: to.Ptr[int32](80000), - // 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](4193280), - // SupportedIops: to.Ptr[int32](7500), - // SupportedIopsTiers: []*armpostgresqlflexibleservers.StorageTierCapability{ - // { - // 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](131072), - // 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](1200), - // 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"), - // to.Ptr("16")}, - // }, - // { - // Name: to.Ptr("12"), - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("13"), - // to.Ptr("14"), - // to.Ptr("15"), - // to.Ptr("16")}, - // }, - // { - // Name: to.Ptr("13"), - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("14"), - // to.Ptr("15"), - // to.Ptr("16")}, - // }, - // { - // Name: to.Ptr("14"), - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("15"), - // to.Ptr("16")}, - // }, - // { - // Name: to.Ptr("15"), - // SupportedVersionsToUpgrade: []*string{ - // to.Ptr("16")}, - // }, - // { - // Name: to.Ptr("16"), - // SupportedVersionsToUpgrade: []*string{ - // }, - // }}, - // 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 14509fcaaa85..282f087383e7 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servers_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servers_client.go @@ -43,7 +43,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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -69,7 +69,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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview 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" @@ -111,7 +111,7 @@ func (client *ServersClient) createCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -123,7 +123,7 @@ func (client *ServersClient) createCreateRequest(ctx context.Context, resourceGr // BeginDelete - Deletes a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -148,7 +148,7 @@ func (client *ServersClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview func (client *ServersClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *ServersClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -245,7 +245,7 @@ func (client *ServersClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,7 +262,7 @@ func (client *ServersClient) getHandleResponse(resp *http.Response) (ServersClie // NewListPager - List all the servers in a given subscription. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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]{ @@ -299,7 +299,7 @@ func (client *ServersClient) listCreateRequest(ctx context.Context, _ *ServersCl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -316,7 +316,7 @@ func (client *ServersClient) listHandleResponse(resp *http.Response) (ServersCli // NewListByResourceGroupPager - List all the servers in a given resource group. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ServersClientListByResourceGroupOptions contains the optional parameters for the ServersClient.NewListByResourceGroupPager // method. @@ -359,7 +359,7 @@ func (client *ServersClient) listByResourceGroupCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -377,7 +377,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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -402,7 +402,7 @@ func (client *ServersClient) BeginRestart(ctx context.Context, resourceGroupName // Restart - Restarts a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview func (client *ServersClient) restart(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginRestartOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginRestart" @@ -444,7 +444,7 @@ func (client *ServersClient) restartCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -459,7 +459,7 @@ func (client *ServersClient) restartCreateRequest(ctx context.Context, resourceG // BeginStart - Starts a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -484,7 +484,7 @@ func (client *ServersClient) BeginStart(ctx context.Context, resourceGroupName s // Start - Starts a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview func (client *ServersClient) start(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginStart" @@ -526,7 +526,7 @@ func (client *ServersClient) startCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -535,7 +535,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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -560,7 +560,7 @@ func (client *ServersClient) BeginStop(ctx context.Context, resourceGroupName st // Stop - Stops a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview func (client *ServersClient) stop(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "ServersClient.BeginStop" @@ -602,7 +602,7 @@ func (client *ServersClient) stopCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -612,7 +612,7 @@ func (client *ServersClient) stopCreateRequest(ctx context.Context, resourceGrou // server definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -639,7 +639,7 @@ func (client *ServersClient) BeginUpdate(ctx context.Context, resourceGroupName // definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview 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" @@ -681,7 +681,7 @@ func (client *ServersClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") 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 deleted file mode 100644 index f2ec7375bf7b..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/servers_client_example_test.go +++ /dev/null @@ -1,2210 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armpostgresqlflexibleservers_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerCreateGeoRestoreWithDataEncryptionEnabled.json -func ExampleServersClient_BeginCreate_createADatabaseAsAGeoRestoreInGeoPairedLocation() { - 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", "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), - 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"), - }, - }, 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("pgtestsvc5geo"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5geo"), - // Location: to.Ptr("eastus"), - // 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{ - // 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.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"), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc5geo.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), - // }, - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerCreatePointInTimeRestore.json -func ExampleServersClient_BeginCreate_createADatabaseAsAPointInTimeRestore() { - 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", armpostgresqlflexibleservers.Server{ - Location: to.Ptr("westus"), - Properties: &armpostgresqlflexibleservers.ServerProperties{ - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModePointInTimeRestore), - 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"), - }, - }, 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"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5"), - // 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), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc5.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), - // }, - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerCreate.json -func ExampleServersClient_BeginCreate_createANewServer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "pgtestsvc4", armpostgresqlflexibleservers.Server{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "ElasticServer": to.Ptr("1"), - }, - Properties: &armpostgresqlflexibleservers.ServerProperties{ - AdministratorLogin: to.Ptr("cloudsa"), - AdministratorLoginPassword: to.Ptr("password"), - AvailabilityZone: to.Ptr("1"), - Backup: &armpostgresqlflexibleservers.Backup{ - BackupRetentionDays: to.Ptr[int32](7), - GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - }, - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeCreate), - HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - }, - 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"), - }, - Storage: &armpostgresqlflexibleservers.Storage{ - AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - 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), - }, - }, 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"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // 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-26T01:08:06.719Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("c7d7483a8ceb.test-private-dns-zone.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), - // }, - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerCreateWithAadAuthEnabled.json -func ExampleServersClient_BeginCreate_createANewServerWithActiveDirectoryAuthenticationEnabled() { - 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", "pgtestsvc4", armpostgresqlflexibleservers.Server{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "ElasticServer": to.Ptr("1"), - }, - Properties: &armpostgresqlflexibleservers.ServerProperties{ - AdministratorLogin: to.Ptr("cloudsa"), - AdministratorLoginPassword: to.Ptr("password"), - AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumEnabled), - PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), - }, - AvailabilityZone: to.Ptr("1"), - Backup: &armpostgresqlflexibleservers.Backup{ - BackupRetentionDays: to.Ptr[int32](7), - GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - }, - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeCreate), - DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - }, - HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - }, - 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"), - }, - Storage: &armpostgresqlflexibleservers.Storage{ - AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - 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), - }, - }, 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"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // 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.ActiveDirectoryAuthEnumEnabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), - // }, - // 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-26T01:08:06.719Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("c7d7483a8ceb.test-private-dns-zone.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), - // }, - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerCreateReplica.json -func ExampleServersClient_BeginCreate_serverCreateReplica() { - 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", "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), - 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"), - }, - }, 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("pgtestsvc5rep"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5rep"), - // Location: to.Ptr("westus"), - // 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{ - // 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), - // }, - // 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"), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc5rep.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), - // }, - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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), - // }, - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerCreateWithDataEncryptionEnabled.json -func ExampleServersClient_BeginCreate_serverCreateWithDataEncryptionEnabled() { - 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", "pgtestsvc4", armpostgresqlflexibleservers.Server{ - Location: to.Ptr("westus"), - 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": {}, - }, - }, - Properties: &armpostgresqlflexibleservers.ServerProperties{ - AdministratorLogin: to.Ptr("cloudsa"), - AdministratorLoginPassword: to.Ptr("password"), - AvailabilityZone: to.Ptr("1"), - Backup: &armpostgresqlflexibleservers.Backup{ - BackupRetentionDays: to.Ptr[int32](7), - GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - }, - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeCreate), - 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"), - }, - HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - }, - 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"), - }, - Storage: &armpostgresqlflexibleservers.Storage{ - AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - StorageSizeGB: to.Ptr[int32](512), - }, - Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - }, - SKU: &armpostgresqlflexibleservers.SKU{ - Name: to.Ptr("Standard_D4s_v3"), - Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - }, - }, 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"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // 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{ - // ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumEnabled), - // 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-26T01:08:06.719Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // 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"), - // }, - // FullyQualifiedDomainName: to.Ptr("c7d7483a8ceb.test-private-dns-zone.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), - // }, - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerUpdate.json -func ExampleServersClient_BeginUpdate_serverUpdate() { - 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, "TestGroup", "pgtestsvc4", armpostgresqlflexibleservers.ServerForUpdate{ - Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ - AdministratorLoginPassword: to.Ptr("newpassword"), - Backup: &armpostgresqlflexibleservers.Backup{ - BackupRetentionDays: to.Ptr[int32](20), - }, - 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{ - Name: to.Ptr("Standard_D8s_v3"), - Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - }, - }, 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"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // 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("c7d7483a8ceb.test-private-dns-zone.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), - // }, - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerUpdateWithAadAuthEnabled.json -func ExampleServersClient_BeginUpdate_serverUpdateWithAadAuthEnabled() { - 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, "TestGroup", "pgtestsvc4", armpostgresqlflexibleservers.ServerForUpdate{ - Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ - AdministratorLoginPassword: to.Ptr("newpassword"), - AuthConfig: &armpostgresqlflexibleservers.AuthConfig{ - ActiveDirectoryAuth: to.Ptr(armpostgresqlflexibleservers.ActiveDirectoryAuthEnumEnabled), - PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), - }, - Backup: &armpostgresqlflexibleservers.Backup{ - BackupRetentionDays: to.Ptr[int32](20), - }, - 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{ - Name: to.Ptr("Standard_D8s_v3"), - Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - }, - }, 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"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // 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.ActiveDirectoryAuthEnumEnabled), - // PasswordAuth: to.Ptr(armpostgresqlflexibleservers.PasswordAuthEnumEnabled), - // TenantID: to.Ptr("tttttt-tttt-tttt-tttt-tttttttttttt"), - // }, - // 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("c7d7483a8ceb.test-private-dns-zone.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), - // }, - // 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), - // }, - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerUpdateWithCustomerMaintenanceWindow.json -func ExampleServersClient_BeginUpdate_serverUpdateWithCustomerMaintenanceWindow() { - 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, "testrg", "pgtestsvc4", armpostgresqlflexibleservers.ServerForUpdate{ - Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForUpdateUpdate), - MaintenanceWindow: &armpostgresqlflexibleservers.MaintenanceWindow{ - CustomWindow: to.Ptr("Enabled"), - DayOfWeek: to.Ptr[int32](0), - StartHour: to.Ptr[int32](8), - StartMinute: to.Ptr[int32](0), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armpostgresqlflexibleservers.Server{ - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // 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-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("c7d7483a8ceb.test-private-dns-zone.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("Enabled"), - // DayOfWeek: to.Ptr[int32](0), - // StartHour: to.Ptr[int32](8), - // 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), - // }, - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerUpdateWithDataEncryptionEnabled.json -func ExampleServersClient_BeginUpdate_serverUpdateWithDataEncryptionEnabled() { - 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, "TestGroup", "pgtestsvc4", armpostgresqlflexibleservers.ServerForUpdate{ - 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.ServerPropertiesForUpdate{ - AdministratorLoginPassword: to.Ptr("newpassword"), - Backup: &armpostgresqlflexibleservers.Backup{ - BackupRetentionDays: to.Ptr[int32](20), - }, - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForUpdateUpdate), - 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"), - }, - }, - SKU: &armpostgresqlflexibleservers.SKU{ - Name: to.Ptr("Standard_D8s_v3"), - Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - }, - }, 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"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // Location: to.Ptr("westus"), - // 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"), - // }, - // "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity-1": &armpostgresqlflexibleservers.UserIdentity{ - // ClientID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"), - // PrincipalID: to.Ptr("90008082-e024-4cc3-8fcf-63bcdb9cf6b6"), - // }, - // }, - // }, - // 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.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"), - // }, - // FullyQualifiedDomainName: to.Ptr("c7d7483a8ceb.test-private-dns-zone.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), - // }, - // 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), - // }, - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerUpdateWithMajorVersionUpgrade.json -func ExampleServersClient_BeginUpdate_serverUpdateWithMajorVersionUpgrade() { - 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, "testrg", "pgtestsvc4", armpostgresqlflexibleservers.ServerForUpdate{ - Properties: &armpostgresqlflexibleservers.ServerPropertiesForUpdate{ - CreateMode: to.Ptr(armpostgresqlflexibleservers.CreateModeForUpdateUpdate), - Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionFourteen), - }, - }, 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"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // 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-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // DataEncryption: &armpostgresqlflexibleservers.DataEncryption{ - // Type: to.Ptr(armpostgresqlflexibleservers.ArmServerKeyTypeSystemManaged), - // }, - // FullyQualifiedDomainName: to.Ptr("c7d7483a8ceb.test-private-dns-zone.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), - // }, - // 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), - // }, - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerDelete.json -func ExampleServersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginDelete(ctx, "testrg", "testserver", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerGet.json -func ExampleServersClient_Get_serverGet() { - 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", "pgtestsvc1", 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/pgtestsvc1"), - // 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("pgtestsvc1.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), - // }, - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerGetWithVnet.json -func ExampleServersClient_Get_serverGetWithVnet() { - 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", "pgtestsvc4", 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("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // 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-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("c7d7483a8ceb.test-private-dns-zone.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), - // }, - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerListByResourceGroup.json -func ExampleServersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServersClient().NewListByResourceGroupPager("testrg", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerListResult = armpostgresqlflexibleservers.ServerListResult{ - // Value: []*armpostgresqlflexibleservers.Server{ - // { - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // 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-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("c7d7483a8ceb.test-private-dns-zone.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // 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), - // }, - // 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), - // }, - // }, - // { - // 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"), - // 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:15:38.813Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc1.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateNotEnabled), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), - // }, - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerList.json -func ExampleServersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServersClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerListResult = armpostgresqlflexibleservers.ServerListResult{ - // Value: []*armpostgresqlflexibleservers.Server{ - // { - // Name: to.Ptr("pgtestsvc4"), - // Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers"), - // ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc4"), - // 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-26T01:16:58.372Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("c7d7483a8ceb.test-private-dns-zone.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeZoneRedundant), - // StandbyAvailabilityZone: to.Ptr("2"), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateHealthy), - // }, - // 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), - // }, - // State: to.Ptr(armpostgresqlflexibleservers.ServerStateReady), - // Storage: &armpostgresqlflexibleservers.Storage{ - // AutoGrow: to.Ptr(armpostgresqlflexibleservers.StorageAutoGrowDisabled), - // StorageSizeGB: to.Ptr[int32](512), - // }, - // Version: to.Ptr(armpostgresqlflexibleservers.ServerVersionTwelve), - // }, - // SKU: &armpostgresqlflexibleservers.SKU{ - // Name: to.Ptr("Standard_D4s_v3"), - // Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose), - // }, - // }, - // { - // 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("eastus"), - // 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:15:38.813Z"); return t}()), - // GeoRedundantBackup: to.Ptr(armpostgresqlflexibleservers.GeoRedundantBackupEnumDisabled), - // }, - // FullyQualifiedDomainName: to.Ptr("pgtestsvc1.postgres.database.azure.com"), - // HighAvailability: &armpostgresqlflexibleservers.HighAvailability{ - // Mode: to.Ptr(armpostgresqlflexibleservers.HighAvailabilityModeDisabled), - // State: to.Ptr(armpostgresqlflexibleservers.ServerHAStateNotEnabled), - // }, - // MinorVersion: to.Ptr("6"), - // Network: &armpostgresqlflexibleservers.Network{ - // PublicNetworkAccess: to.Ptr(armpostgresqlflexibleservers.ServerPublicNetworkAccessStateEnabled), - // }, - // 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), - // }, - // 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerRestart.json -func ExampleServersClient_BeginRestart_serverRestart() { - 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().BeginRestart(ctx, "testrg", "testserver", &armpostgresqlflexibleservers.ServersClientBeginRestartOptions{Parameters: 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerRestartWithFailover.json -func ExampleServersClient_BeginRestart_serverRestartWithFailover() { - 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().BeginRestart(ctx, "testrg", "testserver", &armpostgresqlflexibleservers.ServersClientBeginRestartOptions{Parameters: &armpostgresqlflexibleservers.RestartParameter{ - FailoverMode: to.Ptr(armpostgresqlflexibleservers.FailoverModeForcedFailover), - RestartWithFailover: to.Ptr(true), - }, - }) - 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerStart.json -func ExampleServersClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginStart(ctx, "testrg", "testserver", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerStop.json -func ExampleServersClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginStop(ctx, "testrg", "testserver", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client.go index 57fce1c1e4d6..cde1e8f2ccec 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client.go @@ -43,7 +43,7 @@ func NewServerThreatProtectionSettingsClient(subscriptionID string, credential a // 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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -71,7 +71,7 @@ func (client *ServerThreatProtectionSettingsClient) BeginCreateOrUpdate(ctx cont // 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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview 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" @@ -117,7 +117,7 @@ func (client *ServerThreatProtectionSettingsClient) createOrUpdateCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -129,7 +129,7 @@ func (client *ServerThreatProtectionSettingsClient) createOrUpdateCreateRequest( // Get - Get a server's Advanced Threat Protection settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -181,7 +181,7 @@ func (client *ServerThreatProtectionSettingsClient) getCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -198,7 +198,7 @@ func (client *ServerThreatProtectionSettingsClient) getHandleResponse(resp *http // NewListByServerPager - Get a list of server's Threat Protection state. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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 @@ -246,7 +246,7 @@ func (client *ServerThreatProtectionSettingsClient) listByServerCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client_example_test.go deleted file mode 100644 index ce891eb4a104..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/serverthreatprotectionsettings_client_example_test.go +++ /dev/null @@ -1,122 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/ServerThreatProtectionSettingsCreateOrUpdate.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/tuningconfiguration_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningconfiguration_client.go new file mode 100644 index 000000000000..ca0ddca08b64 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningconfiguration_client.go @@ -0,0 +1,515 @@ +// Copyright (c) Microsoft Corporation. All rights 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" +) + +// TuningConfigurationClient contains the methods for the TuningConfiguration group. +// Don't use this type directly, use NewTuningConfigurationClient() instead. +type TuningConfigurationClient struct { + internal *arm.Client + subscriptionID string +} + +// NewTuningConfigurationClient creates a new instance of TuningConfigurationClient 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 NewTuningConfigurationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TuningConfigurationClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &TuningConfigurationClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginDisable - Disables the config tuning. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-15-privatepreview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - tuningOption - The name of the tuning option. +// - options - TuningConfigurationClientBeginDisableOptions contains the optional parameters for the TuningConfigurationClient.BeginDisable +// method. +func (client *TuningConfigurationClient) BeginDisable(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, options *TuningConfigurationClientBeginDisableOptions) (*runtime.Poller[TuningConfigurationClientDisableResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.disable(ctx, resourceGroupName, serverName, tuningOption, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TuningConfigurationClientDisableResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[TuningConfigurationClientDisableResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Disable - Disables the config tuning. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-15-privatepreview +func (client *TuningConfigurationClient) disable(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, options *TuningConfigurationClientBeginDisableOptions) (*http.Response, error) { + var err error + const operationName = "TuningConfigurationClient.BeginDisable" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.disableCreateRequest(ctx, resourceGroupName, serverName, tuningOption, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// disableCreateRequest creates the Disable request. +func (client *TuningConfigurationClient) disableCreateRequest(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, _ *TuningConfigurationClientBeginDisableOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}/disable" + 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 tuningOption == "" { + return nil, errors.New("parameter tuningOption cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{tuningOption}", url.PathEscape(string(tuningOption))) + 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", "2025-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginEnable - Enables the config tuning. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-15-privatepreview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - tuningOption - The name of the tuning option. +// - options - TuningConfigurationClientBeginEnableOptions contains the optional parameters for the TuningConfigurationClient.BeginEnable +// method. +func (client *TuningConfigurationClient) BeginEnable(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, options *TuningConfigurationClientBeginEnableOptions) (*runtime.Poller[TuningConfigurationClientEnableResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.enable(ctx, resourceGroupName, serverName, tuningOption, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TuningConfigurationClientEnableResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[TuningConfigurationClientEnableResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Enable - Enables the config tuning. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-15-privatepreview +func (client *TuningConfigurationClient) enable(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, options *TuningConfigurationClientBeginEnableOptions) (*http.Response, error) { + var err error + const operationName = "TuningConfigurationClient.BeginEnable" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.enableCreateRequest(ctx, resourceGroupName, serverName, tuningOption, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// enableCreateRequest creates the Enable request. +func (client *TuningConfigurationClient) enableCreateRequest(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, _ *TuningConfigurationClientBeginEnableOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}/enable" + 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 tuningOption == "" { + return nil, errors.New("parameter tuningOption cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{tuningOption}", url.PathEscape(string(tuningOption))) + 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", "2025-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// NewListSessionDetailsPager - Gets the session details of a config tuning session. +// +// Generated from API version 2025-03-15-privatepreview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - tuningOption - The name of the tuning option. +// - sessionID - Guid of the objectId for the session. +// - options - TuningConfigurationClientListSessionDetailsOptions contains the optional parameters for the TuningConfigurationClient.NewListSessionDetailsPager +// method. +func (client *TuningConfigurationClient) NewListSessionDetailsPager(resourceGroupName string, serverName string, tuningOption TuningOptionEnum, sessionID string, options *TuningConfigurationClientListSessionDetailsOptions) *runtime.Pager[TuningConfigurationClientListSessionDetailsResponse] { + return runtime.NewPager(runtime.PagingHandler[TuningConfigurationClientListSessionDetailsResponse]{ + More: func(page TuningConfigurationClientListSessionDetailsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *TuningConfigurationClientListSessionDetailsResponse) (TuningConfigurationClientListSessionDetailsResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "TuningConfigurationClient.NewListSessionDetailsPager") + 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.listSessionDetailsCreateRequest(ctx, resourceGroupName, serverName, tuningOption, sessionID, options) + }, nil) + if err != nil { + return TuningConfigurationClientListSessionDetailsResponse{}, err + } + return client.listSessionDetailsHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listSessionDetailsCreateRequest creates the ListSessionDetails request. +func (client *TuningConfigurationClient) listSessionDetailsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, sessionID string, _ *TuningConfigurationClientListSessionDetailsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}/sessionDetails" + 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 tuningOption == "" { + return nil, errors.New("parameter tuningOption cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{tuningOption}", url.PathEscape(string(tuningOption))) + 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", "2025-03-15-privatepreview") + reqQP.Set("sessionId", sessionID) + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listSessionDetailsHandleResponse handles the ListSessionDetails response. +func (client *TuningConfigurationClient) listSessionDetailsHandleResponse(resp *http.Response) (TuningConfigurationClientListSessionDetailsResponse, error) { + result := TuningConfigurationClientListSessionDetailsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SessionDetailsListResult); err != nil { + return TuningConfigurationClientListSessionDetailsResponse{}, err + } + return result, nil +} + +// NewListSessionsPager - Gets up the config tuning session status. +// +// Generated from API version 2025-03-15-privatepreview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - tuningOption - The name of the tuning option. +// - options - TuningConfigurationClientListSessionsOptions contains the optional parameters for the TuningConfigurationClient.NewListSessionsPager +// method. +func (client *TuningConfigurationClient) NewListSessionsPager(resourceGroupName string, serverName string, tuningOption TuningOptionEnum, options *TuningConfigurationClientListSessionsOptions) *runtime.Pager[TuningConfigurationClientListSessionsResponse] { + return runtime.NewPager(runtime.PagingHandler[TuningConfigurationClientListSessionsResponse]{ + More: func(page TuningConfigurationClientListSessionsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *TuningConfigurationClientListSessionsResponse) (TuningConfigurationClientListSessionsResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "TuningConfigurationClient.NewListSessionsPager") + 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.listSessionsCreateRequest(ctx, resourceGroupName, serverName, tuningOption, options) + }, nil) + if err != nil { + return TuningConfigurationClientListSessionsResponse{}, err + } + return client.listSessionsHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listSessionsCreateRequest creates the ListSessions request. +func (client *TuningConfigurationClient) listSessionsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, _ *TuningConfigurationClientListSessionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}/sessions" + 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 tuningOption == "" { + return nil, errors.New("parameter tuningOption cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{tuningOption}", url.PathEscape(string(tuningOption))) + 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", "2025-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listSessionsHandleResponse handles the ListSessions response. +func (client *TuningConfigurationClient) listSessionsHandleResponse(resp *http.Response) (TuningConfigurationClientListSessionsResponse, error) { + result := TuningConfigurationClientListSessionsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SessionsListResult); err != nil { + return TuningConfigurationClientListSessionsResponse{}, err + } + return result, nil +} + +// BeginStartSession - Starts up the config tuning session. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-15-privatepreview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - tuningOption - The name of the tuning option. +// - configTuningRequest - The parameters for tuning request. +// - options - TuningConfigurationClientBeginStartSessionOptions contains the optional parameters for the TuningConfigurationClient.BeginStartSession +// method. +func (client *TuningConfigurationClient) BeginStartSession(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, configTuningRequest ConfigTuningRequestParameter, options *TuningConfigurationClientBeginStartSessionOptions) (*runtime.Poller[TuningConfigurationClientStartSessionResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.startSession(ctx, resourceGroupName, serverName, tuningOption, configTuningRequest, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TuningConfigurationClientStartSessionResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[TuningConfigurationClientStartSessionResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// StartSession - Starts up the config tuning session. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-15-privatepreview +func (client *TuningConfigurationClient) startSession(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, configTuningRequest ConfigTuningRequestParameter, options *TuningConfigurationClientBeginStartSessionOptions) (*http.Response, error) { + var err error + const operationName = "TuningConfigurationClient.BeginStartSession" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.startSessionCreateRequest(ctx, resourceGroupName, serverName, tuningOption, configTuningRequest, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// startSessionCreateRequest creates the StartSession request. +func (client *TuningConfigurationClient) startSessionCreateRequest(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, configTuningRequest ConfigTuningRequestParameter, _ *TuningConfigurationClientBeginStartSessionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}/startSession" + 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 tuningOption == "" { + return nil, errors.New("parameter tuningOption cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{tuningOption}", url.PathEscape(string(tuningOption))) + 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", "2025-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, configTuningRequest); err != nil { + return nil, err + } + return req, nil +} + +// BeginStopSession - Stops the config tuning session. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-15-privatepreview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - tuningOption - The name of the tuning option. +// - options - TuningConfigurationClientBeginStopSessionOptions contains the optional parameters for the TuningConfigurationClient.BeginStopSession +// method. +func (client *TuningConfigurationClient) BeginStopSession(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, options *TuningConfigurationClientBeginStopSessionOptions) (*runtime.Poller[TuningConfigurationClientStopSessionResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.stopSession(ctx, resourceGroupName, serverName, tuningOption, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TuningConfigurationClientStopSessionResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[TuningConfigurationClientStopSessionResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// StopSession - Stops the config tuning session. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-15-privatepreview +func (client *TuningConfigurationClient) stopSession(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, options *TuningConfigurationClientBeginStopSessionOptions) (*http.Response, error) { + var err error + const operationName = "TuningConfigurationClient.BeginStopSession" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.stopSessionCreateRequest(ctx, resourceGroupName, serverName, tuningOption, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// stopSessionCreateRequest creates the StopSession request. +func (client *TuningConfigurationClient) stopSessionCreateRequest(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, _ *TuningConfigurationClientBeginStopSessionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}/stopSession" + 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 tuningOption == "" { + return nil, errors.New("parameter tuningOption cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{tuningOption}", url.PathEscape(string(tuningOption))) + 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", "2025-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningindex_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningindex_client.go new file mode 100644 index 000000000000..0bddc013a3f7 --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningindex_client.go @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights 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" +) + +// TuningIndexClient contains the methods for the TuningIndex group. +// Don't use this type directly, use NewTuningIndexClient() instead. +type TuningIndexClient struct { + internal *arm.Client + subscriptionID string +} + +// NewTuningIndexClient creates a new instance of TuningIndexClient 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 NewTuningIndexClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TuningIndexClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &TuningIndexClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListRecommendationsPager - Retrieve the list of available tuning index recommendations. +// +// Generated from API version 2025-03-15-privatepreview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - tuningOption - The name of the tuning option. +// - options - TuningIndexClientListRecommendationsOptions contains the optional parameters for the TuningIndexClient.NewListRecommendationsPager +// method. +func (client *TuningIndexClient) NewListRecommendationsPager(resourceGroupName string, serverName string, tuningOption TuningOptionEnum, options *TuningIndexClientListRecommendationsOptions) *runtime.Pager[TuningIndexClientListRecommendationsResponse] { + return runtime.NewPager(runtime.PagingHandler[TuningIndexClientListRecommendationsResponse]{ + More: func(page TuningIndexClientListRecommendationsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *TuningIndexClientListRecommendationsResponse) (TuningIndexClientListRecommendationsResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "TuningIndexClient.NewListRecommendationsPager") + 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.listRecommendationsCreateRequest(ctx, resourceGroupName, serverName, tuningOption, options) + }, nil) + if err != nil { + return TuningIndexClientListRecommendationsResponse{}, err + } + return client.listRecommendationsHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listRecommendationsCreateRequest creates the ListRecommendations request. +func (client *TuningIndexClient) listRecommendationsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, options *TuningIndexClientListRecommendationsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}/recommendations" + 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 tuningOption == "" { + return nil, errors.New("parameter tuningOption cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{tuningOption}", url.PathEscape(string(tuningOption))) + 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", "2025-03-15-privatepreview") + if options != nil && options.RecommendationType != nil { + reqQP.Set("recommendationType", string(*options.RecommendationType)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listRecommendationsHandleResponse handles the ListRecommendations response. +func (client *TuningIndexClient) listRecommendationsHandleResponse(resp *http.Response) (TuningIndexClientListRecommendationsResponse, error) { + result := TuningIndexClientListRecommendationsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.IndexRecommendationListResult); err != nil { + return TuningIndexClientListRecommendationsResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningoptions_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningoptions_client.go new file mode 100644 index 000000000000..5c73c1d04b1e --- /dev/null +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/tuningoptions_client.go @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights 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" +) + +// TuningOptionsClient contains the methods for the TuningOptions group. +// Don't use this type directly, use NewTuningOptionsClient() instead. +type TuningOptionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewTuningOptionsClient creates a new instance of TuningOptionsClient 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 NewTuningOptionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TuningOptionsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &TuningOptionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Retrieve the tuning option on a server. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-15-privatepreview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - tuningOption - The name of the tuning option. +// - options - TuningOptionsClientGetOptions contains the optional parameters for the TuningOptionsClient.Get method. +func (client *TuningOptionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, options *TuningOptionsClientGetOptions) (TuningOptionsClientGetResponse, error) { + var err error + const operationName = "TuningOptionsClient.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, tuningOption, options) + if err != nil { + return TuningOptionsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return TuningOptionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TuningOptionsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *TuningOptionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, tuningOption TuningOptionEnum, _ *TuningOptionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}" + 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 tuningOption == "" { + return nil, errors.New("parameter tuningOption cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{tuningOption}", url.PathEscape(string(tuningOption))) + 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", "2025-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *TuningOptionsClient) getHandleResponse(resp *http.Response) (TuningOptionsClientGetResponse, error) { + result := TuningOptionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.TuningOptionsResource); err != nil { + return TuningOptionsClientGetResponse{}, err + } + return result, nil +} + +// NewListByServerPager - Retrieve the list of available tuning options. +// +// Generated from API version 2025-03-15-privatepreview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serverName - The name of the server. +// - options - TuningOptionsClientListByServerOptions contains the optional parameters for the TuningOptionsClient.NewListByServerPager +// method. +func (client *TuningOptionsClient) NewListByServerPager(resourceGroupName string, serverName string, options *TuningOptionsClientListByServerOptions) *runtime.Pager[TuningOptionsClientListByServerResponse] { + return runtime.NewPager(runtime.PagingHandler[TuningOptionsClientListByServerResponse]{ + More: func(page TuningOptionsClientListByServerResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *TuningOptionsClientListByServerResponse) (TuningOptionsClientListByServerResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "TuningOptionsClient.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 TuningOptionsClientListByServerResponse{}, err + } + return client.listByServerHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByServerCreateRequest creates the ListByServer request. +func (client *TuningOptionsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, _ *TuningOptionsClientListByServerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions" + 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", "2025-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByServerHandleResponse handles the ListByServer response. +func (client *TuningOptionsClient) listByServerHandleResponse(resp *http.Response) (TuningOptionsClientListByServerResponse, error) { + result := TuningOptionsClientListByServerResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.TuningOptionsListResult); err != nil { + return TuningOptionsClientListByServerResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client.go index 98cbf1c88530..c596e575c6ef 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client.go @@ -43,7 +43,7 @@ func NewVirtualEndpointsClient(subscriptionID string, credential azcore.TokenCre // BeginCreate - Creates a new virtual endpoint for PostgreSQL flexible server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -71,7 +71,7 @@ func (client *VirtualEndpointsClient) BeginCreate(ctx context.Context, resourceG // Create - Creates a new virtual endpoint for PostgreSQL flexible server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview 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" @@ -117,7 +117,7 @@ func (client *VirtualEndpointsClient) createCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -129,7 +129,7 @@ func (client *VirtualEndpointsClient) createCreateRequest(ctx context.Context, r // BeginDelete - Deletes a virtual endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -156,7 +156,7 @@ func (client *VirtualEndpointsClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes a virtual endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview 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" @@ -202,7 +202,7 @@ func (client *VirtualEndpointsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -211,7 +211,7 @@ func (client *VirtualEndpointsClient) deleteCreateRequest(ctx context.Context, r // Get - Gets information about a virtual endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -262,7 +262,7 @@ func (client *VirtualEndpointsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,7 +279,7 @@ func (client *VirtualEndpointsClient) getHandleResponse(resp *http.Response) (Vi // NewListByServerPager - List all the servers in a given resource group. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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 @@ -327,7 +327,7 @@ func (client *VirtualEndpointsClient) listByServerCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -346,7 +346,7 @@ func (client *VirtualEndpointsClient) listByServerHandleResponse(resp *http.Resp // in the normal virtual endpoint definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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. @@ -375,7 +375,7 @@ func (client *VirtualEndpointsClient) BeginUpdate(ctx context.Context, resourceG // normal virtual endpoint definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-01 +// Generated from API version 2025-03-15-privatepreview 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" @@ -421,7 +421,7 @@ func (client *VirtualEndpointsClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") 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/virtualendpoints_client_example_test.go b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client_example_test.go deleted file mode 100644 index 085004546c1a..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualendpoints_client_example_test.go +++ /dev/null @@ -1,200 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/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 9725cce73bb6..0afbeb8013ae 100644 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_client.go @@ -43,7 +43,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 2024-08-01 +// Generated from API version 2025-03-15-privatepreview // - 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 @@ -86,7 +86,7 @@ func (client *VirtualNetworkSubnetUsageClient) executeCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-01") + reqQP.Set("api-version", "2025-03-15-privatepreview") 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 deleted file mode 100644 index 7c3480b83f05..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/virtualnetworksubnetusage_client_example_test.go +++ /dev/null @@ -1,54 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/ecee919199a39cc0d864410f540aa105bf7cdb64/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/examples/VirtualNetworkSubnetUsage.json -func ExampleVirtualNetworkSubnetUsageClient_Execute() { - 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.NewVirtualNetworkSubnetUsageClient().Execute(ctx, "westus", armpostgresqlflexibleservers.VirtualNetworkSubnetUsageParameter{ - VirtualNetworkArmResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/testvnet"), - }, 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.VirtualNetworkSubnetUsageResult = armpostgresqlflexibleservers.VirtualNetworkSubnetUsageResult{ - // DelegatedSubnetsUsage: []*armpostgresqlflexibleservers.DelegatedSubnetUsage{ - // { - // SubnetName: to.Ptr("test-subnet-1"), - // Usage: to.Ptr[int64](2), - // }, - // { - // SubnetName: to.Ptr("test-subnet-2"), - // Usage: to.Ptr[int64](3), - // }}, - // Location: to.Ptr("westus"), - // SubscriptionID: to.Ptr("ffffffff-ffff-ffff-ffff-ffffffffffff"), - // } -}