// 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 armcosmos_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/cosmos/armcosmos/v4"
	"log"
)

// Generated from example definition: 2026-03-15/CosmosDBRestorableGremlinResourceList.json
func ExampleRestorableGremlinResourcesClient_NewListPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcosmos.NewClientFactory("2296c272-5d55-40d9-bc05-4d56dc2d7588", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewRestorableGremlinResourcesClient().NewListPager("WestUS", "d9b26648-2f53-4541-b3d8-3044f4f9810d", &armcosmos.RestorableGremlinResourcesClientListOptions{
		RestoreLocation:       to.Ptr("WestUS"),
		RestoreTimestampInUTC: to.Ptr("06/01/2022 4:56")})
	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 = armcosmos.RestorableGremlinResourcesClientListResponse{
		// 	RestorableGremlinResourcesListResult: armcosmos.RestorableGremlinResourcesListResult{
		// 		Value: []*armcosmos.RestorableGremlinResourcesGetResult{
		// 			{
		// 				ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorableGremlinResources/Database1"),
		// 				Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableGremlinResources"),
		// 				Name: to.Ptr("Database1"),
		// 				DatabaseName: to.Ptr("Database1"),
		// 				GraphNames: []*string{
		// 					to.Ptr("Graph1"),
		// 				},
		// 			},
		// 			{
		// 				ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorableGremlinResources/Database2"),
		// 				Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableGremlinResources"),
		// 				Name: to.Ptr("Database2"),
		// 				DatabaseName: to.Ptr("Database2"),
		// 				GraphNames: []*string{
		// 					to.Ptr("Graph1"),
		// 					to.Ptr("Graph2"),
		// 				},
		// 			},
		// 			{
		// 				ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorableGremlinResources/Database3"),
		// 				Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableGremlinResources"),
		// 				Name: to.Ptr("Database3"),
		// 				DatabaseName: to.Ptr("Database3"),
		// 				GraphNames: []*string{
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}
