// 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 armpanngfw_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/paloaltonetworksngfw/armpanngfw/v2"
	"log"
)

// Generated from example definition: 2025-10-08/MetricsObjectFirewall_CreateOrUpdate_MaximumSet_Gen.json
func ExampleMetricsObjectFirewallClient_BeginCreateOrUpdate_metricsObjectFirewallCreateOrUpdateMaximumSetGen() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpanngfw.NewClientFactory("aaaaaaa", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewMetricsObjectFirewallClient().BeginCreateOrUpdate(ctx, "rgopenapi", "aaaaaaaaaaaaaaaaaaaaaaaa", armpanngfw.MetricsObjectFirewallResource{
		Properties: &armpanngfw.MetricsObject{
			ApplicationInsightsConnectionString: to.Ptr("aaa"),
			ApplicationInsightsResourceID:       to.Ptr("aaaaaaaaaaaaaaa"),
			PanEtag:                             to.Ptr("aaaaaaaaaa"),
		},
	}, 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 = armpanngfw.MetricsObjectFirewallClientCreateOrUpdateResponse{
	// 	MetricsObjectFirewallResource: armpanngfw.MetricsObjectFirewallResource{
	// 		Name: to.Ptr("aaaaaaaaaaaaaaaaaa"),
	// 		Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"),
	// 		ID: to.Ptr("aaaaaaaaaaaa"),
	// 		Properties: &armpanngfw.MetricsObject{
	// 			ApplicationInsightsConnectionString: to.Ptr("aaa"),
	// 			ApplicationInsightsResourceID: to.Ptr("aaaaaaaaaaaaaaa"),
	// 			PanEtag: to.Ptr("aaaaaaaaaa"),
	// 			ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateAccepted),
	// 		},
	// 		SystemData: &armpanngfw.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-07-04T09:21:06.704Z"); return t}()),
	// 			CreatedBy: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"),
	// 			CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-07-04T09:21:06.704Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("aaaaaaaaaaa"),
	// 			LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-10-08/MetricsObjectFirewall_CreateOrUpdate_MinimumSet_Gen.json
func ExampleMetricsObjectFirewallClient_BeginCreateOrUpdate_metricsObjectFirewallCreateOrUpdateMinimumSetGen() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpanngfw.NewClientFactory("aaaaaaa", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewMetricsObjectFirewallClient().BeginCreateOrUpdate(ctx, "rgopenapi", "aaaaaaaaaaaaaaaaaaaaaaaa", armpanngfw.MetricsObjectFirewallResource{
		Properties: &armpanngfw.MetricsObject{
			ApplicationInsightsConnectionString: to.Ptr("aaa"),
			ApplicationInsightsResourceID:       to.Ptr("aaaaaaaaaaaaaaa"),
		},
	}, 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 = armpanngfw.MetricsObjectFirewallClientCreateOrUpdateResponse{
	// 	MetricsObjectFirewallResource: armpanngfw.MetricsObjectFirewallResource{
	// 		ID: to.Ptr("aaaaaaaaaaaa"),
	// 		Properties: &armpanngfw.MetricsObject{
	// 			ApplicationInsightsConnectionString: to.Ptr("aaa"),
	// 			ApplicationInsightsResourceID: to.Ptr("aaaaaaaaaaaaaaa"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-10-08/MetricsObjectFirewall_Delete_MaximumSet_Gen.json
func ExampleMetricsObjectFirewallClient_BeginDelete_metricsObjectFirewallDeleteMaximumSetGen() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpanngfw.NewClientFactory("aaaaaaa", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewMetricsObjectFirewallClient().BeginDelete(ctx, "rgopenapi", "aaaaaaaaaaaaaaaaaaaaaaaa", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to poll the result: %v", err)
	}
}

// Generated from example definition: 2025-10-08/MetricsObjectFirewall_Delete_MinimumSet_Gen.json
func ExampleMetricsObjectFirewallClient_BeginDelete_metricsObjectFirewallDeleteMinimumSetGen() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpanngfw.NewClientFactory("aaaaaaa", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewMetricsObjectFirewallClient().BeginDelete(ctx, "rgopenapi", "aaaaaaaaaaaaaaaaaaaaaaaa", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to poll the result: %v", err)
	}
}

// Generated from example definition: 2025-10-08/MetricsObjectFirewall_Get_MaximumSet_Gen.json
func ExampleMetricsObjectFirewallClient_Get_metricsObjectFirewallGetMaximumSetGen() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpanngfw.NewClientFactory("aaaaaaa", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewMetricsObjectFirewallClient().Get(ctx, "rgopenapi", "aaaaaaaaaaaaaaaaaaaaaaaa", 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 = armpanngfw.MetricsObjectFirewallClientGetResponse{
	// 	MetricsObjectFirewallResource: armpanngfw.MetricsObjectFirewallResource{
	// 		Name: to.Ptr("aaaaaaaaaaaaaaaaaa"),
	// 		Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"),
	// 		ID: to.Ptr("aaaaaaaaaaaa"),
	// 		Properties: &armpanngfw.MetricsObject{
	// 			ApplicationInsightsConnectionString: to.Ptr("aaa"),
	// 			ApplicationInsightsResourceID: to.Ptr("aaaaaaaaaaaaaaa"),
	// 			PanEtag: to.Ptr("aaaaaaaaaa"),
	// 			ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateAccepted),
	// 		},
	// 		SystemData: &armpanngfw.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-07-04T09:21:06.704Z"); return t}()),
	// 			CreatedBy: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"),
	// 			CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-07-04T09:21:06.704Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("aaaaaaaaaaa"),
	// 			LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-10-08/MetricsObjectFirewall_Get_MinimumSet_Gen.json
func ExampleMetricsObjectFirewallClient_Get_metricsObjectFirewallGetMinimumSetGen() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpanngfw.NewClientFactory("aaaaaaa", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewMetricsObjectFirewallClient().Get(ctx, "rgopenapi", "aaaaaaaaaaaaaaaaaaaaaaaa", 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 = armpanngfw.MetricsObjectFirewallClientGetResponse{
	// 	MetricsObjectFirewallResource: armpanngfw.MetricsObjectFirewallResource{
	// 		ID: to.Ptr("aaaaaaaaaaaa"),
	// 		Properties: &armpanngfw.MetricsObject{
	// 			ApplicationInsightsConnectionString: to.Ptr("aaa"),
	// 			ApplicationInsightsResourceID: to.Ptr("aaaaaaaaaaaaaaa"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-10-08/MetricsObjectFirewall_ListByFirewalls_MaximumSet_Gen.json
func ExampleMetricsObjectFirewallClient_NewListByFirewallsPager_metricsObjectFirewallListByFirewallsMaximumSetGen() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpanngfw.NewClientFactory("aaaaaaaaaaaaaaaaaaaaaaaaa", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewMetricsObjectFirewallClient().NewListByFirewallsPager("rgopenapi", "IFTDk", 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 = armpanngfw.MetricsObjectFirewallClientListByFirewallsResponse{
		// 	MetricsObjectFirewallResourceListResult: armpanngfw.MetricsObjectFirewallResourceListResult{
		// 		NextLink: to.Ptr("https://management.azure.com/subscriptions/aaaaaaaaaaaaaaaaaaaaaaaaa/resourceGroups/rgopenapi/providers/PaloAltoNetworks.Cloudngfw/firewalls/firewall1/metrics?api-version=2025-10-08&$skiptoken=xyz"),
		// 		Value: []*armpanngfw.MetricsObjectFirewallResource{
		// 			{
		// 				Name: to.Ptr("aaaaaa"),
		// 				Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"),
		// 				ID: to.Ptr("aaaaaaa"),
		// 				Properties: &armpanngfw.MetricsObject{
		// 					ApplicationInsightsConnectionString: to.Ptr("aaaaaaaaa"),
		// 					ApplicationInsightsResourceID: to.Ptr("aaaaaaaaaa"),
		// 					PanEtag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"),
		// 					ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateAccepted),
		// 				},
		// 				SystemData: &armpanngfw.SystemData{
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-07-17T09:12:09.452Z"); return t}()),
		// 					CreatedBy: to.Ptr("aaaaaaaaaaaaaaa"),
		// 					CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-07-17T09:12:09.452Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"),
		// 					LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2025-10-08/MetricsObjectFirewall_ListByFirewalls_MinimumSet_Gen.json
func ExampleMetricsObjectFirewallClient_NewListByFirewallsPager_metricsObjectFirewallListByFirewallsMinimumSetGen() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpanngfw.NewClientFactory("aaaaaaaaaaaaaaaaaaaaaaaaa", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewMetricsObjectFirewallClient().NewListByFirewallsPager("rgopenapi", "IFTDk", 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 = armpanngfw.MetricsObjectFirewallClientListByFirewallsResponse{
		// 	MetricsObjectFirewallResourceListResult: armpanngfw.MetricsObjectFirewallResourceListResult{
		// 		Value: []*armpanngfw.MetricsObjectFirewallResource{
		// 			{
		// 				ID: to.Ptr("aaaaaaaaaaaa"),
		// 				Properties: &armpanngfw.MetricsObject{
		// 					ApplicationInsightsConnectionString: to.Ptr("aaaaaaaaa"),
		// 					ApplicationInsightsResourceID: to.Ptr("aaaaaaaaaa"),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}
