//go:build go1.18
// +build go1.18

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
// DO NOT EDIT.

package armappcomplianceautomation_test

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation"
)

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_CheckNameAvailability.json
func ExampleProviderActionsClient_CheckNameAvailability() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewProviderActionsClient().CheckNameAvailability(ctx, armappcomplianceautomation.CheckNameAvailabilityRequest{}, 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.CheckNameAvailabilityResponse = armappcomplianceautomation.CheckNameAvailabilityResponse{
	// 	Message: to.Ptr("An report named 'reportABC' is already in use."),
	// 	NameAvailable: to.Ptr(false),
	// 	Reason: to.Ptr(armappcomplianceautomation.CheckNameAvailabilityReasonAlreadyExists),
	// }
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_GetCollectionCount.json
func ExampleProviderActionsClient_GetCollectionCount() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewProviderActionsClient().GetCollectionCount(ctx, armappcomplianceautomation.GetCollectionCountRequest{}, 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.GetCollectionCountResponse = armappcomplianceautomation.GetCollectionCountResponse{
	// 	Count: to.Ptr[int32](100),
	// }
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_GetOverviewStatus.json
func ExampleProviderActionsClient_GetOverviewStatus() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewProviderActionsClient().GetOverviewStatus(ctx, armappcomplianceautomation.GetOverviewStatusRequest{}, 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.GetOverviewStatusResponse = armappcomplianceautomation.GetOverviewStatusResponse{
	// 	StatusList: []*armappcomplianceautomation.StatusItem{
	// 		{
	// 			StatusName: to.Ptr("Active"),
	// 			StatusValue: to.Ptr("100"),
	// 		},
	// 		{
	// 			StatusName: to.Ptr("Failed"),
	// 			StatusValue: to.Ptr("0"),
	// 		},
	// 		{
	// 			StatusName: to.Ptr("Disabled"),
	// 			StatusValue: to.Ptr("0"),
	// 	}},
	// }
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/ListInUseStorageAccountsWithSubscriptions.json
func ExampleProviderActionsClient_ListInUseStorageAccounts_listInUseStorageAccountsWithSubscriptions() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewProviderActionsClient().ListInUseStorageAccounts(ctx, armappcomplianceautomation.ListInUseStorageAccountsRequest{}, 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.ListInUseStorageAccountsResponse = armappcomplianceautomation.ListInUseStorageAccountsResponse{
	// 	StorageAccountList: []*armappcomplianceautomation.StorageInfo{
	// 		{
	// 			AccountName: to.Ptr("SA_name1"),
	// 			Location: to.Ptr("WEST US"),
	// 			ResourceGroup: to.Ptr("tetsRG"),
	// 			SubscriptionID: to.Ptr("0000000-0000-0000-0000-000000000001"),
	// 		},
	// 		{
	// 			AccountName: to.Ptr("SA_name2"),
	// 			Location: to.Ptr("WEST US"),
	// 			ResourceGroup: to.Ptr("tetsRG"),
	// 			SubscriptionID: to.Ptr("0000000-0000-0000-0000-000000000001"),
	// 	}},
	// }
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/ListInUseStorageAccountsWithoutSubscriptions.json
func ExampleProviderActionsClient_ListInUseStorageAccounts_listInUseStorageAccountsWithoutSubscriptions() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewProviderActionsClient().ListInUseStorageAccounts(ctx, armappcomplianceautomation.ListInUseStorageAccountsRequest{}, 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.ListInUseStorageAccountsResponse = armappcomplianceautomation.ListInUseStorageAccountsResponse{
	// 	StorageAccountList: []*armappcomplianceautomation.StorageInfo{
	// 		{
	// 			AccountName: to.Ptr("SA_name1"),
	// 			Location: to.Ptr("WEST US"),
	// 			ResourceGroup: to.Ptr("tetsRG"),
	// 			SubscriptionID: to.Ptr("0000000-0000-0000-0000-000000000001"),
	// 		},
	// 		{
	// 			AccountName: to.Ptr("SA_name2"),
	// 			Location: to.Ptr("WEST US"),
	// 			ResourceGroup: to.Ptr("tetsRG"),
	// 			SubscriptionID: to.Ptr("0000000-0000-0000-0000-000000000001"),
	// 	}},
	// }
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Onboard.json
func ExampleProviderActionsClient_BeginOnboard() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewProviderActionsClient().BeginOnboard(ctx, armappcomplianceautomation.OnboardRequest{}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.OnboardResponse = armappcomplianceautomation.OnboardResponse{
	// 	SubscriptionIDs: []*string{
	// 		to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		to.Ptr("00000000-0000-0000-0000-000000000001")},
	// 	}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/TriggerEvaluation.json
func ExampleProviderActionsClient_BeginTriggerEvaluation() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewProviderActionsClient().BeginTriggerEvaluation(ctx, armappcomplianceautomation.TriggerEvaluationRequest{}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.TriggerEvaluationResponse = armappcomplianceautomation.TriggerEvaluationResponse{
	// 	Properties: &armappcomplianceautomation.TriggerEvaluationProperty{
	// 		EvaluationEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T05:10:00.000Z"); return t}()),
	// 		QuickAssessments: []*armappcomplianceautomation.QuickAssessment{
	// 			{
	// 				Description: to.Ptr("Protect your storage accounts from potential threats using virtual network rules as a preferred method instead of IP-based filtering. Disabling IP-based filtering prevents public IPs from accessing your storage accounts."),
	// 				DisplayName: to.Ptr("Storage accounts should restrict network access using virtual network rules"),
	// 				RemediationLink: to.Ptr("Protect your storage accounts from potential threats using virtual network rules as a preferred method instead of IP-based filtering. Disabling IP-based filtering prevents public IPs from accessing your storage accounts."),
	// 				ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storettas3iw2megtcarm"),
	// 				ResourceStatus: to.Ptr(armappcomplianceautomation.ResourceStatusHealthy),
	// 				ResponsibilityID: to.Ptr("/providers/microsoft.authorization/policydefinitions/2a1a9cdf-e04d-429a-8416-3bfb72a1b26f"),
	// 				Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T05:00:00.000Z"); return t}()),
	// 			},
	// 			{
	// 				Description: to.Ptr(""),
	// 				DisplayName: to.Ptr("Secure transfer to storage accounts should be enabled"),
	// 				RemediationLink: to.Ptr(""),
	// 				ResourceID: to.Ptr("/subscriptions/0000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storettas3iw2megtcarm"),
	// 				ResourceStatus: to.Ptr(armappcomplianceautomation.ResourceStatusUnhealthy),
	// 				ResponsibilityID: to.Ptr("/providers/Microsoft.Authorization/policyDefinitions/404c3081-a854-4457-ae30-26a93ef643f9"),
	// 				Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T05:00:00.000Z"); return t}()),
	// 		}},
	// 		ResourceIDs: []*string{
	// 			to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storettas3iw2megtcarm")},
	// 			TriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T05:00:00.000Z"); return t}()),
	// 		},
	// 	}
}
