// Copyright (c) Microsoft 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 armsql_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/sql/armsql/v2"
	"log"
	"time"
)

// Generated from example definition: 2025-02-01-preview/CreateDatabaseConfiguredBackupStorageRedundancy.json
func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithSpecifiedBackupStorageRedundancy() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{
		Location: to.Ptr("southeastasia"),
		Properties: &armsql.DatabaseProperties{
			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyZone),
		},
	}, 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 = armsql.DatabasesClientCreateOrUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyZone),
	// 			CurrentServiceObjectiveName: to.Ptr("S0"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("Standard"),
	// 				Capacity: to.Ptr[int32](10),
	// 				Tier: to.Ptr("Standard"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			MaxSizeBytes: to.Ptr[int64](268435456000),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyZone),
	// 			RequestedServiceObjectiveName: to.Ptr("S0"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("Standard"),
	// 			Capacity: to.Ptr[int32](10),
	// 			Tier: to.Ptr("Standard"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/CreateDatabaseCopyMode.json
func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseAsACopy() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "dbcopy", armsql.Database{
		Location: to.Ptr("southeastasia"),
		Properties: &armsql.DatabaseProperties{
			CreateMode:       to.Ptr(armsql.CreateModeCopy),
			SourceDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
		},
		SKU: &armsql.SKU{
			Name: to.Ptr("S0"),
			Tier: to.Ptr("Standard"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to 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 = armsql.DatabasesClientCreateOrUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("dbcopy"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/dbcopy"),
	// 		Kind: to.Ptr("v12.0,user"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("S0"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("Standard"),
	// 				Capacity: to.Ptr[int32](10),
	// 				Tier: to.Ptr("Standard"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			MaxSizeBytes: to.Ptr[int64](268435456000),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("S0"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("Standard"),
	// 			Capacity: to.Ptr[int32](10),
	// 			Tier: to.Ptr("Standard"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/CreateDatabaseDefaultEnclave.json
func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithDefaultEnclaveType() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{
		Location: to.Ptr("southeastasia"),
		Properties: &armsql.DatabaseProperties{
			PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault),
		},
	}, 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 = armsql.DatabasesClientCreateOrUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("S0"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("Standard"),
	// 				Capacity: to.Ptr[int32](10),
	// 				Tier: to.Ptr("Standard"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			MaxSizeBytes: to.Ptr[int64](268435456000),
	// 			PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("S0"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("Standard"),
	// 			Capacity: to.Ptr[int32](10),
	// 			Tier: to.Ptr("Standard"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/CreateDatabaseDefaultMode.json
func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithDefaultMode() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{
		Location: to.Ptr("southeastasia"),
		Properties: &armsql.DatabaseProperties{
			Collation:    to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
			CreateMode:   to.Ptr(armsql.CreateModeDefault),
			MaxSizeBytes: to.Ptr[int64](1073741824),
		},
		SKU: &armsql.SKU{
			Name: to.Ptr("S0"),
			Tier: to.Ptr("Standard"),
		},
	}, nil)
	if err != nil {
		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 = armsql.DatabasesClientCreateOrUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("S0"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("Standard"),
	// 				Capacity: to.Ptr[int32](10),
	// 				Tier: to.Ptr("Standard"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			MaxSizeBytes: to.Ptr[int64](1073741824),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("S0"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("S0"),
	// 			Capacity: to.Ptr[int32](10),
	// 			Tier: to.Ptr("Standard"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/CreateDatabaseDefaultModeWithKeysAndEncryptionProtector.json
func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithDatabaseLevelCustomerManagedKeys() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{
		Identity: &armsql.DatabaseIdentity{
			Type: to.Ptr(armsql.DatabaseIdentityTypeUserAssigned),
			UserAssignedIdentities: map[string]*armsql.DatabaseUserIdentity{
				"/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.ManagedIdentity/userAssignedIdentities/umi": {},
			},
		},
		Location: to.Ptr("southeastasia"),
		Properties: &armsql.DatabaseProperties{
			Collation:           to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
			CreateMode:          to.Ptr(armsql.CreateModeDefault),
			EncryptionProtector: to.Ptr("https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion"),
			Keys: map[string]*armsql.DatabaseKey{
				"https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion":   {},
				"https://your-key-vault-name.vault.azure.net/yourKey2/yourKey2Version": {},
			},
			MaxSizeBytes: to.Ptr[int64](1073741824),
		},
		SKU: &armsql.SKU{
			Name: to.Ptr("S0"),
			Tier: to.Ptr("Standard"),
		},
	}, nil)
	if err != nil {
		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 = armsql.DatabasesClientCreateOrUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("S0"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("Standard"),
	// 				Capacity: to.Ptr[int32](10),
	// 				Tier: to.Ptr("Standard"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			MaxSizeBytes: to.Ptr[int64](1073741824),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("S0"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("S0"),
	// 			Capacity: to.Ptr[int32](10),
	// 			Tier: to.Ptr("Standard"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/CreateDatabaseDefaultModeWithVersionlessKeysAndVersionlessEncryptionProtector.json
func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithDatabaseLevelVersionlessCustomerManagedKeys() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{
		Identity: &armsql.DatabaseIdentity{
			Type: to.Ptr(armsql.DatabaseIdentityTypeUserAssigned),
			UserAssignedIdentities: map[string]*armsql.DatabaseUserIdentity{
				"/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.ManagedIdentity/userAssignedIdentities/umi": {},
			},
		},
		Location: to.Ptr("southeastasia"),
		Properties: &armsql.DatabaseProperties{
			Collation:           to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
			CreateMode:          to.Ptr(armsql.CreateModeDefault),
			EncryptionProtector: to.Ptr("https://your-key-vault-name.vault.azure.net/yourKey"),
			Keys: map[string]*armsql.DatabaseKey{
				"https://your-key-vault-name.vault.azure.net/yourKey":  {},
				"https://your-key-vault-name.vault.azure.net/yourKey2": {},
			},
			MaxSizeBytes: to.Ptr[int64](1073741824),
		},
		SKU: &armsql.SKU{
			Name: to.Ptr("S0"),
			Tier: to.Ptr("Standard"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to 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 = armsql.DatabasesClientCreateOrUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("S0"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("Standard"),
	// 				Capacity: to.Ptr[int32](10),
	// 				Tier: to.Ptr("Standard"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			MaxSizeBytes: to.Ptr[int64](1073741824),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("S0"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("S0"),
	// 			Capacity: to.Ptr[int32](10),
	// 			Tier: to.Ptr("Standard"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/CreateDatabaseLedger.json
func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithLedgerOn() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{
		Location: to.Ptr("southeastasia"),
		Properties: &armsql.DatabaseProperties{
			IsLedgerOn: to.Ptr(true),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to 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 = armsql.DatabasesClientCreateOrUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("S0"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("Standard"),
	// 				Capacity: to.Ptr[int32](10),
	// 				Tier: to.Ptr("Standard"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			IsLedgerOn: to.Ptr(true),
	// 			MaxSizeBytes: to.Ptr[int64](268435456000),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("S0"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("Standard"),
	// 			Capacity: to.Ptr[int32](10),
	// 			Tier: to.Ptr("Standard"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/CreateDatabaseMaintenanceConfiguration.json
func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithPreferredMaintenanceWindow() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{
		Location: to.Ptr("southeastasia"),
		Properties: &armsql.DatabaseProperties{
			Collation:                  to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
			CreateMode:                 to.Ptr(armsql.CreateModeDefault),
			MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"),
			MaxSizeBytes:               to.Ptr[int64](1073741824),
		},
		SKU: &armsql.SKU{
			Name: to.Ptr("S2"),
			Tier: to.Ptr("Standard"),
		},
	}, nil)
	if err != nil {
		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 = armsql.DatabasesClientCreateOrUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("S2"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("Standard"),
	// 				Capacity: to.Ptr[int32](50),
	// 				Tier: to.Ptr("Standard"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-08-29T06:41:18.283Z"); return t}()),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"),
	// 			MaxSizeBytes: to.Ptr[int64](1073741824),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("S2"),
	// 			Tier: to.Ptr("Standard"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/CreateDatabaseMin.json
func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithMinimumNumberOfParameters() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{
		Location: to.Ptr("southeastasia"),
	}, 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 = armsql.DatabasesClientCreateOrUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("S0"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("Standard"),
	// 				Capacity: to.Ptr[int32](10),
	// 				Tier: to.Ptr("Standard"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			MaxSizeBytes: to.Ptr[int64](268435456000),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("S0"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("Standard"),
	// 			Capacity: to.Ptr[int32](10),
	// 			Tier: to.Ptr("Standard"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/CreateDatabaseNamedReplica.json
func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseAsNamedReplicaSecondary() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{
		Location: to.Ptr("southeastasia"),
		Properties: &armsql.DatabaseProperties{
			CreateMode:       to.Ptr(armsql.CreateModeSecondary),
			SecondaryType:    to.Ptr(armsql.SecondaryTypeNamed),
			SourceDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/primarydb"),
		},
		SKU: &armsql.SKU{
			Name:     to.Ptr("HS_Gen4"),
			Capacity: to.Ptr[int32](2),
			Tier:     to.Ptr("Hyperscale"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to 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 = armsql.DatabasesClientCreateOrUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user,vcore,hyperscale"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("HS_Gen4_2"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("HS_Gen4"),
	// 				Capacity: to.Ptr[int32](2),
	// 				Family: to.Ptr("Gen4"),
	// 				Tier: to.Ptr("Hyperscale"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			HighAvailabilityReplicaCount: to.Ptr[int32](0),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded),
	// 			MaxSizeBytes: to.Ptr[int64](-1),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("HS_Gen4_2"),
	// 			SecondaryType: to.Ptr(armsql.SecondaryTypeNamed),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("HS_Gen4"),
	// 			Capacity: to.Ptr[int32](2),
	// 			Family: to.Ptr("Gen4"),
	// 			Tier: to.Ptr("Hyperscale"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/CreateDatabasePITRMode.json
func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseFromPointInTimeRestore() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "dbpitr", armsql.Database{
		Location: to.Ptr("southeastasia"),
		Properties: &armsql.DatabaseProperties{
			CreateMode:         to.Ptr(armsql.CreateModePointInTimeRestore),
			RestorePointInTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-22T05:35:31.503Z"); return t }()),
			SourceDatabaseID:   to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SoutheastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to 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 = armsql.DatabasesClientCreateOrUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("dbpitr"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SoutheastAsia/providers/Microsoft.Sql/servers/testsvr/databases/dbpitr"),
	// 		Kind: to.Ptr("v12.0,user"),
	// 		Location: to.Ptr("SoutheastAsia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-23T20:31:35.807Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("S0"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("Standard"),
	// 				Capacity: to.Ptr[int32](10),
	// 				Tier: to.Ptr("Standard"),
	// 			},
	// 			DatabaseID: to.Ptr("2463ef48-53e2-4c26-9781-2d7138080bfd"),
	// 			DefaultSecondaryLocation: to.Ptr("SoutheastAsia"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-23T20:47:37Z"); return t}()),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			MaxSizeBytes: to.Ptr[int64](268435456000),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("S0"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("Standard"),
	// 			Capacity: to.Ptr[int32](10),
	// 			Tier: to.Ptr("Standard"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/CreateDatabaseSecondaryMode.json
func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseAsAnOnLineSecondary() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{
		Location: to.Ptr("southeastasia"),
		Properties: &armsql.DatabaseProperties{
			CreateMode:       to.Ptr(armsql.CreateModeSecondary),
			SecondaryType:    to.Ptr(armsql.SecondaryTypeGeo),
			SourceDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/testdb"),
		},
		SKU: &armsql.SKU{
			Name: to.Ptr("S0"),
			Tier: to.Ptr("Standard"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to 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 = armsql.DatabasesClientCreateOrUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("S0"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("Standard"),
	// 				Capacity: to.Ptr[int32](10),
	// 				Tier: to.Ptr("Standard"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			MaxSizeBytes: to.Ptr[int64](268435456000),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("S0"),
	// 			SecondaryType: to.Ptr(armsql.SecondaryTypeGeo),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("Standard"),
	// 			Capacity: to.Ptr[int32](10),
	// 			Tier: to.Ptr("Standard"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/CreateDatabaseStandbyMode.json
func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseAsAStandbySecondary() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{
		Location: to.Ptr("southeastasia"),
		Properties: &armsql.DatabaseProperties{
			CreateMode:       to.Ptr(armsql.CreateModeSecondary),
			SecondaryType:    to.Ptr(armsql.SecondaryTypeStandby),
			SourceDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/testdb"),
		},
		SKU: &armsql.SKU{
			Name: to.Ptr("S0"),
			Tier: to.Ptr("Standard"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to 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 = armsql.DatabasesClientCreateOrUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("S0"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("Standard"),
	// 				Capacity: to.Ptr[int32](10),
	// 				Tier: to.Ptr("Standard"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			MaxSizeBytes: to.Ptr[int64](268435456000),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("S0"),
	// 			SecondaryType: to.Ptr(armsql.SecondaryTypeStandby),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("Standard"),
	// 			Capacity: to.Ptr[int32](10),
	// 			Tier: to.Ptr("Standard"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/CreateDatabaseVBSEnclave.json
func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithVbsEnclaveType() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{
		Location: to.Ptr("southeastasia"),
		Properties: &armsql.DatabaseProperties{
			PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS),
		},
	}, 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 = armsql.DatabasesClientCreateOrUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("S0"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("Standard"),
	// 				Capacity: to.Ptr[int32](10),
	// 				Tier: to.Ptr("Standard"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			MaxSizeBytes: to.Ptr[int64](268435456000),
	// 			PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("S0"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("Standard"),
	// 			Capacity: to.Ptr[int32](10),
	// 			Tier: to.Ptr("Standard"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/CreateDatabaseWithAvailabilityZone.json
func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithAvailabilityZoneSpecified() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{
		Location: to.Ptr("southeastasia"),
		Properties: &armsql.DatabaseProperties{
			AvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne),
			Collation:        to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
			CreateMode:       to.Ptr(armsql.CreateModeDefault),
			MaxSizeBytes:     to.Ptr[int64](1073741824),
		},
		SKU: &armsql.SKU{
			Name: to.Ptr("S0"),
			Tier: to.Ptr("Standard"),
		},
	}, nil)
	if err != nil {
		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 = armsql.DatabasesClientCreateOrUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			AvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne),
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("S0"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("Standard"),
	// 				Capacity: to.Ptr[int32](10),
	// 				Tier: to.Ptr("Standard"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			MaxSizeBytes: to.Ptr[int64](1073741824),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("S0"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("S0"),
	// 			Capacity: to.Ptr[int32](10),
	// 			Tier: to.Ptr("Standard"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/CreateDatabaseWithEncryptionProtectorAutoRotation.json
func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithEncryptionProtectorAutoRotation() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{
		Identity: &armsql.DatabaseIdentity{
			Type: to.Ptr(armsql.DatabaseIdentityTypeUserAssigned),
			UserAssignedIdentities: map[string]*armsql.DatabaseUserIdentity{
				"/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.ManagedIdentity/userAssignedIdentities/umi": {},
			},
		},
		Location: to.Ptr("southeastasia"),
		Properties: &armsql.DatabaseProperties{
			Collation:                       to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
			CreateMode:                      to.Ptr(armsql.CreateModeDefault),
			EncryptionProtector:             to.Ptr("https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion"),
			EncryptionProtectorAutoRotation: to.Ptr(true),
			MaxSizeBytes:                    to.Ptr[int64](1073741824),
		},
		SKU: &armsql.SKU{
			Name: to.Ptr("S0"),
			Tier: to.Ptr("Standard"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to 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 = armsql.DatabasesClientCreateOrUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("S0"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("Standard"),
	// 				Capacity: to.Ptr[int32](10),
	// 				Tier: to.Ptr("Standard"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			EncryptionProtector: to.Ptr("https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion"),
	// 			EncryptionProtectorAutoRotation: to.Ptr(true),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			MaxSizeBytes: to.Ptr[int64](1073741824),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("S0"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("S0"),
	// 			Capacity: to.Ptr[int32](10),
	// 			Tier: to.Ptr("Standard"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/CreateDwDatabaseCrossSubscriptionPITR.json
func ExampleDatabasesClient_BeginCreateOrUpdate_createsADataWarehouseDatabaseAsACrossSubscriptionRestoreFromARestorePointOfAnExistingDatabase() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdw", armsql.Database{
		Location: to.Ptr("southeastasia"),
		Properties: &armsql.DatabaseProperties{
			CreateMode:         to.Ptr(armsql.CreateModePointInTimeRestore),
			RestorePointInTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-22T05:35:31.503Z"); return t }()),
			SourceResourceID:   to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/srcsvr/databases/srcdw"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to 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 = armsql.DatabasesClientCreateOrUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdw"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdw"),
	// 		Kind: to.Ptr("v12.0,user,datawarehouse,gen2"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-24T06:46:14.99Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("DW1000c"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("DataWarehouse"),
	// 				Capacity: to.Ptr[int32](9000),
	// 				Tier: to.Ptr("DataWarehouse"),
	// 			},
	// 			DatabaseID: to.Ptr("188784c9-d602-4684-86cf-e67b6f03551a"),
	// 			DefaultSecondaryLocation: to.Ptr("eastus"),
	// 			MaxSizeBytes: to.Ptr[int64](263882790666240),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled),
	// 			RequestedServiceObjectiveName: to.Ptr("DW1000c"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("DataWarehouse"),
	// 			Capacity: to.Ptr[int32](9000),
	// 			Tier: to.Ptr("DataWarehouse"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/CreateDwDatabaseCrossSubscriptionRecovery.json
func ExampleDatabasesClient_BeginCreateOrUpdate_createsADataWarehouseDatabaseAsACrossSubscriptionRestoreFromAGeoBackup() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-WestUS", "testsvr", "testdw", armsql.Database{
		Location: to.Ptr("westus"),
		Properties: &armsql.DatabaseProperties{
			CreateMode:       to.Ptr(armsql.CreateModeRecovery),
			SourceResourceID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-SQL-EastUS/providers/Microsoft.Sql/servers/srcsvr/recoverabledatabases/srcdw"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to 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 = armsql.DatabasesClientCreateOrUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdw"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-WestUS/providers/Microsoft.Sql/servers/testsvr/databases/testdw"),
	// 		Kind: to.Ptr("v12.0,user,datawarehouse,gen2"),
	// 		Location: to.Ptr("westus"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-24T06:46:14.99Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("DW1000c"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("DataWarehouse"),
	// 				Capacity: to.Ptr[int32](9000),
	// 				Tier: to.Ptr("DataWarehouse"),
	// 			},
	// 			DatabaseID: to.Ptr("188784c9-d602-4684-86cf-e67b6f03551a"),
	// 			DefaultSecondaryLocation: to.Ptr("eastus"),
	// 			MaxSizeBytes: to.Ptr[int64](263882790666240),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled),
	// 			RequestedServiceObjectiveName: to.Ptr("DW1000c"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("DataWarehouse"),
	// 			Capacity: to.Ptr[int32](9000),
	// 			Tier: to.Ptr("DataWarehouse"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/CreateDwDatabaseCrossSubscriptionRestore.json
func ExampleDatabasesClient_BeginCreateOrUpdate_createsADataWarehouseDatabaseAsACrossSubscriptionRestoreFromABackupOfADroppedDatabase() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdw", armsql.Database{
		Location: to.Ptr("southeastasia"),
		Properties: &armsql.DatabaseProperties{
			CreateMode:       to.Ptr(armsql.CreateModeRestore),
			SourceResourceID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/srcsvr/restorableDroppedDatabases/srcdw,131403269876900000"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to 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 = armsql.DatabasesClientCreateOrUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdw"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdw"),
	// 		Kind: to.Ptr("v12.0,user,datawarehouse,gen2"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-24T06:46:14.99Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("DW1000c"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("DataWarehouse"),
	// 				Capacity: to.Ptr[int32](9000),
	// 				Tier: to.Ptr("DataWarehouse"),
	// 			},
	// 			DatabaseID: to.Ptr("188784c9-d602-4684-86cf-e67b6f03551a"),
	// 			DefaultSecondaryLocation: to.Ptr("eastus"),
	// 			MaxSizeBytes: to.Ptr[int64](263882790666240),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled),
	// 			RequestedServiceObjectiveName: to.Ptr("DW1000c"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("DataWarehouse"),
	// 			Capacity: to.Ptr[int32](9000),
	// 			Tier: to.Ptr("DataWarehouse"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/CreateVCoreDatabaseByServiceObjective.json
func ExampleDatabasesClient_BeginCreateOrUpdate_createsAVCoreDatabaseBySpecifyingServiceObjectiveName() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{
		Location: to.Ptr("southeastasia"),
		SKU: &armsql.SKU{
			Name:     to.Ptr("BC"),
			Capacity: to.Ptr[int32](2),
			Family:   to.Ptr("Gen4"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to 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 = armsql.DatabasesClientCreateOrUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("BC_Gen4_2"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("BC_Gen4"),
	// 				Capacity: to.Ptr[int32](2),
	// 				Tier: to.Ptr("BusinessCritical"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded),
	// 			MaxLogSizeBytes: to.Ptr[int64](104857600),
	// 			MaxSizeBytes: to.Ptr[int64](1073741824),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("BC_Gen4"),
	// 			Capacity: to.Ptr[int32](2),
	// 			Family: to.Ptr("Gen4"),
	// 			Tier: to.Ptr("BusinessCritical"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/CreateVCoreDatabaseBySkuNameCapacity.json
func ExampleDatabasesClient_BeginCreateOrUpdate_createsAVCoreDatabaseBySpecifyingSkuNameAndCapacity() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{
		Location: to.Ptr("southeastasia"),
		SKU: &armsql.SKU{
			Name:     to.Ptr("BC_Gen4"),
			Capacity: to.Ptr[int32](2),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to 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 = armsql.DatabasesClientCreateOrUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("BC_Gen4_2"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("BC_Gen4"),
	// 				Capacity: to.Ptr[int32](2),
	// 				Tier: to.Ptr("BusinessCritical"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded),
	// 			MaxLogSizeBytes: to.Ptr[int64](104857600),
	// 			MaxSizeBytes: to.Ptr[int64](1073741824),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("BC_Gen4"),
	// 			Capacity: to.Ptr[int32](2),
	// 			Family: to.Ptr("Gen4"),
	// 			Tier: to.Ptr("BusinessCritical"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/UpdateDatabaseHyperscaleMigrationPerformCutover.json
func ExampleDatabasesClient_BeginCreateOrUpdate_updatesADatabaseToHyperscaleTierByTriggeringManualCutoverDuringMigrationWorkflow() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{
		Identity: &armsql.DatabaseIdentity{
			Type: to.Ptr(armsql.DatabaseIdentityTypeUserAssigned),
			UserAssignedIdentities: map[string]*armsql.DatabaseUserIdentity{
				"/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/userAssignedIdentities/umi": {},
			},
		},
		Location: to.Ptr("southeastasia"),
		Properties: &armsql.DatabaseProperties{
			PerformCutover: to.Ptr(true),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to 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 = armsql.DatabasesClientCreateOrUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user,vcore"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-08T12:41:23.953Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("GP_Gen5_2"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("GP_Gen5"),
	// 				Capacity: to.Ptr[int32](2),
	// 				Family: to.Ptr("Gen5"),
	// 				Tier: to.Ptr("GeneralPurpose"),
	// 			},
	// 			DatabaseID: to.Ptr("dad50ee1-9fbb-4fb9-bd2b-5786d175ce3c"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-08T12:42:00Z"); return t}()),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded),
	// 			MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"),
	// 			MaxLogSizeBytes: to.Ptr[int64](193273528320),
	// 			MaxSizeBytes: to.Ptr[int64](34359738368),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("HS_Gen5_2"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("HS_Gen5"),
	// 			Capacity: to.Ptr[int32](2),
	// 			Family: to.Ptr("Gen5"),
	// 			Tier: to.Ptr("Hyperscale"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/UpdateDatabaseHyperscaleMigrationWithManualCutover.json
func ExampleDatabasesClient_BeginCreateOrUpdate_updatesADatabaseToHyperscaleSloWithManualCutover() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{
		Identity: &armsql.DatabaseIdentity{
			Type: to.Ptr(armsql.DatabaseIdentityTypeUserAssigned),
			UserAssignedIdentities: map[string]*armsql.DatabaseUserIdentity{
				"/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/userAssignedIdentities/umi": {},
			},
		},
		Location: to.Ptr("southeastasia"),
		Properties: &armsql.DatabaseProperties{
			ManualCutover: to.Ptr(true),
		},
		SKU: &armsql.SKU{
			Name: to.Ptr("HS_Gen5_2"),
			Tier: to.Ptr("Hyperscale"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to 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 = armsql.DatabasesClientCreateOrUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user,vcore"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-08T12:41:23.953Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("GP_Gen5_2"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("GP_Gen5"),
	// 				Capacity: to.Ptr[int32](2),
	// 				Family: to.Ptr("Gen5"),
	// 				Tier: to.Ptr("GeneralPurpose"),
	// 			},
	// 			DatabaseID: to.Ptr("dad50ee1-9fbb-4fb9-bd2b-5786d175ce3c"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-08T12:42:00Z"); return t}()),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded),
	// 			MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"),
	// 			MaxLogSizeBytes: to.Ptr[int64](193273528320),
	// 			MaxSizeBytes: to.Ptr[int64](34359738368),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("HS_Gen5_2"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("HS_Gen5"),
	// 			Capacity: to.Ptr[int32](2),
	// 			Family: to.Ptr("Gen5"),
	// 			Tier: to.Ptr("Hyperscale"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/DeleteDatabase.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 := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginDelete(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to 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 = armsql.DatabasesClientDeleteResponse{
	// }
}

// Generated from example definition: 2025-02-01-preview/ExportDatabase.json
func ExampleDatabasesClient_BeginExport_exportsADatabase() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginExport(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.ExportDatabaseDefinition{
		AdministratorLogin:         to.Ptr("login"),
		AdministratorLoginPassword: to.Ptr("password"),
		AuthenticationType:         to.Ptr("Sql"),
		StorageKey:                 to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=="),
		StorageKeyType:             to.Ptr(armsql.StorageKeyTypeStorageAccessKey),
		StorageURI:                 to.Ptr("https://test.blob.core.windows.net/test.bacpac"),
	}, 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 = armsql.DatabasesClientExportResponse{
	// 	ImportExportOperationResult: armsql.ImportExportOperationResult{
	// 		Name: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases/importExportOperationResults"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/importExportOperationResults/9d9a794a-5cec-4f23-af70-d29511b522a4"),
	// 		Properties: &armsql.ImportExportOperationResultProperties{
	// 			BlobURI: to.Ptr("https://test.blob.core.windows.net/test.bacpac"),
	// 			DatabaseName: to.Ptr("testdb"),
	// 			LastModifiedTime: to.Ptr("2/2/2020 8:34:47 PM"),
	// 			QueuedTime: to.Ptr("2/2/2020 8:33:27 PM"),
	// 			RequestID: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"),
	// 			RequestType: to.Ptr("Export"),
	// 			ServerName: to.Ptr("testsvr.database.windows.net"),
	// 			Status: to.Ptr("Completed"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/ExportDatabaseWithManagedIdentity.json
func ExampleDatabasesClient_BeginExport_exportsADatabaseUsingManagedIdentityToCommunicateWithSqlServerAndStorageAccount() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginExport(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.ExportDatabaseDefinition{
		AdministratorLogin: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/rgName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName"),
		AuthenticationType: to.Ptr("ManagedIdentity"),
		StorageKey:         to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/rgName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName"),
		StorageKeyType:     to.Ptr(armsql.StorageKeyTypeManagedIdentity),
		StorageURI:         to.Ptr("https://test.blob.core.windows.net/test.bacpac"),
	}, 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 = armsql.DatabasesClientExportResponse{
	// 	ImportExportOperationResult: armsql.ImportExportOperationResult{
	// 		Name: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases/importExportOperationResults"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/importExportOperationResults/9d9a794a-5cec-4f23-af70-d29511b522a4"),
	// 		Properties: &armsql.ImportExportOperationResultProperties{
	// 			BlobURI: to.Ptr("https://test.blob.core.windows.net/test.bacpac"),
	// 			DatabaseName: to.Ptr("testdb"),
	// 			LastModifiedTime: to.Ptr("2/2/2020 8:34:47 PM"),
	// 			QueuedTime: to.Ptr("2/2/2020 8:33:27 PM"),
	// 			RequestID: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"),
	// 			RequestType: to.Ptr("Export"),
	// 			ServerName: to.Ptr("testsvr.database.windows.net"),
	// 			Status: to.Ptr("Completed"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/ExportDatabaseWithNetworkIsolation.json
func ExampleDatabasesClient_BeginExport_exportsADatabaseUsingPrivateLinkToCommunicateWithSqlServerAndStorageAccount() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginExport(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.ExportDatabaseDefinition{
		AdministratorLogin:         to.Ptr("login"),
		AdministratorLoginPassword: to.Ptr("password"),
		AuthenticationType:         to.Ptr("Sql"),
		NetworkIsolation: &armsql.NetworkIsolationSettings{
			SQLServerResourceID:      to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr"),
			StorageAccountResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Storage/storageAccounts/test-privatelink"),
		},
		StorageKey:     to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=="),
		StorageKeyType: to.Ptr(armsql.StorageKeyTypeStorageAccessKey),
		StorageURI:     to.Ptr("https://test.blob.core.windows.net/test.bacpac"),
	}, 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 = armsql.DatabasesClientExportResponse{
	// 	ImportExportOperationResult: armsql.ImportExportOperationResult{
	// 		Name: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases/importExportOperationResults"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/importExportOperationResults/9d9a794a-5cec-4f23-af70-d29511b522a4"),
	// 		Properties: &armsql.ImportExportOperationResultProperties{
	// 			BlobURI: to.Ptr("https://test.blob.core.windows.net/test.bacpac"),
	// 			DatabaseName: to.Ptr("testdb"),
	// 			LastModifiedTime: to.Ptr("2/2/2020 8:34:47 PM"),
	// 			QueuedTime: to.Ptr("2/2/2020 8:33:27 PM"),
	// 			RequestID: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"),
	// 			RequestType: to.Ptr("Export"),
	// 			ServerName: to.Ptr("testsvr.database.windows.net"),
	// 			Status: to.Ptr("Completed"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/FailoverDatabase.json
func ExampleDatabasesClient_BeginFailover() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginFailover(ctx, "group1", "testServer", "testDatabase", &armsql.DatabasesClientBeginFailoverOptions{
		ReplicaType: to.Ptr(armsql.ReplicaTypePrimary)})
	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 = armsql.DatabasesClientFailoverResponse{
	// }
}

// Generated from example definition: 2025-02-01-preview/GetDatabaseWithAvailabilityZone.json
func ExampleDatabasesClient_Get_getsADatabaseWithAvailabilityZoneSpecified() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDatabasesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", 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 = armsql.DatabasesClientGetResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			AvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne),
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("S0"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("Standard"),
	// 				Capacity: to.Ptr[int32](10),
	// 				Tier: to.Ptr("Standard"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			MaxSizeBytes: to.Ptr[int64](1073741824),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("S0"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("S0"),
	// 			Capacity: to.Ptr[int32](10),
	// 			Tier: to.Ptr("Standard"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/GetVCoreDatabase.json
func ExampleDatabasesClient_Get_getsADatabase() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDatabasesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", 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 = armsql.DatabasesClientGetResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user,vcore"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("BC_Gen5_2"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("BC_Gen5"),
	// 				Capacity: to.Ptr[int32](2),
	// 				Tier: to.Ptr("BusinessCritical"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded),
	// 			MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"),
	// 			MaxLogSizeBytes: to.Ptr[int64](104857600),
	// 			MaxSizeBytes: to.Ptr[int64](268435456000),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("BC_Gen5_2"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("BC_Gen5"),
	// 			Capacity: to.Ptr[int32](2),
	// 			Tier: to.Ptr("BusinessCritical"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/GetVCoreDatabaseDefaultEnclave.json
func ExampleDatabasesClient_Get_getsADatabaseConfiguredWithDefaultEnclaveType() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDatabasesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", 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 = armsql.DatabasesClientGetResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user,vcore"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("BC_Gen5_2"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("BC_Gen5"),
	// 				Capacity: to.Ptr[int32](2),
	// 				Tier: to.Ptr("BusinessCritical"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded),
	// 			MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"),
	// 			MaxLogSizeBytes: to.Ptr[int64](104857600),
	// 			MaxSizeBytes: to.Ptr[int64](268435456000),
	// 			PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("BC_Gen5_2"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("BC_Gen5"),
	// 			Capacity: to.Ptr[int32](2),
	// 			Tier: to.Ptr("BusinessCritical"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/GetVCoreDatabaseVBSEnclave.json
func ExampleDatabasesClient_Get_getsADatabaseConfiguredWithVbsEnclaveType() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDatabasesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", 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 = armsql.DatabasesClientGetResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user,vcore"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("BC_Gen5_2"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("BC_Gen5"),
	// 				Capacity: to.Ptr[int32](2),
	// 				Tier: to.Ptr("BusinessCritical"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded),
	// 			MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"),
	// 			MaxLogSizeBytes: to.Ptr[int64](104857600),
	// 			MaxSizeBytes: to.Ptr[int64](268435456000),
	// 			PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("BC_Gen5_2"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("BC_Gen5"),
	// 			Capacity: to.Ptr[int32](2),
	// 			Tier: to.Ptr("BusinessCritical"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/GetVCoreDatabaseWithExpandEqualsKeys.json
func ExampleDatabasesClient_Get_getsADatabaseWithDatabaseLevelKeysExpanded() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDatabasesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", &armsql.DatabasesClientGetOptions{
		Expand: to.Ptr("keys")})
	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 = armsql.DatabasesClientGetResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user,vcore"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("BC_Gen5_2"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("BC_Gen5"),
	// 				Capacity: to.Ptr[int32](2),
	// 				Tier: to.Ptr("BusinessCritical"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			EncryptionProtector: to.Ptr("https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion"),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			Keys: map[string]*armsql.DatabaseKey{
	// 				"https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion": &armsql.DatabaseKey{
	// 				},
	// 				"https://your-key-vault-name.vault.azure.net/yourKey2/yourKey2Version": &armsql.DatabaseKey{
	// 				},
	// 			},
	// 			LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded),
	// 			MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"),
	// 			MaxLogSizeBytes: to.Ptr[int64](104857600),
	// 			MaxSizeBytes: to.Ptr[int64](268435456000),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("BC_Gen5_2"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("BC_Gen5"),
	// 			Capacity: to.Ptr[int32](2),
	// 			Tier: to.Ptr("BusinessCritical"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/GetVCoreDatabaseWithExpandEqualsKeysWithVersionlessKeys.json
func ExampleDatabasesClient_Get_getsADatabaseWithDatabaseLevelKeysExpandedUsingVersionlessKeys() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDatabasesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", &armsql.DatabasesClientGetOptions{
		Expand: to.Ptr("keys")})
	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 = armsql.DatabasesClientGetResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user,vcore"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("BC_Gen5_2"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("BC_Gen5"),
	// 				Capacity: to.Ptr[int32](2),
	// 				Tier: to.Ptr("BusinessCritical"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			EncryptionProtector: to.Ptr("https://your-key-vault-name.vault.azure.net/yourKey"),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			Keys: map[string]*armsql.DatabaseKey{
	// 				"https://your-key-vault-name.vault.azure.net/yourKey": &armsql.DatabaseKey{
	// 				},
	// 				"https://your-key-vault-name.vault.azure.net/yourKey2": &armsql.DatabaseKey{
	// 				},
	// 			},
	// 			LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded),
	// 			MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"),
	// 			MaxLogSizeBytes: to.Ptr[int64](104857600),
	// 			MaxSizeBytes: to.Ptr[int64](268435456000),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("BC_Gen5_2"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("BC_Gen5"),
	// 			Capacity: to.Ptr[int32](2),
	// 			Tier: to.Ptr("BusinessCritical"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/ImportDatabase.json
func ExampleDatabasesClient_BeginImport_importsToAnExistingEmptyDatabase() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginImport(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.ImportExistingDatabaseDefinition{
		AdministratorLogin:         to.Ptr("login"),
		AdministratorLoginPassword: to.Ptr("password"),
		AuthenticationType:         to.Ptr("Sql"),
		StorageKey:                 to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=="),
		StorageKeyType:             to.Ptr(armsql.StorageKeyTypeStorageAccessKey),
		StorageURI:                 to.Ptr("https://test.blob.core.windows.net/test.bacpac"),
	}, 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 = armsql.DatabasesClientImportResponse{
	// 	ImportExportOperationResult: armsql.ImportExportOperationResult{
	// 		Name: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases/importExportOperationResults"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/importExportOperationResults/9d9a794a-5cec-4f23-af70-d29511b522a4"),
	// 		Properties: &armsql.ImportExportOperationResultProperties{
	// 			BlobURI: to.Ptr("https://test.blob.core.windows.net/test.bacpac"),
	// 			DatabaseName: to.Ptr("testdb"),
	// 			LastModifiedTime: to.Ptr("2/2/2020 8:34:47 PM"),
	// 			QueuedTime: to.Ptr("2/2/2020 8:33:27 PM"),
	// 			RequestID: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"),
	// 			RequestType: to.Ptr("Import"),
	// 			ServerName: to.Ptr("testsvr.database.windows.net"),
	// 			Status: to.Ptr("Completed"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/ImportDatabaseWithManagedIdentity.json
func ExampleDatabasesClient_BeginImport_importsToAnExistingEmptyDatabaseUsingManagedIdentityToCommunicateWithSqlServerAndStorageAccount() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginImport(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.ImportExistingDatabaseDefinition{
		AdministratorLogin: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/rgName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName"),
		AuthenticationType: to.Ptr("ManagedIdentity"),
		StorageKey:         to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/rgName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName"),
		StorageKeyType:     to.Ptr(armsql.StorageKeyTypeManagedIdentity),
		StorageURI:         to.Ptr("https://test.blob.core.windows.net/test.bacpac"),
	}, 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 = armsql.DatabasesClientImportResponse{
	// 	ImportExportOperationResult: armsql.ImportExportOperationResult{
	// 		Name: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases/importExportOperationResults"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/importExportOperationResults/9d9a794a-5cec-4f23-af70-d29511b522a4"),
	// 		Properties: &armsql.ImportExportOperationResultProperties{
	// 			BlobURI: to.Ptr("https://test.blob.core.windows.net/test.bacpac"),
	// 			DatabaseName: to.Ptr("testdb"),
	// 			LastModifiedTime: to.Ptr("2/2/2020 8:34:47 PM"),
	// 			QueuedTime: to.Ptr("2/2/2020 8:33:27 PM"),
	// 			RequestID: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"),
	// 			RequestType: to.Ptr("Import"),
	// 			ServerName: to.Ptr("testsvr.database.windows.net"),
	// 			Status: to.Ptr("Completed"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/ImportDatabaseWithNetworkIsolation.json
func ExampleDatabasesClient_BeginImport_importsToAnExistingEmptyDatabaseUsingPrivateLinkToCommunicateWithSqlServerAndStorageAccount() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginImport(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.ImportExistingDatabaseDefinition{
		AdministratorLogin:         to.Ptr("login"),
		AdministratorLoginPassword: to.Ptr("password"),
		AuthenticationType:         to.Ptr("Sql"),
		NetworkIsolation: &armsql.NetworkIsolationSettings{
			SQLServerResourceID:      to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr"),
			StorageAccountResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Storage/storageAccounts/test-privatelink"),
		},
		StorageKey:     to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=="),
		StorageKeyType: to.Ptr(armsql.StorageKeyTypeStorageAccessKey),
		StorageURI:     to.Ptr("https://test.blob.core.windows.net/test.bacpac"),
	}, 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 = armsql.DatabasesClientImportResponse{
	// 	ImportExportOperationResult: armsql.ImportExportOperationResult{
	// 		Name: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases/importExportOperationResults"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/importExportOperationResults/9d9a794a-5cec-4f23-af70-d29511b522a4"),
	// 		Properties: &armsql.ImportExportOperationResultProperties{
	// 			BlobURI: to.Ptr("https://test.blob.core.windows.net/test.bacpac"),
	// 			DatabaseName: to.Ptr("testdb"),
	// 			LastModifiedTime: to.Ptr("2/2/2020 8:34:47 PM"),
	// 			QueuedTime: to.Ptr("2/2/2020 8:33:27 PM"),
	// 			RequestID: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"),
	// 			RequestType: to.Ptr("Import"),
	// 			ServerName: to.Ptr("testsvr.database.windows.net"),
	// 			Status: to.Ptr("Completed"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/ListDatabasesByElasticPool.json
func ExampleDatabasesClient_NewListByElasticPoolPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDatabasesClient().NewListByElasticPoolPager("Default-SQL-SouthEastAsia", "testsvr", "pool1", 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 = armsql.DatabasesClientListByElasticPoolResponse{
		// 	DatabaseListResult: armsql.DatabaseListResult{
		// 		Value: []*armsql.Database{
		// 			{
		// 				Name: to.Ptr("DB001"),
		// 				Type: to.Ptr("Microsoft.Sql/servers/databases"),
		// 				ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/DB001"),
		// 				Kind: to.Ptr("v12.0,user"),
		// 				Location: to.Ptr("southeastasia"),
		// 				Properties: &armsql.DatabaseProperties{
		// 					CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
		// 					Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
		// 					CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-12T22:08:39.163Z"); return t}()),
		// 					CurrentServiceObjectiveName: to.Ptr("ElasticPool"),
		// 					DatabaseID: to.Ptr("bfe0735f-bc87-447f-b2c2-481f4b100614"),
		// 					DefaultSecondaryLocation: to.Ptr("North Europe"),
		// 					ElasticPoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/elasticPools/Pool1"),
		// 					MaxSizeBytes: to.Ptr[int64](268435456000),
		// 					Status: to.Ptr(armsql.DatabaseStatusOnline),
		// 				},
		// 				SKU: &armsql.SKU{
		// 					Name: to.Ptr("ElasticPool"),
		// 					Tier: to.Ptr("Standard"),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("DB002"),
		// 				Type: to.Ptr("Microsoft.Sql/servers/databases"),
		// 				ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/DB002"),
		// 				Kind: to.Ptr("v12.0,user"),
		// 				Location: to.Ptr("southeastasia"),
		// 				Properties: &armsql.DatabaseProperties{
		// 					CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
		// 					Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
		// 					CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-12T22:10:10.773Z"); return t}()),
		// 					CurrentServiceObjectiveName: to.Ptr("ElasticPool"),
		// 					DatabaseID: to.Ptr("82246152-3177-4357-b81c-a16d87ce3593"),
		// 					DefaultSecondaryLocation: to.Ptr("North Europe"),
		// 					ElasticPoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/elasticPools/Pool1"),
		// 					MaxSizeBytes: to.Ptr[int64](268435456000),
		// 					Status: to.Ptr(armsql.DatabaseStatusOnline),
		// 				},
		// 				SKU: &armsql.SKU{
		// 					Name: to.Ptr("ElasticPool"),
		// 					Tier: to.Ptr("Standard"),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2025-02-01-preview/ListVCoreDatabasesByServer.json
func ExampleDatabasesClient_NewListByServerPager_getsAListOfDatabases() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDatabasesClient().NewListByServerPager("Default-SQL-SouthEastAsia", "testsvr", 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 = armsql.DatabasesClientListByServerResponse{
		// 	DatabaseListResult: armsql.DatabaseListResult{
		// 		Value: []*armsql.Database{
		// 			{
		// 				Name: to.Ptr("testdb"),
		// 				Type: to.Ptr("Microsoft.Sql/servers/databases"),
		// 				ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
		// 				Kind: to.Ptr("v12.0,user,vcore"),
		// 				Location: to.Ptr("southeastasia"),
		// 				Properties: &armsql.DatabaseProperties{
		// 					CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
		// 					Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
		// 					CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
		// 					CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyZone),
		// 					CurrentServiceObjectiveName: to.Ptr("BC_Gen4_2"),
		// 					CurrentSKU: &armsql.SKU{
		// 						Name: to.Ptr("BC_Gen4"),
		// 						Capacity: to.Ptr[int32](2),
		// 						Tier: to.Ptr("BusinessCritical"),
		// 					},
		// 					DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
		// 					DefaultSecondaryLocation: to.Ptr("North Europe"),
		// 					EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
		// 					IsInfraEncryptionEnabled: to.Ptr(false),
		// 					IsLedgerOn: to.Ptr(false),
		// 					LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded),
		// 					MaxLogSizeBytes: to.Ptr[int64](104857600),
		// 					MaxSizeBytes: to.Ptr[int64](268435456000),
		// 					ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled),
		// 					RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyZone),
		// 					RequestedServiceObjectiveName: to.Ptr("BC_Gen4_2"),
		// 					Status: to.Ptr(armsql.DatabaseStatusOnline),
		// 					ZoneRedundant: to.Ptr(false),
		// 				},
		// 				SKU: &armsql.SKU{
		// 					Name: to.Ptr("BC_Gen4"),
		// 					Capacity: to.Ptr[int32](2),
		// 					Tier: to.Ptr("BusinessCritical"),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("master"),
		// 				Type: to.Ptr("Microsoft.Sql/servers/databases"),
		// 				ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/master"),
		// 				Kind: to.Ptr("v12.0,system"),
		// 				Location: to.Ptr("southeastasia"),
		// 				Properties: &armsql.DatabaseProperties{
		// 					CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
		// 					Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
		// 					CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:23:42.537Z"); return t}()),
		// 					CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyLocal),
		// 					CurrentServiceObjectiveName: to.Ptr("System0"),
		// 					CurrentSKU: &armsql.SKU{
		// 						Name: to.Ptr("System0"),
		// 						Capacity: to.Ptr[int32](0),
		// 						Tier: to.Ptr("System"),
		// 					},
		// 					DatabaseID: to.Ptr("e6be351f-2cc9-4604-9e52-b0b28b2710b0"),
		// 					DefaultSecondaryLocation: to.Ptr("North Europe"),
		// 					IsInfraEncryptionEnabled: to.Ptr(false),
		// 					IsLedgerOn: to.Ptr(false),
		// 					MaxSizeBytes: to.Ptr[int64](32212254720),
		// 					ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled),
		// 					RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyLocal),
		// 					RequestedServiceObjectiveName: to.Ptr("System0"),
		// 					Status: to.Ptr(armsql.DatabaseStatusOnline),
		// 					ZoneRedundant: to.Ptr(false),
		// 				},
		// 				SKU: &armsql.SKU{
		// 					Name: to.Ptr("System0"),
		// 					Capacity: to.Ptr[int32](0),
		// 					Tier: to.Ptr("System"),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2025-02-01-preview/ListVCoreDatabasesByServerWithOdata.json
func ExampleDatabasesClient_NewListByServerPager_getsAListOfDatabasesWithODataFiltering() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDatabasesClient().NewListByServerPager("Default-SQL-SouthEastAsia", "testsvr", 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 = armsql.DatabasesClientListByServerResponse{
		// 	DatabaseListResult: armsql.DatabaseListResult{
		// 		Value: []*armsql.Database{
		// 			{
		// 				SKU: &armsql.SKU{
		// 					Name: to.Ptr("BC_Gen5"),
		// 					Tier: to.Ptr("BusinessCritical"),
		// 					Capacity: to.Ptr[int32](2),
		// 				},
		// 				Kind: to.Ptr("v12.0,user,vcore"),
		// 				Properties: &armsql.DatabaseProperties{
		// 					Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
		// 					MaxSizeBytes: to.Ptr[int64](268435456000),
		// 					Status: to.Ptr(armsql.DatabaseStatusOnline),
		// 					DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
		// 					CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
		// 					CurrentServiceObjectiveName: to.Ptr("BC_Gen5_2"),
		// 					RequestedServiceObjectiveName: to.Ptr("BC_Gen5_2"),
		// 					DefaultSecondaryLocation: to.Ptr("North Europe"),
		// 					CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
		// 					LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded),
		// 					MaxLogSizeBytes: to.Ptr[int64](104857600),
		// 					IsInfraEncryptionEnabled: to.Ptr(false),
		// 					ZoneRedundant: to.Ptr(false),
		// 					ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled),
		// 					EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
		// 					MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"),
		// 					CurrentSKU: &armsql.SKU{
		// 						Name: to.Ptr("BC_Gen5"),
		// 						Tier: to.Ptr("BusinessCritical"),
		// 						Capacity: to.Ptr[int32](2),
		// 					},
		// 					CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					IsLedgerOn: to.Ptr(false),
		// 				},
		// 				Location: to.Ptr("southeastasia"),
		// 				ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/db2"),
		// 				Name: to.Ptr("db2"),
		// 				Type: to.Ptr("Microsoft.Sql/servers/databases"),
		// 			},
		// 			{
		// 				SKU: &armsql.SKU{
		// 					Name: to.Ptr("BC_Gen5"),
		// 					Tier: to.Ptr("BusinessCritical"),
		// 					Capacity: to.Ptr[int32](2),
		// 				},
		// 				Kind: to.Ptr("v12.0,user,vcore"),
		// 				Properties: &armsql.DatabaseProperties{
		// 					Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
		// 					MaxSizeBytes: to.Ptr[int64](268435456000),
		// 					Status: to.Ptr(armsql.DatabaseStatusOnline),
		// 					DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
		// 					CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
		// 					CurrentServiceObjectiveName: to.Ptr("BC_Gen5_2"),
		// 					RequestedServiceObjectiveName: to.Ptr("BC_Gen5_2"),
		// 					DefaultSecondaryLocation: to.Ptr("North Europe"),
		// 					CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
		// 					LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded),
		// 					MaxLogSizeBytes: to.Ptr[int64](104857600),
		// 					IsInfraEncryptionEnabled: to.Ptr(false),
		// 					ZoneRedundant: to.Ptr(false),
		// 					ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled),
		// 					EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
		// 					MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"),
		// 					CurrentSKU: &armsql.SKU{
		// 						Name: to.Ptr("BC_Gen5"),
		// 						Tier: to.Ptr("BusinessCritical"),
		// 						Capacity: to.Ptr[int32](2),
		// 					},
		// 					CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					IsLedgerOn: to.Ptr(false),
		// 				},
		// 				Location: to.Ptr("southeastasia"),
		// 				ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/db1"),
		// 				Name: to.Ptr("db1"),
		// 				Type: to.Ptr("Microsoft.Sql/servers/databases"),
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2025-02-01-preview/ListVCoreDatabasesEnclaveTypeByServer.json
func ExampleDatabasesClient_NewListByServerPager_getsAListOfDatabasesConfiguredWithEnclaveType() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDatabasesClient().NewListByServerPager("Default-SQL-SouthEastAsia", "testsvr", 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 = armsql.DatabasesClientListByServerResponse{
		// 	DatabaseListResult: armsql.DatabaseListResult{
		// 		Value: []*armsql.Database{
		// 			{
		// 				Name: to.Ptr("testdb"),
		// 				Type: to.Ptr("Microsoft.Sql/servers/databases"),
		// 				ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
		// 				Kind: to.Ptr("v12.0,user,vcore"),
		// 				Location: to.Ptr("southeastasia"),
		// 				Properties: &armsql.DatabaseProperties{
		// 					CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
		// 					Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
		// 					CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
		// 					CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyZone),
		// 					CurrentServiceObjectiveName: to.Ptr("BC_Gen4_2"),
		// 					CurrentSKU: &armsql.SKU{
		// 						Name: to.Ptr("BC_Gen4"),
		// 						Capacity: to.Ptr[int32](2),
		// 						Tier: to.Ptr("BusinessCritical"),
		// 					},
		// 					DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
		// 					DefaultSecondaryLocation: to.Ptr("North Europe"),
		// 					EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
		// 					IsInfraEncryptionEnabled: to.Ptr(false),
		// 					IsLedgerOn: to.Ptr(false),
		// 					LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded),
		// 					MaxLogSizeBytes: to.Ptr[int64](104857600),
		// 					MaxSizeBytes: to.Ptr[int64](268435456000),
		// 					PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault),
		// 					ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled),
		// 					RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyZone),
		// 					RequestedServiceObjectiveName: to.Ptr("BC_Gen4_2"),
		// 					Status: to.Ptr(armsql.DatabaseStatusOnline),
		// 					ZoneRedundant: to.Ptr(false),
		// 				},
		// 				SKU: &armsql.SKU{
		// 					Name: to.Ptr("BC_Gen4"),
		// 					Capacity: to.Ptr[int32](2),
		// 					Tier: to.Ptr("BusinessCritical"),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("master"),
		// 				Type: to.Ptr("Microsoft.Sql/servers/databases"),
		// 				ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/master"),
		// 				Kind: to.Ptr("v12.0,system"),
		// 				Location: to.Ptr("southeastasia"),
		// 				Properties: &armsql.DatabaseProperties{
		// 					CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
		// 					Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
		// 					CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:23:42.537Z"); return t}()),
		// 					CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyLocal),
		// 					CurrentServiceObjectiveName: to.Ptr("System0"),
		// 					CurrentSKU: &armsql.SKU{
		// 						Name: to.Ptr("System0"),
		// 						Capacity: to.Ptr[int32](0),
		// 						Tier: to.Ptr("System"),
		// 					},
		// 					DatabaseID: to.Ptr("e6be351f-2cc9-4604-9e52-b0b28b2710b0"),
		// 					DefaultSecondaryLocation: to.Ptr("North Europe"),
		// 					IsInfraEncryptionEnabled: to.Ptr(false),
		// 					IsLedgerOn: to.Ptr(false),
		// 					MaxSizeBytes: to.Ptr[int64](32212254720),
		// 					PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS),
		// 					ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled),
		// 					RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyLocal),
		// 					RequestedServiceObjectiveName: to.Ptr("System0"),
		// 					Status: to.Ptr(armsql.DatabaseStatusOnline),
		// 					ZoneRedundant: to.Ptr(false),
		// 				},
		// 				SKU: &armsql.SKU{
		// 					Name: to.Ptr("System0"),
		// 					Capacity: to.Ptr[int32](0),
		// 					Tier: to.Ptr("System"),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2025-02-01-preview/ListVCoreInaccessibleDatabasesByServer.json
func ExampleDatabasesClient_NewListInaccessibleByServerPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDatabasesClient().NewListInaccessibleByServerPager("Default-SQL-SouthEastAsia", "testsvr", 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 = armsql.DatabasesClientListInaccessibleByServerResponse{
		// 	DatabaseListResult: armsql.DatabaseListResult{
		// 		Value: []*armsql.Database{
		// 			{
		// 				Name: to.Ptr("testdb"),
		// 				Type: to.Ptr("Microsoft.Sql/servers/databases"),
		// 				ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
		// 				Kind: to.Ptr("v12.0,user,vcore"),
		// 				Location: to.Ptr("southeastasia"),
		// 				Properties: &armsql.DatabaseProperties{
		// 					CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
		// 					Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
		// 					CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
		// 					CurrentServiceObjectiveName: to.Ptr("BC_Gen4_2"),
		// 					DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
		// 					DefaultSecondaryLocation: to.Ptr("North Europe"),
		// 					LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded),
		// 					MaxLogSizeBytes: to.Ptr[int64](104857600),
		// 					MaxSizeBytes: to.Ptr[int64](268435456000),
		// 					ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled),
		// 					Status: to.Ptr(armsql.DatabaseStatusInaccessible),
		// 				},
		// 				SKU: &armsql.SKU{
		// 					Name: to.Ptr("BC_Gen4"),
		// 					Capacity: to.Ptr[int32](2),
		// 					Tier: to.Ptr("BusinessCritical"),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2025-02-01-preview/PauseDatabase.json
func ExampleDatabasesClient_BeginPause() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginPause(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdwdb", 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 = armsql.DatabasesClientPauseResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdwdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdwdb"),
	// 		Kind: to.Ptr("v12.0,user,datawarehouse"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-13T02:04:26.187Z"); return t}()),
	// 			CurrentServiceObjectiveName: to.Ptr("D1"),
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			MaxSizeBytes: to.Ptr[int64](10995116277760),
	// 			Status: to.Ptr(armsql.DatabaseStatusPaused),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("DataWarehouse"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/RenameDatabase.json
func ExampleDatabasesClient_Rename() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDatabasesClient().Rename(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.ResourceMoveDefinition{
		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/newtestdb"),
	}, 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 = armsql.DatabasesClientRenameResponse{
	// }
}

// Generated from example definition: 2025-02-01-preview/ResumeDatabase.json
func ExampleDatabasesClient_BeginResume() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginResume(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdwdb", 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 = armsql.DatabasesClientResumeResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdwdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdwdb"),
	// 		Kind: to.Ptr("v12.0,user,datawarehouse"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-13T02:04:26.187Z"); return t}()),
	// 			CurrentServiceObjectiveName: to.Ptr("D1"),
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			MaxSizeBytes: to.Ptr[int64](10995116277760),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("DataWarehouse"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/PatchDatabaseDefaultEnclave.json
func ExampleDatabasesClient_BeginUpdate_updatesADatabaseWithDefaultEnclaveType() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.DatabaseUpdate{
		Properties: &armsql.DatabaseUpdateProperties{
			PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault),
		},
	}, 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 = armsql.DatabasesClientUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("S0"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("Standard"),
	// 				Capacity: to.Ptr[int32](10),
	// 				Tier: to.Ptr("Standard"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			MaxSizeBytes: to.Ptr[int64](268435456000),
	// 			PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("S0"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("Standard"),
	// 			Capacity: to.Ptr[int32](10),
	// 			Tier: to.Ptr("Standard"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/PatchDatabaseVBSEnclave.json
func ExampleDatabasesClient_BeginUpdate_updatesADatabaseWithVbsEnclaveType() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.DatabaseUpdate{
		Properties: &armsql.DatabaseUpdateProperties{
			PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS),
		},
	}, 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 = armsql.DatabasesClientUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("S0"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("Standard"),
	// 				Capacity: to.Ptr[int32](10),
	// 				Tier: to.Ptr("Standard"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			MaxSizeBytes: to.Ptr[int64](268435456000),
	// 			PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("S0"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("Standard"),
	// 			Capacity: to.Ptr[int32](10),
	// 			Tier: to.Ptr("Standard"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/PatchVCoreDatabase.json
func ExampleDatabasesClient_BeginUpdate_updatesADatabase() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.DatabaseUpdate{
		Properties: &armsql.DatabaseUpdateProperties{
			LicenseType:  to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded),
			MaxSizeBytes: to.Ptr[int64](1073741824),
		},
		SKU: &armsql.SKU{
			Name: to.Ptr("BC_Gen4_4"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to 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 = armsql.DatabasesClientUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user,vcore"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("BC_Gen4_2"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("BC_Gen4"),
	// 				Capacity: to.Ptr[int32](4),
	// 				Tier: to.Ptr("BusinessCritical"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded),
	// 			MaxLogSizeBytes: to.Ptr[int64](104857600),
	// 			MaxSizeBytes: to.Ptr[int64](1073741824),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyLocal),
	// 			RequestedServiceObjectiveName: to.Ptr("BC_Gen4_2"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("BC_Gen4"),
	// 			Capacity: to.Ptr[int32](4),
	// 			Tier: to.Ptr("BusinessCritical"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/PatchVCoreDatabaseAssignMaintenanceConfiguration.json
func ExampleDatabasesClient_BeginUpdate_assignsMaintenanceWindowToADatabase() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.DatabaseUpdate{
		Properties: &armsql.DatabaseUpdateProperties{
			MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"),
		},
		SKU: &armsql.SKU{
			Name: to.Ptr("BC_Gen5_4"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to 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 = armsql.DatabasesClientUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user,vcore"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("BC_Gen5_2"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("BC_Gen5"),
	// 				Capacity: to.Ptr[int32](4),
	// 				Tier: to.Ptr("BusinessCritical"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded),
	// 			MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"),
	// 			MaxLogSizeBytes: to.Ptr[int64](104857600),
	// 			MaxSizeBytes: to.Ptr[int64](1073741824),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("BC_Gen5_2"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("BC_Gen5"),
	// 			Capacity: to.Ptr[int32](4),
	// 			Tier: to.Ptr("BusinessCritical"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/PatchVCoreDatabaseResetMaintenanceConfiguration.json
func ExampleDatabasesClient_BeginUpdate_resetsMaintenanceWindowOfADatabaseToDefault() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.DatabaseUpdate{
		Properties: &armsql.DatabaseUpdateProperties{
			MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"),
		},
		SKU: &armsql.SKU{
			Name: to.Ptr("BC_Gen5_4"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to 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 = armsql.DatabasesClientUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user,vcore"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("BC_Gen5_4"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("BC_Gen5"),
	// 				Capacity: to.Ptr[int32](4),
	// 				Tier: to.Ptr("BusinessCritical"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded),
	// 			MaxLogSizeBytes: to.Ptr[int64](104857600),
	// 			MaxSizeBytes: to.Ptr[int64](1073741824),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedServiceObjectiveName: to.Ptr("BC_Gen5_4"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("BC_Gen5"),
	// 			Capacity: to.Ptr[int32](4),
	// 			Tier: to.Ptr("BusinessCritical"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/PatchVCoreDatabaseWithKeysAndEncryptionProtector.json
func ExampleDatabasesClient_BeginUpdate_patchADatabaseWithDatabaseLevelCustomerManagedKeys() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.DatabaseUpdate{
		Identity: &armsql.DatabaseIdentity{
			Type: to.Ptr(armsql.DatabaseIdentityTypeUserAssigned),
			UserAssignedIdentities: map[string]*armsql.DatabaseUserIdentity{
				"/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.ManagedIdentity/userAssignedIdentities/umi": {},
			},
		},
		Properties: &armsql.DatabaseUpdateProperties{
			EncryptionProtector: to.Ptr("https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion"),
			Keys: map[string]*armsql.DatabaseKey{
				"https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion": {},
			},
		},
		SKU: &armsql.SKU{
			Name: to.Ptr("S0"),
			Tier: to.Ptr("Standard"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to 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 = armsql.DatabasesClientUpdateResponse{
	// 	Database: armsql.Database{
	// 		Name: to.Ptr("testdb"),
	// 		Type: to.Ptr("Microsoft.Sql/servers/databases"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
	// 		Kind: to.Ptr("v12.0,user,vcore"),
	// 		Location: to.Ptr("southeastasia"),
	// 		Properties: &armsql.DatabaseProperties{
	// 			CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			CurrentServiceObjectiveName: to.Ptr("BC_Gen4_2"),
	// 			CurrentSKU: &armsql.SKU{
	// 				Name: to.Ptr("BC_Gen4"),
	// 				Capacity: to.Ptr[int32](4),
	// 				Tier: to.Ptr("BusinessCritical"),
	// 			},
	// 			DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"),
	// 			DefaultSecondaryLocation: to.Ptr("North Europe"),
	// 			EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()),
	// 			IsInfraEncryptionEnabled: to.Ptr(false),
	// 			IsLedgerOn: to.Ptr(false),
	// 			LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded),
	// 			MaxLogSizeBytes: to.Ptr[int64](104857600),
	// 			MaxSizeBytes: to.Ptr[int64](1073741824),
	// 			ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyLocal),
	// 			RequestedServiceObjectiveName: to.Ptr("BC_Gen4_2"),
	// 			Status: to.Ptr(armsql.DatabaseStatusOnline),
	// 			ZoneRedundant: to.Ptr(false),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("BC_Gen4"),
	// 			Capacity: to.Ptr[int32](4),
	// 			Tier: to.Ptr("BusinessCritical"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/UpgradeDataWarehouse.json
func ExampleDatabasesClient_BeginUpgradeDataWarehouse() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginUpgradeDataWarehouse(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdwdb", 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 = armsql.DatabasesClientUpgradeDataWarehouseResponse{
	// }
}
