// 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 armapplicationinsights_test

import (
	"context"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights/v2"
	"log"
)

// Generated from example definition: 2024-02-01-preview/DeletedWorkbooksList.json
func ExampleDeletedWorkbooksClient_NewListBySubscriptionPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDeletedWorkbooksClient().NewListBySubscriptionPager(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 = armapplicationinsights.DeletedWorkbooksClientListBySubscriptionResponse{
		// 	DeletedWorkbooksListResult: armapplicationinsights.DeletedWorkbooksListResult{
		// 		Value: []*armapplicationinsights.DeletedWorkbook{
		// 			{
		// 				Name: to.Ptr("55555555-6666-7777-8888-999999999999"),
		// 				Type: to.Ptr("Microsoft.Insights/workbooks"),
		// 				ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/my-resource-group/providers/Microsoft.Insights/workbooks/55555555-6666-7777-8888-999999999999"),
		// 				Kind: to.Ptr(armapplicationinsights.WorkbookSharedTypeKindShared),
		// 				Location: to.Ptr("westus"),
		// 				Properties: &armapplicationinsights.DeletedWorkbookProperties{
		// 					Description: to.Ptr("Sample workbook1"),
		// 					Category: to.Ptr("workbook"),
		// 					DisplayName: to.Ptr("Workbook 1"),
		// 					Revision: to.Ptr("12345678901234567890123456789010"),
		// 					SerializedData: nil,
		// 					SourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/my-resource-group/providers/Microsoft.Web/sites/MyApp1"),
		// 					StorageURI: nil,
		// 					TimeModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T09:07:00.123456Z"); return t}()),
		// 					UserID: to.Ptr("userId"),
		// 					Version: to.Ptr("Notebook/1.0"),
		// 				},
		// 				Tags: map[string]*string{
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("55555555-6666-7777-8888-999999999998"),
		// 				Type: to.Ptr("Microsoft.Insights/workbooks"),
		// 				ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/my-resource-group2/providers/Microsoft.Insights/workbooks/55555555-6666-7777-8888-999999999998"),
		// 				Kind: to.Ptr(armapplicationinsights.WorkbookSharedTypeKindShared),
		// 				Location: to.Ptr("westus"),
		// 				Properties: &armapplicationinsights.DeletedWorkbookProperties{
		// 					Description: to.Ptr("Sample workbook2"),
		// 					Category: to.Ptr("workbook"),
		// 					DisplayName: to.Ptr("Workbook 2"),
		// 					Revision: to.Ptr("12345678901234567890123456789011"),
		// 					SerializedData: nil,
		// 					SourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/my-resource-group2/providers/Microsoft.Web/sites/MyApp2"),
		// 					StorageURI: nil,
		// 					TimeModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-04T09:07:01.123456Z"); return t}()),
		// 					UserID: to.Ptr("userId"),
		// 					Version: to.Ptr("Notebook/1.0"),
		// 				},
		// 				Tags: map[string]*string{
		// 					"TagSample01": to.Ptr("sample01"),
		// 					"TagSample02": to.Ptr("sample02"),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}
