// 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 armedgeorder_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/edgeorder/armedgeorder/v2"
	"log"
)

// Generated from example definition: 2024-02-01/CancelOrderItem.json
func ExampleOrderItemsClient_Cancel() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armedgeorder.NewClientFactory("eb5dc900-6186-49d8-b7d7-febd866fdc1d", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewOrderItemsClient().Cancel(ctx, "YourResourceGroupName", "TestOrderItemName3", armedgeorder.CancellationReason{
		Reason: to.Ptr("Order cancelled"),
	}, 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 = armedgeorder.OrderItemsClientCancelResponse{
	// }
}

// Generated from example definition: 2024-02-01/CreateOrderItem.json
func ExampleOrderItemsClient_BeginCreate() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armedgeorder.NewClientFactory("eb5dc900-6186-49d8-b7d7-febd866fdc1d", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewOrderItemsClient().BeginCreate(ctx, "YourResourceGroupName", "TestOrderItemName2", armedgeorder.OrderItemResource{
		Location: to.Ptr("eastus"),
		Properties: &armedgeorder.OrderItemProperties{
			AddressDetails: &armedgeorder.AddressDetails{
				ForwardAddress: &armedgeorder.AddressProperties{
					ContactDetails: &armedgeorder.ContactDetails{
						ContactName: to.Ptr("XXXX XXXX"),
						EmailList: []*string{
							to.Ptr("xxxx@xxxx.xxx"),
						},
						Phone:          to.Ptr("0000000000"),
						PhoneExtension: to.Ptr(""),
					},
					ShippingAddress: &armedgeorder.ShippingAddress{
						AddressType:     to.Ptr(armedgeorder.AddressTypeNone),
						City:            to.Ptr("San Francisco"),
						CompanyName:     to.Ptr("Microsoft"),
						Country:         to.Ptr("US"),
						PostalCode:      to.Ptr("94107"),
						StateOrProvince: to.Ptr("CA"),
						StreetAddress1:  to.Ptr("16 TOWNSEND ST"),
						StreetAddress2:  to.Ptr("UNIT 1"),
					},
				},
			},
			OrderID: to.Ptr("/subscriptions/eb5dc900-6186-49d8-b7d7-febd866fdc1d/resourceGroups/YourResourceGroupName/providers/Microsoft.EdgeOrder/locations/eastus/orders/TestOrderName2"),
			OrderItemDetails: &armedgeorder.OrderItemDetails{
				OrderItemType: to.Ptr(armedgeorder.OrderItemTypePurchase),
				Preferences: &armedgeorder.Preferences{
					TransportPreferences: &armedgeorder.TransportPreferences{
						PreferredShipmentType: to.Ptr(armedgeorder.TransportShipmentTypesMicrosoftManaged),
					},
				},
				ProductDetails: &armedgeorder.ProductDetails{
					HierarchyInformation: &armedgeorder.HierarchyInformation{
						ConfigurationName: to.Ptr("edgep_base"),
						ProductFamilyName: to.Ptr("azurestackedge"),
						ProductLineName:   to.Ptr("azurestackedge"),
						ProductName:       to.Ptr("azurestackedgegpu"),
					},
				},
			},
		},
	}, 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 = armedgeorder.OrderItemsClientCreateResponse{
	// 	OrderItemResource: &armedgeorder.OrderItemResource{
	// 		Name: to.Ptr("TestOrderItemName2"),
	// 		Type: to.Ptr("Microsoft.EdgeOrder/orderItems"),
	// 		ID: to.Ptr("/subscriptions/eb5dc900-6186-49d8-b7d7-febd866fdc1d/resourceGroups/YourResourceGroupName/providers/Microsoft.EdgeOrder/orderItems/TestOrderItemName2"),
	// 		Location: to.Ptr("eastus"),
	// 		Properties: &armedgeorder.OrderItemProperties{
	// 			AddressDetails: &armedgeorder.AddressDetails{
	// 				ForwardAddress: &armedgeorder.AddressProperties{
	// 					AddressValidationStatus: to.Ptr(armedgeorder.AddressValidationStatusValid),
	// 					ContactDetails: &armedgeorder.ContactDetails{
	// 						ContactName: to.Ptr("XXXX XXXX"),
	// 						EmailList: []*string{
	// 							to.Ptr("xxxx@xxxx.xxx"),
	// 						},
	// 						Phone: to.Ptr("0000000000"),
	// 						PhoneExtension: to.Ptr(""),
	// 					},
	// 					ShippingAddress: &armedgeorder.ShippingAddress{
	// 						AddressType: to.Ptr(armedgeorder.AddressTypeNone),
	// 						City: to.Ptr("San Francisco"),
	// 						CompanyName: to.Ptr("Microsoft"),
	// 						Country: to.Ptr("US"),
	// 						PostalCode: to.Ptr("94107"),
	// 						StateOrProvince: to.Ptr("CA"),
	// 						StreetAddress1: to.Ptr("16 TOWNSEND ST"),
	// 						StreetAddress2: to.Ptr("UNIT 1"),
	// 					},
	// 				},
	// 			},
	// 			OrderID: to.Ptr("/subscriptions/eb5dc900-6186-49d8-b7d7-febd866fdc1d/resourceGroups/YourResourceGroupName/providers/Microsoft.EdgeOrder/locations/eastus/orders/TestOrderName2"),
	// 			OrderItemDetails: &armedgeorder.OrderItemDetails{
	// 				CancellationStatus: to.Ptr(armedgeorder.OrderItemCancellationEnumCancellable),
	// 				CurrentStage: &armedgeorder.StageDetails{
	// 					StageName: to.Ptr(armedgeorder.StageNamePlaced),
	// 					StageStatus: to.Ptr(armedgeorder.StageStatusInProgress),
	// 					StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T10:58:27.5824859+05:30"); return t}()),
	// 				},
	// 				DeletionStatus: to.Ptr(armedgeorder.ActionStatusEnumNotAllowed),
	// 				ManagementRpDetailsList: []*armedgeorder.ResourceProviderDetails{
	// 					{
	// 						ResourceProviderNamespace: to.Ptr("Microsoft.DataBoxEdge"),
	// 					},
	// 				},
	// 				NotificationEmailList: []*string{
	// 				},
	// 				OrderItemStageHistory: []*armedgeorder.StageDetails{
	// 					{
	// 						StageName: to.Ptr(armedgeorder.StageNamePlaced),
	// 						StageStatus: to.Ptr(armedgeorder.StageStatusNone),
	// 					},
	// 					{
	// 						StageName: to.Ptr(armedgeorder.StageNameConfirmed),
	// 						StageStatus: to.Ptr(armedgeorder.StageStatusNone),
	// 					},
	// 					{
	// 						StageName: to.Ptr(armedgeorder.StageNameReadyToShip),
	// 						StageStatus: to.Ptr(armedgeorder.StageStatusNone),
	// 					},
	// 					{
	// 						StageName: to.Ptr(armedgeorder.StageNameShipped),
	// 						StageStatus: to.Ptr(armedgeorder.StageStatusNone),
	// 					},
	// 					{
	// 						StageName: to.Ptr(armedgeorder.StageNameDelivered),
	// 						StageStatus: to.Ptr(armedgeorder.StageStatusNone),
	// 					},
	// 					{
	// 						StageName: to.Ptr(armedgeorder.StageNameInUse),
	// 						StageStatus: to.Ptr(armedgeorder.StageStatusNone),
	// 					},
	// 				},
	// 				OrderItemType: to.Ptr(armedgeorder.OrderItemTypePurchase),
	// 				Preferences: &armedgeorder.Preferences{
	// 					TransportPreferences: &armedgeorder.TransportPreferences{
	// 						PreferredShipmentType: to.Ptr(armedgeorder.TransportShipmentTypesMicrosoftManaged),
	// 					},
	// 				},
	// 				ProductDetails: &armedgeorder.ProductDetails{
	// 					DisplayInfo: &armedgeorder.DisplayInfo{
	// 						ConfigurationDisplayName: to.Ptr("Azure Stack Edge Pro - 1 GPU"),
	// 						ProductFamilyDisplayName: to.Ptr("Azure Stack Edge"),
	// 					},
	// 					HierarchyInformation: &armedgeorder.HierarchyInformation{
	// 						ConfigurationName: to.Ptr("edgep_base"),
	// 						ProductFamilyName: to.Ptr("azurestackedge"),
	// 						ProductLineName: to.Ptr("azurestackedge"),
	// 						ProductName: to.Ptr("azurestackedgegpu"),
	// 					},
	// 					ProductDoubleEncryptionStatus: to.Ptr(armedgeorder.DoubleEncryptionStatusDisabled),
	// 				},
	// 				ReturnStatus: to.Ptr(armedgeorder.OrderItemReturnEnumNotReturnable),
	// 			},
	// 			StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T10:58:27.5824859+05:30"); return t}()),
	// 		},
	// 		SystemData: &armedgeorder.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()),
	// 		},
	// 		Tags: map[string]*string{
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2024-02-01/DeleteOrderItemByName.json
func ExampleOrderItemsClient_BeginDelete() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armedgeorder.NewClientFactory("eb5dc900-6186-49d8-b7d7-febd866fdc1d", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewOrderItemsClient().BeginDelete(ctx, "YourResourceGroupName", "TestOrderItemName3", 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 pull the result: %v", err)
	}
}

// Generated from example definition: 2024-02-01/GetOrderItemByName.json
func ExampleOrderItemsClient_Get() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armedgeorder.NewClientFactory("eb5dc900-6186-49d8-b7d7-febd866fdc1d", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewOrderItemsClient().Get(ctx, "YourResourceGroupName", "TestOrderItemName1", 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 = armedgeorder.OrderItemsClientGetResponse{
	// 	OrderItemResource: &armedgeorder.OrderItemResource{
	// 		Name: to.Ptr("TestOrderItemName1"),
	// 		Type: to.Ptr("Microsoft.EdgeOrder/orderItems"),
	// 		ID: to.Ptr("/subscriptions/eb5dc900-6186-49d8-b7d7-febd866fdc1d/resourceGroups/YourResourceGroupName/providers/Microsoft.EdgeOrder/orderItems/TestOrderItemName1"),
	// 		Location: to.Ptr("eastus"),
	// 		Properties: &armedgeorder.OrderItemProperties{
	// 			AddressDetails: &armedgeorder.AddressDetails{
	// 				ForwardAddress: &armedgeorder.AddressProperties{
	// 					AddressValidationStatus: to.Ptr(armedgeorder.AddressValidationStatusValid),
	// 					ContactDetails: &armedgeorder.ContactDetails{
	// 						ContactName: to.Ptr("XXXX XXXX"),
	// 						EmailList: []*string{
	// 							to.Ptr("xxxx@xxxx.xxx"),
	// 						},
	// 						Phone: to.Ptr("0000000000"),
	// 						PhoneExtension: to.Ptr(""),
	// 					},
	// 					ShippingAddress: &armedgeorder.ShippingAddress{
	// 						AddressType: to.Ptr(armedgeorder.AddressTypeNone),
	// 						City: to.Ptr("San Francisco"),
	// 						CompanyName: to.Ptr("Microsoft"),
	// 						Country: to.Ptr("US"),
	// 						PostalCode: to.Ptr("94107"),
	// 						StateOrProvince: to.Ptr("CA"),
	// 						StreetAddress1: to.Ptr("16 TOWNSEND ST"),
	// 						StreetAddress2: to.Ptr("UNIT 1"),
	// 					},
	// 				},
	// 			},
	// 			OrderID: to.Ptr("/subscriptions/eb5dc900-6186-49d8-b7d7-febd866fdc1d/resourceGroups/YourResourceGroupName/providers/Microsoft.EdgeOrder/locations/eastus/orders/TestOrderName1"),
	// 			OrderItemDetails: &armedgeorder.OrderItemDetails{
	// 				CancellationStatus: to.Ptr(armedgeorder.OrderItemCancellationEnumNotCancellable),
	// 				CurrentStage: &armedgeorder.StageDetails{
	// 					StageName: to.Ptr(armedgeorder.StageNameConfirmed),
	// 					StageStatus: to.Ptr(armedgeorder.StageStatusSucceeded),
	// 					StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T11:05:00.3575338+05:30"); return t}()),
	// 				},
	// 				DeletionStatus: to.Ptr(armedgeorder.ActionStatusEnumNotAllowed),
	// 				ManagementRpDetailsList: []*armedgeorder.ResourceProviderDetails{
	// 					{
	// 						ResourceProviderNamespace: to.Ptr("Microsoft.DataBoxEdge"),
	// 					},
	// 				},
	// 				NotificationEmailList: []*string{
	// 				},
	// 				OrderItemStageHistory: []*armedgeorder.StageDetails{
	// 					{
	// 						StageName: to.Ptr(armedgeorder.StageNamePlaced),
	// 						StageStatus: to.Ptr(armedgeorder.StageStatusSucceeded),
	// 						StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T10:55:54.3427968+05:30"); return t}()),
	// 					},
	// 					{
	// 						StageName: to.Ptr(armedgeorder.StageNameConfirmed),
	// 						StageStatus: to.Ptr(armedgeorder.StageStatusSucceeded),
	// 						StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T11:05:00.3575338+05:30"); return t}()),
	// 					},
	// 					{
	// 						StageName: to.Ptr(armedgeorder.StageNameReadyToShip),
	// 						StageStatus: to.Ptr(armedgeorder.StageStatusNone),
	// 					},
	// 					{
	// 						StageName: to.Ptr(armedgeorder.StageNameShipped),
	// 						StageStatus: to.Ptr(armedgeorder.StageStatusNone),
	// 					},
	// 					{
	// 						StageName: to.Ptr(armedgeorder.StageNameDelivered),
	// 						StageStatus: to.Ptr(armedgeorder.StageStatusNone),
	// 					},
	// 					{
	// 						StageName: to.Ptr(armedgeorder.StageNameInUse),
	// 						StageStatus: to.Ptr(armedgeorder.StageStatusNone),
	// 					},
	// 				},
	// 				OrderItemType: to.Ptr(armedgeorder.OrderItemTypePurchase),
	// 				Preferences: &armedgeorder.Preferences{
	// 					TransportPreferences: &armedgeorder.TransportPreferences{
	// 						PreferredShipmentType: to.Ptr(armedgeorder.TransportShipmentTypesMicrosoftManaged),
	// 					},
	// 				},
	// 				ProductDetails: &armedgeorder.ProductDetails{
	// 					DisplayInfo: &armedgeorder.DisplayInfo{
	// 						ConfigurationDisplayName: to.Ptr("Azure Stack Edge Pro - 1 GPU"),
	// 						ProductFamilyDisplayName: to.Ptr("Azure Stack Edge"),
	// 					},
	// 					HierarchyInformation: &armedgeorder.HierarchyInformation{
	// 						ConfigurationName: to.Ptr("edgep_base"),
	// 						ProductFamilyName: to.Ptr("azurestackedge"),
	// 						ProductLineName: to.Ptr("azurestackedge"),
	// 						ProductName: to.Ptr("azurestackedgegpu"),
	// 					},
	// 					ProductDoubleEncryptionStatus: to.Ptr(armedgeorder.DoubleEncryptionStatusDisabled),
	// 				},
	// 				ReturnStatus: to.Ptr(armedgeorder.OrderItemReturnEnumNotReturnable),
	// 			},
	// 			StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T10:55:10.2820482+05:30"); return t}()),
	// 		},
	// 		SystemData: &armedgeorder.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()),
	// 		},
	// 		Tags: map[string]*string{
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2024-02-01/ListOrderItemsAtResourceGroupLevel.json
func ExampleOrderItemsClient_NewListByResourceGroupPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armedgeorder.NewClientFactory("eb5dc900-6186-49d8-b7d7-febd866fdc1d", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewOrderItemsClient().NewListByResourceGroupPager("YourResourceGroupName", 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 = armedgeorder.OrderItemsClientListByResourceGroupResponse{
		// 	OrderItemResourceList: armedgeorder.OrderItemResourceList{
		// 		Value: []*armedgeorder.OrderItemResource{
		// 			{
		// 				Name: to.Ptr("TestOrderItemName1"),
		// 				Type: to.Ptr("Microsoft.EdgeOrder/orderItems"),
		// 				ID: to.Ptr("/subscriptions/eb5dc900-6186-49d8-b7d7-febd866fdc1d/resourceGroups/YourResourceGroupName/providers/Microsoft.EdgeOrder/orderItems/TestOrderItemName1"),
		// 				Location: to.Ptr("eastus"),
		// 				Properties: &armedgeorder.OrderItemProperties{
		// 					AddressDetails: &armedgeorder.AddressDetails{
		// 						ForwardAddress: &armedgeorder.AddressProperties{
		// 							AddressValidationStatus: to.Ptr(armedgeorder.AddressValidationStatusValid),
		// 							ContactDetails: &armedgeorder.ContactDetails{
		// 								ContactName: to.Ptr("XXXX XXXX"),
		// 								EmailList: []*string{
		// 									to.Ptr("xxxx@xxxx.xxx"),
		// 								},
		// 								Phone: to.Ptr("0000000000"),
		// 								PhoneExtension: to.Ptr(""),
		// 							},
		// 							ShippingAddress: &armedgeorder.ShippingAddress{
		// 								AddressType: to.Ptr(armedgeorder.AddressTypeNone),
		// 								City: to.Ptr("San Francisco"),
		// 								CompanyName: to.Ptr("Microsoft"),
		// 								Country: to.Ptr("US"),
		// 								PostalCode: to.Ptr("94107"),
		// 								StateOrProvince: to.Ptr("CA"),
		// 								StreetAddress1: to.Ptr("16 TOWNSEND ST"),
		// 								StreetAddress2: to.Ptr("UNIT 1"),
		// 							},
		// 						},
		// 					},
		// 					OrderID: to.Ptr("/subscriptions/eb5dc900-6186-49d8-b7d7-febd866fdc1d/resourceGroups/YourResourceGroupName/providers/Microsoft.EdgeOrder/locations/eastus/orders/TestOrderName1"),
		// 					OrderItemDetails: &armedgeorder.OrderItemDetails{
		// 						CancellationStatus: to.Ptr(armedgeorder.OrderItemCancellationEnumNotCancellable),
		// 						CurrentStage: &armedgeorder.StageDetails{
		// 							StageName: to.Ptr(armedgeorder.StageNameConfirmed),
		// 							StageStatus: to.Ptr(armedgeorder.StageStatusSucceeded),
		// 							StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T11:05:00.3575338+05:30"); return t}()),
		// 						},
		// 						DeletionStatus: to.Ptr(armedgeorder.ActionStatusEnumNotAllowed),
		// 						ManagementRpDetailsList: []*armedgeorder.ResourceProviderDetails{
		// 							{
		// 								ResourceProviderNamespace: to.Ptr("Microsoft.DataBoxEdge"),
		// 							},
		// 						},
		// 						NotificationEmailList: []*string{
		// 						},
		// 						OrderItemStageHistory: []*armedgeorder.StageDetails{
		// 							{
		// 								StageName: to.Ptr(armedgeorder.StageNamePlaced),
		// 								StageStatus: to.Ptr(armedgeorder.StageStatusSucceeded),
		// 								StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T10:55:54.3427968+05:30"); return t}()),
		// 							},
		// 							{
		// 								StageName: to.Ptr(armedgeorder.StageNameConfirmed),
		// 								StageStatus: to.Ptr(armedgeorder.StageStatusSucceeded),
		// 								StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T11:05:00.3575338+05:30"); return t}()),
		// 							},
		// 							{
		// 								StageName: to.Ptr(armedgeorder.StageNameReadyToShip),
		// 								StageStatus: to.Ptr(armedgeorder.StageStatusNone),
		// 							},
		// 							{
		// 								StageName: to.Ptr(armedgeorder.StageNameShipped),
		// 								StageStatus: to.Ptr(armedgeorder.StageStatusNone),
		// 							},
		// 							{
		// 								StageName: to.Ptr(armedgeorder.StageNameDelivered),
		// 								StageStatus: to.Ptr(armedgeorder.StageStatusNone),
		// 							},
		// 							{
		// 								StageName: to.Ptr(armedgeorder.StageNameInUse),
		// 								StageStatus: to.Ptr(armedgeorder.StageStatusNone),
		// 							},
		// 						},
		// 						OrderItemType: to.Ptr(armedgeorder.OrderItemTypePurchase),
		// 						Preferences: &armedgeorder.Preferences{
		// 							TransportPreferences: &armedgeorder.TransportPreferences{
		// 								PreferredShipmentType: to.Ptr(armedgeorder.TransportShipmentTypesMicrosoftManaged),
		// 							},
		// 						},
		// 						ProductDetails: &armedgeorder.ProductDetails{
		// 							DisplayInfo: &armedgeorder.DisplayInfo{
		// 								ConfigurationDisplayName: to.Ptr("Azure Stack Edge Pro - 1 GPU"),
		// 								ProductFamilyDisplayName: to.Ptr("Azure Stack Edge"),
		// 							},
		// 							HierarchyInformation: &armedgeorder.HierarchyInformation{
		// 								ConfigurationName: to.Ptr("edgep_base"),
		// 								ProductFamilyName: to.Ptr("azurestackedge"),
		// 								ProductLineName: to.Ptr("azurestackedge"),
		// 								ProductName: to.Ptr("azurestackedgegpu"),
		// 							},
		// 							ProductDoubleEncryptionStatus: to.Ptr(armedgeorder.DoubleEncryptionStatusDisabled),
		// 						},
		// 						ReturnStatus: to.Ptr(armedgeorder.OrderItemReturnEnumNotReturnable),
		// 					},
		// 					StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T10:55:10.2820482+05:30"); return t}()),
		// 				},
		// 				SystemData: &armedgeorder.SystemData{
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()),
		// 				},
		// 				Tags: map[string]*string{
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("TestOrderItemName2"),
		// 				Type: to.Ptr("Microsoft.EdgeOrder/orderItems"),
		// 				ID: to.Ptr("/subscriptions/eb5dc900-6186-49d8-b7d7-febd866fdc1d/resourceGroups/YourResourceGroupName/providers/Microsoft.EdgeOrder/orderItems/TestOrderItemName2"),
		// 				Location: to.Ptr("eastus"),
		// 				Properties: &armedgeorder.OrderItemProperties{
		// 					AddressDetails: &armedgeorder.AddressDetails{
		// 						ForwardAddress: &armedgeorder.AddressProperties{
		// 							AddressValidationStatus: to.Ptr(armedgeorder.AddressValidationStatusValid),
		// 							ContactDetails: &armedgeorder.ContactDetails{
		// 								ContactName: to.Ptr("XXXX XXXX"),
		// 								EmailList: []*string{
		// 									to.Ptr("xxxx@xxxx.xxx"),
		// 								},
		// 								Phone: to.Ptr("0000000000"),
		// 								PhoneExtension: to.Ptr(""),
		// 							},
		// 							ShippingAddress: &armedgeorder.ShippingAddress{
		// 								AddressType: to.Ptr(armedgeorder.AddressTypeNone),
		// 								City: to.Ptr("San Francisco"),
		// 								CompanyName: to.Ptr("Microsoft"),
		// 								Country: to.Ptr("US"),
		// 								PostalCode: to.Ptr("94107"),
		// 								StateOrProvince: to.Ptr("CA"),
		// 								StreetAddress1: to.Ptr("16 TOWNSEND ST"),
		// 								StreetAddress2: to.Ptr("UNIT 1"),
		// 							},
		// 						},
		// 					},
		// 					OrderID: to.Ptr("/subscriptions/eb5dc900-6186-49d8-b7d7-febd866fdc1d/resourceGroups/YourResourceGroupName/providers/Microsoft.EdgeOrder/locations/eastus/orders/TestOrderName2"),
		// 					OrderItemDetails: &armedgeorder.OrderItemDetails{
		// 						CancellationStatus: to.Ptr(armedgeorder.OrderItemCancellationEnumNotCancellable),
		// 						CurrentStage: &armedgeorder.StageDetails{
		// 							StageName: to.Ptr(armedgeorder.StageNameConfirmed),
		// 							StageStatus: to.Ptr(armedgeorder.StageStatusSucceeded),
		// 							StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T11:07:29.9896685+05:30"); return t}()),
		// 						},
		// 						DeletionStatus: to.Ptr(armedgeorder.ActionStatusEnumNotAllowed),
		// 						ManagementRpDetailsList: []*armedgeorder.ResourceProviderDetails{
		// 							{
		// 								ResourceProviderNamespace: to.Ptr("Microsoft.DataBoxEdge"),
		// 							},
		// 						},
		// 						NotificationEmailList: []*string{
		// 						},
		// 						OrderItemStageHistory: []*armedgeorder.StageDetails{
		// 							{
		// 								StageName: to.Ptr(armedgeorder.StageNamePlaced),
		// 								StageStatus: to.Ptr(armedgeorder.StageStatusSucceeded),
		// 								StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T10:59:04.9701334+05:30"); return t}()),
		// 							},
		// 							{
		// 								StageName: to.Ptr(armedgeorder.StageNameConfirmed),
		// 								StageStatus: to.Ptr(armedgeorder.StageStatusSucceeded),
		// 								StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T11:07:29.9896685+05:30"); return t}()),
		// 							},
		// 							{
		// 								StageName: to.Ptr(armedgeorder.StageNameReadyToShip),
		// 								StageStatus: to.Ptr(armedgeorder.StageStatusNone),
		// 							},
		// 							{
		// 								StageName: to.Ptr(armedgeorder.StageNameShipped),
		// 								StageStatus: to.Ptr(armedgeorder.StageStatusNone),
		// 							},
		// 							{
		// 								StageName: to.Ptr(armedgeorder.StageNameDelivered),
		// 								StageStatus: to.Ptr(armedgeorder.StageStatusNone),
		// 							},
		// 							{
		// 								StageName: to.Ptr(armedgeorder.StageNameInUse),
		// 								StageStatus: to.Ptr(armedgeorder.StageStatusNone),
		// 							},
		// 						},
		// 						OrderItemType: to.Ptr(armedgeorder.OrderItemTypePurchase),
		// 						Preferences: &armedgeorder.Preferences{
		// 							TransportPreferences: &armedgeorder.TransportPreferences{
		// 								PreferredShipmentType: to.Ptr(armedgeorder.TransportShipmentTypesMicrosoftManaged),
		// 							},
		// 						},
		// 						ProductDetails: &armedgeorder.ProductDetails{
		// 							DisplayInfo: &armedgeorder.DisplayInfo{
		// 								ConfigurationDisplayName: to.Ptr("Azure Stack Edge Pro - 1 GPU"),
		// 								ProductFamilyDisplayName: to.Ptr("Azure Stack Edge"),
		// 							},
		// 							HierarchyInformation: &armedgeorder.HierarchyInformation{
		// 								ConfigurationName: to.Ptr("edgep_base"),
		// 								ProductFamilyName: to.Ptr("azurestackedge"),
		// 								ProductLineName: to.Ptr("azurestackedge"),
		// 								ProductName: to.Ptr("azurestackedgegpu"),
		// 							},
		// 							ProductDoubleEncryptionStatus: to.Ptr(armedgeorder.DoubleEncryptionStatusDisabled),
		// 						},
		// 						ReturnStatus: to.Ptr(armedgeorder.OrderItemReturnEnumNotReturnable),
		// 					},
		// 					StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T10:58:27.5824859+05:30"); return t}()),
		// 				},
		// 				SystemData: &armedgeorder.SystemData{
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()),
		// 				},
		// 				Tags: map[string]*string{
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2024-02-01/ListOrderItemsAtSubscriptionLevel.json
func ExampleOrderItemsClient_NewListBySubscriptionPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armedgeorder.NewClientFactory("eb5dc900-6186-49d8-b7d7-febd866fdc1d", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewOrderItemsClient().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 = armedgeorder.OrderItemsClientListBySubscriptionResponse{
		// 	OrderItemResourceList: armedgeorder.OrderItemResourceList{
		// 		Value: []*armedgeorder.OrderItemResource{
		// 			{
		// 				Name: to.Ptr("TestOrderItemName1"),
		// 				Type: to.Ptr("Microsoft.EdgeOrder/orderItems"),
		// 				ID: to.Ptr("/subscriptions/eb5dc900-6186-49d8-b7d7-febd866fdc1d/resourceGroups/YourResourceGroupName/providers/Microsoft.EdgeOrder/orderItems/TestOrderItemName1"),
		// 				Location: to.Ptr("eastus"),
		// 				Properties: &armedgeorder.OrderItemProperties{
		// 					AddressDetails: &armedgeorder.AddressDetails{
		// 						ForwardAddress: &armedgeorder.AddressProperties{
		// 							AddressValidationStatus: to.Ptr(armedgeorder.AddressValidationStatusValid),
		// 							ContactDetails: &armedgeorder.ContactDetails{
		// 								ContactName: to.Ptr("XXXX XXXX"),
		// 								EmailList: []*string{
		// 									to.Ptr("xxxx@xxxx.xxx"),
		// 								},
		// 								Phone: to.Ptr("0000000000"),
		// 								PhoneExtension: to.Ptr(""),
		// 							},
		// 							ShippingAddress: &armedgeorder.ShippingAddress{
		// 								AddressType: to.Ptr(armedgeorder.AddressTypeNone),
		// 								City: to.Ptr("San Francisco"),
		// 								CompanyName: to.Ptr("Microsoft"),
		// 								Country: to.Ptr("US"),
		// 								PostalCode: to.Ptr("94107"),
		// 								StateOrProvince: to.Ptr("CA"),
		// 								StreetAddress1: to.Ptr("16 TOWNSEND ST"),
		// 								StreetAddress2: to.Ptr("UNIT 1"),
		// 							},
		// 						},
		// 					},
		// 					OrderID: to.Ptr("/subscriptions/eb5dc900-6186-49d8-b7d7-febd866fdc1d/resourceGroups/YourResourceGroupName/providers/Microsoft.EdgeOrder/locations/eastus/orders/TestOrderName1"),
		// 					OrderItemDetails: &armedgeorder.OrderItemDetails{
		// 						CancellationStatus: to.Ptr(armedgeorder.OrderItemCancellationEnumNotCancellable),
		// 						CurrentStage: &armedgeorder.StageDetails{
		// 							StageName: to.Ptr(armedgeorder.StageNameConfirmed),
		// 							StageStatus: to.Ptr(armedgeorder.StageStatusSucceeded),
		// 							StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T11:05:00.3575338+05:30"); return t}()),
		// 						},
		// 						DeletionStatus: to.Ptr(armedgeorder.ActionStatusEnumNotAllowed),
		// 						ManagementRpDetailsList: []*armedgeorder.ResourceProviderDetails{
		// 							{
		// 								ResourceProviderNamespace: to.Ptr("Microsoft.DataBoxEdge"),
		// 							},
		// 						},
		// 						NotificationEmailList: []*string{
		// 						},
		// 						OrderItemStageHistory: []*armedgeorder.StageDetails{
		// 							{
		// 								StageName: to.Ptr(armedgeorder.StageNamePlaced),
		// 								StageStatus: to.Ptr(armedgeorder.StageStatusSucceeded),
		// 								StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T10:55:54.3427968+05:30"); return t}()),
		// 							},
		// 							{
		// 								StageName: to.Ptr(armedgeorder.StageNameConfirmed),
		// 								StageStatus: to.Ptr(armedgeorder.StageStatusSucceeded),
		// 								StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T11:05:00.3575338+05:30"); return t}()),
		// 							},
		// 							{
		// 								StageName: to.Ptr(armedgeorder.StageNameReadyToShip),
		// 								StageStatus: to.Ptr(armedgeorder.StageStatusNone),
		// 							},
		// 							{
		// 								StageName: to.Ptr(armedgeorder.StageNameShipped),
		// 								StageStatus: to.Ptr(armedgeorder.StageStatusNone),
		// 							},
		// 							{
		// 								StageName: to.Ptr(armedgeorder.StageNameDelivered),
		// 								StageStatus: to.Ptr(armedgeorder.StageStatusNone),
		// 							},
		// 							{
		// 								StageName: to.Ptr(armedgeorder.StageNameInUse),
		// 								StageStatus: to.Ptr(armedgeorder.StageStatusNone),
		// 							},
		// 						},
		// 						OrderItemType: to.Ptr(armedgeorder.OrderItemTypePurchase),
		// 						Preferences: &armedgeorder.Preferences{
		// 							TransportPreferences: &armedgeorder.TransportPreferences{
		// 								PreferredShipmentType: to.Ptr(armedgeorder.TransportShipmentTypesMicrosoftManaged),
		// 							},
		// 						},
		// 						ProductDetails: &armedgeorder.ProductDetails{
		// 							DisplayInfo: &armedgeorder.DisplayInfo{
		// 								ConfigurationDisplayName: to.Ptr("Azure Stack Edge Pro - 1 GPU"),
		// 								ProductFamilyDisplayName: to.Ptr("Azure Stack Edge"),
		// 							},
		// 							HierarchyInformation: &armedgeorder.HierarchyInformation{
		// 								ConfigurationName: to.Ptr("edgep_base"),
		// 								ProductFamilyName: to.Ptr("azurestackedge"),
		// 								ProductLineName: to.Ptr("azurestackedge"),
		// 								ProductName: to.Ptr("azurestackedgegpu"),
		// 							},
		// 							ProductDoubleEncryptionStatus: to.Ptr(armedgeorder.DoubleEncryptionStatusDisabled),
		// 						},
		// 						ReturnStatus: to.Ptr(armedgeorder.OrderItemReturnEnumNotReturnable),
		// 					},
		// 					StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T10:55:10.2820482+05:30"); return t}()),
		// 				},
		// 				SystemData: &armedgeorder.SystemData{
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()),
		// 				},
		// 				Tags: map[string]*string{
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("TestOrderItemName2"),
		// 				Type: to.Ptr("Microsoft.EdgeOrder/orderItems"),
		// 				ID: to.Ptr("/subscriptions/eb5dc900-6186-49d8-b7d7-febd866fdc1d/resourceGroups/YourResourceGroupName/providers/Microsoft.EdgeOrder/orderItems/TestOrderItemName2"),
		// 				Location: to.Ptr("eastus"),
		// 				Properties: &armedgeorder.OrderItemProperties{
		// 					AddressDetails: &armedgeorder.AddressDetails{
		// 						ForwardAddress: &armedgeorder.AddressProperties{
		// 							AddressValidationStatus: to.Ptr(armedgeorder.AddressValidationStatusValid),
		// 							ContactDetails: &armedgeorder.ContactDetails{
		// 								ContactName: to.Ptr("XXXX XXXX"),
		// 								EmailList: []*string{
		// 									to.Ptr("xxxx@xxxx.xxx"),
		// 								},
		// 								Phone: to.Ptr("0000000000"),
		// 								PhoneExtension: to.Ptr(""),
		// 							},
		// 							ShippingAddress: &armedgeorder.ShippingAddress{
		// 								AddressType: to.Ptr(armedgeorder.AddressTypeNone),
		// 								City: to.Ptr("San Francisco"),
		// 								CompanyName: to.Ptr("Microsoft"),
		// 								Country: to.Ptr("US"),
		// 								PostalCode: to.Ptr("94107"),
		// 								StateOrProvince: to.Ptr("CA"),
		// 								StreetAddress1: to.Ptr("16 TOWNSEND ST"),
		// 								StreetAddress2: to.Ptr("UNIT 1"),
		// 							},
		// 						},
		// 					},
		// 					OrderID: to.Ptr("/subscriptions/eb5dc900-6186-49d8-b7d7-febd866fdc1d/resourceGroups/YourResourceGroupName/providers/Microsoft.EdgeOrder/locations/eastus/orders/TestOrderName2"),
		// 					OrderItemDetails: &armedgeorder.OrderItemDetails{
		// 						CancellationStatus: to.Ptr(armedgeorder.OrderItemCancellationEnumNotCancellable),
		// 						CurrentStage: &armedgeorder.StageDetails{
		// 							StageName: to.Ptr(armedgeorder.StageNameConfirmed),
		// 							StageStatus: to.Ptr(armedgeorder.StageStatusSucceeded),
		// 							StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T11:07:29.9896685+05:30"); return t}()),
		// 						},
		// 						DeletionStatus: to.Ptr(armedgeorder.ActionStatusEnumNotAllowed),
		// 						ManagementRpDetailsList: []*armedgeorder.ResourceProviderDetails{
		// 							{
		// 								ResourceProviderNamespace: to.Ptr("Microsoft.DataBoxEdge"),
		// 							},
		// 						},
		// 						NotificationEmailList: []*string{
		// 						},
		// 						OrderItemStageHistory: []*armedgeorder.StageDetails{
		// 							{
		// 								StageName: to.Ptr(armedgeorder.StageNamePlaced),
		// 								StageStatus: to.Ptr(armedgeorder.StageStatusSucceeded),
		// 								StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T10:59:04.9701334+05:30"); return t}()),
		// 							},
		// 							{
		// 								StageName: to.Ptr(armedgeorder.StageNameConfirmed),
		// 								StageStatus: to.Ptr(armedgeorder.StageStatusSucceeded),
		// 								StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T11:07:29.9896685+05:30"); return t}()),
		// 							},
		// 							{
		// 								StageName: to.Ptr(armedgeorder.StageNameReadyToShip),
		// 								StageStatus: to.Ptr(armedgeorder.StageStatusNone),
		// 							},
		// 							{
		// 								StageName: to.Ptr(armedgeorder.StageNameShipped),
		// 								StageStatus: to.Ptr(armedgeorder.StageStatusNone),
		// 							},
		// 							{
		// 								StageName: to.Ptr(armedgeorder.StageNameDelivered),
		// 								StageStatus: to.Ptr(armedgeorder.StageStatusNone),
		// 							},
		// 							{
		// 								StageName: to.Ptr(armedgeorder.StageNameInUse),
		// 								StageStatus: to.Ptr(armedgeorder.StageStatusNone),
		// 							},
		// 						},
		// 						OrderItemType: to.Ptr(armedgeorder.OrderItemTypePurchase),
		// 						Preferences: &armedgeorder.Preferences{
		// 							TransportPreferences: &armedgeorder.TransportPreferences{
		// 								PreferredShipmentType: to.Ptr(armedgeorder.TransportShipmentTypesMicrosoftManaged),
		// 							},
		// 						},
		// 						ProductDetails: &armedgeorder.ProductDetails{
		// 							DisplayInfo: &armedgeorder.DisplayInfo{
		// 								ConfigurationDisplayName: to.Ptr("Azure Stack Edge Pro - 1 GPU"),
		// 								ProductFamilyDisplayName: to.Ptr("Azure Stack Edge"),
		// 							},
		// 							HierarchyInformation: &armedgeorder.HierarchyInformation{
		// 								ConfigurationName: to.Ptr("edgep_base"),
		// 								ProductFamilyName: to.Ptr("azurestackedge"),
		// 								ProductLineName: to.Ptr("azurestackedge"),
		// 								ProductName: to.Ptr("azurestackedgegpu"),
		// 							},
		// 							ProductDoubleEncryptionStatus: to.Ptr(armedgeorder.DoubleEncryptionStatusDisabled),
		// 						},
		// 						ReturnStatus: to.Ptr(armedgeorder.OrderItemReturnEnumNotReturnable),
		// 					},
		// 					StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T10:58:27.5824859+05:30"); return t}()),
		// 				},
		// 				SystemData: &armedgeorder.SystemData{
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()),
		// 				},
		// 				Tags: map[string]*string{
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2024-02-01/ReturnOrderItem.json
func ExampleOrderItemsClient_BeginReturn() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armedgeorder.NewClientFactory("eb5dc900-6186-49d8-b7d7-febd866fdc1d", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewOrderItemsClient().BeginReturn(ctx, "YourResourceGroupName", "TestOrderName4", armedgeorder.ReturnOrderItemDetails{
		ReturnReason: to.Ptr("Order returned"),
	}, 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 = armedgeorder.OrderItemsClientReturnResponse{
	// }
}

// Generated from example definition: 2024-02-01/UpdateOrderItem.json
func ExampleOrderItemsClient_BeginUpdate() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armedgeorder.NewClientFactory("eb5dc900-6186-49d8-b7d7-febd866fdc1d", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewOrderItemsClient().BeginUpdate(ctx, "YourResourceGroupName", "TestOrderItemName3", armedgeorder.OrderItemUpdateParameter{
		Properties: &armedgeorder.OrderItemUpdateProperties{
			Preferences: &armedgeorder.Preferences{
				TransportPreferences: &armedgeorder.TransportPreferences{
					PreferredShipmentType: to.Ptr(armedgeorder.TransportShipmentTypesCustomerManaged),
				},
			},
		},
	}, 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 = armedgeorder.OrderItemsClientUpdateResponse{
	// 	OrderItemResource: &armedgeorder.OrderItemResource{
	// 		Name: to.Ptr("TestOrderItemName3"),
	// 		Type: to.Ptr("Microsoft.EdgeOrder/orderItems"),
	// 		ID: to.Ptr("/subscriptions/eb5dc900-6186-49d8-b7d7-febd866fdc1d/resourceGroups/YourResourceGroupName/providers/Microsoft.EdgeOrder/orderItems/TestOrderItemName3"),
	// 		Location: to.Ptr("eastus"),
	// 		Properties: &armedgeorder.OrderItemProperties{
	// 			AddressDetails: &armedgeorder.AddressDetails{
	// 				ForwardAddress: &armedgeorder.AddressProperties{
	// 					AddressValidationStatus: to.Ptr(armedgeorder.AddressValidationStatusValid),
	// 					ContactDetails: &armedgeorder.ContactDetails{
	// 						ContactName: to.Ptr("XXXX XXXX"),
	// 						EmailList: []*string{
	// 							to.Ptr("xxxx@xxxx.xxx"),
	// 						},
	// 						Phone: to.Ptr("0000000000"),
	// 						PhoneExtension: to.Ptr(""),
	// 					},
	// 					ShippingAddress: &armedgeorder.ShippingAddress{
	// 						AddressType: to.Ptr(armedgeorder.AddressTypeNone),
	// 						City: to.Ptr("San Francisco"),
	// 						CompanyName: to.Ptr("Microsoft"),
	// 						Country: to.Ptr("US"),
	// 						PostalCode: to.Ptr("94107"),
	// 						StateOrProvince: to.Ptr("CA"),
	// 						StreetAddress1: to.Ptr("16 TOWNSEND ST"),
	// 						StreetAddress2: to.Ptr("UNIT 1"),
	// 					},
	// 				},
	// 			},
	// 			OrderID: to.Ptr("/subscriptions/eb5dc900-6186-49d8-b7d7-febd866fdc1d/resourceGroups/YourResourceGroupName/providers/Microsoft.EdgeOrder/locations/eastus/orders/TestOrderName3"),
	// 			OrderItemDetails: &armedgeorder.OrderItemDetails{
	// 				CancellationStatus: to.Ptr(armedgeorder.OrderItemCancellationEnumCancellable),
	// 				CurrentStage: &armedgeorder.StageDetails{
	// 					StageName: to.Ptr(armedgeorder.StageNamePlaced),
	// 					StageStatus: to.Ptr(armedgeorder.StageStatusSucceeded),
	// 					StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T11:30:31.5838042+05:30"); return t}()),
	// 				},
	// 				DeletionStatus: to.Ptr(armedgeorder.ActionStatusEnumNotAllowed),
	// 				ManagementRpDetailsList: []*armedgeorder.ResourceProviderDetails{
	// 					{
	// 						ResourceProviderNamespace: to.Ptr("Microsoft.DataBoxEdge"),
	// 					},
	// 				},
	// 				NotificationEmailList: []*string{
	// 				},
	// 				OrderItemStageHistory: []*armedgeorder.StageDetails{
	// 					{
	// 						StageName: to.Ptr(armedgeorder.StageNamePlaced),
	// 						StageStatus: to.Ptr(armedgeorder.StageStatusSucceeded),
	// 						StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T11:30:31.5838042+05:30"); return t}()),
	// 					},
	// 					{
	// 						StageName: to.Ptr(armedgeorder.StageNameConfirmed),
	// 						StageStatus: to.Ptr(armedgeorder.StageStatusNone),
	// 					},
	// 					{
	// 						StageName: to.Ptr(armedgeorder.StageNameReadyToShip),
	// 						StageStatus: to.Ptr(armedgeorder.StageStatusNone),
	// 					},
	// 					{
	// 						StageName: to.Ptr(armedgeorder.StageNameShipped),
	// 						StageStatus: to.Ptr(armedgeorder.StageStatusNone),
	// 					},
	// 					{
	// 						StageName: to.Ptr(armedgeorder.StageNameDelivered),
	// 						StageStatus: to.Ptr(armedgeorder.StageStatusNone),
	// 					},
	// 					{
	// 						StageName: to.Ptr(armedgeorder.StageNameInUse),
	// 						StageStatus: to.Ptr(armedgeorder.StageStatusNone),
	// 					},
	// 				},
	// 				OrderItemType: to.Ptr(armedgeorder.OrderItemTypePurchase),
	// 				Preferences: &armedgeorder.Preferences{
	// 					TransportPreferences: &armedgeorder.TransportPreferences{
	// 						PreferredShipmentType: to.Ptr(armedgeorder.TransportShipmentTypesCustomerManaged),
	// 					},
	// 				},
	// 				ProductDetails: &armedgeorder.ProductDetails{
	// 					DisplayInfo: &armedgeorder.DisplayInfo{
	// 						ConfigurationDisplayName: to.Ptr("Azure Stack Edge Pro - 1 GPU"),
	// 						ProductFamilyDisplayName: to.Ptr("Azure Stack Edge"),
	// 					},
	// 					HierarchyInformation: &armedgeorder.HierarchyInformation{
	// 						ConfigurationName: to.Ptr("edgep_base"),
	// 						ProductFamilyName: to.Ptr("azurestackedge"),
	// 						ProductLineName: to.Ptr("azurestackedge"),
	// 						ProductName: to.Ptr("azurestackedgegpu"),
	// 					},
	// 					ProductDoubleEncryptionStatus: to.Ptr(armedgeorder.DoubleEncryptionStatusDisabled),
	// 				},
	// 				ReturnStatus: to.Ptr(armedgeorder.OrderItemReturnEnumNotReturnable),
	// 			},
	// 			StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T11:29:47.3483197+05:30"); return t}()),
	// 		},
	// 		SystemData: &armedgeorder.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()),
	// 		},
	// 		Tags: map[string]*string{
	// 		},
	// 	},
	// }
}
