// 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 armdeviceregistry_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/deviceregistry/armdeviceregistry/v2"
	"log"
	"time"
)

// Generated from example definition: 2026-03-01-preview/CreateOrReplace_NamespaceDiscoveredAsset.json
func ExampleNamespaceDiscoveredAssetsClient_BeginCreateOrReplace() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdeviceregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewNamespaceDiscoveredAssetsClient().BeginCreateOrReplace(ctx, "myResourceGroup", "my-namespace-1", "my-discoveredasset-1", armdeviceregistry.NamespaceDiscoveredAsset{
		Location: to.Ptr("West Europe"),
		ExtendedLocation: &armdeviceregistry.ExtendedLocation{
			Type: to.Ptr("CustomLocation"),
			Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
		},
		Tags: map[string]*string{
			"site": to.Ptr("building-1"),
		},
		Properties: &armdeviceregistry.NamespaceDiscoveredAssetProperties{
			DeviceRef: &armdeviceregistry.DeviceRef{
				DeviceName:   to.Ptr("myDevice"),
				EndpointName: to.Ptr("opcuaendpointname"),
			},
			AssetTypeRefs: []*string{
				to.Ptr("myAssetTypeRef1"),
				to.Ptr("myAssetTypeRef2"),
			},
			DiscoveryID:      to.Ptr("11111111-1111-1111-1111-111111111111"),
			Version:          to.Ptr[int64](73766),
			Manufacturer:     to.Ptr("Contoso"),
			ManufacturerURI:  to.Ptr("https://www.contoso.com/manufacturerUri"),
			Model:            to.Ptr("ContosoModel"),
			ProductCode:      to.Ptr("SA34VDG"),
			HardwareRevision: to.Ptr("1.0"),
			SoftwareRevision: to.Ptr("2.0"),
			DocumentationURI: to.Ptr("https://www.example.com/manual"),
			SerialNumber:     to.Ptr("64-103816-519918-8"),
			Attributes: map[string]any{
				"floor": "1",
			},
			DefaultDatasetsConfiguration:         to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
			DefaultEventsConfiguration:           to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
			DefaultStreamsConfiguration:          to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
			DefaultManagementGroupsConfiguration: to.Ptr("{\"retryCount\":10,\"retryBackoffInterval\":15}"),
			DefaultDatasetsDestinations: []armdeviceregistry.DatasetDestinationClassification{
				&armdeviceregistry.DatasetBrokerStateStoreDestination{
					Target: to.Ptr(armdeviceregistry.DatasetDestinationTargetBrokerStateStore),
					Configuration: &armdeviceregistry.BrokerStateStoreDestinationConfiguration{
						Key: to.Ptr("defaultValue"),
					},
				},
			},
			DefaultEventsDestinations: []armdeviceregistry.EventDestinationClassification{
				&armdeviceregistry.EventStorageDestination{
					Target: to.Ptr(armdeviceregistry.EventDestinationTargetStorage),
					Configuration: &armdeviceregistry.StorageDestinationConfiguration{
						Path: to.Ptr("/tmp"),
					},
				},
			},
			DefaultStreamsDestinations: []armdeviceregistry.StreamDestinationClassification{
				&armdeviceregistry.StreamMqttDestination{
					Target: to.Ptr(armdeviceregistry.StreamDestinationTargetMqtt),
					Configuration: &armdeviceregistry.MqttDestinationConfiguration{
						Topic:  to.Ptr("/contoso/test"),
						Retain: to.Ptr(armdeviceregistry.TopicRetainTypeNever),
						Qos:    to.Ptr(armdeviceregistry.MqttDestinationQosQos0),
						TTL:    to.Ptr[int64](3600),
					},
				},
			},
			Datasets: []*armdeviceregistry.NamespaceDiscoveredDataset{
				{
					Name:                 to.Ptr("dataset1"),
					DataSource:           to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/Boiler;i=5"),
					TypeRef:              to.Ptr("dataset1TypeRef"),
					DatasetConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
					LastUpdatedOn:        to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t }()),
					Destinations: []armdeviceregistry.DatasetDestinationClassification{
						&armdeviceregistry.DatasetBrokerStateStoreDestination{
							Target: to.Ptr(armdeviceregistry.DatasetDestinationTargetBrokerStateStore),
							Configuration: &armdeviceregistry.BrokerStateStoreDestinationConfiguration{
								Key: to.Ptr("dataset1"),
							},
						},
					},
					DataPoints: []*armdeviceregistry.NamespaceDiscoveredDatasetDataPoint{
						{
							Name:                   to.Ptr("dataset1DataPoint1"),
							DataSource:             to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3"),
							DataPointConfiguration: to.Ptr("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
							TypeRef:                to.Ptr("dataset1DataPoint1TypeRef"),
							LastUpdatedOn:          to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t }()),
						},
						{
							Name:                   to.Ptr("dataset1DataPoint2"),
							DataSource:             to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4"),
							DataPointConfiguration: to.Ptr("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
							TypeRef:                to.Ptr("dataset1DataPoint2TypeRef"),
							LastUpdatedOn:          to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t }()),
						},
					},
				},
			},
			Streams: []*armdeviceregistry.NamespaceDiscoveredStream{
				{
					Name:                to.Ptr("stream1"),
					StreamConfiguration: to.Ptr("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
					LastUpdatedOn:       to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t }()),
					TypeRef:             to.Ptr("stream1TypeRef"),
					Destinations: []armdeviceregistry.StreamDestinationClassification{
						&armdeviceregistry.StreamStorageDestination{
							Target: to.Ptr(armdeviceregistry.StreamDestinationTargetStorage),
							Configuration: &armdeviceregistry.StorageDestinationConfiguration{
								Path: to.Ptr("/tmp/stream1"),
							},
						},
					},
				},
				{
					Name:                to.Ptr("stream2"),
					StreamConfiguration: to.Ptr("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
					LastUpdatedOn:       to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t }()),
					TypeRef:             to.Ptr("stream2TypeRef"),
					Destinations: []armdeviceregistry.StreamDestinationClassification{
						&armdeviceregistry.StreamMqttDestination{
							Target: to.Ptr(armdeviceregistry.StreamDestinationTargetMqtt),
							Configuration: &armdeviceregistry.MqttDestinationConfiguration{
								Topic:  to.Ptr("/contoso/testStream2"),
								Retain: to.Ptr(armdeviceregistry.TopicRetainTypeNever),
								Qos:    to.Ptr(armdeviceregistry.MqttDestinationQosQos0),
								TTL:    to.Ptr[int64](7200),
							},
						},
					},
				},
			},
			ManagementGroups: []*armdeviceregistry.NamespaceDiscoveredManagementGroup{
				{
					Name:                         to.Ptr("managementGroup1"),
					ManagementGroupConfiguration: to.Ptr("{\"retryCount\":10,\"retryBackoffInterval\":15}"),
					TypeRef:                      to.Ptr("managementGroup1TypeRef"),
					LastUpdatedOn:                to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t }()),
					DefaultTopic:                 to.Ptr("/contoso/managementGroup1"),
					DefaultTimeoutInSeconds:      to.Ptr[int32](100),
					Actions: []*armdeviceregistry.NamespaceDiscoveredManagementAction{
						{
							Name:                to.Ptr("action1"),
							ActionConfiguration: to.Ptr("{\"retryCount\":5,\"retryBackoffInterval\":5}"),
							TargetURI:           to.Ptr("/onvif/device_service?ONVIFProfile=Profile1"),
							Topic:               to.Ptr("/contoso/managementGroup1/action1"),
							TypeRef:             to.Ptr("action1TypeRef"),
							ActionType:          to.Ptr(armdeviceregistry.NamespaceDiscoveredManagementActionTypeCall),
							TimeoutInSeconds:    to.Ptr[int32](60),
							LastUpdatedOn:       to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t }()),
						},
						{
							Name:                to.Ptr("action2"),
							ActionConfiguration: to.Ptr("{\"retryCount\":5,\"retryBackoffInterval\":5}"),
							TargetURI:           to.Ptr("/onvif/device_service?ONVIFProfile=Profile2"),
							Topic:               to.Ptr("/contoso/managementGroup1/action2"),
							TypeRef:             to.Ptr("action2TypeRef"),
							ActionType:          to.Ptr(armdeviceregistry.NamespaceDiscoveredManagementActionTypeCall),
							TimeoutInSeconds:    to.Ptr[int32](60),
							LastUpdatedOn:       to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t }()),
						},
					},
				},
			},
		},
	}, 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 = armdeviceregistry.NamespaceDiscoveredAssetsClientCreateOrReplaceResponse{
	// 	NamespaceDiscoveredAsset: armdeviceregistry.NamespaceDiscoveredAsset{
	// 		ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/namespaces/my-namespace-1/discoveredAssets/my-discoveredasset-1"),
	// 		Name: to.Ptr("my-discoveredasset-1"),
	// 		Type: to.Ptr("Microsoft.DeviceRegistry/namespaces/discoveredAssets"),
	// 		Location: to.Ptr("West Europe"),
	// 		ExtendedLocation: &armdeviceregistry.ExtendedLocation{
	// 			Type: to.Ptr("CustomLocation"),
	// 			Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
	// 		},
	// 		Tags: map[string]*string{
	// 			"site": to.Ptr("building-1"),
	// 		},
	// 		SystemData: &armdeviceregistry.SystemData{
	// 			CreatedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
	// 			CreatedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T00:36:43.2516899Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
	// 			LastModifiedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T01:37:16.0922793Z"); return t}()),
	// 		},
	// 		Properties: &armdeviceregistry.NamespaceDiscoveredAssetProperties{
	// 			DeviceRef: &armdeviceregistry.DeviceRef{
	// 				DeviceName: to.Ptr("myDevice"),
	// 				EndpointName: to.Ptr("opcuaendpointname"),
	// 			},
	// 			AssetTypeRefs: []*string{
	// 				to.Ptr("myAssetTypeRef1"),
	// 				to.Ptr("myAssetTypeRef2"),
	// 			},
	// 			DiscoveryID: to.Ptr("11111111-1111-1111-1111-111111111111"),
	// 			Version: to.Ptr[int64](73766),
	// 			Manufacturer: to.Ptr("Contoso"),
	// 			ManufacturerURI: to.Ptr("https://www.contoso.com/manufacturerUri"),
	// 			Model: to.Ptr("ContosoModel"),
	// 			ProductCode: to.Ptr("SA34VDG"),
	// 			HardwareRevision: to.Ptr("1.0"),
	// 			SoftwareRevision: to.Ptr("2.0"),
	// 			DocumentationURI: to.Ptr("https://www.example.com/manual"),
	// 			SerialNumber: to.Ptr("64-103816-519918-8"),
	// 			Attributes: map[string]any{
	// 				"floor": "1",
	// 			},
	// 			DefaultDatasetsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
	// 			DefaultEventsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
	// 			DefaultStreamsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
	// 			DefaultManagementGroupsConfiguration: to.Ptr("{\"retryCount\":10,\"retryBackoffInterval\":15}"),
	// 			DefaultDatasetsDestinations: []armdeviceregistry.DatasetDestinationClassification{
	// 				&armdeviceregistry.DatasetBrokerStateStoreDestination{
	// 					Target: to.Ptr(armdeviceregistry.DatasetDestinationTargetBrokerStateStore),
	// 					Configuration: &armdeviceregistry.BrokerStateStoreDestinationConfiguration{
	// 						Key: to.Ptr("defaultValue"),
	// 					},
	// 				},
	// 			},
	// 			DefaultEventsDestinations: []armdeviceregistry.EventDestinationClassification{
	// 				&armdeviceregistry.EventStorageDestination{
	// 					Target: to.Ptr(armdeviceregistry.EventDestinationTargetStorage),
	// 					Configuration: &armdeviceregistry.StorageDestinationConfiguration{
	// 						Path: to.Ptr("/tmp"),
	// 					},
	// 				},
	// 			},
	// 			DefaultStreamsDestinations: []armdeviceregistry.StreamDestinationClassification{
	// 				&armdeviceregistry.StreamMqttDestination{
	// 					Target: to.Ptr(armdeviceregistry.StreamDestinationTargetMqtt),
	// 					Configuration: &armdeviceregistry.MqttDestinationConfiguration{
	// 						Topic: to.Ptr("/contoso/test"),
	// 						Retain: to.Ptr(armdeviceregistry.TopicRetainTypeNever),
	// 						Qos: to.Ptr(armdeviceregistry.MqttDestinationQosQos0),
	// 						TTL: to.Ptr[int64](3600),
	// 					},
	// 				},
	// 			},
	// 			Datasets: []*armdeviceregistry.NamespaceDiscoveredDataset{
	// 				{
	// 					Name: to.Ptr("dataset1"),
	// 					DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/Boiler;i=5"),
	// 					TypeRef: to.Ptr("dataset1TypeRef"),
	// 					DatasetConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
	// 					LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
	// 					Destinations: []armdeviceregistry.DatasetDestinationClassification{
	// 						&armdeviceregistry.DatasetBrokerStateStoreDestination{
	// 							Target: to.Ptr(armdeviceregistry.DatasetDestinationTargetBrokerStateStore),
	// 							Configuration: &armdeviceregistry.BrokerStateStoreDestinationConfiguration{
	// 								Key: to.Ptr("dataset1"),
	// 							},
	// 						},
	// 					},
	// 					DataPoints: []*armdeviceregistry.NamespaceDiscoveredDatasetDataPoint{
	// 						{
	// 							Name: to.Ptr("dataset1DataPoint1"),
	// 							DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3"),
	// 							DataPointConfiguration: to.Ptr("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
	// 							TypeRef: to.Ptr("dataset1DataPoint1TypeRef"),
	// 							LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
	// 						},
	// 						{
	// 							Name: to.Ptr("dataset1DataPoint2"),
	// 							DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4"),
	// 							DataPointConfiguration: to.Ptr("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
	// 							TypeRef: to.Ptr("dataset1DataPoint2TypeRef"),
	// 							LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
	// 						},
	// 					},
	// 				},
	// 			},
	// 			Streams: []*armdeviceregistry.NamespaceDiscoveredStream{
	// 				{
	// 					Name: to.Ptr("stream1"),
	// 					StreamConfiguration: to.Ptr("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
	// 					LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
	// 					TypeRef: to.Ptr("stream1TypeRef"),
	// 					Destinations: []armdeviceregistry.StreamDestinationClassification{
	// 						&armdeviceregistry.StreamStorageDestination{
	// 							Target: to.Ptr(armdeviceregistry.StreamDestinationTargetStorage),
	// 							Configuration: &armdeviceregistry.StorageDestinationConfiguration{
	// 								Path: to.Ptr("/tmp/stream1"),
	// 							},
	// 						},
	// 					},
	// 				},
	// 				{
	// 					Name: to.Ptr("stream2"),
	// 					StreamConfiguration: to.Ptr("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
	// 					LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
	// 					TypeRef: to.Ptr("stream2TypeRef"),
	// 					Destinations: []armdeviceregistry.StreamDestinationClassification{
	// 						&armdeviceregistry.StreamMqttDestination{
	// 							Target: to.Ptr(armdeviceregistry.StreamDestinationTargetMqtt),
	// 							Configuration: &armdeviceregistry.MqttDestinationConfiguration{
	// 								Topic: to.Ptr("/contoso/testStream2"),
	// 								Retain: to.Ptr(armdeviceregistry.TopicRetainTypeNever),
	// 								Qos: to.Ptr(armdeviceregistry.MqttDestinationQosQos0),
	// 								TTL: to.Ptr[int64](7200),
	// 							},
	// 						},
	// 					},
	// 				},
	// 			},
	// 			ManagementGroups: []*armdeviceregistry.NamespaceDiscoveredManagementGroup{
	// 				{
	// 					Name: to.Ptr("managementGroup1"),
	// 					ManagementGroupConfiguration: to.Ptr("{\"retryCount\":10,\"retryBackoffInterval\":15}"),
	// 					TypeRef: to.Ptr("managementGroup1TypeRef"),
	// 					LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
	// 					DefaultTopic: to.Ptr("/contoso/managementGroup1"),
	// 					DefaultTimeoutInSeconds: to.Ptr[int32](100),
	// 					Actions: []*armdeviceregistry.NamespaceDiscoveredManagementAction{
	// 						{
	// 							Name: to.Ptr("action1"),
	// 							ActionConfiguration: to.Ptr("{\"retryCount\":5,\"retryBackoffInterval\":5}"),
	// 							TargetURI: to.Ptr("/onvif/device_service?ONVIFProfile=Profile1"),
	// 							Topic: to.Ptr("/contoso/managementGroup1/action1"),
	// 							TypeRef: to.Ptr("action1TypeRef"),
	// 							ActionType: to.Ptr(armdeviceregistry.NamespaceDiscoveredManagementActionTypeCall),
	// 							TimeoutInSeconds: to.Ptr[int32](60),
	// 							LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
	// 						},
	// 						{
	// 							Name: to.Ptr("action2"),
	// 							ActionConfiguration: to.Ptr("{\"retryCount\":5,\"retryBackoffInterval\":5}"),
	// 							TargetURI: to.Ptr("/onvif/device_service?ONVIFProfile=Profile2"),
	// 							Topic: to.Ptr("/contoso/managementGroup1/action2"),
	// 							TypeRef: to.Ptr("action2TypeRef"),
	// 							ActionType: to.Ptr(armdeviceregistry.NamespaceDiscoveredManagementActionTypeCall),
	// 							TimeoutInSeconds: to.Ptr[int32](60),
	// 							LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
	// 						},
	// 					},
	// 				},
	// 			},
	// 			ProvisioningState: to.Ptr(armdeviceregistry.ProvisioningStateSucceeded),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2026-03-01-preview/Delete_NamespaceDiscoveredAsset.json
func ExampleNamespaceDiscoveredAssetsClient_BeginDelete() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdeviceregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewNamespaceDiscoveredAssetsClient().BeginDelete(ctx, "myResourceGroup", "my-namespace-1", "my-discoveredasset-1", 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: 2026-03-01-preview/Get_NamespaceDiscoveredAsset.json
func ExampleNamespaceDiscoveredAssetsClient_Get() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdeviceregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewNamespaceDiscoveredAssetsClient().Get(ctx, "myResourceGroup", "my-namespace-1", "my-discoveredasset-1", 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 = armdeviceregistry.NamespaceDiscoveredAssetsClientGetResponse{
	// 	NamespaceDiscoveredAsset: armdeviceregistry.NamespaceDiscoveredAsset{
	// 		ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/namespaces/my-namespace-1/discoveredAssets/my-discoveredasset-1"),
	// 		Name: to.Ptr("my-discoveredasset-1"),
	// 		Type: to.Ptr("Microsoft.DeviceRegistry/namespaces/discoveredAssets"),
	// 		Location: to.Ptr("West Europe"),
	// 		ExtendedLocation: &armdeviceregistry.ExtendedLocation{
	// 			Type: to.Ptr("CustomLocation"),
	// 			Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
	// 		},
	// 		Tags: map[string]*string{
	// 			"site": to.Ptr("building-1"),
	// 		},
	// 		SystemData: &armdeviceregistry.SystemData{
	// 			CreatedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
	// 			CreatedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T00:36:43.2516899Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
	// 			LastModifiedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T01:37:16.0922793Z"); return t}()),
	// 		},
	// 		Properties: &armdeviceregistry.NamespaceDiscoveredAssetProperties{
	// 			DeviceRef: &armdeviceregistry.DeviceRef{
	// 				DeviceName: to.Ptr("myDevice"),
	// 				EndpointName: to.Ptr("opcuaendpointname"),
	// 			},
	// 			AssetTypeRefs: []*string{
	// 				to.Ptr("myAssetTypeRef1"),
	// 				to.Ptr("myAssetTypeRef2"),
	// 			},
	// 			DiscoveryID: to.Ptr("11111111-1111-1111-1111-111111111111"),
	// 			Version: to.Ptr[int64](73766),
	// 			Manufacturer: to.Ptr("Contoso"),
	// 			ManufacturerURI: to.Ptr("https://www.contoso.com/manufacturerUri"),
	// 			Model: to.Ptr("ContosoModel"),
	// 			ProductCode: to.Ptr("SA34VDG"),
	// 			HardwareRevision: to.Ptr("1.0"),
	// 			SoftwareRevision: to.Ptr("2.0"),
	// 			DocumentationURI: to.Ptr("https://www.example.com/manual"),
	// 			SerialNumber: to.Ptr("64-103816-519918-8"),
	// 			DefaultDatasetsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
	// 			DefaultManagementGroupsConfiguration: to.Ptr("{\"retryCount\":10,\"retryBackoffInterval\":15}"),
	// 			Datasets: []*armdeviceregistry.NamespaceDiscoveredDataset{
	// 				{
	// 					Name: to.Ptr("dataset1"),
	// 					DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/Boiler;i=5"),
	// 					TypeRef: to.Ptr("dataset1TypeRef"),
	// 					DatasetConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
	// 					LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
	// 					DataPoints: []*armdeviceregistry.NamespaceDiscoveredDatasetDataPoint{
	// 						{
	// 							Name: to.Ptr("dataPoint1"),
	// 							DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1"),
	// 							TypeRef: to.Ptr("dataset1DataPoint1TypeRef"),
	// 							LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
	// 						},
	// 						{
	// 							Name: to.Ptr("dataPoint2"),
	// 							DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2"),
	// 							LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
	// 						},
	// 					},
	// 				},
	// 			},
	// 			Streams: []*armdeviceregistry.NamespaceDiscoveredStream{
	// 				{
	// 					Name: to.Ptr("stream1"),
	// 					StreamConfiguration: to.Ptr("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
	// 					TypeRef: to.Ptr("stream1TypeRef"),
	// 					LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
	// 					Destinations: []armdeviceregistry.StreamDestinationClassification{
	// 						&armdeviceregistry.StreamStorageDestination{
	// 							Target: to.Ptr(armdeviceregistry.StreamDestinationTargetStorage),
	// 							Configuration: &armdeviceregistry.StorageDestinationConfiguration{
	// 								Path: to.Ptr("/tmp/stream1"),
	// 							},
	// 						},
	// 					},
	// 				},
	// 				{
	// 					Name: to.Ptr("stream2"),
	// 					StreamConfiguration: to.Ptr("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
	// 					TypeRef: to.Ptr("stream2TypeRef"),
	// 					LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
	// 					Destinations: []armdeviceregistry.StreamDestinationClassification{
	// 						&armdeviceregistry.StreamMqttDestination{
	// 							Target: to.Ptr(armdeviceregistry.StreamDestinationTargetMqtt),
	// 							Configuration: &armdeviceregistry.MqttDestinationConfiguration{
	// 								Topic: to.Ptr("/contoso/testStream2"),
	// 								Retain: to.Ptr(armdeviceregistry.TopicRetainTypeNever),
	// 								Qos: to.Ptr(armdeviceregistry.MqttDestinationQosQos0),
	// 								TTL: to.Ptr[int64](7200),
	// 							},
	// 						},
	// 					},
	// 				},
	// 			},
	// 			ManagementGroups: []*armdeviceregistry.NamespaceDiscoveredManagementGroup{
	// 				{
	// 					Name: to.Ptr("managementGroup1"),
	// 					ManagementGroupConfiguration: to.Ptr("{\"retryCount\":10,\"retryBackoffInterval\":15}"),
	// 					TypeRef: to.Ptr("managementGroup1TypeRef"),
	// 					DefaultTopic: to.Ptr("/contoso/managementGroup1"),
	// 					DefaultTimeoutInSeconds: to.Ptr[int32](100),
	// 					LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
	// 					Actions: []*armdeviceregistry.NamespaceDiscoveredManagementAction{
	// 						{
	// 							Name: to.Ptr("action1"),
	// 							ActionConfiguration: to.Ptr("{\"retryCount\":5,\"retryBackoffInterval\":5}"),
	// 							TargetURI: to.Ptr("/onvif/device_service?ONVIFProfile=Profile1"),
	// 							Topic: to.Ptr("/contoso/managementGroup1/action1"),
	// 							TypeRef: to.Ptr("action1TypeRef"),
	// 							ActionType: to.Ptr(armdeviceregistry.NamespaceDiscoveredManagementActionTypeCall),
	// 							TimeoutInSeconds: to.Ptr[int32](60),
	// 							LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
	// 						},
	// 						{
	// 							Name: to.Ptr("action2"),
	// 							ActionConfiguration: to.Ptr("{\"retryCount\":5,\"retryBackoffInterval\":5}"),
	// 							TargetURI: to.Ptr("/onvif/device_service?ONVIFProfile=Profile2"),
	// 							Topic: to.Ptr("/contoso/managementGroup1/action2"),
	// 							TypeRef: to.Ptr("action2TypeRef"),
	// 							ActionType: to.Ptr(armdeviceregistry.NamespaceDiscoveredManagementActionTypeCall),
	// 							TimeoutInSeconds: to.Ptr[int32](60),
	// 							LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
	// 						},
	// 					},
	// 				},
	// 			},
	// 			ProvisioningState: to.Ptr(armdeviceregistry.ProvisioningStateSucceeded),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2026-03-01-preview/List_NamespaceDiscoveredAssets_ByResourceGroup.json
func ExampleNamespaceDiscoveredAssetsClient_NewListByResourceGroupPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdeviceregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewNamespaceDiscoveredAssetsClient().NewListByResourceGroupPager("myResourceGroup", "my-namespace-1", 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 = armdeviceregistry.NamespaceDiscoveredAssetsClientListByResourceGroupResponse{
		// 	NamespaceDiscoveredAssetListResult: armdeviceregistry.NamespaceDiscoveredAssetListResult{
		// 		Value: []*armdeviceregistry.NamespaceDiscoveredAsset{
		// 			{
		// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/namespaces/my-namespace-1/discoveredAssets/my-discoveredasset-1"),
		// 				Name: to.Ptr("my-discoveredasset-1"),
		// 				Type: to.Ptr("Microsoft.DeviceRegistry/namespaces/discoveredAssets"),
		// 				Location: to.Ptr("West Europe"),
		// 				ExtendedLocation: &armdeviceregistry.ExtendedLocation{
		// 					Type: to.Ptr("CustomLocation"),
		// 					Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
		// 				},
		// 				Tags: map[string]*string{
		// 					"site": to.Ptr("building-1"),
		// 				},
		// 				SystemData: &armdeviceregistry.SystemData{
		// 					CreatedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
		// 					CreatedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T00:36:43.2516899Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
		// 					LastModifiedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T01:37:16.0922793Z"); return t}()),
		// 				},
		// 				Properties: &armdeviceregistry.NamespaceDiscoveredAssetProperties{
		// 					DeviceRef: &armdeviceregistry.DeviceRef{
		// 						DeviceName: to.Ptr("myDevice"),
		// 						EndpointName: to.Ptr("opcuaendpointname"),
		// 					},
		// 					AssetTypeRefs: []*string{
		// 						to.Ptr("myAssetTypeRef1"),
		// 						to.Ptr("myAssetTypeRef2"),
		// 					},
		// 					DiscoveryID: to.Ptr("11111111-1111-1111-1111-111111111111"),
		// 					Version: to.Ptr[int64](73766),
		// 					Manufacturer: to.Ptr("Contoso"),
		// 					ManufacturerURI: to.Ptr("https://www.contoso.com/manufacturerUri"),
		// 					Model: to.Ptr("ContosoModel"),
		// 					ProductCode: to.Ptr("SA34VDG"),
		// 					HardwareRevision: to.Ptr("1.0"),
		// 					SoftwareRevision: to.Ptr("2.0"),
		// 					DocumentationURI: to.Ptr("https://www.example.com/manual"),
		// 					SerialNumber: to.Ptr("64-103816-519918-8"),
		// 					DefaultDatasetsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
		// 					DefaultManagementGroupsConfiguration: to.Ptr("{\"retryCount\":10,\"retryBackoffInterval\":15}"),
		// 					Datasets: []*armdeviceregistry.NamespaceDiscoveredDataset{
		// 						{
		// 							Name: to.Ptr("dataset1"),
		// 							DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/Boiler;i=5"),
		// 							TypeRef: to.Ptr("dataset1TypeRef"),
		// 							DatasetConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
		// 							LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
		// 							DataPoints: []*armdeviceregistry.NamespaceDiscoveredDatasetDataPoint{
		// 								{
		// 									Name: to.Ptr("dataPoint1"),
		// 									DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1"),
		// 									TypeRef: to.Ptr("dataset1DataPoint1TypeRef"),
		// 									LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
		// 								},
		// 								{
		// 									Name: to.Ptr("dataPoint2"),
		// 									DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2"),
		// 									LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
		// 								},
		// 							},
		// 						},
		// 					},
		// 					ManagementGroups: []*armdeviceregistry.NamespaceDiscoveredManagementGroup{
		// 						{
		// 							Name: to.Ptr("managementGroup1"),
		// 							ManagementGroupConfiguration: to.Ptr("{\"retryCount\":10,\"retryBackoffInterval\":15}"),
		// 							TypeRef: to.Ptr("managementGroup1TypeRef"),
		// 							DefaultTopic: to.Ptr("/contoso/managementGroup1"),
		// 							DefaultTimeoutInSeconds: to.Ptr[int32](100),
		// 							LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
		// 							Actions: []*armdeviceregistry.NamespaceDiscoveredManagementAction{
		// 								{
		// 									Name: to.Ptr("action1"),
		// 									ActionConfiguration: to.Ptr("{\"retryCount\":5,\"retryBackoffInterval\":5}"),
		// 									TargetURI: to.Ptr("/onvif/device_service?ONVIFProfile=Profile1"),
		// 									Topic: to.Ptr("/contoso/managementGroup1/action1"),
		// 									TypeRef: to.Ptr("action1TypeRef"),
		// 									ActionType: to.Ptr(armdeviceregistry.NamespaceDiscoveredManagementActionTypeCall),
		// 									TimeoutInSeconds: to.Ptr[int32](60),
		// 									LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
		// 								},
		// 								{
		// 									Name: to.Ptr("action2"),
		// 									ActionConfiguration: to.Ptr("{\"retryCount\":5,\"retryBackoffInterval\":5}"),
		// 									TargetURI: to.Ptr("/onvif/device_service?ONVIFProfile=Profile2"),
		// 									Topic: to.Ptr("/contoso/managementGroup1/action2"),
		// 									TypeRef: to.Ptr("action2TypeRef"),
		// 									ActionType: to.Ptr(armdeviceregistry.NamespaceDiscoveredManagementActionTypeCall),
		// 									TimeoutInSeconds: to.Ptr[int32](60),
		// 									LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
		// 								},
		// 							},
		// 						},
		// 					},
		// 					ProvisioningState: to.Ptr(armdeviceregistry.ProvisioningStateSucceeded),
		// 				},
		// 			},
		// 			{
		// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/namespaces/my-namespace-1/discoveredAssets/my-discoveredasset-2"),
		// 				Name: to.Ptr("my-discoveredasset-2"),
		// 				Type: to.Ptr("Microsoft.DeviceRegistry/namespaces/discoveredAssets"),
		// 				Location: to.Ptr("West Europe"),
		// 				ExtendedLocation: &armdeviceregistry.ExtendedLocation{
		// 					Type: to.Ptr("CustomLocation"),
		// 					Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
		// 				},
		// 				Tags: map[string]*string{
		// 					"site": to.Ptr("building-2"),
		// 				},
		// 				SystemData: &armdeviceregistry.SystemData{
		// 					CreatedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
		// 					CreatedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T00:36:43.2516899Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
		// 					LastModifiedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T01:37:16.0922793Z"); return t}()),
		// 				},
		// 				Properties: &armdeviceregistry.NamespaceDiscoveredAssetProperties{
		// 					DeviceRef: &armdeviceregistry.DeviceRef{
		// 						DeviceName: to.Ptr("myDevice"),
		// 						EndpointName: to.Ptr("opcuaendpointname"),
		// 					},
		// 					DiscoveryID: to.Ptr("11111111-1111-1111-1111-111111111111"),
		// 					Version: to.Ptr[int64](73766),
		// 					Manufacturer: to.Ptr("Contoso"),
		// 					ManufacturerURI: to.Ptr("https://www.contoso.com/manufacturerUri"),
		// 					Model: to.Ptr("ContosoModel"),
		// 					ProductCode: to.Ptr("SA34VDG"),
		// 					HardwareRevision: to.Ptr("1.0"),
		// 					SoftwareRevision: to.Ptr("2.0"),
		// 					DocumentationURI: to.Ptr("https://www.example.com/manual"),
		// 					SerialNumber: to.Ptr("64-103816-519918-8"),
		// 					DefaultDatasetsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
		// 					Datasets: []*armdeviceregistry.NamespaceDiscoveredDataset{
		// 						{
		// 							Name: to.Ptr("dataset1"),
		// 							DatasetConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
		// 							LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
		// 							DataPoints: []*armdeviceregistry.NamespaceDiscoveredDatasetDataPoint{
		// 								{
		// 									Name: to.Ptr("dataPoint1"),
		// 									DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1"),
		// 									LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
		// 								},
		// 								{
		// 									Name: to.Ptr("dataPoint2"),
		// 									DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2"),
		// 									LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
		// 								},
		// 							},
		// 						},
		// 					},
		// 					ProvisioningState: to.Ptr(armdeviceregistry.ProvisioningStateSucceeded),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2026-03-01-preview/Update_NamespaceDiscoveredAsset.json
func ExampleNamespaceDiscoveredAssetsClient_BeginUpdate() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdeviceregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewNamespaceDiscoveredAssetsClient().BeginUpdate(ctx, "myResourceGroup", "my-namespace-1", "my-discoveredasset-1", armdeviceregistry.NamespaceDiscoveredAssetUpdate{
		Properties: &armdeviceregistry.NamespaceDiscoveredAssetUpdateProperties{
			DocumentationURI: to.Ptr("https://www.example.com/manual-2"),
		},
	}, 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 = armdeviceregistry.NamespaceDiscoveredAssetsClientUpdateResponse{
	// 	NamespaceDiscoveredAsset: armdeviceregistry.NamespaceDiscoveredAsset{
	// 		ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/namespaces/my-namespace-1/discoveredAssets/my-discoveredasset-1"),
	// 		Name: to.Ptr("my-asset"),
	// 		Type: to.Ptr("Microsoft.DeviceRegistry/namespaces/discoveredAssets"),
	// 		Location: to.Ptr("West Europe"),
	// 		ExtendedLocation: &armdeviceregistry.ExtendedLocation{
	// 			Type: to.Ptr("CustomLocation"),
	// 			Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
	// 		},
	// 		Tags: map[string]*string{
	// 			"site": to.Ptr("building-1"),
	// 		},
	// 		SystemData: &armdeviceregistry.SystemData{
	// 			CreatedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
	// 			CreatedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T00:36:43.2516899Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
	// 			LastModifiedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T01:37:16.0922793Z"); return t}()),
	// 		},
	// 		Properties: &armdeviceregistry.NamespaceDiscoveredAssetProperties{
	// 			DeviceRef: &armdeviceregistry.DeviceRef{
	// 				DeviceName: to.Ptr("myDevice"),
	// 				EndpointName: to.Ptr("opcuaendpointname"),
	// 			},
	// 			AssetTypeRefs: []*string{
	// 				to.Ptr("myAssetTypeRef1"),
	// 				to.Ptr("myAssetTypeRef2"),
	// 			},
	// 			DiscoveryID: to.Ptr("11111111-1111-1111-1111-111111111111"),
	// 			Version: to.Ptr[int64](73766),
	// 			Manufacturer: to.Ptr("Contoso"),
	// 			ManufacturerURI: to.Ptr("https://www.contoso.com/manufacturerUri"),
	// 			Model: to.Ptr("ContosoModel"),
	// 			ProductCode: to.Ptr("SA34VDG"),
	// 			HardwareRevision: to.Ptr("1.0"),
	// 			SoftwareRevision: to.Ptr("2.0"),
	// 			DocumentationURI: to.Ptr("https://www.example.com/manual-2"),
	// 			SerialNumber: to.Ptr("64-103816-519918-8"),
	// 			DefaultDatasetsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
	// 			DefaultManagementGroupsConfiguration: to.Ptr("{\"retryCount\":10,\"retryBackoffInterval\":15}"),
	// 			Datasets: []*armdeviceregistry.NamespaceDiscoveredDataset{
	// 				{
	// 					Name: to.Ptr("dataset1"),
	// 					DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/Boiler;i=5"),
	// 					TypeRef: to.Ptr("dataset1TypeRef"),
	// 					DatasetConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
	// 					LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
	// 					DataPoints: []*armdeviceregistry.NamespaceDiscoveredDatasetDataPoint{
	// 						{
	// 							Name: to.Ptr("dataPoint1"),
	// 							DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1"),
	// 							TypeRef: to.Ptr("dataset1DataPoint1TypeRef"),
	// 							LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
	// 						},
	// 						{
	// 							Name: to.Ptr("dataPoint2"),
	// 							DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2"),
	// 							LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
	// 						},
	// 					},
	// 				},
	// 			},
	// 			Streams: []*armdeviceregistry.NamespaceDiscoveredStream{
	// 				{
	// 					Name: to.Ptr("stream1"),
	// 					StreamConfiguration: to.Ptr("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
	// 					TypeRef: to.Ptr("stream1TypeRef"),
	// 					LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
	// 					Destinations: []armdeviceregistry.StreamDestinationClassification{
	// 						&armdeviceregistry.StreamStorageDestination{
	// 							Target: to.Ptr(armdeviceregistry.StreamDestinationTargetStorage),
	// 							Configuration: &armdeviceregistry.StorageDestinationConfiguration{
	// 								Path: to.Ptr("/tmp/stream1"),
	// 							},
	// 						},
	// 					},
	// 				},
	// 				{
	// 					Name: to.Ptr("stream2"),
	// 					StreamConfiguration: to.Ptr("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
	// 					TypeRef: to.Ptr("stream2TypeRef"),
	// 					LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
	// 					Destinations: []armdeviceregistry.StreamDestinationClassification{
	// 						&armdeviceregistry.StreamMqttDestination{
	// 							Target: to.Ptr(armdeviceregistry.StreamDestinationTargetMqtt),
	// 							Configuration: &armdeviceregistry.MqttDestinationConfiguration{
	// 								Topic: to.Ptr("/contoso/testStream2"),
	// 								Retain: to.Ptr(armdeviceregistry.TopicRetainTypeNever),
	// 								Qos: to.Ptr(armdeviceregistry.MqttDestinationQosQos0),
	// 								TTL: to.Ptr[int64](7200),
	// 							},
	// 						},
	// 					},
	// 				},
	// 			},
	// 			ManagementGroups: []*armdeviceregistry.NamespaceDiscoveredManagementGroup{
	// 				{
	// 					Name: to.Ptr("managementGroup1"),
	// 					ManagementGroupConfiguration: to.Ptr("{\"retryCount\":10,\"retryBackoffInterval\":15}"),
	// 					TypeRef: to.Ptr("managementGroup1TypeRef"),
	// 					DefaultTopic: to.Ptr("/contoso/managementGroup1"),
	// 					DefaultTimeoutInSeconds: to.Ptr[int32](100),
	// 					LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
	// 					Actions: []*armdeviceregistry.NamespaceDiscoveredManagementAction{
	// 						{
	// 							Name: to.Ptr("action1"),
	// 							ActionConfiguration: to.Ptr("{\"retryCount\":5,\"retryBackoffInterval\":5}"),
	// 							TargetURI: to.Ptr("/onvif/device_service?ONVIFProfile=Profile1"),
	// 							Topic: to.Ptr("/contoso/managementGroup1/action1"),
	// 							TypeRef: to.Ptr("action1TypeRef"),
	// 							ActionType: to.Ptr(armdeviceregistry.NamespaceDiscoveredManagementActionTypeCall),
	// 							TimeoutInSeconds: to.Ptr[int32](60),
	// 							LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
	// 						},
	// 						{
	// 							Name: to.Ptr("action2"),
	// 							ActionConfiguration: to.Ptr("{\"retryCount\":5,\"retryBackoffInterval\":5}"),
	// 							TargetURI: to.Ptr("/onvif/device_service?ONVIFProfile=Profile2"),
	// 							Topic: to.Ptr("/contoso/managementGroup1/action2"),
	// 							TypeRef: to.Ptr("action2TypeRef"),
	// 							ActionType: to.Ptr(armdeviceregistry.NamespaceDiscoveredManagementActionTypeCall),
	// 							TimeoutInSeconds: to.Ptr[int32](60),
	// 							LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-09T14:20:00.52Z"); return t}()),
	// 						},
	// 					},
	// 				},
	// 			},
	// 			ProvisioningState: to.Ptr(armdeviceregistry.ProvisioningStateSucceeded),
	// 		},
	// 	},
	// }
}
