// 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"
)

// Generated from example definition: 2025-02-01-preview/ManagedInstanceCreateMax.json
func ExampleManagedInstancesClient_BeginCreateOrUpdate_createManagedInstanceWithAllProperties() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("20D7082A-0FC7-4468-82BD-542694D5042B", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewManagedInstancesClient().BeginCreateOrUpdate(ctx, "testrg", "testinstance", armsql.ManagedInstance{
		Location: to.Ptr("Japan East"),
		Properties: &armsql.ManagedInstanceProperties{
			AdministratorLogin:         to.Ptr("dummylogin"),
			AdministratorLoginPassword: to.Ptr("PLACEHOLDER"),
			Administrators: &armsql.ManagedInstanceExternalAdministrator{
				AzureADOnlyAuthentication: to.Ptr(true),
				Login:                     to.Ptr("bob@contoso.com"),
				PrincipalType:             to.Ptr(armsql.PrincipalTypeUser),
				Sid:                       to.Ptr("00000011-1111-2222-2222-123456789111"),
				TenantID:                  to.Ptr("00000011-1111-2222-2222-123456789111"),
			},
			AuthenticationMetadata:           to.Ptr(armsql.AuthMetadataLookupModesAzureAD),
			Collation:                        to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
			DatabaseFormat:                   to.Ptr(armsql.ManagedInstanceDatabaseFormatAlwaysUpToDate),
			DNSZonePartner:                   to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance"),
			HybridSecondaryUsage:             to.Ptr(armsql.HybridSecondaryUsagePassive),
			InstancePoolID:                   to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/pool1"),
			LicenseType:                      to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded),
			MaintenanceConfigurationID:       to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"),
			MinimalTLSVersion:                to.Ptr("1.2"),
			ProxyOverride:                    to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect),
			PublicDataEndpointEnabled:        to.Ptr(false),
			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
			RequestedLogicalAvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne),
			ServicePrincipal: &armsql.ServicePrincipal{
				Type: to.Ptr(armsql.ServicePrincipalTypeSystemAssigned),
			},
			StorageSizeInGB: to.Ptr[int32](1024),
			SubnetID:        to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
			TimezoneID:      to.Ptr("UTC"),
			VCores:          to.Ptr[int32](8),
		},
		SKU: &armsql.SKU{
			Name: to.Ptr("GP_Gen5"),
			Tier: to.Ptr("GeneralPurpose"),
		},
		Tags: map[string]*string{
			"tagKey1": to.Ptr("TagValue1"),
		},
	}, 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.ManagedInstancesClientCreateOrUpdateResponse{
	// 	ManagedInstance: armsql.ManagedInstance{
	// 		Name: to.Ptr("testinstance"),
	// 		Type: to.Ptr("Microsoft.Sql/managedInstances"),
	// 		ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance"),
	// 		Location: to.Ptr("japaneast"),
	// 		Properties: &armsql.ManagedInstanceProperties{
	// 			AdministratorLogin: to.Ptr("dummylogin"),
	// 			Administrators: &armsql.ManagedInstanceExternalAdministrator{
	// 				AzureADOnlyAuthentication: to.Ptr(true),
	// 				Login: to.Ptr("bob@contoso.com"),
	// 				PrincipalType: to.Ptr(armsql.PrincipalTypeUser),
	// 				Sid: to.Ptr("00000011-1111-2222-2222-123456789111"),
	// 				TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"),
	// 			},
	// 			AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesAzureAD),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatAlwaysUpToDate),
	// 			DNSZone: to.Ptr("1b4e2caff2530"),
	// 			ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled),
	// 			FullyQualifiedDomainName: to.Ptr("testinstance.1b4e2caff2530.database.windows.net"),
	// 			HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive),
	// 			InstancePoolID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/pool1"),
	// 			LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded),
	// 			MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"),
	// 			MinimalTLSVersion: to.Ptr("1.2"),
	// 			ProvisioningState: to.Ptr(armsql.ProvisioningState("Creating")),
	// 			ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect),
	// 			PublicDataEndpointEnabled: to.Ptr(false),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedLogicalAvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne),
	// 			ServicePrincipal: &armsql.ServicePrincipal{
	// 				Type: to.Ptr(armsql.ServicePrincipalTypeSystemAssigned),
	// 				ClientID: to.Ptr("00000011-1111-2222-2222-123456789111"),
	// 				PrincipalID: to.Ptr("00000011-1111-2222-2222-123456789111"),
	// 				TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"),
	// 			},
	// 			State: to.Ptr("Ready"),
	// 			StorageSizeInGB: to.Ptr[int32](1024),
	// 			SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
	// 			TimezoneID: to.Ptr("UTC"),
	// 			VCores: to.Ptr[int32](8),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("GP_Gen5"),
	// 			Capacity: to.Ptr[int32](8),
	// 			Family: to.Ptr("Gen5"),
	// 			Tier: to.Ptr("GeneralPurpose"),
	// 		},
	// 		Tags: map[string]*string{
	// 			"tagKey1": to.Ptr("TagValue1"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/ManagedInstanceCreateMin.json
func ExampleManagedInstancesClient_BeginCreateOrUpdate_createManagedInstanceWithMinimalProperties() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("20D7082A-0FC7-4468-82BD-542694D5042B", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewManagedInstancesClient().BeginCreateOrUpdate(ctx, "testrg", "testinstance", armsql.ManagedInstance{
		Location: to.Ptr("Japan East"),
		Properties: &armsql.ManagedInstanceProperties{
			AdministratorLogin:         to.Ptr("dummylogin"),
			AdministratorLoginPassword: to.Ptr("PLACEHOLDER"),
			LicenseType:                to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded),
			StorageSizeInGB:            to.Ptr[int32](1024),
			SubnetID:                   to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
			VCores:                     to.Ptr[int32](8),
		},
		SKU: &armsql.SKU{
			Name: to.Ptr("GP_Gen5"),
			Tier: to.Ptr("GeneralPurpose"),
		},
	}, 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.ManagedInstancesClientCreateOrUpdateResponse{
	// 	ManagedInstance: armsql.ManagedInstance{
	// 		Name: to.Ptr("testinstance"),
	// 		Type: to.Ptr("Microsoft.Sql/managedInstances"),
	// 		ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance"),
	// 		Location: to.Ptr("japaneast"),
	// 		Properties: &armsql.ManagedInstanceProperties{
	// 			AdministratorLogin: to.Ptr("dummylogin"),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022),
	// 			DNSZone: to.Ptr("1b4e2caff2530"),
	// 			ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled),
	// 			FullyQualifiedDomainName: to.Ptr("testinstance.1b4e2caff2530.database.windows.net"),
	// 			HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive),
	// 			LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded),
	// 			ProvisioningState: to.Ptr(armsql.ProvisioningState("Creating")),
	// 			ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect),
	// 			PublicDataEndpointEnabled: to.Ptr(false),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			State: to.Ptr("Ready"),
	// 			StorageSizeInGB: to.Ptr[int32](1024),
	// 			SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
	// 			VCores: to.Ptr[int32](8),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("GP_Gen5"),
	// 			Capacity: to.Ptr[int32](8),
	// 			Family: to.Ptr("Gen4"),
	// 			Tier: to.Ptr("GeneralPurpose"),
	// 		},
	// 		Tags: map[string]*string{
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/ManagedInstanceDelete.json
func ExampleManagedInstancesClient_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.NewManagedInstancesClient().BeginDelete(ctx, "testrg", "testinstance", 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.ManagedInstancesClientDeleteResponse{
	// }
}

// Generated from example definition: 2025-02-01-preview/FailoverManagedInstance.json
func ExampleManagedInstancesClient_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.NewManagedInstancesClient().BeginFailover(ctx, "group1", "instanceName", &armsql.ManagedInstancesClientBeginFailoverOptions{
		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.ManagedInstancesClientFailoverResponse{
	// }
}

// Generated from example definition: 2025-02-01-preview/ManagedInstanceGet.json
func ExampleManagedInstancesClient_Get_getManagedInstance() {
	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.NewManagedInstancesClient().Get(ctx, "testrg", "testinstance", 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.ManagedInstancesClientGetResponse{
	// 	ManagedInstance: armsql.ManagedInstance{
	// 		Name: to.Ptr("testinstance"),
	// 		Type: to.Ptr("Microsoft.Sql/managedInstances"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance"),
	// 		Location: to.Ptr("japaneast"),
	// 		Properties: &armsql.ManagedInstanceProperties{
	// 			AdministratorLogin: to.Ptr("dummylogin"),
	// 			AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022),
	// 			DNSZone: to.Ptr("1b4e2caff2530"),
	// 			ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled),
	// 			FullyQualifiedDomainName: to.Ptr("testinstance.1b4e2caff2530.database.windows.net"),
	// 			HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive),
	// 			InstancePoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/instancePool1"),
	// 			LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded),
	// 			MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"),
	// 			MinimalTLSVersion: to.Ptr("1.2"),
	// 			PricingModel: to.Ptr(armsql.PricingModelRegular),
	// 			ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded),
	// 			ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault),
	// 			PublicDataEndpointEnabled: to.Ptr(false),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedLogicalAvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne),
	// 			ServicePrincipal: &armsql.ServicePrincipal{
	// 				Type: to.Ptr(armsql.ServicePrincipalTypeSystemAssigned),
	// 				ClientID: to.Ptr("00000011-1111-2222-2222-123456789111"),
	// 				PrincipalID: to.Ptr("00000011-1111-2222-2222-123456789111"),
	// 				TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"),
	// 			},
	// 			State: to.Ptr("Ready"),
	// 			StorageSizeInGB: to.Ptr[int32](1024),
	// 			SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
	// 			VCores: to.Ptr[int32](8),
	// 			VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-999999999999"),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("GP_Gen5"),
	// 			Capacity: to.Ptr[int32](8),
	// 			Family: to.Ptr("Gen5"),
	// 			Tier: to.Ptr("GeneralPurpose"),
	// 		},
	// 		Tags: map[string]*string{
	// 			"key": to.Ptr("value"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/ManagedInstanceGetWhileUpdating.json
func ExampleManagedInstancesClient_Get_getManagedInstanceWhileResourceIsUpdating() {
	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.NewManagedInstancesClient().Get(ctx, "testrg", "testinstance", 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.ManagedInstancesClientGetResponse{
	// 	ManagedInstance: armsql.ManagedInstance{
	// 		Name: to.Ptr("testinstance"),
	// 		Type: to.Ptr("Microsoft.Sql/managedInstances"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance"),
	// 		Location: to.Ptr("japaneast"),
	// 		Properties: &armsql.ManagedInstanceProperties{
	// 			AdministratorLogin: to.Ptr("dummylogin"),
	// 			AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()),
	// 			DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022),
	// 			DNSZone: to.Ptr("1b4e2caff2530"),
	// 			ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled),
	// 			FullyQualifiedDomainName: to.Ptr("testinstance.1b4e2caff2530.database.windows.net"),
	// 			InstancePoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/instancePool1"),
	// 			LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded),
	// 			MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"),
	// 			MinimalTLSVersion: to.Ptr("1.2"),
	// 			PricingModel: to.Ptr(armsql.PricingModelRegular),
	// 			ProvisioningState: to.Ptr(armsql.ProvisioningState("Updating")),
	// 			ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault),
	// 			PublicDataEndpointEnabled: to.Ptr(false),
	// 			RequestedLogicalAvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne),
	// 			State: to.Ptr("Ready"),
	// 			StorageSizeInGB: to.Ptr[int32](1024),
	// 			SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
	// 			VCores: to.Ptr[int32](8),
	// 			VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-999999999999"),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("GP_Gen5"),
	// 			Capacity: to.Ptr[int32](8),
	// 			Family: to.Ptr("Gen5"),
	// 			Tier: to.Ptr("GeneralPurpose"),
	// 		},
	// 		Tags: map[string]*string{
	// 			"key": to.Ptr("value"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/ManagedInstanceGetWithExpandEqualsAdministrators.json
func ExampleManagedInstancesClient_Get_getManagedInstanceWithExpandAdministratorsActivedirectory() {
	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.NewManagedInstancesClient().Get(ctx, "testrg", "testinstance", 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.ManagedInstancesClientGetResponse{
	// 	ManagedInstance: armsql.ManagedInstance{
	// 		Name: to.Ptr("testinstance"),
	// 		Type: to.Ptr("Microsoft.Sql/managedInstances"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance"),
	// 		Location: to.Ptr("japaneast"),
	// 		Properties: &armsql.ManagedInstanceProperties{
	// 			AdministratorLogin: to.Ptr("dummylogin"),
	// 			Administrators: &armsql.ManagedInstanceExternalAdministrator{
	// 				AzureADOnlyAuthentication: to.Ptr(true),
	// 				Login: to.Ptr("bob@contoso.com"),
	// 				PrincipalType: to.Ptr(armsql.PrincipalTypeUser),
	// 				Sid: to.Ptr("00000011-1111-2222-2222-123456789111"),
	// 				TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"),
	// 			},
	// 			AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022),
	// 			DNSZone: to.Ptr("1b4e2caff2530"),
	// 			ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled),
	// 			FullyQualifiedDomainName: to.Ptr("testinstance.1b4e2caff2530.database.windows.net"),
	// 			HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive),
	// 			InstancePoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/instancePool1"),
	// 			LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded),
	// 			MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"),
	// 			MinimalTLSVersion: to.Ptr("1.2"),
	// 			PricingModel: to.Ptr(armsql.PricingModelRegular),
	// 			ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded),
	// 			ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault),
	// 			PublicDataEndpointEnabled: to.Ptr(false),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedLogicalAvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne),
	// 			State: to.Ptr("Ready"),
	// 			StorageSizeInGB: to.Ptr[int32](1024),
	// 			SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
	// 			VCores: to.Ptr[int32](8),
	// 			VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-999999999999"),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("GP_Gen5"),
	// 			Capacity: to.Ptr[int32](8),
	// 			Family: to.Ptr("Gen5"),
	// 			Tier: to.Ptr("GeneralPurpose"),
	// 		},
	// 		Tags: map[string]*string{
	// 			"key": to.Ptr("value"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/ManagedInstanceList.json
func ExampleManagedInstancesClient_NewListPager_listManagedInstances() {
	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.NewManagedInstancesClient().NewListPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page = armsql.ManagedInstancesClientListResponse{
		// 	ManagedInstanceListResult: armsql.ManagedInstanceListResult{
		// 		Value: []*armsql.ManagedInstance{
		// 			{
		// 				Name: to.Ptr("testinstance1"),
		// 				Type: to.Ptr("Microsoft.Sql/managedInstances"),
		// 				ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance1"),
		// 				Location: to.Ptr("japaneast"),
		// 				Properties: &armsql.ManagedInstanceProperties{
		// 					AdministratorLogin: to.Ptr("dummylogin"),
		// 					AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows),
		// 					Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
		// 					CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()),
		// 					CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022),
		// 					DNSZone: to.Ptr("1b4e2caff2530"),
		// 					ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled),
		// 					FullyQualifiedDomainName: to.Ptr("testinstance1.1b4e2caff2530.database.windows.net"),
		// 					HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive),
		// 					LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded),
		// 					MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"),
		// 					MinimalTLSVersion: to.Ptr("1.2"),
		// 					PricingModel: to.Ptr(armsql.PricingModelRegular),
		// 					ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded),
		// 					ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault),
		// 					PublicDataEndpointEnabled: to.Ptr(false),
		// 					RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					RequestedLogicalAvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne),
		// 					State: to.Ptr("Ready"),
		// 					StorageSizeInGB: to.Ptr[int32](1024),
		// 					SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
		// 					VCores: to.Ptr[int32](8),
		// 					VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-999999999999"),
		// 				},
		// 				SKU: &armsql.SKU{
		// 					Name: to.Ptr("GP_Gen5"),
		// 					Capacity: to.Ptr[int32](8),
		// 					Family: to.Ptr("Gen5"),
		// 					Tier: to.Ptr("GeneralPurpose"),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("testinstance2"),
		// 				Type: to.Ptr("Microsoft.Sql/managedInstances"),
		// 				ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance2"),
		// 				Location: to.Ptr("japaneast"),
		// 				Properties: &armsql.ManagedInstanceProperties{
		// 					AdministratorLogin: to.Ptr("dummylogin"),
		// 					AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows),
		// 					Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
		// 					CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()),
		// 					CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022),
		// 					DNSZone: to.Ptr("2c3d1bdae3412"),
		// 					ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled),
		// 					FullyQualifiedDomainName: to.Ptr("testinstance2.2c3d1bdae3412.database.windows.net"),
		// 					HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive),
		// 					LicenseType: to.Ptr(armsql.ManagedInstanceLicenseType("Full")),
		// 					MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"),
		// 					MinimalTLSVersion: to.Ptr("1.2"),
		// 					PricingModel: to.Ptr(armsql.PricingModelRegular),
		// 					ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded),
		// 					ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault),
		// 					PublicDataEndpointEnabled: to.Ptr(false),
		// 					RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					RequestedLogicalAvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne),
		// 					State: to.Ptr("Ready"),
		// 					StorageSizeInGB: to.Ptr[int32](1024),
		// 					SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/subnet2"),
		// 					VCores: to.Ptr[int32](16),
		// 					VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-444444444444"),
		// 				},
		// 				SKU: &armsql.SKU{
		// 					Name: to.Ptr("BC_Gen5"),
		// 					Capacity: to.Ptr[int32](16),
		// 					Family: to.Ptr("Gen5"),
		// 					Tier: to.Ptr("BusinessCritical"),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2025-02-01-preview/ManagedInstanceListWithExpandEqualsAdministrators.json
func ExampleManagedInstancesClient_NewListPager_listManagedInstancesWithExpandAdministratorsActivedirectory() {
	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.NewManagedInstancesClient().NewListPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page = armsql.ManagedInstancesClientListResponse{
		// 	ManagedInstanceListResult: armsql.ManagedInstanceListResult{
		// 		Value: []*armsql.ManagedInstance{
		// 			{
		// 				Name: to.Ptr("testinstance1"),
		// 				Type: to.Ptr("Microsoft.Sql/managedInstances"),
		// 				ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance1"),
		// 				Location: to.Ptr("japaneast"),
		// 				Properties: &armsql.ManagedInstanceProperties{
		// 					AdministratorLogin: to.Ptr("dummylogin"),
		// 					Administrators: &armsql.ManagedInstanceExternalAdministrator{
		// 						AzureADOnlyAuthentication: to.Ptr(true),
		// 						Login: to.Ptr("bob@contoso.com"),
		// 						PrincipalType: to.Ptr(armsql.PrincipalTypeUser),
		// 						Sid: to.Ptr("00000011-1111-2222-2222-123456789111"),
		// 						TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"),
		// 					},
		// 					AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows),
		// 					Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
		// 					CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()),
		// 					CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022),
		// 					DNSZone: to.Ptr("1b4e2caff2530"),
		// 					ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled),
		// 					FullyQualifiedDomainName: to.Ptr("testinstance1.1b4e2caff2530.database.windows.net"),
		// 					HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive),
		// 					LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded),
		// 					MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"),
		// 					MinimalTLSVersion: to.Ptr("1.2"),
		// 					PricingModel: to.Ptr(armsql.PricingModelRegular),
		// 					ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded),
		// 					ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault),
		// 					PublicDataEndpointEnabled: to.Ptr(false),
		// 					RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					RequestedLogicalAvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne),
		// 					State: to.Ptr("Ready"),
		// 					StorageSizeInGB: to.Ptr[int32](1024),
		// 					SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
		// 					VCores: to.Ptr[int32](8),
		// 					VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-999999999999"),
		// 				},
		// 				SKU: &armsql.SKU{
		// 					Name: to.Ptr("GP_Gen5"),
		// 					Capacity: to.Ptr[int32](8),
		// 					Family: to.Ptr("Gen4"),
		// 					Tier: to.Ptr("GeneralPurpose"),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("testinstance2"),
		// 				Type: to.Ptr("Microsoft.Sql/managedInstances"),
		// 				ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance2"),
		// 				Location: to.Ptr("japaneast"),
		// 				Properties: &armsql.ManagedInstanceProperties{
		// 					AdministratorLogin: to.Ptr("dummylogin"),
		// 					Administrators: &armsql.ManagedInstanceExternalAdministrator{
		// 						AzureADOnlyAuthentication: to.Ptr(true),
		// 						Login: to.Ptr("bob@contoso.com"),
		// 						PrincipalType: to.Ptr(armsql.PrincipalTypeUser),
		// 						Sid: to.Ptr("00000011-1111-2222-2222-123456789111"),
		// 						TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"),
		// 					},
		// 					AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows),
		// 					Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
		// 					CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()),
		// 					CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022),
		// 					DNSZone: to.Ptr("2c3d1bdae3412"),
		// 					ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled),
		// 					FullyQualifiedDomainName: to.Ptr("testinstance2.2c3d1bdae3412.database.windows.net"),
		// 					HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive),
		// 					LicenseType: to.Ptr(armsql.ManagedInstanceLicenseType("Full")),
		// 					MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_2"),
		// 					MinimalTLSVersion: to.Ptr("1.2"),
		// 					PricingModel: to.Ptr(armsql.PricingModelRegular),
		// 					ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded),
		// 					ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault),
		// 					PublicDataEndpointEnabled: to.Ptr(false),
		// 					RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					RequestedLogicalAvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne),
		// 					State: to.Ptr("Ready"),
		// 					StorageSizeInGB: to.Ptr[int32](1024),
		// 					SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/subnet2"),
		// 					VCores: to.Ptr[int32](16),
		// 					VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-444444444444"),
		// 				},
		// 				SKU: &armsql.SKU{
		// 					Name: to.Ptr("BC_Gen5"),
		// 					Capacity: to.Ptr[int32](16),
		// 					Family: to.Ptr("Gen4"),
		// 					Tier: to.Ptr("BusinessCritical"),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2025-02-01-preview/ManagedInstanceListByInstancePool.json
func ExampleManagedInstancesClient_NewListByInstancePoolPager_listManagedInstancesByInstancePool() {
	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.NewManagedInstancesClient().NewListByInstancePoolPager("Test1", "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.ManagedInstancesClientListByInstancePoolResponse{
		// 	ManagedInstanceListResult: armsql.ManagedInstanceListResult{
		// 		Value: []*armsql.ManagedInstance{
		// 			{
		// 				Name: to.Ptr("testinstance1"),
		// 				Type: to.Ptr("Microsoft.Sql/managedInstances"),
		// 				ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance1"),
		// 				Location: to.Ptr("canadacentral"),
		// 				Properties: &armsql.ManagedInstanceProperties{
		// 					AdministratorLogin: to.Ptr("dummylogin"),
		// 					AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows),
		// 					Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
		// 					CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()),
		// 					CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022),
		// 					DNSZone: to.Ptr("1b4e2caff2530"),
		// 					ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled),
		// 					FullyQualifiedDomainName: to.Ptr("testinstance1.1b4e2caff2530.database.windows.net"),
		// 					HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive),
		// 					InstancePoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/instancePools/pool1"),
		// 					LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded),
		// 					MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_CanadaCentral_MI_1"),
		// 					MinimalTLSVersion: to.Ptr("1.2"),
		// 					PricingModel: to.Ptr(armsql.PricingModelRegular),
		// 					ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded),
		// 					ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect),
		// 					PublicDataEndpointEnabled: to.Ptr(false),
		// 					RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					State: to.Ptr("Ready"),
		// 					StorageSizeInGB: to.Ptr[int32](1024),
		// 					SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
		// 					VCores: to.Ptr[int32](8),
		// 					VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-999999999999"),
		// 				},
		// 				SKU: &armsql.SKU{
		// 					Name: to.Ptr("GP_Gen5"),
		// 					Capacity: to.Ptr[int32](8),
		// 					Family: to.Ptr("Gen5"),
		// 					Tier: to.Ptr("GeneralPurpose"),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("testinstance2"),
		// 				Type: to.Ptr("Microsoft.Sql/managedInstances"),
		// 				ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance2"),
		// 				Location: to.Ptr("canadacentral"),
		// 				Properties: &armsql.ManagedInstanceProperties{
		// 					AdministratorLogin: to.Ptr("dummylogin"),
		// 					AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows),
		// 					Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
		// 					CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()),
		// 					CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022),
		// 					DNSZone: to.Ptr("2c3d1bdae3412"),
		// 					ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled),
		// 					FullyQualifiedDomainName: to.Ptr("testinstance2.2c3d1bdae3412.database.windows.net"),
		// 					HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive),
		// 					InstancePoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/instancePools/pool1"),
		// 					LicenseType: to.Ptr(armsql.ManagedInstanceLicenseType("Full")),
		// 					MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_CanadaCentral_MI_1"),
		// 					MinimalTLSVersion: to.Ptr("1.2"),
		// 					PricingModel: to.Ptr(armsql.PricingModelRegular),
		// 					ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded),
		// 					ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect),
		// 					PublicDataEndpointEnabled: to.Ptr(false),
		// 					RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					State: to.Ptr("Ready"),
		// 					StorageSizeInGB: to.Ptr[int32](1024),
		// 					SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
		// 					VCores: to.Ptr[int32](16),
		// 					VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-999999999999"),
		// 				},
		// 				SKU: &armsql.SKU{
		// 					Name: to.Ptr("GP_Gen5"),
		// 					Capacity: to.Ptr[int32](16),
		// 					Family: to.Ptr("Gen5"),
		// 					Tier: to.Ptr("GeneralPurpose"),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2025-02-01-preview/ManagedInstanceListByInstancePoolWithExpandEqualsAdministrators.json
func ExampleManagedInstancesClient_NewListByInstancePoolPager_listManagedInstancesByInstancePoolWithExpandAdministratorsActivedirectory() {
	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.NewManagedInstancesClient().NewListByInstancePoolPager("Test1", "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.ManagedInstancesClientListByInstancePoolResponse{
		// 	ManagedInstanceListResult: armsql.ManagedInstanceListResult{
		// 		Value: []*armsql.ManagedInstance{
		// 			{
		// 				Name: to.Ptr("testinstance1"),
		// 				Type: to.Ptr("Microsoft.Sql/managedInstances"),
		// 				ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance1"),
		// 				Location: to.Ptr("canadacentral"),
		// 				Properties: &armsql.ManagedInstanceProperties{
		// 					AdministratorLogin: to.Ptr("dummylogin"),
		// 					Administrators: &armsql.ManagedInstanceExternalAdministrator{
		// 						AzureADOnlyAuthentication: to.Ptr(true),
		// 						Login: to.Ptr("bob@contoso.com"),
		// 						PrincipalType: to.Ptr(armsql.PrincipalTypeUser),
		// 						Sid: to.Ptr("00000011-1111-2222-2222-123456789111"),
		// 						TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"),
		// 					},
		// 					AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows),
		// 					Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
		// 					CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()),
		// 					CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022),
		// 					DNSZone: to.Ptr("1b4e2caff2530"),
		// 					ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled),
		// 					FullyQualifiedDomainName: to.Ptr("testinstance1.1b4e2caff2530.database.windows.net"),
		// 					HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive),
		// 					InstancePoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/instancePools/pool1"),
		// 					LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded),
		// 					MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_CanadaCentral_MI_1"),
		// 					MinimalTLSVersion: to.Ptr("1.2"),
		// 					PricingModel: to.Ptr(armsql.PricingModelRegular),
		// 					ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded),
		// 					ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect),
		// 					PublicDataEndpointEnabled: to.Ptr(false),
		// 					RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					State: to.Ptr("Ready"),
		// 					StorageSizeInGB: to.Ptr[int32](1024),
		// 					SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
		// 					VCores: to.Ptr[int32](8),
		// 					VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-999999999999"),
		// 				},
		// 				SKU: &armsql.SKU{
		// 					Name: to.Ptr("GP_Gen5"),
		// 					Capacity: to.Ptr[int32](8),
		// 					Family: to.Ptr("Gen5"),
		// 					Tier: to.Ptr("GeneralPurpose"),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("testinstance2"),
		// 				Type: to.Ptr("Microsoft.Sql/managedInstances"),
		// 				ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance2"),
		// 				Location: to.Ptr("canadacentral"),
		// 				Properties: &armsql.ManagedInstanceProperties{
		// 					AdministratorLogin: to.Ptr("dummylogin"),
		// 					Administrators: &armsql.ManagedInstanceExternalAdministrator{
		// 						AzureADOnlyAuthentication: to.Ptr(true),
		// 						Login: to.Ptr("bob@contoso.com"),
		// 						PrincipalType: to.Ptr(armsql.PrincipalTypeUser),
		// 						Sid: to.Ptr("00000011-1111-2222-2222-123456789111"),
		// 						TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"),
		// 					},
		// 					AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows),
		// 					Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
		// 					CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()),
		// 					CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022),
		// 					DNSZone: to.Ptr("2c3d1bdae3412"),
		// 					ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled),
		// 					FullyQualifiedDomainName: to.Ptr("testinstance2.2c3d1bdae3412.database.windows.net"),
		// 					HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive),
		// 					InstancePoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/instancePools/pool1"),
		// 					LicenseType: to.Ptr(armsql.ManagedInstanceLicenseType("Full")),
		// 					MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_CanadaCentral_MI_2"),
		// 					MinimalTLSVersion: to.Ptr("1.2"),
		// 					PricingModel: to.Ptr(armsql.PricingModelRegular),
		// 					ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded),
		// 					ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect),
		// 					PublicDataEndpointEnabled: to.Ptr(false),
		// 					RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					State: to.Ptr("Ready"),
		// 					StorageSizeInGB: to.Ptr[int32](1024),
		// 					SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
		// 					VCores: to.Ptr[int32](16),
		// 					VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-999999999999"),
		// 				},
		// 				SKU: &armsql.SKU{
		// 					Name: to.Ptr("GP_Gen5"),
		// 					Capacity: to.Ptr[int32](16),
		// 					Family: to.Ptr("Gen5"),
		// 					Tier: to.Ptr("GeneralPurpose"),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2025-02-01-preview/ManagedInstanceTopQueriesList.json
func ExampleManagedInstancesClient_NewListByManagedInstancePager_obtainListOfInstanceSTopResourceConsumingQueries() {
	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.NewManagedInstancesClient().NewListByManagedInstancePager("sqlcrudtest-7398", "sqlcrudtest-4645", &armsql.ManagedInstancesClientListByManagedInstanceOptions{
		Interval:          to.Ptr(armsql.QueryTimeGrainTypePT1H),
		ObservationMetric: to.Ptr(armsql.MetricTypeDuration)})
	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.ManagedInstancesClientListByManagedInstanceResponse{
		// 	TopQueriesListResult: armsql.TopQueriesListResult{
		// 		Value: []*armsql.TopQueries{
		// 			{
		// 				AggregationFunction: to.Ptr("sum"),
		// 				EndTime: to.Ptr("03/05/2020 13:00:00"),
		// 				IntervalType: to.Ptr(armsql.QueryTimeGrainTypeP1D),
		// 				NumberOfQueries: to.Ptr[int32](5),
		// 				ObservationMetric: to.Ptr("cpu"),
		// 				Queries: []*armsql.QueryStatisticsProperties{
		// 					{
		// 						DatabaseName: to.Ptr("db1"),
		// 						Intervals: []*armsql.QueryMetricInterval{
		// 							{
		// 								ExecutionCount: to.Ptr[int64](1),
		// 								IntervalStartTime: to.Ptr("03/03/2020 00:00:00"),
		// 								Metrics: []*armsql.QueryMetricProperties{
		// 									{
		// 										Name: to.Ptr("cpu"),
		// 										DisplayName: to.Ptr("Cpu"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0.0015841714409722222),
		// 									},
		// 									{
		// 										Name: to.Ptr("io"),
		// 										DisplayName: to.Ptr("Physical Io Reads"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0.000004340277777777778),
		// 									},
		// 									{
		// 										Name: to.Ptr("logIo"),
		// 										DisplayName: to.Ptr("Log Writes"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0),
		// 									},
		// 									{
		// 										Name: to.Ptr("memory"),
		// 										DisplayName: to.Ptr("Memory consumption"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypeKB),
		// 										Value: to.Ptr[float64](8336),
		// 									},
		// 									{
		// 										Name: to.Ptr("duration"),
		// 										DisplayName: to.Ptr("Query duration"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds),
		// 										Value: to.Ptr[float64](11306905),
		// 									},
		// 								},
		// 							},
		// 						},
		// 						QueryID: to.Ptr("25"),
		// 					},
		// 					{
		// 						DatabaseName: to.Ptr("db1"),
		// 						Intervals: []*armsql.QueryMetricInterval{
		// 							{
		// 								ExecutionCount: to.Ptr[int64](1),
		// 								IntervalStartTime: to.Ptr("03/03/2020 00:00:00"),
		// 								Metrics: []*armsql.QueryMetricProperties{
		// 									{
		// 										Name: to.Ptr("cpu"),
		// 										DisplayName: to.Ptr("Cpu"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0.0009521432291666667),
		// 									},
		// 									{
		// 										Name: to.Ptr("io"),
		// 										DisplayName: to.Ptr("Physical Io Reads"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](2.3148148148148148e-7),
		// 									},
		// 									{
		// 										Name: to.Ptr("logIo"),
		// 										DisplayName: to.Ptr("Log Writes"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0),
		// 									},
		// 									{
		// 										Name: to.Ptr("memory"),
		// 										DisplayName: to.Ptr("Memory consumption"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypeKB),
		// 										Value: to.Ptr[float64](1024),
		// 									},
		// 									{
		// 										Name: to.Ptr("duration"),
		// 										DisplayName: to.Ptr("Query duration"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds),
		// 										Value: to.Ptr[float64](6620020),
		// 									},
		// 								},
		// 							},
		// 						},
		// 						QueryID: to.Ptr("21"),
		// 					},
		// 					{
		// 						DatabaseName: to.Ptr("db3"),
		// 						Intervals: []*armsql.QueryMetricInterval{
		// 							{
		// 								ExecutionCount: to.Ptr[int64](104),
		// 								IntervalStartTime: to.Ptr("03/04/2020 00:00:00"),
		// 								Metrics: []*armsql.QueryMetricProperties{
		// 									{
		// 										Name: to.Ptr("cpu"),
		// 										DisplayName: to.Ptr("Cpu"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0.0008006611689814815),
		// 									},
		// 									{
		// 										Name: to.Ptr("io"),
		// 										DisplayName: to.Ptr("Physical Io Reads"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0),
		// 									},
		// 									{
		// 										Name: to.Ptr("logIo"),
		// 										DisplayName: to.Ptr("Log Writes"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0),
		// 									},
		// 									{
		// 										Name: to.Ptr("memory"),
		// 										DisplayName: to.Ptr("Memory consumption"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypeKB),
		// 										Value: to.Ptr[float64](0),
		// 									},
		// 									{
		// 										Name: to.Ptr("duration"),
		// 										DisplayName: to.Ptr("Query duration"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds),
		// 										Value: to.Ptr[float64](5543088),
		// 									},
		// 								},
		// 							},
		// 						},
		// 						QueryID: to.Ptr("3"),
		// 					},
		// 					{
		// 						DatabaseName: to.Ptr("db2"),
		// 						Intervals: []*armsql.QueryMetricInterval{
		// 							{
		// 								ExecutionCount: to.Ptr[int64](89),
		// 								IntervalStartTime: to.Ptr("03/03/2020 00:00:00"),
		// 								Metrics: []*armsql.QueryMetricProperties{
		// 									{
		// 										Name: to.Ptr("cpu"),
		// 										DisplayName: to.Ptr("Cpu"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0.0006882543402777778),
		// 									},
		// 									{
		// 										Name: to.Ptr("io"),
		// 										DisplayName: to.Ptr("Physical Io Reads"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0),
		// 									},
		// 									{
		// 										Name: to.Ptr("logIo"),
		// 										DisplayName: to.Ptr("Log Writes"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0),
		// 									},
		// 									{
		// 										Name: to.Ptr("memory"),
		// 										DisplayName: to.Ptr("Memory consumption"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypeKB),
		// 										Value: to.Ptr[float64](0),
		// 									},
		// 									{
		// 										Name: to.Ptr("duration"),
		// 										DisplayName: to.Ptr("Query duration"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds),
		// 										Value: to.Ptr[float64](4761877),
		// 									},
		// 								},
		// 							},
		// 						},
		// 						QueryID: to.Ptr("3"),
		// 					},
		// 					{
		// 						DatabaseName: to.Ptr("db3"),
		// 						Intervals: []*armsql.QueryMetricInterval{
		// 							{
		// 								ExecutionCount: to.Ptr[int64](1),
		// 								IntervalStartTime: to.Ptr("03/04/2020 00:00:00"),
		// 								Metrics: []*armsql.QueryMetricProperties{
		// 									{
		// 										Name: to.Ptr("cpu"),
		// 										DisplayName: to.Ptr("Cpu"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0.0006220661168981482),
		// 									},
		// 									{
		// 										Name: to.Ptr("io"),
		// 										DisplayName: to.Ptr("Physical Io Reads"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0),
		// 									},
		// 									{
		// 										Name: to.Ptr("logIo"),
		// 										DisplayName: to.Ptr("Log Writes"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0),
		// 									},
		// 									{
		// 										Name: to.Ptr("memory"),
		// 										DisplayName: to.Ptr("Memory consumption"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypeKB),
		// 										Value: to.Ptr[float64](1024),
		// 									},
		// 									{
		// 										Name: to.Ptr("duration"),
		// 										DisplayName: to.Ptr("Query duration"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds),
		// 										Value: to.Ptr[float64](4454161),
		// 									},
		// 								},
		// 							},
		// 						},
		// 						QueryID: to.Ptr("22"),
		// 					},
		// 				},
		// 				StartTime: to.Ptr("03/01/2020 00:00:00"),
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2025-02-01-preview/ManagedInstanceTopQueriesListMax.json
func ExampleManagedInstancesClient_NewListByManagedInstancePager_obtainListOfInstanceSTopResourceConsumingQueriesFullBlownRequestAndResponse() {
	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.NewManagedInstancesClient().NewListByManagedInstancePager("sqlcrudtest-7398", "sqlcrudtest-4645", &armsql.ManagedInstancesClientListByManagedInstanceOptions{
		Databases:         to.Ptr("db1,db2"),
		EndTime:           to.Ptr("2020-03-12T12:00:00Z"),
		Interval:          to.Ptr(armsql.QueryTimeGrainTypeP1D),
		ObservationMetric: to.Ptr(armsql.MetricTypeCPU),
		StartTime:         to.Ptr("2020-03-10T12:00:00Z")})
	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.ManagedInstancesClientListByManagedInstanceResponse{
		// 	TopQueriesListResult: armsql.TopQueriesListResult{
		// 		Value: []*armsql.TopQueries{
		// 			{
		// 				AggregationFunction: to.Ptr("sum"),
		// 				EndTime: to.Ptr("03/12/2020 13:00:00"),
		// 				IntervalType: to.Ptr(armsql.QueryTimeGrainTypeP1D),
		// 				NumberOfQueries: to.Ptr[int32](5),
		// 				ObservationMetric: to.Ptr("cpu"),
		// 				Queries: []*armsql.QueryStatisticsProperties{
		// 					{
		// 						DatabaseName: to.Ptr("db1"),
		// 						Intervals: []*armsql.QueryMetricInterval{
		// 							{
		// 								ExecutionCount: to.Ptr[int64](1),
		// 								IntervalStartTime: to.Ptr("03/11/2020 00:00:00"),
		// 								Metrics: []*armsql.QueryMetricProperties{
		// 									{
		// 										Name: to.Ptr("cpu"),
		// 										DisplayName: to.Ptr("Cpu"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0.0015934667245370371),
		// 									},
		// 									{
		// 										Name: to.Ptr("io"),
		// 										DisplayName: to.Ptr("Physical Io Reads"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0.000004224537037037037),
		// 									},
		// 									{
		// 										Name: to.Ptr("logIo"),
		// 										DisplayName: to.Ptr("Log Writes"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0),
		// 									},
		// 									{
		// 										Name: to.Ptr("memory"),
		// 										DisplayName: to.Ptr("Memory consumption"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypeKB),
		// 										Value: to.Ptr[float64](8336),
		// 									},
		// 									{
		// 										Name: to.Ptr("duration"),
		// 										DisplayName: to.Ptr("Query duration"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds),
		// 										Value: to.Ptr[float64](11091296),
		// 									},
		// 								},
		// 							},
		// 						},
		// 						QueryID: to.Ptr("28"),
		// 					},
		// 					{
		// 						DatabaseName: to.Ptr("db1"),
		// 						Intervals: []*armsql.QueryMetricInterval{
		// 							{
		// 								ExecutionCount: to.Ptr[int64](1),
		// 								IntervalStartTime: to.Ptr("03/11/2020 00:00:00"),
		// 								Metrics: []*armsql.QueryMetricProperties{
		// 									{
		// 										Name: to.Ptr("cpu"),
		// 										DisplayName: to.Ptr("Cpu"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0.0009522783564814815),
		// 									},
		// 									{
		// 										Name: to.Ptr("io"),
		// 										DisplayName: to.Ptr("Physical Io Reads"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](1.7361111111111112e-7),
		// 									},
		// 									{
		// 										Name: to.Ptr("logIo"),
		// 										DisplayName: to.Ptr("Log Writes"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0),
		// 									},
		// 									{
		// 										Name: to.Ptr("memory"),
		// 										DisplayName: to.Ptr("Memory consumption"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypeKB),
		// 										Value: to.Ptr[float64](1024),
		// 									},
		// 									{
		// 										Name: to.Ptr("duration"),
		// 										DisplayName: to.Ptr("Query duration"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds),
		// 										Value: to.Ptr[float64](6625562),
		// 									},
		// 								},
		// 							},
		// 						},
		// 						QueryID: to.Ptr("24"),
		// 					},
		// 					{
		// 						DatabaseName: to.Ptr("db1"),
		// 						Intervals: []*armsql.QueryMetricInterval{
		// 							{
		// 								ExecutionCount: to.Ptr[int64](82),
		// 								IntervalStartTime: to.Ptr("03/11/2020 00:00:00"),
		// 								Metrics: []*armsql.QueryMetricProperties{
		// 									{
		// 										Name: to.Ptr("cpu"),
		// 										DisplayName: to.Ptr("Cpu"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0.0007183139467592593),
		// 									},
		// 									{
		// 										Name: to.Ptr("io"),
		// 										DisplayName: to.Ptr("Physical Io Reads"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0),
		// 									},
		// 									{
		// 										Name: to.Ptr("logIo"),
		// 										DisplayName: to.Ptr("Log Writes"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0),
		// 									},
		// 									{
		// 										Name: to.Ptr("memory"),
		// 										DisplayName: to.Ptr("Memory consumption"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypeKB),
		// 										Value: to.Ptr[float64](0),
		// 									},
		// 									{
		// 										Name: to.Ptr("duration"),
		// 										DisplayName: to.Ptr("Query duration"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds),
		// 										Value: to.Ptr[float64](4970199),
		// 									},
		// 								},
		// 							},
		// 						},
		// 						QueryID: to.Ptr("3"),
		// 					},
		// 					{
		// 						DatabaseName: to.Ptr("db1"),
		// 						Intervals: []*armsql.QueryMetricInterval{
		// 							{
		// 								ExecutionCount: to.Ptr[int64](1),
		// 								IntervalStartTime: to.Ptr("03/11/2020 00:00:00"),
		// 								Metrics: []*armsql.QueryMetricProperties{
		// 									{
		// 										Name: to.Ptr("cpu"),
		// 										DisplayName: to.Ptr("Cpu"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0.0006494454571759259),
		// 									},
		// 									{
		// 										Name: to.Ptr("io"),
		// 										DisplayName: to.Ptr("Physical Io Reads"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0.000005034722222222222),
		// 									},
		// 									{
		// 										Name: to.Ptr("logIo"),
		// 										DisplayName: to.Ptr("Log Writes"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0),
		// 									},
		// 									{
		// 										Name: to.Ptr("memory"),
		// 										DisplayName: to.Ptr("Memory consumption"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypeKB),
		// 										Value: to.Ptr[float64](1024),
		// 									},
		// 									{
		// 										Name: to.Ptr("duration"),
		// 										DisplayName: to.Ptr("Query duration"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds),
		// 										Value: to.Ptr[float64](4530668),
		// 									},
		// 								},
		// 							},
		// 						},
		// 						QueryID: to.Ptr("29"),
		// 					},
		// 					{
		// 						DatabaseName: to.Ptr("db2"),
		// 						Intervals: []*armsql.QueryMetricInterval{
		// 							{
		// 								ExecutionCount: to.Ptr[int64](1),
		// 								IntervalStartTime: to.Ptr("03/11/2020 00:00:00"),
		// 								Metrics: []*armsql.QueryMetricProperties{
		// 									{
		// 										Name: to.Ptr("cpu"),
		// 										DisplayName: to.Ptr("Cpu"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0.0006275368923611112),
		// 									},
		// 									{
		// 										Name: to.Ptr("io"),
		// 										DisplayName: to.Ptr("Physical Io Reads"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0),
		// 									},
		// 									{
		// 										Name: to.Ptr("logIo"),
		// 										DisplayName: to.Ptr("Log Writes"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage),
		// 										Value: to.Ptr[float64](0),
		// 									},
		// 									{
		// 										Name: to.Ptr("memory"),
		// 										DisplayName: to.Ptr("Memory consumption"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypeKB),
		// 										Value: to.Ptr[float64](1024),
		// 									},
		// 									{
		// 										Name: to.Ptr("duration"),
		// 										DisplayName: to.Ptr("Query duration"),
		// 										Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds),
		// 										Value: to.Ptr[float64](4349943),
		// 									},
		// 								},
		// 							},
		// 						},
		// 						QueryID: to.Ptr("25"),
		// 					},
		// 				},
		// 				StartTime: to.Ptr("03/10/2020 00:00:00"),
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2025-02-01-preview/ManagedInstanceTopQueriesListMin.json
func ExampleManagedInstancesClient_NewListByManagedInstancePager_obtainListOfInstanceSTopResourceConsumingQueriesMinimalRequestAndResponse() {
	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.NewManagedInstancesClient().NewListByManagedInstancePager("sqlcrudtest-7398", "sqlcrudtest-4645", 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.ManagedInstancesClientListByManagedInstanceResponse{
		// 	TopQueriesListResult: armsql.TopQueriesListResult{
		// 		Value: []*armsql.TopQueries{
		// 			{
		// 				AggregationFunction: to.Ptr("sum"),
		// 				EndTime: to.Ptr("03/11/2020 12:24:07"),
		// 				IntervalType: to.Ptr(armsql.QueryTimeGrainTypePT1H),
		// 				NumberOfQueries: to.Ptr[int32](5),
		// 				ObservationMetric: to.Ptr("cpu"),
		// 				Queries: []*armsql.QueryStatisticsProperties{
		// 				},
		// 				StartTime: to.Ptr("03/10/2020 12:00:00"),
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2025-02-01-preview/ManagedInstanceListByResourceGroup.json
func ExampleManagedInstancesClient_NewListByResourceGroupPager_listManagedInstancesByResourceGroup() {
	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.NewManagedInstancesClient().NewListByResourceGroupPager("Test1", 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.ManagedInstancesClientListByResourceGroupResponse{
		// 	ManagedInstanceListResult: armsql.ManagedInstanceListResult{
		// 		Value: []*armsql.ManagedInstance{
		// 			{
		// 				Name: to.Ptr("testinstance1"),
		// 				Type: to.Ptr("Microsoft.Sql/managedInstances"),
		// 				ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance1"),
		// 				Location: to.Ptr("japaneast"),
		// 				Properties: &armsql.ManagedInstanceProperties{
		// 					AdministratorLogin: to.Ptr("dummylogin"),
		// 					AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows),
		// 					Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
		// 					CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()),
		// 					CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022),
		// 					DNSZone: to.Ptr("1b4e2caff2530"),
		// 					ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled),
		// 					FullyQualifiedDomainName: to.Ptr("testinstance1.1b4e2caff2530.database.windows.net"),
		// 					HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive),
		// 					LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded),
		// 					MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"),
		// 					MinimalTLSVersion: to.Ptr("1.2"),
		// 					PricingModel: to.Ptr(armsql.PricingModelRegular),
		// 					ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded),
		// 					ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault),
		// 					PublicDataEndpointEnabled: to.Ptr(false),
		// 					RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					RequestedLogicalAvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne),
		// 					State: to.Ptr("Ready"),
		// 					StorageSizeInGB: to.Ptr[int32](1024),
		// 					SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
		// 					VCores: to.Ptr[int32](8),
		// 					VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-999999999999"),
		// 				},
		// 				SKU: &armsql.SKU{
		// 					Name: to.Ptr("GP_Gen5"),
		// 					Capacity: to.Ptr[int32](8),
		// 					Family: to.Ptr("Gen5"),
		// 					Tier: to.Ptr("GeneralPurpose"),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("testinstance2"),
		// 				Type: to.Ptr("Microsoft.Sql/managedInstances"),
		// 				ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance2"),
		// 				Location: to.Ptr("japaneast"),
		// 				Properties: &armsql.ManagedInstanceProperties{
		// 					AdministratorLogin: to.Ptr("dummylogin"),
		// 					AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows),
		// 					Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
		// 					CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()),
		// 					CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022),
		// 					DNSZone: to.Ptr("2c3d1bdae3412"),
		// 					ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled),
		// 					FullyQualifiedDomainName: to.Ptr("testinstance2.2c3d1bdae3412.database.windows.net"),
		// 					HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive),
		// 					LicenseType: to.Ptr(armsql.ManagedInstanceLicenseType("Full")),
		// 					MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"),
		// 					MinimalTLSVersion: to.Ptr("1.2"),
		// 					PricingModel: to.Ptr(armsql.PricingModelRegular),
		// 					ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded),
		// 					ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault),
		// 					PublicDataEndpointEnabled: to.Ptr(false),
		// 					RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					RequestedLogicalAvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne),
		// 					State: to.Ptr("Ready"),
		// 					StorageSizeInGB: to.Ptr[int32](1024),
		// 					SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/subnet2"),
		// 					VCores: to.Ptr[int32](16),
		// 					VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-444444444444"),
		// 				},
		// 				SKU: &armsql.SKU{
		// 					Name: to.Ptr("BC_Gen5"),
		// 					Capacity: to.Ptr[int32](16),
		// 					Family: to.Ptr("Gen5"),
		// 					Tier: to.Ptr("BusinessCritical"),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2025-02-01-preview/ManagedInstanceListByResourceGroupWithExpandEqualsAdministrators.json
func ExampleManagedInstancesClient_NewListByResourceGroupPager_listManagedInstancesByResourceGroupWithExpandAdministratorsActivedirectory() {
	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.NewManagedInstancesClient().NewListByResourceGroupPager("Test1", 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.ManagedInstancesClientListByResourceGroupResponse{
		// 	ManagedInstanceListResult: armsql.ManagedInstanceListResult{
		// 		Value: []*armsql.ManagedInstance{
		// 			{
		// 				Name: to.Ptr("testinstance1"),
		// 				Type: to.Ptr("Microsoft.Sql/managedInstances"),
		// 				ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance1"),
		// 				Location: to.Ptr("japaneast"),
		// 				Properties: &armsql.ManagedInstanceProperties{
		// 					AdministratorLogin: to.Ptr("dummylogin"),
		// 					Administrators: &armsql.ManagedInstanceExternalAdministrator{
		// 						AzureADOnlyAuthentication: to.Ptr(true),
		// 						Login: to.Ptr("bob@contoso.com"),
		// 						PrincipalType: to.Ptr(armsql.PrincipalTypeUser),
		// 						Sid: to.Ptr("00000011-1111-2222-2222-123456789111"),
		// 						TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"),
		// 					},
		// 					AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows),
		// 					Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
		// 					CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()),
		// 					CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022),
		// 					DNSZone: to.Ptr("1b4e2caff2530"),
		// 					ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled),
		// 					FullyQualifiedDomainName: to.Ptr("testinstance1.1b4e2caff2530.database.windows.net"),
		// 					HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive),
		// 					LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded),
		// 					MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"),
		// 					MinimalTLSVersion: to.Ptr("1.2"),
		// 					PricingModel: to.Ptr(armsql.PricingModelRegular),
		// 					ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded),
		// 					ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault),
		// 					PublicDataEndpointEnabled: to.Ptr(false),
		// 					RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					RequestedLogicalAvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne),
		// 					State: to.Ptr("Ready"),
		// 					StorageSizeInGB: to.Ptr[int32](1024),
		// 					SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
		// 					VCores: to.Ptr[int32](8),
		// 					VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-999999999999"),
		// 				},
		// 				SKU: &armsql.SKU{
		// 					Name: to.Ptr("GP_Gen5"),
		// 					Capacity: to.Ptr[int32](8),
		// 					Family: to.Ptr("Gen4"),
		// 					Tier: to.Ptr("GeneralPurpose"),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("testinstance2"),
		// 				Type: to.Ptr("Microsoft.Sql/managedInstances"),
		// 				ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance2"),
		// 				Location: to.Ptr("japaneast"),
		// 				Properties: &armsql.ManagedInstanceProperties{
		// 					AdministratorLogin: to.Ptr("dummylogin"),
		// 					Administrators: &armsql.ManagedInstanceExternalAdministrator{
		// 						AzureADOnlyAuthentication: to.Ptr(true),
		// 						Login: to.Ptr("bob@contoso.com"),
		// 						PrincipalType: to.Ptr(armsql.PrincipalTypeUser),
		// 						Sid: to.Ptr("00000011-1111-2222-2222-123456789111"),
		// 						TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"),
		// 					},
		// 					AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows),
		// 					Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
		// 					CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()),
		// 					CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022),
		// 					DNSZone: to.Ptr("2c3d1bdae3412"),
		// 					ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled),
		// 					FullyQualifiedDomainName: to.Ptr("testinstance2.2c3d1bdae3412.database.windows.net"),
		// 					HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive),
		// 					LicenseType: to.Ptr(armsql.ManagedInstanceLicenseType("Full")),
		// 					MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_2"),
		// 					MinimalTLSVersion: to.Ptr("1.2"),
		// 					PricingModel: to.Ptr(armsql.PricingModelRegular),
		// 					ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded),
		// 					ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault),
		// 					PublicDataEndpointEnabled: to.Ptr(false),
		// 					RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
		// 					RequestedLogicalAvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne),
		// 					State: to.Ptr("Ready"),
		// 					StorageSizeInGB: to.Ptr[int32](1024),
		// 					SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/subnet2"),
		// 					VCores: to.Ptr[int32](16),
		// 					VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-444444444444"),
		// 				},
		// 				SKU: &armsql.SKU{
		// 					Name: to.Ptr("BC_Gen5"),
		// 					Capacity: to.Ptr[int32](16),
		// 					Family: to.Ptr("Gen4"),
		// 					Tier: to.Ptr("BusinessCritical"),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2025-02-01-preview/ListOutboundNetworkDependenciesByManagedInstance.json
func ExampleManagedInstancesClient_NewListOutboundNetworkDependenciesByManagedInstancePager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsql.NewClientFactory("20d7082a-0fc7-4468-82bd-542694d5042b", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewManagedInstancesClient().NewListOutboundNetworkDependenciesByManagedInstancePager("sqlcrudtest-7398", "testinstance", 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.ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse{
		// 	OutboundEnvironmentEndpointCollection: armsql.OutboundEnvironmentEndpointCollection{
		// 		Value: []*armsql.OutboundEnvironmentEndpoint{
		// 			{
		// 				Category: to.Ptr("Azure SQL Database"),
		// 				Endpoints: []*armsql.EndpointDependency{
		// 					{
		// 						DomainName: to.Ptr("control.database.windows.net"),
		// 						EndpointDetails: []*armsql.EndpointDetail{
		// 							{
		// 								Port: to.Ptr[int32](443),
		// 							},
		// 						},
		// 					},
		// 					{
		// 						DomainName: to.Ptr("worker.database.windows.net"),
		// 						EndpointDetails: []*armsql.EndpointDetail{
		// 							{
		// 								Port: to.Ptr[int32](443),
		// 							},
		// 						},
		// 					},
		// 				},
		// 			},
		// 			{
		// 				Category: to.Ptr("Azure Storage"),
		// 				Endpoints: []*armsql.EndpointDependency{
		// 					{
		// 						DomainName: to.Ptr("blob.core.windows.net"),
		// 						EndpointDetails: []*armsql.EndpointDetail{
		// 							{
		// 								Port: to.Ptr[int32](443),
		// 							},
		// 						},
		// 					},
		// 					{
		// 						DomainName: to.Ptr("table.core.windows.net"),
		// 						EndpointDetails: []*armsql.EndpointDetail{
		// 							{
		// 								Port: to.Ptr[int32](443),
		// 							},
		// 						},
		// 					},
		// 				},
		// 			},
		// 			{
		// 				Category: to.Ptr("Service Bus"),
		// 				Endpoints: []*armsql.EndpointDependency{
		// 					{
		// 						DomainName: to.Ptr("servicebus.windows.net"),
		// 						EndpointDetails: []*armsql.EndpointDetail{
		// 							{
		// 								Port: to.Ptr[int32](443),
		// 							},
		// 						},
		// 					},
		// 				},
		// 			},
		// 			{
		// 				Category: to.Ptr("Certificate Verification"),
		// 				Endpoints: []*armsql.EndpointDependency{
		// 					{
		// 						DomainName: to.Ptr("dsms.core.windows.net"),
		// 						EndpointDetails: []*armsql.EndpointDetail{
		// 							{
		// 								Port: to.Ptr[int32](443),
		// 							},
		// 						},
		// 					},
		// 					{
		// 						DomainName: to.Ptr("dsts.core.windows.net"),
		// 						EndpointDetails: []*armsql.EndpointDetail{
		// 							{
		// 								Port: to.Ptr[int32](443),
		// 							},
		// 						},
		// 					},
		// 					{
		// 						DomainName: to.Ptr("login.windows.net"),
		// 						EndpointDetails: []*armsql.EndpointDetail{
		// 							{
		// 								Port: to.Ptr[int32](443),
		// 							},
		// 						},
		// 					},
		// 				},
		// 			},
		// 			{
		// 				Category: to.Ptr("Telemetry"),
		// 				Endpoints: []*armsql.EndpointDependency{
		// 					{
		// 						DomainName: to.Ptr("azurewatsonanalysis-prod.core.windows.net"),
		// 						EndpointDetails: []*armsql.EndpointDetail{
		// 							{
		// 								Port: to.Ptr[int32](443),
		// 							},
		// 						},
		// 					},
		// 					{
		// 						DomainName: to.Ptr("global.metrics.nsatc.net"),
		// 						EndpointDetails: []*armsql.EndpointDetail{
		// 							{
		// 								Port: to.Ptr[int32](443),
		// 							},
		// 						},
		// 					},
		// 					{
		// 						DomainName: to.Ptr("production.diagnostics.monitoring.core.windows.net"),
		// 						EndpointDetails: []*armsql.EndpointDetail{
		// 							{
		// 								Port: to.Ptr[int32](443),
		// 							},
		// 						},
		// 					},
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2025-02-01-preview/ManagedInstanceReevaluateInaccessibleDatabaseState.json
func ExampleManagedInstancesClient_BeginReevaluateInaccessibleDatabaseState() {
	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.NewManagedInstancesClient().BeginReevaluateInaccessibleDatabaseState(ctx, "testrg", "testinstance", 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.ManagedInstancesClientReevaluateInaccessibleDatabaseStateResponse{
	// }
}

// Generated from example definition: 2025-02-01-preview/ManagedInstanceRefreshExternalGovernanceStatus.json
func ExampleManagedInstancesClient_BeginRefreshStatus() {
	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.NewManagedInstancesClient().BeginRefreshStatus(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", 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.ManagedInstancesClientRefreshStatusResponse{
	// 	RefreshExternalGovernanceStatusOperationResultMI: armsql.RefreshExternalGovernanceStatusOperationResultMI{
	// 		Name: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"),
	// 		Type: to.Ptr("Microsoft.Sql/locations/refreshExternalGovernanceStatusMIOperationResults"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.Sql/locations/japaneast/refreshExternalGovernanceStatusMIOperationResults/9d9a794a-5cec-4f23-af70-d29511b522a4"),
	// 		Properties: &armsql.RefreshExternalGovernanceStatusOperationResultPropertiesMI{
	// 			ManagedInstanceName: to.Ptr("testsvr.database.windows.net"),
	// 			QueuedTime: to.Ptr("2/12/2022 8:33:27 PM"),
	// 			RequestID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 			RequestType: to.Ptr("UpdatePurviewMetadata"),
	// 			Status: to.Ptr("Completed"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/StartManagedInstance.json
func ExampleManagedInstancesClient_BeginStart() {
	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.NewManagedInstancesClient().BeginStart(ctx, "startrg", "mitostart", 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.ManagedInstancesClientStartResponse{
	// 	ManagedInstance: armsql.ManagedInstance{
	// 		Name: to.Ptr("mitostart"),
	// 		Type: to.Ptr("Microsoft.Sql/managedInstances"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/startrg/providers/Microsoft.Sql/managedInstances/mitostart"),
	// 		Location: to.Ptr("japaneast"),
	// 		Properties: &armsql.ManagedInstanceProperties{
	// 			AdministratorLogin: to.Ptr("dummylogin"),
	// 			AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022),
	// 			DNSZone: to.Ptr("1234567891234"),
	// 			ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled),
	// 			FullyQualifiedDomainName: to.Ptr("mitostart.1234567891234.database.windows.net"),
	// 			HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive),
	// 			InstancePoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/startrg/providers/Microsoft.Sql/instancePools/instancePool1"),
	// 			LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded),
	// 			MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"),
	// 			MinimalTLSVersion: to.Ptr("1.2"),
	// 			ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded),
	// 			ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault),
	// 			PublicDataEndpointEnabled: to.Ptr(false),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedLogicalAvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne),
	// 			ServicePrincipal: &armsql.ServicePrincipal{
	// 				Type: to.Ptr(armsql.ServicePrincipalTypeSystemAssigned),
	// 				ClientID: to.Ptr("00000011-1111-2222-2222-123456789111"),
	// 				PrincipalID: to.Ptr("00000011-1111-2222-2222-123456789111"),
	// 				TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"),
	// 			},
	// 			State: to.Ptr("Ready"),
	// 			StorageSizeInGB: to.Ptr[int32](1024),
	// 			SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/startrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
	// 			VCores: to.Ptr[int32](8),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("GP_Gen5"),
	// 			Capacity: to.Ptr[int32](8),
	// 			Family: to.Ptr("Gen5"),
	// 			Tier: to.Ptr("GeneralPurpose"),
	// 		},
	// 		Tags: map[string]*string{
	// 			"key": to.Ptr("value"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/StopManagedInstance.json
func ExampleManagedInstancesClient_BeginStop() {
	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.NewManagedInstancesClient().BeginStop(ctx, "stoprg", "mitostop", 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.ManagedInstancesClientStopResponse{
	// 	ManagedInstance: armsql.ManagedInstance{
	// 		Name: to.Ptr("mitostop"),
	// 		Type: to.Ptr("Microsoft.Sql/managedInstances"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/stoprg/providers/Microsoft.Sql/managedInstances/mitostop"),
	// 		Location: to.Ptr("japaneast"),
	// 		Properties: &armsql.ManagedInstanceProperties{
	// 			AdministratorLogin: to.Ptr("dummylogin"),
	// 			AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022),
	// 			DNSZone: to.Ptr("1234567891234"),
	// 			ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled),
	// 			FullyQualifiedDomainName: to.Ptr("mitostop.1234567891234.database.windows.net"),
	// 			HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive),
	// 			InstancePoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/stoprg/providers/Microsoft.Sql/instancePools/instancePool1"),
	// 			LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded),
	// 			MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"),
	// 			MinimalTLSVersion: to.Ptr("1.2"),
	// 			ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded),
	// 			ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault),
	// 			PublicDataEndpointEnabled: to.Ptr(false),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedLogicalAvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne),
	// 			ServicePrincipal: &armsql.ServicePrincipal{
	// 				Type: to.Ptr(armsql.ServicePrincipalTypeSystemAssigned),
	// 				ClientID: to.Ptr("00000011-1111-2222-2222-123456789111"),
	// 				PrincipalID: to.Ptr("00000011-1111-2222-2222-123456789111"),
	// 				TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"),
	// 			},
	// 			State: to.Ptr("Stopped"),
	// 			StorageSizeInGB: to.Ptr[int32](1024),
	// 			SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/stoprg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
	// 			VCores: to.Ptr[int32](8),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("GP_Gen5"),
	// 			Capacity: to.Ptr[int32](8),
	// 			Family: to.Ptr("Gen5"),
	// 			Tier: to.Ptr("GeneralPurpose"),
	// 		},
	// 		Tags: map[string]*string{
	// 			"key": to.Ptr("value"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/ManagedInstanceRemoveMaintenanceConfiguration.json
func ExampleManagedInstancesClient_BeginUpdate_removeMaintenancePolicyFromManagedInstanceSelectDefaultMaintenancePolicy() {
	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.NewManagedInstancesClient().BeginUpdate(ctx, "testrg", "testinstance", armsql.ManagedInstanceUpdate{
		Properties: &armsql.ManagedInstanceProperties{
			MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"),
		},
	}, 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.ManagedInstancesClientUpdateResponse{
	// 	ManagedInstance: armsql.ManagedInstance{
	// 		Name: to.Ptr("testinstance"),
	// 		Type: to.Ptr("Microsoft.Sql/managedInstances"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance"),
	// 		Location: to.Ptr("japaneast"),
	// 		Properties: &armsql.ManagedInstanceProperties{
	// 			AdministratorLogin: to.Ptr("dummylogin"),
	// 			AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022),
	// 			DNSZone: to.Ptr("1b4e2caff2530"),
	// 			ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled),
	// 			FullyQualifiedDomainName: to.Ptr("testinstance.1b4e2caff2530.database.windows.net"),
	// 			HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive),
	// 			InstancePoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/instancePool1"),
	// 			LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded),
	// 			MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"),
	// 			ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault),
	// 			PublicDataEndpointEnabled: to.Ptr(false),
	// 			RequestedLogicalAvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne),
	// 			State: to.Ptr("Ready"),
	// 			StorageSizeInGB: to.Ptr[int32](1024),
	// 			SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
	// 			VCores: to.Ptr[int32](8),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("GP_Gen5"),
	// 			Capacity: to.Ptr[int32](8),
	// 			Family: to.Ptr("Gen4"),
	// 			Tier: to.Ptr("GeneralPurpose"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/ManagedInstanceUpdateMax.json
func ExampleManagedInstancesClient_BeginUpdate_updateManagedInstanceWithAllProperties() {
	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.NewManagedInstancesClient().BeginUpdate(ctx, "testrg", "testinstance", armsql.ManagedInstanceUpdate{
		Properties: &armsql.ManagedInstanceProperties{
			AdministratorLogin:               to.Ptr("dummylogin"),
			AdministratorLoginPassword:       to.Ptr("PLACEHOLDER"),
			AuthenticationMetadata:           to.Ptr(armsql.AuthMetadataLookupModesWindows),
			Collation:                        to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
			DatabaseFormat:                   to.Ptr(armsql.ManagedInstanceDatabaseFormatAlwaysUpToDate),
			HybridSecondaryUsage:             to.Ptr(armsql.HybridSecondaryUsagePassive),
			LicenseType:                      to.Ptr(armsql.ManagedInstanceLicenseTypeBasePrice),
			MaintenanceConfigurationID:       to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"),
			MinimalTLSVersion:                to.Ptr("1.2"),
			ProxyOverride:                    to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect),
			PublicDataEndpointEnabled:        to.Ptr(false),
			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
			RequestedLogicalAvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne),
			StorageSizeInGB:                  to.Ptr[int32](448),
			VCores:                           to.Ptr[int32](8),
		},
		SKU: &armsql.SKU{
			Name:     to.Ptr("GP_Gen5"),
			Capacity: to.Ptr[int32](8),
			Tier:     to.Ptr("GeneralPurpose"),
		},
		Tags: map[string]*string{
			"tagKey1": to.Ptr("TagValue1"),
		},
	}, 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.ManagedInstancesClientUpdateResponse{
	// 	ManagedInstance: armsql.ManagedInstance{
	// 		Name: to.Ptr("testinstance"),
	// 		Type: to.Ptr("Microsoft.Sql/managedInstances"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance"),
	// 		Location: to.Ptr("japaneast"),
	// 		Properties: &armsql.ManagedInstanceProperties{
	// 			AdministratorLogin: to.Ptr("dummylogin"),
	// 			AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatAlwaysUpToDate),
	// 			DNSZone: to.Ptr("1b4e2caff2530"),
	// 			ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled),
	// 			FullyQualifiedDomainName: to.Ptr("testinstance.1b4e2caff2530.database.windows.net"),
	// 			HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive),
	// 			InstancePoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/instancePool1"),
	// 			LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeBasePrice),
	// 			MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"),
	// 			MinimalTLSVersion: to.Ptr("1.2"),
	// 			ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect),
	// 			PublicDataEndpointEnabled: to.Ptr(false),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedLogicalAvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne),
	// 			State: to.Ptr("Ready"),
	// 			StorageSizeInGB: to.Ptr[int32](448),
	// 			SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
	// 			VCores: to.Ptr[int32](8),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("GP_Gen5"),
	// 			Capacity: to.Ptr[int32](8),
	// 			Family: to.Ptr("Gen4"),
	// 			Tier: to.Ptr("GeneralPurpose"),
	// 		},
	// 		Tags: map[string]*string{
	// 			"tagKey1": to.Ptr("TagValue1"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/ManagedInstanceUpdateMin.json
func ExampleManagedInstancesClient_BeginUpdate_updateManagedInstanceWithMinimalProperties() {
	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.NewManagedInstancesClient().BeginUpdate(ctx, "testrg", "testinstance", armsql.ManagedInstanceUpdate{
		Tags: map[string]*string{
			"tagKey1": to.Ptr("TagValue1"),
		},
	}, 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.ManagedInstancesClientUpdateResponse{
	// 	ManagedInstance: armsql.ManagedInstance{
	// 		Name: to.Ptr("testinstance"),
	// 		Type: to.Ptr("Microsoft.Sql/managedInstances"),
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance"),
	// 		Location: to.Ptr("japaneast"),
	// 		Properties: &armsql.ManagedInstanceProperties{
	// 			AdministratorLogin: to.Ptr("PLACEHOLDER"),
	// 			AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows),
	// 			Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
	// 			CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022),
	// 			DNSZone: to.Ptr("1b4e2caff2530"),
	// 			ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled),
	// 			FullyQualifiedDomainName: to.Ptr("testinstance.1b4e2caff2530.database.windows.net"),
	// 			HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive),
	// 			InstancePoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/instancePool1"),
	// 			LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded),
	// 			MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"),
	// 			ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault),
	// 			PublicDataEndpointEnabled: to.Ptr(false),
	// 			RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo),
	// 			RequestedLogicalAvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne),
	// 			State: to.Ptr("Ready"),
	// 			StorageSizeInGB: to.Ptr[int32](1024),
	// 			SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
	// 			VCores: to.Ptr[int32](8),
	// 		},
	// 		SKU: &armsql.SKU{
	// 			Name: to.Ptr("GP_Gen5"),
	// 			Capacity: to.Ptr[int32](8),
	// 			Family: to.Ptr("Gen4"),
	// 			Tier: to.Ptr("GeneralPurpose"),
	// 		},
	// 		Tags: map[string]*string{
	// 			"tagKey1": to.Ptr("TagValue1"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-02-01-preview/ManagedInstancValidateAzureKeyVaultEncryptionKey.json
func ExampleManagedInstancesClient_BeginValidateAzureKeyVaultEncryptionKey() {
	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.NewManagedInstancesClient().BeginValidateAzureKeyVaultEncryptionKey(ctx, "testrg", "testinstance", armsql.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest{
		TdeKeyURI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to 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.ManagedInstancesClientValidateAzureKeyVaultEncryptionKeyResponse{
	// }
}
