// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.

package armpostgresqlhsc_test

import (
	"context"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresqlhsc/armpostgresqlhsc"
	"log"
)

// Generated from example definition: 2023-03-02-preview/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 := armpostgresqlhsc.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationsClient().Get(ctx, "TestResourceGroup", "testcluster", "client_encoding", 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 = armpostgresqlhsc.ConfigurationsClientGetResponse{
	// 	Configuration: armpostgresqlhsc.Configuration{
	// 		Name: to.Ptr("client_encoding"),
	// 		Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/configurations"),
	// 		ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/configurations/client_encoding"),
	// 		Properties: &armpostgresqlhsc.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(armpostgresqlhsc.ConfigurationDataTypeEnumeration),
	// 			ServerRoleGroupConfigurations: []*armpostgresqlhsc.ServerRoleGroupConfiguration{
	// 				{
	// 					DefaultValue: to.Ptr("sql_ascii"),
	// 					Role: to.Ptr(armpostgresqlhsc.ServerRoleCoordinator),
	// 					Source: to.Ptr("user-override"),
	// 					Value: to.Ptr("ISO_8859_7"),
	// 				},
	// 				{
	// 					DefaultValue: to.Ptr("sql_ascii"),
	// 					Role: to.Ptr(armpostgresqlhsc.ServerRoleWorker),
	// 					Source: to.Ptr("user-override"),
	// 					Value: to.Ptr("ISO_8859_7"),
	// 				},
	// 			},
	// 		},
	// 		SystemData: &armpostgresqlhsc.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()),
	// 			CreatedBy: to.Ptr("user1"),
	// 			CreatedByType: to.Ptr(armpostgresqlhsc.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("user2"),
	// 			LastModifiedByType: to.Ptr(armpostgresqlhsc.CreatedByTypeUser),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2023-03-02-preview/ConfigurationGetCoordinator.json
func ExampleConfigurationsClient_GetCoordinator() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresqlhsc.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationsClient().GetCoordinator(ctx, "TestResourceGroup", "testcluster", "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 = armpostgresqlhsc.ConfigurationsClientGetCoordinatorResponse{
	// 	ServerConfiguration: armpostgresqlhsc.ServerConfiguration{
	// 		ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/coordinatorConfigurations/array_nulls"),
	// 		Name: to.Ptr("array_nulls"),
	// 		Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/coordinatorConfigurations"),
	// 		SystemData: &armpostgresqlhsc.SystemData{
	// 			CreatedBy: to.Ptr("user1"),
	// 			CreatedByType: to.Ptr(armpostgresqlhsc.CreatedByTypeUser),
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("user2"),
	// 			LastModifiedByType: to.Ptr(armpostgresqlhsc.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()),
	// 		},
	// 		Properties: &armpostgresqlhsc.ServerConfigurationProperties{
	// 			Value: to.Ptr("on"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2023-03-02-preview/ConfigurationGetNode.json
func ExampleConfigurationsClient_GetNode() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresqlhsc.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationsClient().GetNode(ctx, "TestResourceGroup", "testcluster", "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 = armpostgresqlhsc.ConfigurationsClientGetNodeResponse{
	// 	ServerConfiguration: armpostgresqlhsc.ServerConfiguration{
	// 		Name: to.Ptr("array_nulls"),
	// 		Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/nodeConfigurations"),
	// 		ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/nodeConfigurations/array_nulls"),
	// 		Properties: &armpostgresqlhsc.ServerConfigurationProperties{
	// 			Value: to.Ptr("off"),
	// 		},
	// 		SystemData: &armpostgresqlhsc.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()),
	// 			CreatedBy: to.Ptr("user1"),
	// 			CreatedByType: to.Ptr(armpostgresqlhsc.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("user2"),
	// 			LastModifiedByType: to.Ptr(armpostgresqlhsc.CreatedByTypeUser),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2023-03-02-preview/ConfigurationListByCluster.json
func ExampleConfigurationsClient_NewListByClusterPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresqlhsc.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewConfigurationsClient().NewListByClusterPager("TestResourceGroup", "testcluster", 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 = armpostgresqlhsc.ConfigurationsClientListByClusterResponse{
		// 	ClusterConfigurationListResult: armpostgresqlhsc.ClusterConfigurationListResult{
		// 		Value: []*armpostgresqlhsc.Configuration{
		// 			{
		// 				Name: to.Ptr("array_nulls"),
		// 				Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/configurations"),
		// 				ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/configurations/array_nulls"),
		// 				Properties: &armpostgresqlhsc.ConfigurationProperties{
		// 					Description: to.Ptr("Enable input of NULL elements in arrays."),
		// 					AllowedValues: to.Ptr("on,off"),
		// 					DataType: to.Ptr(armpostgresqlhsc.ConfigurationDataTypeBoolean),
		// 					ProvisioningState: to.Ptr(armpostgresqlhsc.ProvisioningStateSucceeded),
		// 					ServerRoleGroupConfigurations: []*armpostgresqlhsc.ServerRoleGroupConfiguration{
		// 						{
		// 							DefaultValue: to.Ptr("on"),
		// 							Role: to.Ptr(armpostgresqlhsc.ServerRoleCoordinator),
		// 							Source: to.Ptr("system-default"),
		// 							Value: to.Ptr("on"),
		// 						},
		// 						{
		// 							DefaultValue: to.Ptr("on"),
		// 							Role: to.Ptr(armpostgresqlhsc.ServerRoleWorker),
		// 							Source: to.Ptr("user-override"),
		// 							Value: to.Ptr("off"),
		// 						},
		// 					},
		// 				},
		// 				SystemData: &armpostgresqlhsc.SystemData{
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()),
		// 					CreatedBy: to.Ptr("user1"),
		// 					CreatedByType: to.Ptr(armpostgresqlhsc.CreatedByTypeUser),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("user2"),
		// 					LastModifiedByType: to.Ptr(armpostgresqlhsc.CreatedByTypeUser),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("backslash_quote"),
		// 				Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/configurations"),
		// 				ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/configurations/backslash_quote"),
		// 				Properties: &armpostgresqlhsc.ConfigurationProperties{
		// 					Description: to.Ptr("Sets whether \"\\'\" is allowed in string literals."),
		// 					AllowedValues: to.Ptr("safe_encoding,on,off"),
		// 					DataType: to.Ptr(armpostgresqlhsc.ConfigurationDataTypeEnumeration),
		// 					ProvisioningState: to.Ptr(armpostgresqlhsc.ProvisioningStateSucceeded),
		// 					ServerRoleGroupConfigurations: []*armpostgresqlhsc.ServerRoleGroupConfiguration{
		// 						{
		// 							DefaultValue: to.Ptr("safe_encoding"),
		// 							Role: to.Ptr(armpostgresqlhsc.ServerRoleCoordinator),
		// 							Source: to.Ptr("user-override"),
		// 							Value: to.Ptr("off"),
		// 						},
		// 						{
		// 							DefaultValue: to.Ptr("safe_encoding"),
		// 							Role: to.Ptr(armpostgresqlhsc.ServerRoleWorker),
		// 							Source: to.Ptr("system-default"),
		// 							Value: to.Ptr("safe_encoding"),
		// 						},
		// 					},
		// 				},
		// 				SystemData: &armpostgresqlhsc.SystemData{
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()),
		// 					CreatedBy: to.Ptr("user1"),
		// 					CreatedByType: to.Ptr(armpostgresqlhsc.CreatedByTypeUser),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("user2"),
		// 					LastModifiedByType: to.Ptr(armpostgresqlhsc.CreatedByTypeUser),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("work_mem"),
		// 				Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/configurations"),
		// 				ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/configurations/work_mem"),
		// 				Properties: &armpostgresqlhsc.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(armpostgresqlhsc.ConfigurationDataTypeInteger),
		// 					ProvisioningState: to.Ptr(armpostgresqlhsc.ProvisioningStateSucceeded),
		// 					ServerRoleGroupConfigurations: []*armpostgresqlhsc.ServerRoleGroupConfiguration{
		// 						{
		// 							DefaultValue: to.Ptr("158720"),
		// 							Role: to.Ptr(armpostgresqlhsc.ServerRoleCoordinator),
		// 							Source: to.Ptr("system-default"),
		// 							Value: to.Ptr("158720"),
		// 						},
		// 						{
		// 							DefaultValue: to.Ptr("115712"),
		// 							Role: to.Ptr(armpostgresqlhsc.ServerRoleWorker),
		// 							Source: to.Ptr("system-default"),
		// 							Value: to.Ptr("115712"),
		// 						},
		// 					},
		// 				},
		// 				SystemData: &armpostgresqlhsc.SystemData{
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()),
		// 					CreatedBy: to.Ptr("user1"),
		// 					CreatedByType: to.Ptr(armpostgresqlhsc.CreatedByTypeUser),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("user2"),
		// 					LastModifiedByType: to.Ptr(armpostgresqlhsc.CreatedByTypeUser),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("client_encoding"),
		// 				Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/configurations"),
		// 				ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/configurations/client_encoding"),
		// 				Properties: &armpostgresqlhsc.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(armpostgresqlhsc.ConfigurationDataTypeEnumeration),
		// 					ProvisioningState: to.Ptr(armpostgresqlhsc.ProvisioningStateSucceeded),
		// 					ServerRoleGroupConfigurations: []*armpostgresqlhsc.ServerRoleGroupConfiguration{
		// 						{
		// 							DefaultValue: to.Ptr("sql_ascii"),
		// 							Role: to.Ptr(armpostgresqlhsc.ServerRoleCoordinator),
		// 							Source: to.Ptr("user-override"),
		// 							Value: to.Ptr("ISO_8859_7"),
		// 						},
		// 						{
		// 							DefaultValue: to.Ptr("sql_ascii"),
		// 							Role: to.Ptr(armpostgresqlhsc.ServerRoleWorker),
		// 							Source: to.Ptr("user-override"),
		// 							Value: to.Ptr("ISO_8859_7"),
		// 						},
		// 					},
		// 				},
		// 				SystemData: &armpostgresqlhsc.SystemData{
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()),
		// 					CreatedBy: to.Ptr("user1"),
		// 					CreatedByType: to.Ptr(armpostgresqlhsc.CreatedByTypeUser),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("user2"),
		// 					LastModifiedByType: to.Ptr(armpostgresqlhsc.CreatedByTypeUser),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2023-03-02-preview/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 := armpostgresqlhsc.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewConfigurationsClient().NewListByServerPager("TestResourceGroup", "testcluster", "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 = armpostgresqlhsc.ConfigurationsClientListByServerResponse{
		// 	ServerConfigurationListResult: armpostgresqlhsc.ServerConfigurationListResult{
		// 		Value: []*armpostgresqlhsc.ServerConfiguration{
		// 			{
		// 				ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/servers/testserver/configurations/application_name"),
		// 				Name: to.Ptr("application_name"),
		// 				Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/servers/configurations"),
		// 				SystemData: &armpostgresqlhsc.SystemData{
		// 					CreatedBy: to.Ptr("user1"),
		// 					CreatedByType: to.Ptr(armpostgresqlhsc.CreatedByTypeUser),
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("user2"),
		// 					LastModifiedByType: to.Ptr(armpostgresqlhsc.CreatedByTypeUser),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()),
		// 				},
		// 				Properties: &armpostgresqlhsc.ServerConfigurationProperties{
		// 					Value: to.Ptr(""),
		// 					Description: to.Ptr("Sets the application name to be reported in statistics and logs."),
		// 					DefaultValue: to.Ptr(""),
		// 					DataType: to.Ptr(armpostgresqlhsc.ConfigurationDataType("String")),
		// 					AllowedValues: to.Ptr("[A-Za-z0-9._-]*"),
		// 					Source: to.Ptr("system-default"),
		// 					ProvisioningState: to.Ptr(armpostgresqlhsc.ProvisioningStateSucceeded),
		// 				},
		// 			},
		// 			{
		// 				ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/servers/testserver/configurations/array_nulls"),
		// 				Name: to.Ptr("array_nulls"),
		// 				Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/servers/configurations"),
		// 				SystemData: &armpostgresqlhsc.SystemData{
		// 					CreatedBy: to.Ptr("user1"),
		// 					CreatedByType: to.Ptr(armpostgresqlhsc.CreatedByTypeUser),
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("user2"),
		// 					LastModifiedByType: to.Ptr(armpostgresqlhsc.CreatedByTypeUser),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()),
		// 				},
		// 				Properties: &armpostgresqlhsc.ServerConfigurationProperties{
		// 					Value: to.Ptr("on"),
		// 					Description: to.Ptr("Enables input of NULL elements in arrays."),
		// 					DefaultValue: to.Ptr("on"),
		// 					DataType: to.Ptr(armpostgresqlhsc.ConfigurationDataTypeBoolean),
		// 					AllowedValues: to.Ptr("on,off"),
		// 					Source: to.Ptr("system-default"),
		// 					ProvisioningState: to.Ptr(armpostgresqlhsc.ProvisioningStateSucceeded),
		// 				},
		// 			},
		// 			{
		// 				ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/servers/testserver/configurations/autovacuum"),
		// 				Name: to.Ptr("autovacuum"),
		// 				Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/servers/configurations"),
		// 				SystemData: &armpostgresqlhsc.SystemData{
		// 					CreatedBy: to.Ptr("user1"),
		// 					CreatedByType: to.Ptr(armpostgresqlhsc.CreatedByTypeUser),
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("user2"),
		// 					LastModifiedByType: to.Ptr(armpostgresqlhsc.CreatedByTypeUser),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()),
		// 				},
		// 				Properties: &armpostgresqlhsc.ServerConfigurationProperties{
		// 					Value: to.Ptr("on"),
		// 					Description: to.Ptr("Starts the autovacuum subprocess."),
		// 					DefaultValue: to.Ptr("on"),
		// 					DataType: to.Ptr(armpostgresqlhsc.ConfigurationDataTypeBoolean),
		// 					AllowedValues: to.Ptr("on,off"),
		// 					Source: to.Ptr("system-default"),
		// 					ProvisioningState: to.Ptr(armpostgresqlhsc.ProvisioningStateSucceeded),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2023-03-02-preview/ConfigurationUpdateCoordinator.json
func ExampleConfigurationsClient_BeginUpdateOnCoordinator() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresqlhsc.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewConfigurationsClient().BeginUpdateOnCoordinator(ctx, "TestResourceGroup", "testcluster", "array_nulls", armpostgresqlhsc.ServerConfiguration{
		Properties: &armpostgresqlhsc.ServerConfigurationProperties{
			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 poll 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 = armpostgresqlhsc.ConfigurationsClientUpdateOnCoordinatorResponse{
	// 	ServerConfiguration: armpostgresqlhsc.ServerConfiguration{
	// 		ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/configurations/array_nulls"),
	// 		Name: to.Ptr("array_nulls"),
	// 		Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/configurations/coordinator"),
	// 		SystemData: &armpostgresqlhsc.SystemData{
	// 			CreatedBy: to.Ptr("user1"),
	// 			CreatedByType: to.Ptr(armpostgresqlhsc.CreatedByTypeUser),
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("user2"),
	// 			LastModifiedByType: to.Ptr(armpostgresqlhsc.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()),
	// 		},
	// 		Properties: &armpostgresqlhsc.ServerConfigurationProperties{
	// 			AllowedValues: to.Ptr("on,off"),
	// 			DataType: to.Ptr(armpostgresqlhsc.ConfigurationDataTypeBoolean),
	// 			DefaultValue: to.Ptr("on"),
	// 			Description: to.Ptr("Enables input of NULL elements in arrays."),
	// 			ProvisioningState: to.Ptr(armpostgresqlhsc.ProvisioningStateInProgress),
	// 			RequiresRestart: to.Ptr(false),
	// 			Source: to.Ptr("user-override"),
	// 			Value: to.Ptr("on"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2023-03-02-preview/ConfigurationUpdateNode.json
func ExampleConfigurationsClient_BeginUpdateOnNode() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpostgresqlhsc.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewConfigurationsClient().BeginUpdateOnNode(ctx, "TestResourceGroup", "testcluster", "array_nulls", armpostgresqlhsc.ServerConfiguration{
		Properties: &armpostgresqlhsc.ServerConfigurationProperties{
			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 poll 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 = armpostgresqlhsc.ConfigurationsClientUpdateOnNodeResponse{
	// 	ServerConfiguration: armpostgresqlhsc.ServerConfiguration{
	// 		Name: to.Ptr("array_nulls"),
	// 		Type: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2/configurations/node"),
	// 		ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/testcluster/configurations/array_nulls"),
	// 		Properties: &armpostgresqlhsc.ServerConfigurationProperties{
	// 			Description: to.Ptr("Enables input of NULL elements in arrays."),
	// 			AllowedValues: to.Ptr("on,off"),
	// 			DataType: to.Ptr(armpostgresqlhsc.ConfigurationDataTypeBoolean),
	// 			DefaultValue: to.Ptr("on"),
	// 			ProvisioningState: to.Ptr(armpostgresqlhsc.ProvisioningStateInProgress),
	// 			RequiresRestart: to.Ptr(false),
	// 			Source: to.Ptr("user-override"),
	// 			Value: to.Ptr("off"),
	// 		},
	// 		SystemData: &armpostgresqlhsc.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()),
	// 			CreatedBy: to.Ptr("user1"),
	// 			CreatedByType: to.Ptr(armpostgresqlhsc.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("user2"),
	// 			LastModifiedByType: to.Ptr(armpostgresqlhsc.CreatedByTypeUser),
	// 		},
	// 	},
	// }
}
