diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/ArmDeviceRegistryModelFactory.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/ArmDeviceRegistryModelFactory.cs index 23be7c4b75af..8983de055604 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/ArmDeviceRegistryModelFactory.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/ArmDeviceRegistryModelFactory.cs @@ -236,7 +236,7 @@ public static DeviceRegistryBillingContainerData DeviceRegistryBillingContainerD serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -245,12 +245,12 @@ public static DeviceRegistryBillingContainerData DeviceRegistryBillingContainerD /// The location. /// The resource-specific properties for this resource. /// The managed service identities assigned to this resource. Current supported identity types: None, SystemAssigned. - /// A new instance for mocking. - public static DeviceRegistryNamespaceData DeviceRegistryNamespaceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, DeviceRegistryNamespaceProperties properties = null, ManagedServiceIdentity identity = null) + /// A new instance for mocking. + public static NamespaceData NamespaceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, NamespaceProperties properties = null, ManagedServiceIdentity identity = null) { tags ??= new Dictionary(); - return new DeviceRegistryNamespaceData( + return new NamespaceData( id, name, resourceType, @@ -262,30 +262,30 @@ public static DeviceRegistryNamespaceData DeviceRegistryNamespaceData(ResourceId serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Globally unique, immutable, non-reusable ID. /// Assigned and unassigned messaging endpoints. /// Provisioning state of the resource. - /// A new instance for mocking. - public static DeviceRegistryNamespaceProperties DeviceRegistryNamespaceProperties(string uuid = null, IDictionary messagingEndpoints = null, DeviceRegistryProvisioningState? provisioningState = null) + /// A new instance for mocking. + public static NamespaceProperties NamespaceProperties(string uuid = null, IDictionary messagingEndpoints = null, DeviceRegistryProvisioningState? provisioningState = null) { messagingEndpoints ??= new Dictionary(); - return new DeviceRegistryNamespaceProperties(uuid, messagingEndpoints != null ? new Messaging(messagingEndpoints, serializedAdditionalRawData: null) : null, provisioningState, serializedAdditionalRawData: null); + return new NamespaceProperties(uuid, messagingEndpoints != null ? new Messaging(messagingEndpoints, serializedAdditionalRawData: null) : null, provisioningState, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Multi-part error code for classification and root causing of errors (ex: 400.200.100.432). /// Human-readable helpful error message to provide additional context for error (ex: “Authentication method not supported”). /// Human-readable helpful detailed text context for debugging (ex: “The following mechanisms are supported...”). /// Unique identifier for the transaction to aid in debugging. - /// A new instance for mocking. - public static DeviceRegistryErrorDetails DeviceRegistryErrorDetails(string code = null, string message = null, string info = null, string correlationId = null) + /// A new instance for mocking. + public static ErrorDetails ErrorDetails(string code = null, string message = null, string info = null, string correlationId = null) { - return new DeviceRegistryErrorDetails(code, message, info, correlationId, serializedAdditionalRawData: null); + return new ErrorDetails(code, message, info, correlationId, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -294,12 +294,12 @@ public static DeviceRegistryErrorDetails DeviceRegistryErrorDetails(string code /// The location. /// The resource-specific properties for this resource. /// The extended location. - /// A new instance for mocking. - public static DeviceRegistryNamespaceAssetData DeviceRegistryNamespaceAssetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, DeviceRegistryNamespaceAssetProperties properties = null, DeviceRegistryExtendedLocation extendedLocation = null) + /// A new instance for mocking. + public static NamespaceAssetData NamespaceAssetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, NamespaceAssetProperties properties = null, DeviceRegistryExtendedLocation extendedLocation = null) { tags ??= new Dictionary(); - return new DeviceRegistryNamespaceAssetData( + return new NamespaceAssetData( id, name, resourceType, @@ -311,7 +311,7 @@ public static DeviceRegistryNamespaceAssetData DeviceRegistryNamespaceAssetData( serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Globally unique, immutable, non-reusable ID. /// Enabled/disabled status of the asset. /// Asset ID provided by the customer. @@ -356,8 +356,8 @@ public static DeviceRegistryNamespaceAssetData DeviceRegistryNamespaceAssetData( /// Array of management groups that are part of the asset. Each management group can have a per-group configuration. /// Read only object to reflect changes that have occurred on the Edge. Similar to Kubernetes status property for custom resources. /// Provisioning state of the resource. - /// A new instance for mocking. - public static DeviceRegistryNamespaceAssetProperties DeviceRegistryNamespaceAssetProperties(string uuid = null, bool? enabled = null, string externalAssetId = null, string displayName = null, string description = null, DeviceRef deviceRef = null, IEnumerable assetTypeRefs = null, long? version = null, DateTimeOffset? lastTransitionOn = null, string manufacturer = null, string manufacturerUri = null, string model = null, string productCode = null, string hardwareRevision = null, string softwareRevision = null, string documentationUri = null, string serialNumber = null, IDictionary attributes = null, IEnumerable discoveredAssetRefs = null, string defaultDatasetsConfiguration = null, string defaultEventsConfiguration = null, string defaultStreamsConfiguration = null, string defaultManagementGroupsConfiguration = null, IEnumerable defaultDatasetsDestinations = null, IEnumerable defaultEventsDestinations = null, IEnumerable defaultStreamsDestinations = null, IEnumerable datasets = null, IEnumerable eventGroups = null, IEnumerable streams = null, IEnumerable managementGroups = null, DeviceRegistryNamespaceAssetStatus status = null, DeviceRegistryProvisioningState? provisioningState = null) + /// A new instance for mocking. + public static NamespaceAssetProperties NamespaceAssetProperties(string uuid = null, bool? enabled = null, string externalAssetId = null, string displayName = null, string description = null, DeviceRef deviceRef = null, IEnumerable assetTypeRefs = null, long? version = null, DateTimeOffset? lastTransitionOn = null, string manufacturer = null, string manufacturerUri = null, string model = null, string productCode = null, string hardwareRevision = null, string softwareRevision = null, string documentationUri = null, string serialNumber = null, IDictionary attributes = null, IEnumerable discoveredAssetRefs = null, string defaultDatasetsConfiguration = null, string defaultEventsConfiguration = null, string defaultStreamsConfiguration = null, string defaultManagementGroupsConfiguration = null, IEnumerable defaultDatasetsDestinations = null, IEnumerable defaultEventsDestinations = null, IEnumerable defaultStreamsDestinations = null, IEnumerable datasets = null, IEnumerable eventGroups = null, IEnumerable streams = null, IEnumerable managementGroups = null, NamespaceAssetStatus status = null, DeviceRegistryProvisioningState? provisioningState = null) { assetTypeRefs ??= new List(); attributes ??= new Dictionary(); @@ -370,7 +370,7 @@ public static DeviceRegistryNamespaceAssetProperties DeviceRegistryNamespaceAsse streams ??= new List(); managementGroups ??= new List(); - return new DeviceRegistryNamespaceAssetProperties( + return new NamespaceAssetProperties( uuid, enabled, externalAssetId, @@ -406,21 +406,21 @@ public static DeviceRegistryNamespaceAssetProperties DeviceRegistryNamespaceAsse serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Defines the asset status config properties. /// Array of dataset statuses that describe the status of each dataset. /// Array of event group statuses that describe the status of each event group. /// Array of stream statuses that describe the status of each stream. /// Array of management group statuses that describe the status of each management group. - /// A new instance for mocking. - public static DeviceRegistryNamespaceAssetStatus DeviceRegistryNamespaceAssetStatus(DeviceRegistryStatusConfig config = null, IEnumerable datasets = null, IEnumerable eventGroups = null, IEnumerable streams = null, IEnumerable managementGroups = null) + /// A new instance for mocking. + public static NamespaceAssetStatus NamespaceAssetStatus(StatusConfig config = null, IEnumerable datasets = null, IEnumerable eventGroups = null, IEnumerable streams = null, IEnumerable managementGroups = null) { - datasets ??= new List(); - eventGroups ??= new List(); - streams ??= new List(); - managementGroups ??= new List(); + datasets ??= new List(); + eventGroups ??= new List(); + streams ??= new List(); + managementGroups ??= new List(); - return new DeviceRegistryNamespaceAssetStatus( + return new NamespaceAssetStatus( config, datasets?.ToList(), eventGroups?.ToList(), @@ -429,102 +429,102 @@ public static DeviceRegistryNamespaceAssetStatus DeviceRegistryNamespaceAssetSta serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// A read-only incremental counter indicating the number of times the configuration has been modified from the perspective of the current actual (edge) state of the CRD. Edge would be the only writer of this value and would sync back up to the cloud. In steady state, this should equal version. /// A read-only timestamp indicating the last time the configuration has been modified from the perspective of the current actual (edge) state of the CRD. Edge would be the only writer of this value and would sync back up to the cloud. /// Object to transfer and persist errors that originate from the edge. - /// A new instance for mocking. - public static DeviceRegistryStatusConfig DeviceRegistryStatusConfig(long? version = null, DateTimeOffset? lastTransitionOn = null, DeviceRegistryStatusError error = null) + /// A new instance for mocking. + public static StatusConfig StatusConfig(long? version = null, DateTimeOffset? lastTransitionOn = null, StatusError error = null) { - return new DeviceRegistryStatusConfig(version, lastTransitionOn, error, serializedAdditionalRawData: null); + return new StatusConfig(version, lastTransitionOn, error, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Error code for classification of errors (ex: '400', '404', '500', etc.). /// Human-readable helpful error message to provide additional context for error (e.g.,: “Capability ID 'foo' does not exist”). /// Array of error details that describe the status of each error. - /// A new instance for mocking. - public static DeviceRegistryStatusError DeviceRegistryStatusError(string code = null, string message = null, IEnumerable details = null) + /// A new instance for mocking. + public static StatusError StatusError(string code = null, string message = null, IEnumerable details = null) { - details ??= new List(); + details ??= new List(); - return new DeviceRegistryStatusError(code, message, details?.ToList(), serializedAdditionalRawData: null); + return new StatusError(code, message, details?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The name of the dataset. Must be unique within the status.datasets array. This name is used to correlate between the spec and status dataset information. /// The message schema reference object. /// Object to transfer and persist errors that originate from the edge. - /// A new instance for mocking. - public static DeviceRegistryNamespaceAssetStatusDataset DeviceRegistryNamespaceAssetStatusDataset(string name = null, DeviceRegistryNamespaceMessageSchemaReference messageSchemaReference = null, DeviceRegistryStatusError error = null) + /// A new instance for mocking. + public static NamespaceAssetStatusDataset NamespaceAssetStatusDataset(string name = null, NamespaceMessageSchemaReference messageSchemaReference = null, StatusError error = null) { - return new DeviceRegistryNamespaceAssetStatusDataset(name, messageSchemaReference, error, serializedAdditionalRawData: null); + return new NamespaceAssetStatusDataset(name, messageSchemaReference, error, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The message schema registry namespace. /// The message schema name. /// The message schema version. - /// A new instance for mocking. - public static DeviceRegistryNamespaceMessageSchemaReference DeviceRegistryNamespaceMessageSchemaReference(string schemaRegistryNamespace = null, string schemaName = null, string schemaVersion = null) + /// A new instance for mocking. + public static NamespaceMessageSchemaReference NamespaceMessageSchemaReference(string schemaRegistryNamespace = null, string schemaName = null, string schemaVersion = null) { - return new DeviceRegistryNamespaceMessageSchemaReference(schemaRegistryNamespace, schemaName, schemaVersion, serializedAdditionalRawData: null); + return new NamespaceMessageSchemaReference(schemaRegistryNamespace, schemaName, schemaVersion, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The name of the event group. Must be unique within the status.eventGroups array. This name is used to correlate between the spec and status event group information. /// Array of event statuses that describe the status of each event in the event group. - /// A new instance for mocking. - public static DeviceRegistryNamespaceAssetStatusEventGroup DeviceRegistryNamespaceAssetStatusEventGroup(string name = null, IEnumerable events = null) + /// A new instance for mocking. + public static NamespaceAssetStatusEventGroup NamespaceAssetStatusEventGroup(string name = null, IEnumerable events = null) { - events ??= new List(); + events ??= new List(); - return new DeviceRegistryNamespaceAssetStatusEventGroup(name, events?.ToList(), serializedAdditionalRawData: null); + return new NamespaceAssetStatusEventGroup(name, events?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The name of the event. Must be unique within the status.events array. This name is used to correlate between the spec and status event information. /// The message schema reference object. /// Object to transfer and persist errors that originate from the edge. - /// A new instance for mocking. - public static DeviceRegistryNamespaceAssetStatusEvent DeviceRegistryNamespaceAssetStatusEvent(string name = null, DeviceRegistryNamespaceMessageSchemaReference messageSchemaReference = null, DeviceRegistryStatusError error = null) + /// A new instance for mocking. + public static NamespaceAssetStatusEvent NamespaceAssetStatusEvent(string name = null, NamespaceMessageSchemaReference messageSchemaReference = null, StatusError error = null) { - return new DeviceRegistryNamespaceAssetStatusEvent(name, messageSchemaReference, error, serializedAdditionalRawData: null); + return new NamespaceAssetStatusEvent(name, messageSchemaReference, error, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The name of the stream. Must be unique within the status.streams array. This name is used to correlate between the spec and status event information. /// The message schema reference object. /// Object to transfer and persist errors that originate from the edge. - /// A new instance for mocking. - public static DeviceRegistryNamespaceAssetStatusStream DeviceRegistryNamespaceAssetStatusStream(string name = null, DeviceRegistryNamespaceMessageSchemaReference messageSchemaReference = null, DeviceRegistryStatusError error = null) + /// A new instance for mocking. + public static NamespaceAssetStatusStream NamespaceAssetStatusStream(string name = null, NamespaceMessageSchemaReference messageSchemaReference = null, StatusError error = null) { - return new DeviceRegistryNamespaceAssetStatusStream(name, messageSchemaReference, error, serializedAdditionalRawData: null); + return new NamespaceAssetStatusStream(name, messageSchemaReference, error, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The name of the management group. Must be unique within the status.managementGroups array. This name is used to correlate between the spec and status event information. /// Array of action statuses that describe the status of each action. - /// A new instance for mocking. - public static DeviceRegistryNamespaceAssetStatusManagementGroup DeviceRegistryNamespaceAssetStatusManagementGroup(string name = null, IEnumerable actions = null) + /// A new instance for mocking. + public static NamespaceAssetStatusManagementGroup NamespaceAssetStatusManagementGroup(string name = null, IEnumerable actions = null) { - actions ??= new List(); + actions ??= new List(); - return new DeviceRegistryNamespaceAssetStatusManagementGroup(name, actions?.ToList(), serializedAdditionalRawData: null); + return new NamespaceAssetStatusManagementGroup(name, actions?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The name of the action. Must be unique within the status.actions array. This name is used to correlate between the spec and status event information. /// The request message schema reference object for the action. /// The response message schema reference object for the action. /// Object to transfer and persist errors that originate from the edge. - /// A new instance for mocking. - public static DeviceRegistryNamespaceAssetStatusManagementAction DeviceRegistryNamespaceAssetStatusManagementAction(string name = null, DeviceRegistryNamespaceMessageSchemaReference requestMessageSchemaReference = null, DeviceRegistryNamespaceMessageSchemaReference responseMessageSchemaReference = null, DeviceRegistryStatusError error = null) + /// A new instance for mocking. + public static NamespaceAssetStatusManagementAction NamespaceAssetStatusManagementAction(string name = null, NamespaceMessageSchemaReference requestMessageSchemaReference = null, NamespaceMessageSchemaReference responseMessageSchemaReference = null, StatusError error = null) { - return new DeviceRegistryNamespaceAssetStatusManagementAction(name, requestMessageSchemaReference, responseMessageSchemaReference, error, serializedAdditionalRawData: null); + return new NamespaceAssetStatusManagementAction(name, requestMessageSchemaReference, responseMessageSchemaReference, error, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -534,12 +534,12 @@ public static DeviceRegistryNamespaceAssetStatusManagementAction DeviceRegistryN /// The resource-specific properties for this resource. /// Resource Tag. /// The extended location. - /// A new instance for mocking. - public static DeviceRegistryNamespaceDeviceData DeviceRegistryNamespaceDeviceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, DeviceRegistryNamespaceDeviceProperties properties = null, string etag = null, DeviceRegistryExtendedLocation extendedLocation = null) + /// A new instance for mocking. + public static NamespaceDeviceData NamespaceDeviceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, NamespaceDeviceProperties properties = null, string etag = null, DeviceRegistryExtendedLocation extendedLocation = null) { tags ??= new Dictionary(); - return new DeviceRegistryNamespaceDeviceData( + return new NamespaceDeviceData( id, name, resourceType, @@ -552,7 +552,7 @@ public static DeviceRegistryNamespaceDeviceData DeviceRegistryNamespaceDeviceDat serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// A unique identifier for the device. /// Indicates if the resource is enabled or not. /// The Device ID provided by the customer. @@ -567,12 +567,12 @@ public static DeviceRegistryNamespaceDeviceData DeviceRegistryNamespaceDeviceDat /// An integer that is incremented each time the resource is modified. /// A timestamp (in UTC) that is updated each time the resource is modified. /// Provisioning state of the resource. - /// A new instance for mocking. - public static DeviceRegistryNamespaceDeviceProperties DeviceRegistryNamespaceDeviceProperties(string uuid = null, bool? enabled = null, string externalDeviceId = null, string discoveredDeviceRef = null, string manufacturer = null, string model = null, string operatingSystem = null, string operatingSystemVersion = null, MessagingEndpoints endpoints = null, IDictionary attributes = null, DeviceStatus status = null, long? version = null, DateTimeOffset? lastTransitionOn = null, DeviceRegistryProvisioningState? provisioningState = null) + /// A new instance for mocking. + public static NamespaceDeviceProperties NamespaceDeviceProperties(string uuid = null, bool? enabled = null, string externalDeviceId = null, string discoveredDeviceRef = null, string manufacturer = null, string model = null, string operatingSystem = null, string operatingSystemVersion = null, MessagingEndpoints endpoints = null, IDictionary attributes = null, DeviceStatus status = null, long? version = null, DateTimeOffset? lastTransitionOn = null, DeviceRegistryProvisioningState? provisioningState = null) { attributes ??= new Dictionary(); - return new DeviceRegistryNamespaceDeviceProperties( + return new NamespaceDeviceProperties( uuid, enabled, externalDeviceId, @@ -594,7 +594,7 @@ public static DeviceRegistryNamespaceDeviceProperties DeviceRegistryNamespaceDev /// Defines the device status config properties. /// Defines the device status for inbound/outbound endpoints. /// A new instance for mocking. - public static DeviceStatus DeviceStatus(DeviceRegistryStatusConfig config = null, IReadOnlyDictionary endpointsInbound = null) + public static DeviceStatus DeviceStatus(StatusConfig config = null, IReadOnlyDictionary endpointsInbound = null) { endpointsInbound ??= new Dictionary(); @@ -604,12 +604,12 @@ public static DeviceStatus DeviceStatus(DeviceRegistryStatusConfig config = null /// Initializes a new instance of . /// Defines the error related to this endpoint. /// A new instance for mocking. - public static DeviceStatusEndpoint DeviceStatusEndpoint(DeviceRegistryStatusError error = null) + public static DeviceStatusEndpoint DeviceStatusEndpoint(StatusError error = null) { return new DeviceStatusEndpoint(error, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -618,12 +618,12 @@ public static DeviceStatusEndpoint DeviceStatusEndpoint(DeviceRegistryStatusErro /// The location. /// The resource-specific properties for this resource. /// The extended location. - /// A new instance for mocking. - public static DeviceRegistryNamespaceDiscoveredAssetData DeviceRegistryNamespaceDiscoveredAssetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, DeviceRegistryNamespaceDiscoveredAssetProperties properties = null, DeviceRegistryExtendedLocation extendedLocation = null) + /// A new instance for mocking. + public static NamespaceDiscoveredAssetData NamespaceDiscoveredAssetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, NamespaceDiscoveredAssetProperties properties = null, DeviceRegistryExtendedLocation extendedLocation = null) { tags ??= new Dictionary(); - return new DeviceRegistryNamespaceDiscoveredAssetData( + return new NamespaceDiscoveredAssetData( id, name, resourceType, @@ -635,7 +635,7 @@ public static DeviceRegistryNamespaceDiscoveredAssetData DeviceRegistryNamespace serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Reference to the device that provides data for this asset. Must provide device name & endpoint on the device to use. /// Human-readable display name. /// URIs or type definition IDs. @@ -676,8 +676,8 @@ public static DeviceRegistryNamespaceDiscoveredAssetData DeviceRegistryNamespace /// Array of streams that are part of the asset. Each stream can have a per-stream configuration. /// Array of management groups that are part of the asset. Each management group can have a per-group configuration. /// Provisioning state of the resource. - /// A new instance for mocking. - public static DeviceRegistryNamespaceDiscoveredAssetProperties DeviceRegistryNamespaceDiscoveredAssetProperties(DeviceRef deviceRef = null, string displayName = null, IEnumerable assetTypeRefs = null, string description = null, string discoveryId = null, string externalAssetId = null, long version = default, string manufacturer = null, string manufacturerUri = null, string model = null, string productCode = null, string hardwareRevision = null, string softwareRevision = null, string documentationUri = null, string serialNumber = null, IDictionary attributes = null, string defaultDatasetsConfiguration = null, string defaultEventsConfiguration = null, string defaultStreamsConfiguration = null, string defaultManagementGroupsConfiguration = null, IEnumerable defaultDatasetsDestinations = null, IEnumerable defaultEventsDestinations = null, IEnumerable defaultStreamsDestinations = null, IEnumerable datasets = null, IEnumerable eventGroups = null, IEnumerable streams = null, IEnumerable managementGroups = null, DeviceRegistryProvisioningState? provisioningState = null) + /// A new instance for mocking. + public static NamespaceDiscoveredAssetProperties NamespaceDiscoveredAssetProperties(DeviceRef deviceRef = null, string displayName = null, IEnumerable assetTypeRefs = null, string description = null, string discoveryId = null, string externalAssetId = null, long version = default, string manufacturer = null, string manufacturerUri = null, string model = null, string productCode = null, string hardwareRevision = null, string softwareRevision = null, string documentationUri = null, string serialNumber = null, IDictionary attributes = null, string defaultDatasetsConfiguration = null, string defaultEventsConfiguration = null, string defaultStreamsConfiguration = null, string defaultManagementGroupsConfiguration = null, IEnumerable defaultDatasetsDestinations = null, IEnumerable defaultEventsDestinations = null, IEnumerable defaultStreamsDestinations = null, IEnumerable datasets = null, IEnumerable eventGroups = null, IEnumerable streams = null, IEnumerable managementGroups = null, DeviceRegistryProvisioningState? provisioningState = null) { assetTypeRefs ??= new List(); attributes ??= new Dictionary(); @@ -689,7 +689,7 @@ public static DeviceRegistryNamespaceDiscoveredAssetProperties DeviceRegistryNam streams ??= new List(); managementGroups ??= new List(); - return new DeviceRegistryNamespaceDiscoveredAssetProperties( + return new NamespaceDiscoveredAssetProperties( deviceRef, displayName, assetTypeRefs?.ToList(), @@ -721,7 +721,7 @@ public static DeviceRegistryNamespaceDiscoveredAssetProperties DeviceRegistryNam serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -730,12 +730,12 @@ public static DeviceRegistryNamespaceDiscoveredAssetProperties DeviceRegistryNam /// The location. /// The resource-specific properties for this resource. /// The extended location. - /// A new instance for mocking. - public static DeviceRegistryNamespaceDiscoveredDeviceData DeviceRegistryNamespaceDiscoveredDeviceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, DeviceRegistryNamespaceDiscoveredDeviceProperties properties = null, DeviceRegistryExtendedLocation extendedLocation = null) + /// A new instance for mocking. + public static NamespaceDiscoveredDeviceData NamespaceDiscoveredDeviceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, NamespaceDiscoveredDeviceProperties properties = null, DeviceRegistryExtendedLocation extendedLocation = null) { tags ??= new Dictionary(); - return new DeviceRegistryNamespaceDiscoveredDeviceData( + return new NamespaceDiscoveredDeviceData( id, name, resourceType, @@ -747,7 +747,7 @@ public static DeviceRegistryNamespaceDiscoveredDeviceData DeviceRegistryNamespac serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// A device ID that represents the device in a system external to Azure. Unique within scope of an Azure tenant. /// Endpoints for discovered devices. /// Device manufacturer. @@ -758,12 +758,12 @@ public static DeviceRegistryNamespaceDiscoveredDeviceData DeviceRegistryNamespac /// Identifier used to detect changes in the discovered device. /// An integer that is incremented each time the resource is modified. /// Provisioning state of the resource. - /// A new instance for mocking. - public static DeviceRegistryNamespaceDiscoveredDeviceProperties DeviceRegistryNamespaceDiscoveredDeviceProperties(string externalDeviceId = null, DiscoveredMessagingEndpoints endpoints = null, string manufacturer = null, string model = null, string operatingSystem = null, string operatingSystemVersion = null, IDictionary attributes = null, string discoveryId = null, long version = default, DeviceRegistryProvisioningState? provisioningState = null) + /// A new instance for mocking. + public static NamespaceDiscoveredDeviceProperties NamespaceDiscoveredDeviceProperties(string externalDeviceId = null, DiscoveredMessagingEndpoints endpoints = null, string manufacturer = null, string model = null, string operatingSystem = null, string operatingSystemVersion = null, IDictionary attributes = null, string discoveryId = null, long version = default, DeviceRegistryProvisioningState? provisioningState = null) { attributes ??= new Dictionary(); - return new DeviceRegistryNamespaceDiscoveredDeviceProperties( + return new NamespaceDiscoveredDeviceProperties( externalDeviceId, endpoints, manufacturer, diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceAssetResource.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceAssetResource.Serialization.cs deleted file mode 100644 index f157cae33249..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceAssetResource.Serialization.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.DeviceRegistry -{ - public partial class DeviceRegistryNamespaceAssetResource : IJsonModel - { - private static DeviceRegistryNamespaceAssetData s_dataDeserializationInstance; - private static DeviceRegistryNamespaceAssetData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - DeviceRegistryNamespaceAssetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerDeviceRegistryContext.Default); - - DeviceRegistryNamespaceAssetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerDeviceRegistryContext.Default); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDeviceResource.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDeviceResource.Serialization.cs deleted file mode 100644 index f89f0fd43c34..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDeviceResource.Serialization.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.DeviceRegistry -{ - public partial class DeviceRegistryNamespaceDeviceResource : IJsonModel - { - private static DeviceRegistryNamespaceDeviceData s_dataDeserializationInstance; - private static DeviceRegistryNamespaceDeviceData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - DeviceRegistryNamespaceDeviceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerDeviceRegistryContext.Default); - - DeviceRegistryNamespaceDeviceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerDeviceRegistryContext.Default); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredAssetResource.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredAssetResource.Serialization.cs deleted file mode 100644 index 78c4b8ebe6c1..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredAssetResource.Serialization.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.DeviceRegistry -{ - public partial class DeviceRegistryNamespaceDiscoveredAssetResource : IJsonModel - { - private static DeviceRegistryNamespaceDiscoveredAssetData s_dataDeserializationInstance; - private static DeviceRegistryNamespaceDiscoveredAssetData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - DeviceRegistryNamespaceDiscoveredAssetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerDeviceRegistryContext.Default); - - DeviceRegistryNamespaceDiscoveredAssetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerDeviceRegistryContext.Default); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredDeviceResource.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredDeviceResource.Serialization.cs deleted file mode 100644 index 44be24267918..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredDeviceResource.Serialization.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.DeviceRegistry -{ - public partial class DeviceRegistryNamespaceDiscoveredDeviceResource : IJsonModel - { - private static DeviceRegistryNamespaceDiscoveredDeviceData s_dataDeserializationInstance; - private static DeviceRegistryNamespaceDiscoveredDeviceData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - DeviceRegistryNamespaceDiscoveredDeviceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerDeviceRegistryContext.Default); - - DeviceRegistryNamespaceDiscoveredDeviceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerDeviceRegistryContext.Default); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceResource.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceResource.Serialization.cs deleted file mode 100644 index 03c5c61426cb..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceResource.Serialization.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.DeviceRegistry -{ - public partial class DeviceRegistryNamespaceResource : IJsonModel - { - private static DeviceRegistryNamespaceData s_dataDeserializationInstance; - private static DeviceRegistryNamespaceData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - DeviceRegistryNamespaceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerDeviceRegistryContext.Default); - - DeviceRegistryNamespaceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerDeviceRegistryContext.Default); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/DeviceRegistryExtensions.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/DeviceRegistryExtensions.cs index 181b0c91a73c..c1a93dfd2bfb 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/DeviceRegistryExtensions.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/DeviceRegistryExtensions.cs @@ -90,98 +90,98 @@ public static DeviceRegistryBillingContainerResource GetDeviceRegistryBillingCon } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static DeviceRegistryNamespaceResource GetDeviceRegistryNamespaceResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static NamespaceResource GetNamespaceResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableDeviceRegistryArmClient(client).GetDeviceRegistryNamespaceResource(id); + return GetMockableDeviceRegistryArmClient(client).GetNamespaceResource(id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static DeviceRegistryNamespaceAssetResource GetDeviceRegistryNamespaceAssetResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static NamespaceAssetResource GetNamespaceAssetResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableDeviceRegistryArmClient(client).GetDeviceRegistryNamespaceAssetResource(id); + return GetMockableDeviceRegistryArmClient(client).GetNamespaceAssetResource(id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static DeviceRegistryNamespaceDeviceResource GetDeviceRegistryNamespaceDeviceResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static NamespaceDeviceResource GetNamespaceDeviceResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableDeviceRegistryArmClient(client).GetDeviceRegistryNamespaceDeviceResource(id); + return GetMockableDeviceRegistryArmClient(client).GetNamespaceDeviceResource(id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static DeviceRegistryNamespaceDiscoveredAssetResource GetDeviceRegistryNamespaceDiscoveredAssetResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static NamespaceDiscoveredAssetResource GetNamespaceDiscoveredAssetResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableDeviceRegistryArmClient(client).GetDeviceRegistryNamespaceDiscoveredAssetResource(id); + return GetMockableDeviceRegistryArmClient(client).GetNamespaceDiscoveredAssetResource(id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static DeviceRegistryNamespaceDiscoveredDeviceResource GetDeviceRegistryNamespaceDiscoveredDeviceResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static NamespaceDiscoveredDeviceResource GetNamespaceDiscoveredDeviceResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableDeviceRegistryArmClient(client).GetDeviceRegistryNamespaceDiscoveredDeviceResource(id); + return GetMockableDeviceRegistryArmClient(client).GetNamespaceDiscoveredDeviceResource(id); } /// @@ -428,20 +428,20 @@ public static Response GetDeviceRegi } /// - /// Gets a collection of DeviceRegistryNamespaceResources in the ResourceGroupResource. + /// Gets a collection of NamespaceResources in the ResourceGroupResource. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// is null. - /// An object representing collection of DeviceRegistryNamespaceResources and their operations over a DeviceRegistryNamespaceResource. - public static DeviceRegistryNamespaceCollection GetDeviceRegistryNamespaces(this ResourceGroupResource resourceGroupResource) + /// An object representing collection of NamespaceResources and their operations over a NamespaceResource. + public static NamespaceCollection GetNamespaces(this ResourceGroupResource resourceGroupResource) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryNamespaces(); + return GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetNamespaces(); } /// @@ -461,12 +461,12 @@ public static DeviceRegistryNamespaceCollection GetDeviceRegistryNamespaces(this /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -475,11 +475,11 @@ public static DeviceRegistryNamespaceCollection GetDeviceRegistryNamespaces(this /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetDeviceRegistryNamespaceAsync(this ResourceGroupResource resourceGroupResource, string namespaceName, CancellationToken cancellationToken = default) + public static async Task> GetNamespaceAsync(this ResourceGroupResource resourceGroupResource, string namespaceName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return await GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryNamespaceAsync(namespaceName, cancellationToken).ConfigureAwait(false); + return await GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetNamespaceAsync(namespaceName, cancellationToken).ConfigureAwait(false); } /// @@ -499,12 +499,12 @@ public static async Task> GetDeviceReg /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -513,11 +513,11 @@ public static async Task> GetDeviceReg /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetDeviceRegistryNamespace(this ResourceGroupResource resourceGroupResource, string namespaceName, CancellationToken cancellationToken = default) + public static Response GetNamespace(this ResourceGroupResource resourceGroupResource, string namespaceName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryNamespace(namespaceName, cancellationToken); + return GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetNamespace(namespaceName, cancellationToken); } /// @@ -867,23 +867,23 @@ public static Pageable GetDeviceRegi /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The cancellation token to use. /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetDeviceRegistryNamespacesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetNamespacesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetDeviceRegistryNamespacesAsync(cancellationToken); + return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetNamespacesAsync(cancellationToken); } /// @@ -903,23 +903,23 @@ public static AsyncPageable GetDeviceRegistryNa /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The cancellation token to use. /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetDeviceRegistryNamespaces(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetNamespaces(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetDeviceRegistryNamespaces(cancellationToken); + return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetNamespaces(cancellationToken); } /// diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistryArmClient.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistryArmClient.cs index 052d4134dbff..f40380dfa187 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistryArmClient.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistryArmClient.cs @@ -71,63 +71,63 @@ public virtual DeviceRegistryBillingContainerResource GetDeviceRegistryBillingCo } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// The resource ID of the resource to get. - /// Returns a object. - public virtual DeviceRegistryNamespaceResource GetDeviceRegistryNamespaceResource(ResourceIdentifier id) + /// Returns a object. + public virtual NamespaceResource GetNamespaceResource(ResourceIdentifier id) { - DeviceRegistryNamespaceResource.ValidateResourceId(id); - return new DeviceRegistryNamespaceResource(Client, id); + NamespaceResource.ValidateResourceId(id); + return new NamespaceResource(Client, id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// The resource ID of the resource to get. - /// Returns a object. - public virtual DeviceRegistryNamespaceAssetResource GetDeviceRegistryNamespaceAssetResource(ResourceIdentifier id) + /// Returns a object. + public virtual NamespaceAssetResource GetNamespaceAssetResource(ResourceIdentifier id) { - DeviceRegistryNamespaceAssetResource.ValidateResourceId(id); - return new DeviceRegistryNamespaceAssetResource(Client, id); + NamespaceAssetResource.ValidateResourceId(id); + return new NamespaceAssetResource(Client, id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// The resource ID of the resource to get. - /// Returns a object. - public virtual DeviceRegistryNamespaceDeviceResource GetDeviceRegistryNamespaceDeviceResource(ResourceIdentifier id) + /// Returns a object. + public virtual NamespaceDeviceResource GetNamespaceDeviceResource(ResourceIdentifier id) { - DeviceRegistryNamespaceDeviceResource.ValidateResourceId(id); - return new DeviceRegistryNamespaceDeviceResource(Client, id); + NamespaceDeviceResource.ValidateResourceId(id); + return new NamespaceDeviceResource(Client, id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// The resource ID of the resource to get. - /// Returns a object. - public virtual DeviceRegistryNamespaceDiscoveredAssetResource GetDeviceRegistryNamespaceDiscoveredAssetResource(ResourceIdentifier id) + /// Returns a object. + public virtual NamespaceDiscoveredAssetResource GetNamespaceDiscoveredAssetResource(ResourceIdentifier id) { - DeviceRegistryNamespaceDiscoveredAssetResource.ValidateResourceId(id); - return new DeviceRegistryNamespaceDiscoveredAssetResource(Client, id); + NamespaceDiscoveredAssetResource.ValidateResourceId(id); + return new NamespaceDiscoveredAssetResource(Client, id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// The resource ID of the resource to get. - /// Returns a object. - public virtual DeviceRegistryNamespaceDiscoveredDeviceResource GetDeviceRegistryNamespaceDiscoveredDeviceResource(ResourceIdentifier id) + /// Returns a object. + public virtual NamespaceDiscoveredDeviceResource GetNamespaceDiscoveredDeviceResource(ResourceIdentifier id) { - DeviceRegistryNamespaceDiscoveredDeviceResource.ValidateResourceId(id); - return new DeviceRegistryNamespaceDiscoveredDeviceResource(Client, id); + NamespaceDiscoveredDeviceResource.ValidateResourceId(id); + return new NamespaceDiscoveredDeviceResource(Client, id); } /// diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistryResourceGroupResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistryResourceGroupResource.cs index 4dfe249d8110..fa457c6bc86e 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistryResourceGroupResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistryResourceGroupResource.cs @@ -171,11 +171,11 @@ public virtual Response GetDeviceReg return GetDeviceRegistryAssetEndpointProfiles().Get(assetEndpointProfileName, cancellationToken); } - /// Gets a collection of DeviceRegistryNamespaceResources in the ResourceGroupResource. - /// An object representing collection of DeviceRegistryNamespaceResources and their operations over a DeviceRegistryNamespaceResource. - public virtual DeviceRegistryNamespaceCollection GetDeviceRegistryNamespaces() + /// Gets a collection of NamespaceResources in the ResourceGroupResource. + /// An object representing collection of NamespaceResources and their operations over a NamespaceResource. + public virtual NamespaceCollection GetNamespaces() { - return GetCachedClient(client => new DeviceRegistryNamespaceCollection(client, Id)); + return GetCachedClient(client => new NamespaceCollection(client, Id)); } /// @@ -195,7 +195,7 @@ public virtual DeviceRegistryNamespaceCollection GetDeviceRegistryNamespaces() /// /// /// Resource - /// + /// /// /// /// @@ -204,9 +204,9 @@ public virtual DeviceRegistryNamespaceCollection GetDeviceRegistryNamespaces() /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetDeviceRegistryNamespaceAsync(string namespaceName, CancellationToken cancellationToken = default) + public virtual async Task> GetNamespaceAsync(string namespaceName, CancellationToken cancellationToken = default) { - return await GetDeviceRegistryNamespaces().GetAsync(namespaceName, cancellationToken).ConfigureAwait(false); + return await GetNamespaces().GetAsync(namespaceName, cancellationToken).ConfigureAwait(false); } /// @@ -226,7 +226,7 @@ public virtual async Task> GetDeviceRe /// /// /// Resource - /// + /// /// /// /// @@ -235,9 +235,9 @@ public virtual async Task> GetDeviceRe /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetDeviceRegistryNamespace(string namespaceName, CancellationToken cancellationToken = default) + public virtual Response GetNamespace(string namespaceName, CancellationToken cancellationToken = default) { - return GetDeviceRegistryNamespaces().Get(namespaceName, cancellationToken); + return GetNamespaces().Get(namespaceName, cancellationToken); } /// Gets a collection of DeviceRegistrySchemaRegistryResources in the ResourceGroupResource. diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistrySubscriptionResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistrySubscriptionResource.cs index 9b708d679bbe..2bf8e55bd378 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistrySubscriptionResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistrySubscriptionResource.cs @@ -21,8 +21,8 @@ public partial class MockableDeviceRegistrySubscriptionResource : ArmResource private AssetsRestOperations _deviceRegistryAssetAssetsRestClient; private ClientDiagnostics _deviceRegistryAssetEndpointProfileAssetEndpointProfilesClientDiagnostics; private AssetEndpointProfilesRestOperations _deviceRegistryAssetEndpointProfileAssetEndpointProfilesRestClient; - private ClientDiagnostics _deviceRegistryNamespaceNamespacesClientDiagnostics; - private NamespacesRestOperations _deviceRegistryNamespaceNamespacesRestClient; + private ClientDiagnostics _namespaceClientDiagnostics; + private NamespacesRestOperations _namespaceRestClient; private ClientDiagnostics _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics; private SchemaRegistriesRestOperations _deviceRegistrySchemaRegistrySchemaRegistriesRestClient; @@ -42,8 +42,8 @@ internal MockableDeviceRegistrySubscriptionResource(ArmClient client, ResourceId private AssetsRestOperations DeviceRegistryAssetAssetsRestClient => _deviceRegistryAssetAssetsRestClient ??= new AssetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DeviceRegistryAssetResource.ResourceType)); private ClientDiagnostics DeviceRegistryAssetEndpointProfileAssetEndpointProfilesClientDiagnostics => _deviceRegistryAssetEndpointProfileAssetEndpointProfilesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistryAssetEndpointProfileResource.ResourceType.Namespace, Diagnostics); private AssetEndpointProfilesRestOperations DeviceRegistryAssetEndpointProfileAssetEndpointProfilesRestClient => _deviceRegistryAssetEndpointProfileAssetEndpointProfilesRestClient ??= new AssetEndpointProfilesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DeviceRegistryAssetEndpointProfileResource.ResourceType)); - private ClientDiagnostics DeviceRegistryNamespaceNamespacesClientDiagnostics => _deviceRegistryNamespaceNamespacesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistryNamespaceResource.ResourceType.Namespace, Diagnostics); - private NamespacesRestOperations DeviceRegistryNamespaceNamespacesRestClient => _deviceRegistryNamespaceNamespacesRestClient ??= new NamespacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DeviceRegistryNamespaceResource.ResourceType)); + private ClientDiagnostics NamespaceClientDiagnostics => _namespaceClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", NamespaceResource.ResourceType.Namespace, Diagnostics); + private NamespacesRestOperations NamespaceRestClient => _namespaceRestClient ??= new NamespacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(NamespaceResource.ResourceType)); private ClientDiagnostics DeviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics => _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistrySchemaRegistryResource.ResourceType.Namespace, Diagnostics); private SchemaRegistriesRestOperations DeviceRegistrySchemaRegistrySchemaRegistriesRestClient => _deviceRegistrySchemaRegistrySchemaRegistriesRestClient ??= new SchemaRegistriesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DeviceRegistrySchemaRegistryResource.ResourceType)); @@ -259,17 +259,17 @@ public virtual Pageable GetDeviceReg /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetDeviceRegistryNamespacesAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetNamespacesAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceRegistryNamespaceNamespacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceRegistryNamespaceNamespacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryNamespaceResource(Client, DeviceRegistryNamespaceData.DeserializeDeviceRegistryNamespaceData(e)), DeviceRegistryNamespaceNamespacesClientDiagnostics, Pipeline, "MockableDeviceRegistrySubscriptionResource.GetDeviceRegistryNamespaces", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => NamespaceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NamespaceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NamespaceResource(Client, NamespaceData.DeserializeNamespaceData(e)), NamespaceClientDiagnostics, Pipeline, "MockableDeviceRegistrySubscriptionResource.GetNamespaces", "value", "nextLink", cancellationToken); } /// @@ -289,17 +289,17 @@ public virtual AsyncPageable GetDeviceRegistryN /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetDeviceRegistryNamespaces(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetNamespaces(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceRegistryNamespaceNamespacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceRegistryNamespaceNamespacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryNamespaceResource(Client, DeviceRegistryNamespaceData.DeserializeDeviceRegistryNamespaceData(e)), DeviceRegistryNamespaceNamespacesClientDiagnostics, Pipeline, "MockableDeviceRegistrySubscriptionResource.GetDeviceRegistryNamespaces", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => NamespaceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NamespaceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NamespaceResource(Client, NamespaceData.DeserializeNamespaceData(e)), NamespaceClientDiagnostics, Pipeline, "MockableDeviceRegistrySubscriptionResource.GetNamespaces", "value", "nextLink", cancellationToken); } /// diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryNamespaceAssetOperationSource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryNamespaceAssetOperationSource.cs deleted file mode 100644 index ea88a945651f..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryNamespaceAssetOperationSource.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry -{ - internal class DeviceRegistryNamespaceAssetOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal DeviceRegistryNamespaceAssetOperationSource(ArmClient client) - { - _client = client; - } - - DeviceRegistryNamespaceAssetResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerDeviceRegistryContext.Default); - return new DeviceRegistryNamespaceAssetResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerDeviceRegistryContext.Default); - return await Task.FromResult(new DeviceRegistryNamespaceAssetResource(_client, data)).ConfigureAwait(false); - } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryNamespaceDeviceOperationSource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryNamespaceDeviceOperationSource.cs deleted file mode 100644 index eabee30c42b0..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryNamespaceDeviceOperationSource.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry -{ - internal class DeviceRegistryNamespaceDeviceOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal DeviceRegistryNamespaceDeviceOperationSource(ArmClient client) - { - _client = client; - } - - DeviceRegistryNamespaceDeviceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerDeviceRegistryContext.Default); - return new DeviceRegistryNamespaceDeviceResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerDeviceRegistryContext.Default); - return await Task.FromResult(new DeviceRegistryNamespaceDeviceResource(_client, data)).ConfigureAwait(false); - } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryNamespaceDiscoveredAssetOperationSource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryNamespaceDiscoveredAssetOperationSource.cs deleted file mode 100644 index c1e24e401bce..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryNamespaceDiscoveredAssetOperationSource.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry -{ - internal class DeviceRegistryNamespaceDiscoveredAssetOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal DeviceRegistryNamespaceDiscoveredAssetOperationSource(ArmClient client) - { - _client = client; - } - - DeviceRegistryNamespaceDiscoveredAssetResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerDeviceRegistryContext.Default); - return new DeviceRegistryNamespaceDiscoveredAssetResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerDeviceRegistryContext.Default); - return await Task.FromResult(new DeviceRegistryNamespaceDiscoveredAssetResource(_client, data)).ConfigureAwait(false); - } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryNamespaceDiscoveredDeviceOperationSource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryNamespaceDiscoveredDeviceOperationSource.cs deleted file mode 100644 index 9ef95e92bc92..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryNamespaceDiscoveredDeviceOperationSource.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry -{ - internal class DeviceRegistryNamespaceDiscoveredDeviceOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal DeviceRegistryNamespaceDiscoveredDeviceOperationSource(ArmClient client) - { - _client = client; - } - - DeviceRegistryNamespaceDiscoveredDeviceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerDeviceRegistryContext.Default); - return new DeviceRegistryNamespaceDiscoveredDeviceResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerDeviceRegistryContext.Default); - return await Task.FromResult(new DeviceRegistryNamespaceDiscoveredDeviceResource(_client, data)).ConfigureAwait(false); - } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryNamespaceOperationSource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryNamespaceOperationSource.cs deleted file mode 100644 index c9911d3cb59d..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryNamespaceOperationSource.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry -{ - internal class DeviceRegistryNamespaceOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal DeviceRegistryNamespaceOperationSource(ArmClient client) - { - _client = client; - } - - DeviceRegistryNamespaceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerDeviceRegistryContext.Default); - return new DeviceRegistryNamespaceResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerDeviceRegistryContext.Default); - return await Task.FromResult(new DeviceRegistryNamespaceResource(_client, data)).ConfigureAwait(false); - } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/NamespaceAssetOperationSource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/NamespaceAssetOperationSource.cs new file mode 100644 index 000000000000..1fd92fa08400 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/NamespaceAssetOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry +{ + internal class NamespaceAssetOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal NamespaceAssetOperationSource(ArmClient client) + { + _client = client; + } + + NamespaceAssetResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerDeviceRegistryContext.Default); + return new NamespaceAssetResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerDeviceRegistryContext.Default); + return await Task.FromResult(new NamespaceAssetResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/NamespaceDeviceOperationSource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/NamespaceDeviceOperationSource.cs new file mode 100644 index 000000000000..cd5e6c58aa96 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/NamespaceDeviceOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry +{ + internal class NamespaceDeviceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal NamespaceDeviceOperationSource(ArmClient client) + { + _client = client; + } + + NamespaceDeviceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerDeviceRegistryContext.Default); + return new NamespaceDeviceResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerDeviceRegistryContext.Default); + return await Task.FromResult(new NamespaceDeviceResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/NamespaceDiscoveredAssetOperationSource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/NamespaceDiscoveredAssetOperationSource.cs new file mode 100644 index 000000000000..3fe5e9cc7beb --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/NamespaceDiscoveredAssetOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry +{ + internal class NamespaceDiscoveredAssetOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal NamespaceDiscoveredAssetOperationSource(ArmClient client) + { + _client = client; + } + + NamespaceDiscoveredAssetResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerDeviceRegistryContext.Default); + return new NamespaceDiscoveredAssetResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerDeviceRegistryContext.Default); + return await Task.FromResult(new NamespaceDiscoveredAssetResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/NamespaceDiscoveredDeviceOperationSource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/NamespaceDiscoveredDeviceOperationSource.cs new file mode 100644 index 000000000000..a63c15d1d0d3 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/NamespaceDiscoveredDeviceOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry +{ + internal class NamespaceDiscoveredDeviceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal NamespaceDiscoveredDeviceOperationSource(ArmClient client) + { + _client = client; + } + + NamespaceDiscoveredDeviceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerDeviceRegistryContext.Default); + return new NamespaceDiscoveredDeviceResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerDeviceRegistryContext.Default); + return await Task.FromResult(new NamespaceDiscoveredDeviceResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/NamespaceOperationSource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/NamespaceOperationSource.cs new file mode 100644 index 000000000000..cb4d645d8c2a --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/NamespaceOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry +{ + internal class NamespaceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal NamespaceOperationSource(ArmClient client) + { + _client = client; + } + + NamespaceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerDeviceRegistryContext.Default); + return new NamespaceResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerDeviceRegistryContext.Default); + return await Task.FromResult(new NamespaceResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AzureResourceManagerDeviceRegistryContext.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AzureResourceManagerDeviceRegistryContext.cs index 86e7ca1a2cb7..6e7134187eff 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AzureResourceManagerDeviceRegistryContext.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AzureResourceManagerDeviceRegistryContext.cs @@ -48,38 +48,9 @@ namespace Azure.ResourceManager.DeviceRegistry [ModelReaderWriterBuildable(typeof(DeviceRegistryDataPoint))] [ModelReaderWriterBuildable(typeof(DeviceRegistryDataPointBase))] [ModelReaderWriterBuildable(typeof(DeviceRegistryDataset))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryErrorDetails))] [ModelReaderWriterBuildable(typeof(DeviceRegistryEvent))] [ModelReaderWriterBuildable(typeof(DeviceRegistryEventBase))] [ModelReaderWriterBuildable(typeof(DeviceRegistryExtendedLocation))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceAssetData))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceAssetPatch))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceAssetProperties))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceAssetResource))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceAssetStatus))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceAssetStatusDataset))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceAssetStatusEvent))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceAssetStatusEventGroup))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceAssetStatusManagementAction))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceAssetStatusManagementGroup))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceAssetStatusStream))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceData))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceDeviceData))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceDevicePatch))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceDeviceProperties))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceDeviceResource))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceDiscoveredAssetData))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceDiscoveredAssetPatch))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceDiscoveredAssetProperties))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceDiscoveredAssetResource))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceDiscoveredDeviceData))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceDiscoveredDevicePatch))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceDiscoveredDeviceProperties))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceDiscoveredDeviceResource))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceMessageSchemaReference))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespacePatch))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceProperties))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryNamespaceResource))] [ModelReaderWriterBuildable(typeof(DeviceRegistrySchemaData))] [ModelReaderWriterBuildable(typeof(DeviceRegistrySchemaProperties))] [ModelReaderWriterBuildable(typeof(DeviceRegistrySchemaRegistryData))] @@ -90,8 +61,6 @@ namespace Azure.ResourceManager.DeviceRegistry [ModelReaderWriterBuildable(typeof(DeviceRegistrySchemaVersionData))] [ModelReaderWriterBuildable(typeof(DeviceRegistrySchemaVersionProperties))] [ModelReaderWriterBuildable(typeof(DeviceRegistrySchemaVersionResource))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryStatusConfig))] - [ModelReaderWriterBuildable(typeof(DeviceRegistryStatusError))] [ModelReaderWriterBuildable(typeof(DeviceRegistryTopic))] [ModelReaderWriterBuildable(typeof(DeviceRegistryUsernamePasswordCredentials))] [ModelReaderWriterBuildable(typeof(DeviceRegistryX509Credentials))] @@ -101,6 +70,7 @@ namespace Azure.ResourceManager.DeviceRegistry [ModelReaderWriterBuildable(typeof(DiscoveredInboundEndpoints))] [ModelReaderWriterBuildable(typeof(DiscoveredMessagingEndpoints))] [ModelReaderWriterBuildable(typeof(DiscoveredOutboundEndpoints))] + [ModelReaderWriterBuildable(typeof(ErrorDetails))] [ModelReaderWriterBuildable(typeof(EventDestination))] [ModelReaderWriterBuildable(typeof(EventMqttDestination))] [ModelReaderWriterBuildable(typeof(EventStorageDestination))] @@ -114,17 +84,41 @@ namespace Azure.ResourceManager.DeviceRegistry [ModelReaderWriterBuildable(typeof(MessagingEndpoint))] [ModelReaderWriterBuildable(typeof(MessagingEndpoints))] [ModelReaderWriterBuildable(typeof(MqttDestinationConfiguration))] + [ModelReaderWriterBuildable(typeof(NamespaceAssetData))] [ModelReaderWriterBuildable(typeof(NamespaceAssetListResult))] + [ModelReaderWriterBuildable(typeof(NamespaceAssetPatch))] + [ModelReaderWriterBuildable(typeof(NamespaceAssetProperties))] + [ModelReaderWriterBuildable(typeof(NamespaceAssetResource))] + [ModelReaderWriterBuildable(typeof(NamespaceAssetStatus))] + [ModelReaderWriterBuildable(typeof(NamespaceAssetStatusDataset))] + [ModelReaderWriterBuildable(typeof(NamespaceAssetStatusEvent))] + [ModelReaderWriterBuildable(typeof(NamespaceAssetStatusEventGroup))] + [ModelReaderWriterBuildable(typeof(NamespaceAssetStatusManagementAction))] + [ModelReaderWriterBuildable(typeof(NamespaceAssetStatusManagementGroup))] + [ModelReaderWriterBuildable(typeof(NamespaceAssetStatusStream))] [ModelReaderWriterBuildable(typeof(NamespaceAssetUpdateProperties))] + [ModelReaderWriterBuildable(typeof(NamespaceData))] [ModelReaderWriterBuildable(typeof(NamespaceDataset))] [ModelReaderWriterBuildable(typeof(NamespaceDatasetDataPoint))] + [ModelReaderWriterBuildable(typeof(NamespaceDeviceData))] [ModelReaderWriterBuildable(typeof(NamespaceDeviceListResult))] + [ModelReaderWriterBuildable(typeof(NamespaceDevicePatch))] + [ModelReaderWriterBuildable(typeof(NamespaceDeviceProperties))] + [ModelReaderWriterBuildable(typeof(NamespaceDeviceResource))] [ModelReaderWriterBuildable(typeof(NamespaceDeviceUpdateProperties))] + [ModelReaderWriterBuildable(typeof(NamespaceDiscoveredAssetData))] [ModelReaderWriterBuildable(typeof(NamespaceDiscoveredAssetListResult))] + [ModelReaderWriterBuildable(typeof(NamespaceDiscoveredAssetPatch))] + [ModelReaderWriterBuildable(typeof(NamespaceDiscoveredAssetProperties))] + [ModelReaderWriterBuildable(typeof(NamespaceDiscoveredAssetResource))] [ModelReaderWriterBuildable(typeof(NamespaceDiscoveredAssetUpdateProperties))] [ModelReaderWriterBuildable(typeof(NamespaceDiscoveredDataset))] [ModelReaderWriterBuildable(typeof(NamespaceDiscoveredDatasetDataPoint))] + [ModelReaderWriterBuildable(typeof(NamespaceDiscoveredDeviceData))] [ModelReaderWriterBuildable(typeof(NamespaceDiscoveredDeviceListResult))] + [ModelReaderWriterBuildable(typeof(NamespaceDiscoveredDevicePatch))] + [ModelReaderWriterBuildable(typeof(NamespaceDiscoveredDeviceProperties))] + [ModelReaderWriterBuildable(typeof(NamespaceDiscoveredDeviceResource))] [ModelReaderWriterBuildable(typeof(NamespaceDiscoveredDeviceUpdateProperties))] [ModelReaderWriterBuildable(typeof(NamespaceDiscoveredEvent))] [ModelReaderWriterBuildable(typeof(NamespaceDiscoveredEventGroup))] @@ -134,7 +128,11 @@ namespace Azure.ResourceManager.DeviceRegistry [ModelReaderWriterBuildable(typeof(NamespaceEvent))] [ModelReaderWriterBuildable(typeof(NamespaceEventGroup))] [ModelReaderWriterBuildable(typeof(NamespaceListResult))] + [ModelReaderWriterBuildable(typeof(NamespaceMessageSchemaReference))] [ModelReaderWriterBuildable(typeof(NamespaceMigrateContent))] + [ModelReaderWriterBuildable(typeof(NamespacePatch))] + [ModelReaderWriterBuildable(typeof(NamespaceProperties))] + [ModelReaderWriterBuildable(typeof(NamespaceResource))] [ModelReaderWriterBuildable(typeof(NamespaceStream))] [ModelReaderWriterBuildable(typeof(NamespaceUpdateProperties))] [ModelReaderWriterBuildable(typeof(OutboundEndpoints))] @@ -143,6 +141,8 @@ namespace Azure.ResourceManager.DeviceRegistry [ModelReaderWriterBuildable(typeof(SchemaRegistryListResult))] [ModelReaderWriterBuildable(typeof(SchemaRegistryUpdateProperties))] [ModelReaderWriterBuildable(typeof(SchemaVersionListResult))] + [ModelReaderWriterBuildable(typeof(StatusConfig))] + [ModelReaderWriterBuildable(typeof(StatusError))] [ModelReaderWriterBuildable(typeof(StorageDestinationConfiguration))] [ModelReaderWriterBuildable(typeof(StreamDestination))] [ModelReaderWriterBuildable(typeof(StreamMqttDestination))] diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceStatus.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceStatus.Serialization.cs index 62e5b04b7c57..10c2a578f681 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceStatus.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceStatus.Serialization.cs @@ -81,7 +81,7 @@ internal static DeviceStatus DeserializeDeviceStatus(JsonElement element, ModelR { return null; } - DeviceRegistryStatusConfig config = default; + StatusConfig config = default; DeviceStatusEndpoints endpoints = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -93,7 +93,7 @@ internal static DeviceStatus DeserializeDeviceStatus(JsonElement element, ModelR { continue; } - config = DeviceRegistryStatusConfig.DeserializeDeviceRegistryStatusConfig(property.Value, options); + config = StatusConfig.DeserializeStatusConfig(property.Value, options); continue; } if (property.NameEquals("endpoints"u8)) diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceStatus.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceStatus.cs index 67f59d06e745..5c8eee65dda8 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceStatus.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceStatus.cs @@ -54,7 +54,7 @@ internal DeviceStatus() /// Defines the device status config properties. /// Defines the device status for inbound/outbound endpoints. /// Keeps track of any properties unknown to the library. - internal DeviceStatus(DeviceRegistryStatusConfig config, DeviceStatusEndpoints endpoints, IDictionary serializedAdditionalRawData) + internal DeviceStatus(StatusConfig config, DeviceStatusEndpoints endpoints, IDictionary serializedAdditionalRawData) { Config = config; Endpoints = endpoints; @@ -62,7 +62,7 @@ internal DeviceStatus(DeviceRegistryStatusConfig config, DeviceStatusEndpoints e } /// Defines the device status config properties. - public DeviceRegistryStatusConfig Config { get; } + public StatusConfig Config { get; } /// Defines the device status for inbound/outbound endpoints. internal DeviceStatusEndpoints Endpoints { get; } /// KeyValue pair representing status of inbound endpoints. diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceStatusEndpoint.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceStatusEndpoint.Serialization.cs index 2b8fafc3638b..27fc4ded2e27 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceStatusEndpoint.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceStatusEndpoint.Serialization.cs @@ -76,7 +76,7 @@ internal static DeviceStatusEndpoint DeserializeDeviceStatusEndpoint(JsonElement { return null; } - DeviceRegistryStatusError error = default; + StatusError error = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -87,7 +87,7 @@ internal static DeviceStatusEndpoint DeserializeDeviceStatusEndpoint(JsonElement { continue; } - error = DeviceRegistryStatusError.DeserializeDeviceRegistryStatusError(property.Value, options); + error = StatusError.DeserializeStatusError(property.Value, options); continue; } if (options.Format != "W") diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceStatusEndpoint.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceStatusEndpoint.cs index 9249f78f625e..a25920f84a3b 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceStatusEndpoint.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceStatusEndpoint.cs @@ -53,13 +53,13 @@ internal DeviceStatusEndpoint() /// Initializes a new instance of . /// Defines the error related to this endpoint. /// Keeps track of any properties unknown to the library. - internal DeviceStatusEndpoint(DeviceRegistryStatusError error, IDictionary serializedAdditionalRawData) + internal DeviceStatusEndpoint(StatusError error, IDictionary serializedAdditionalRawData) { Error = error; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Defines the error related to this endpoint. - public DeviceRegistryStatusError Error { get; } + public StatusError Error { get; } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryErrorDetails.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/ErrorDetails.Serialization.cs similarity index 70% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryErrorDetails.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/ErrorDetails.Serialization.cs index 5bbd2815bd6c..02e2694b3629 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryErrorDetails.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/ErrorDetails.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class DeviceRegistryErrorDetails : IUtf8JsonSerializable, IJsonModel + public partial class ErrorDetails : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryErrorDetails)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ErrorDetails)} does not support writing '{format}' format."); } if (options.Format != "W" && Optional.IsDefined(Code)) @@ -71,19 +71,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceRegistryErrorDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ErrorDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryErrorDetails)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ErrorDetails)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryErrorDetails(document.RootElement, options); + return DeserializeErrorDetails(document.RootElement, options); } - internal static DeviceRegistryErrorDetails DeserializeDeviceRegistryErrorDetails(JsonElement element, ModelReaderWriterOptions options = null) + internal static ErrorDetails DeserializeErrorDetails(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -125,38 +125,38 @@ internal static DeviceRegistryErrorDetails DeserializeDeviceRegistryErrorDetails } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryErrorDetails(code, message, info, correlationId, serializedAdditionalRawData); + return new ErrorDetails(code, message, info, correlationId, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryErrorDetails)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ErrorDetails)} does not support writing '{options.Format}' format."); } } - DeviceRegistryErrorDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ErrorDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryErrorDetails(document.RootElement, options); + return DeserializeErrorDetails(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryErrorDetails)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ErrorDetails)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryErrorDetails.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/ErrorDetails.cs similarity index 87% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryErrorDetails.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/ErrorDetails.cs index da0028fa7bc9..5d50b11282b6 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryErrorDetails.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/ErrorDetails.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// Defines the error details properties. - public partial class DeviceRegistryErrorDetails + public partial class ErrorDetails { /// /// Keeps track of any properties unknown to the library. @@ -45,18 +45,18 @@ public partial class DeviceRegistryErrorDetails /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal DeviceRegistryErrorDetails() + /// Initializes a new instance of . + internal ErrorDetails() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Multi-part error code for classification and root causing of errors (ex: 400.200.100.432). /// Human-readable helpful error message to provide additional context for error (ex: “Authentication method not supported”). /// Human-readable helpful detailed text context for debugging (ex: “The following mechanisms are supported...”). /// Unique identifier for the transaction to aid in debugging. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryErrorDetails(string code, string message, string info, string correlationId, IDictionary serializedAdditionalRawData) + internal ErrorDetails(string code, string message, string info, string correlationId, IDictionary serializedAdditionalRawData) { Code = code; Message = message; diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetListResult.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetListResult.Serialization.cs index 55adff75e949..8dcadd056b89 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetListResult.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetListResult.Serialization.cs @@ -83,7 +83,7 @@ internal static NamespaceAssetListResult DeserializeNamespaceAssetListResult(Jso { return null; } - IReadOnlyList value = default; + IReadOnlyList value = default; Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -91,10 +91,10 @@ internal static NamespaceAssetListResult DeserializeNamespaceAssetListResult(Jso { if (property.NameEquals("value"u8)) { - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(DeviceRegistryNamespaceAssetData.DeserializeDeviceRegistryNamespaceAssetData(item, options)); + array.Add(NamespaceAssetData.DeserializeNamespaceAssetData(item, options)); } value = array; continue; diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetListResult.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetListResult.cs index 95c9d4a6840c..06f853b7c61c 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetListResult.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetListResult.cs @@ -49,7 +49,7 @@ internal partial class NamespaceAssetListResult /// Initializes a new instance of . /// The NamespaceAsset items on this page. /// is null. - internal NamespaceAssetListResult(IEnumerable value) + internal NamespaceAssetListResult(IEnumerable value) { Argument.AssertNotNull(value, nameof(value)); @@ -60,7 +60,7 @@ internal NamespaceAssetListResult(IEnumerable /// The NamespaceAsset items on this page. /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal NamespaceAssetListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + internal NamespaceAssetListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; @@ -73,7 +73,7 @@ internal NamespaceAssetListResult() } /// The NamespaceAsset items on this page. - public IReadOnlyList Value { get; } + public IReadOnlyList Value { get; } /// The link to the next page of items. public Uri NextLink { get; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetPatch.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetPatch.Serialization.cs similarity index 68% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetPatch.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetPatch.Serialization.cs index d77b88822a56..5cf2c8f0b2fb 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetPatch.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetPatch.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class DeviceRegistryNamespaceAssetPatch : IUtf8JsonSerializable, IJsonModel + public partial class NamespaceAssetPatch : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetPatch)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetPatch)} does not support writing '{format}' format."); } if (Optional.IsCollectionDefined(Tags)) @@ -67,19 +67,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceRegistryNamespaceAssetPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NamespaceAssetPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetPatch)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetPatch)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryNamespaceAssetPatch(document.RootElement, options); + return DeserializeNamespaceAssetPatch(document.RootElement, options); } - internal static DeviceRegistryNamespaceAssetPatch DeserializeDeviceRegistryNamespaceAssetPatch(JsonElement element, ModelReaderWriterOptions options = null) + internal static NamespaceAssetPatch DeserializeNamespaceAssetPatch(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -122,38 +122,38 @@ internal static DeviceRegistryNamespaceAssetPatch DeserializeDeviceRegistryNames } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryNamespaceAssetPatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); + return new NamespaceAssetPatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetPatch)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetPatch)} does not support writing '{options.Format}' format."); } } - DeviceRegistryNamespaceAssetPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NamespaceAssetPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryNamespaceAssetPatch(document.RootElement, options); + return DeserializeNamespaceAssetPatch(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetPatch)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetPatch)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetPatch.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetPatch.cs similarity index 82% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetPatch.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetPatch.cs index cc8852c8ecbc..4d8d465459d2 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetPatch.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetPatch.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// The type used for update operations of the NamespaceAsset. - public partial class DeviceRegistryNamespaceAssetPatch + public partial class NamespaceAssetPatch { /// /// Keeps track of any properties unknown to the library. @@ -45,17 +45,17 @@ public partial class DeviceRegistryNamespaceAssetPatch /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public DeviceRegistryNamespaceAssetPatch() + /// Initializes a new instance of . + public NamespaceAssetPatch() { Tags = new ChangeTrackingDictionary(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Resource tags. /// The resource-specific properties for this resource. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryNamespaceAssetPatch(IDictionary tags, NamespaceAssetUpdateProperties properties, IDictionary serializedAdditionalRawData) + internal NamespaceAssetPatch(IDictionary tags, NamespaceAssetUpdateProperties properties, IDictionary serializedAdditionalRawData) { Tags = tags; Properties = properties; diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetProperties.Serialization.cs similarity index 91% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetProperties.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetProperties.Serialization.cs index d9adf07d43c3..58b20d64ac65 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetProperties.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class DeviceRegistryNamespaceAssetProperties : IUtf8JsonSerializable, IJsonModel + public partial class NamespaceAssetProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter wri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetProperties)} does not support writing '{format}' format."); } if (options.Format != "W" && Optional.IsDefined(Uuid)) @@ -271,19 +271,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceRegistryNamespaceAssetProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NamespaceAssetProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryNamespaceAssetProperties(document.RootElement, options); + return DeserializeNamespaceAssetProperties(document.RootElement, options); } - internal static DeviceRegistryNamespaceAssetProperties DeserializeDeviceRegistryNamespaceAssetProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static NamespaceAssetProperties DeserializeNamespaceAssetProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -321,7 +321,7 @@ internal static DeviceRegistryNamespaceAssetProperties DeserializeDeviceRegistry IList eventGroups = default; IList streams = default; IList managementGroups = default; - DeviceRegistryNamespaceAssetStatus status = default; + NamespaceAssetStatus status = default; DeviceRegistryProvisioningState? provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -592,7 +592,7 @@ internal static DeviceRegistryNamespaceAssetProperties DeserializeDeviceRegistry { continue; } - status = DeviceRegistryNamespaceAssetStatus.DeserializeDeviceRegistryNamespaceAssetStatus(property.Value, options); + status = NamespaceAssetStatus.DeserializeNamespaceAssetStatus(property.Value, options); continue; } if (property.NameEquals("provisioningState"u8)) @@ -610,7 +610,7 @@ internal static DeviceRegistryNamespaceAssetProperties DeserializeDeviceRegistry } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryNamespaceAssetProperties( + return new NamespaceAssetProperties( uuid, enabled, externalAssetId, @@ -646,35 +646,35 @@ internal static DeviceRegistryNamespaceAssetProperties DeserializeDeviceRegistry serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetProperties)} does not support writing '{options.Format}' format."); } } - DeviceRegistryNamespaceAssetProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NamespaceAssetProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryNamespaceAssetProperties(document.RootElement, options); + return DeserializeNamespaceAssetProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetProperties.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetProperties.cs similarity index 90% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetProperties.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetProperties.cs index f84d13d7c617..54ea963dd7fd 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetProperties.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetProperties.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// Defines the asset properties. - public partial class DeviceRegistryNamespaceAssetProperties + public partial class NamespaceAssetProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,10 +45,10 @@ public partial class DeviceRegistryNamespaceAssetProperties /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Reference to the device that provides data for this asset. Must provide device name & endpoint on the device to use. /// is null. - public DeviceRegistryNamespaceAssetProperties(DeviceRef deviceRef) + public NamespaceAssetProperties(DeviceRef deviceRef) { Argument.AssertNotNull(deviceRef, nameof(deviceRef)); @@ -65,7 +65,7 @@ public DeviceRegistryNamespaceAssetProperties(DeviceRef deviceRef) ManagementGroups = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Globally unique, immutable, non-reusable ID. /// Enabled/disabled status of the asset. /// Asset ID provided by the customer. @@ -111,7 +111,7 @@ public DeviceRegistryNamespaceAssetProperties(DeviceRef deviceRef) /// Read only object to reflect changes that have occurred on the Edge. Similar to Kubernetes status property for custom resources. /// Provisioning state of the resource. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryNamespaceAssetProperties(string uuid, bool? enabled, string externalAssetId, string displayName, string description, DeviceRef deviceRef, IList assetTypeRefs, long? version, DateTimeOffset? lastTransitionOn, string manufacturer, string manufacturerUri, string model, string productCode, string hardwareRevision, string softwareRevision, string documentationUri, string serialNumber, IDictionary attributes, IList discoveredAssetRefs, string defaultDatasetsConfiguration, string defaultEventsConfiguration, string defaultStreamsConfiguration, string defaultManagementGroupsConfiguration, IList defaultDatasetsDestinations, IList defaultEventsDestinations, IList defaultStreamsDestinations, IList datasets, IList eventGroups, IList streams, IList managementGroups, DeviceRegistryNamespaceAssetStatus status, DeviceRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + internal NamespaceAssetProperties(string uuid, bool? enabled, string externalAssetId, string displayName, string description, DeviceRef deviceRef, IList assetTypeRefs, long? version, DateTimeOffset? lastTransitionOn, string manufacturer, string manufacturerUri, string model, string productCode, string hardwareRevision, string softwareRevision, string documentationUri, string serialNumber, IDictionary attributes, IList discoveredAssetRefs, string defaultDatasetsConfiguration, string defaultEventsConfiguration, string defaultStreamsConfiguration, string defaultManagementGroupsConfiguration, IList defaultDatasetsDestinations, IList defaultEventsDestinations, IList defaultStreamsDestinations, IList datasets, IList eventGroups, IList streams, IList managementGroups, NamespaceAssetStatus status, DeviceRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) { Uuid = uuid; Enabled = enabled; @@ -148,8 +148,8 @@ internal DeviceRegistryNamespaceAssetProperties(string uuid, bool? enabled, stri _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DeviceRegistryNamespaceAssetProperties() + /// Initializes a new instance of for deserialization. + internal NamespaceAssetProperties() { } @@ -255,7 +255,7 @@ internal DeviceRegistryNamespaceAssetProperties() /// Array of management groups that are part of the asset. Each management group can have a per-group configuration. public IList ManagementGroups { get; } /// Read only object to reflect changes that have occurred on the Edge. Similar to Kubernetes status property for custom resources. - public DeviceRegistryNamespaceAssetStatus Status { get; } + public NamespaceAssetStatus Status { get; } /// Provisioning state of the resource. public DeviceRegistryProvisioningState? ProvisioningState { get; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatus.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatus.Serialization.cs similarity index 62% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatus.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatus.Serialization.cs index c314ae3b4500..3cfde4ac758b 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatus.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatus.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class DeviceRegistryNamespaceAssetStatus : IUtf8JsonSerializable, IJsonModel + public partial class NamespaceAssetStatus : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatus)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatus)} does not support writing '{format}' format."); } if (options.Format != "W" && Optional.IsDefined(Config)) @@ -96,19 +96,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceRegistryNamespaceAssetStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NamespaceAssetStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatus)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatus)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryNamespaceAssetStatus(document.RootElement, options); + return DeserializeNamespaceAssetStatus(document.RootElement, options); } - internal static DeviceRegistryNamespaceAssetStatus DeserializeDeviceRegistryNamespaceAssetStatus(JsonElement element, ModelReaderWriterOptions options = null) + internal static NamespaceAssetStatus DeserializeNamespaceAssetStatus(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -116,11 +116,11 @@ internal static DeviceRegistryNamespaceAssetStatus DeserializeDeviceRegistryName { return null; } - DeviceRegistryStatusConfig config = default; - IReadOnlyList datasets = default; - IReadOnlyList eventGroups = default; - IReadOnlyList streams = default; - IReadOnlyList managementGroups = default; + StatusConfig config = default; + IReadOnlyList datasets = default; + IReadOnlyList eventGroups = default; + IReadOnlyList streams = default; + IReadOnlyList managementGroups = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -131,7 +131,7 @@ internal static DeviceRegistryNamespaceAssetStatus DeserializeDeviceRegistryName { continue; } - config = DeviceRegistryStatusConfig.DeserializeDeviceRegistryStatusConfig(property.Value, options); + config = StatusConfig.DeserializeStatusConfig(property.Value, options); continue; } if (property.NameEquals("datasets"u8)) @@ -140,10 +140,10 @@ internal static DeviceRegistryNamespaceAssetStatus DeserializeDeviceRegistryName { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(DeviceRegistryNamespaceAssetStatusDataset.DeserializeDeviceRegistryNamespaceAssetStatusDataset(item, options)); + array.Add(NamespaceAssetStatusDataset.DeserializeNamespaceAssetStatusDataset(item, options)); } datasets = array; continue; @@ -154,10 +154,10 @@ internal static DeviceRegistryNamespaceAssetStatus DeserializeDeviceRegistryName { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(DeviceRegistryNamespaceAssetStatusEventGroup.DeserializeDeviceRegistryNamespaceAssetStatusEventGroup(item, options)); + array.Add(NamespaceAssetStatusEventGroup.DeserializeNamespaceAssetStatusEventGroup(item, options)); } eventGroups = array; continue; @@ -168,10 +168,10 @@ internal static DeviceRegistryNamespaceAssetStatus DeserializeDeviceRegistryName { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(DeviceRegistryNamespaceAssetStatusStream.DeserializeDeviceRegistryNamespaceAssetStatusStream(item, options)); + array.Add(NamespaceAssetStatusStream.DeserializeNamespaceAssetStatusStream(item, options)); } streams = array; continue; @@ -182,10 +182,10 @@ internal static DeviceRegistryNamespaceAssetStatus DeserializeDeviceRegistryName { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(DeviceRegistryNamespaceAssetStatusManagementGroup.DeserializeDeviceRegistryNamespaceAssetStatusManagementGroup(item, options)); + array.Add(NamespaceAssetStatusManagementGroup.DeserializeNamespaceAssetStatusManagementGroup(item, options)); } managementGroups = array; continue; @@ -196,44 +196,44 @@ internal static DeviceRegistryNamespaceAssetStatus DeserializeDeviceRegistryName } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryNamespaceAssetStatus( + return new NamespaceAssetStatus( config, - datasets ?? new ChangeTrackingList(), - eventGroups ?? new ChangeTrackingList(), - streams ?? new ChangeTrackingList(), - managementGroups ?? new ChangeTrackingList(), + datasets ?? new ChangeTrackingList(), + eventGroups ?? new ChangeTrackingList(), + streams ?? new ChangeTrackingList(), + managementGroups ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatus)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatus)} does not support writing '{options.Format}' format."); } } - DeviceRegistryNamespaceAssetStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NamespaceAssetStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryNamespaceAssetStatus(document.RootElement, options); + return DeserializeNamespaceAssetStatus(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatus)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatus)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatus.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatus.cs similarity index 66% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatus.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatus.cs index 4560b7662bb1..d4bf37cf1e81 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatus.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatus.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// Defines the asset status properties. - public partial class DeviceRegistryNamespaceAssetStatus + public partial class NamespaceAssetStatus { /// /// Keeps track of any properties unknown to the library. @@ -45,23 +45,23 @@ public partial class DeviceRegistryNamespaceAssetStatus /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal DeviceRegistryNamespaceAssetStatus() + /// Initializes a new instance of . + internal NamespaceAssetStatus() { - Datasets = new ChangeTrackingList(); - EventGroups = new ChangeTrackingList(); - Streams = new ChangeTrackingList(); - ManagementGroups = new ChangeTrackingList(); + Datasets = new ChangeTrackingList(); + EventGroups = new ChangeTrackingList(); + Streams = new ChangeTrackingList(); + ManagementGroups = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Defines the asset status config properties. /// Array of dataset statuses that describe the status of each dataset. /// Array of event group statuses that describe the status of each event group. /// Array of stream statuses that describe the status of each stream. /// Array of management group statuses that describe the status of each management group. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryNamespaceAssetStatus(DeviceRegistryStatusConfig config, IReadOnlyList datasets, IReadOnlyList eventGroups, IReadOnlyList streams, IReadOnlyList managementGroups, IDictionary serializedAdditionalRawData) + internal NamespaceAssetStatus(StatusConfig config, IReadOnlyList datasets, IReadOnlyList eventGroups, IReadOnlyList streams, IReadOnlyList managementGroups, IDictionary serializedAdditionalRawData) { Config = config; Datasets = datasets; @@ -72,14 +72,14 @@ internal DeviceRegistryNamespaceAssetStatus(DeviceRegistryStatusConfig config, I } /// Defines the asset status config properties. - public DeviceRegistryStatusConfig Config { get; } + public StatusConfig Config { get; } /// Array of dataset statuses that describe the status of each dataset. - public IReadOnlyList Datasets { get; } + public IReadOnlyList Datasets { get; } /// Array of event group statuses that describe the status of each event group. - public IReadOnlyList EventGroups { get; } + public IReadOnlyList EventGroups { get; } /// Array of stream statuses that describe the status of each stream. - public IReadOnlyList Streams { get; } + public IReadOnlyList Streams { get; } /// Array of management group statuses that describe the status of each management group. - public IReadOnlyList ManagementGroups { get; } + public IReadOnlyList ManagementGroups { get; } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusStream.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusDataset.Serialization.cs similarity index 62% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusStream.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusDataset.Serialization.cs index 2e53be63d355..1284e5c2d0e9 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusStream.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusDataset.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class DeviceRegistryNamespaceAssetStatusStream : IUtf8JsonSerializable, IJsonModel + public partial class NamespaceAssetStatusDataset : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter w /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatusStream)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatusDataset)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -66,19 +66,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceRegistryNamespaceAssetStatusStream IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NamespaceAssetStatusDataset IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatusStream)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatusDataset)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryNamespaceAssetStatusStream(document.RootElement, options); + return DeserializeNamespaceAssetStatusDataset(document.RootElement, options); } - internal static DeviceRegistryNamespaceAssetStatusStream DeserializeDeviceRegistryNamespaceAssetStatusStream(JsonElement element, ModelReaderWriterOptions options = null) + internal static NamespaceAssetStatusDataset DeserializeNamespaceAssetStatusDataset(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -87,8 +87,8 @@ internal static DeviceRegistryNamespaceAssetStatusStream DeserializeDeviceRegist return null; } string name = default; - DeviceRegistryNamespaceMessageSchemaReference messageSchemaReference = default; - DeviceRegistryStatusError error = default; + NamespaceMessageSchemaReference messageSchemaReference = default; + StatusError error = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -104,7 +104,7 @@ internal static DeviceRegistryNamespaceAssetStatusStream DeserializeDeviceRegist { continue; } - messageSchemaReference = DeviceRegistryNamespaceMessageSchemaReference.DeserializeDeviceRegistryNamespaceMessageSchemaReference(property.Value, options); + messageSchemaReference = NamespaceMessageSchemaReference.DeserializeNamespaceMessageSchemaReference(property.Value, options); continue; } if (property.NameEquals("error"u8)) @@ -113,7 +113,7 @@ internal static DeviceRegistryNamespaceAssetStatusStream DeserializeDeviceRegist { continue; } - error = DeviceRegistryStatusError.DeserializeDeviceRegistryStatusError(property.Value, options); + error = StatusError.DeserializeStatusError(property.Value, options); continue; } if (options.Format != "W") @@ -122,38 +122,38 @@ internal static DeviceRegistryNamespaceAssetStatusStream DeserializeDeviceRegist } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryNamespaceAssetStatusStream(name, messageSchemaReference, error, serializedAdditionalRawData); + return new NamespaceAssetStatusDataset(name, messageSchemaReference, error, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatusStream)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatusDataset)} does not support writing '{options.Format}' format."); } } - DeviceRegistryNamespaceAssetStatusStream IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NamespaceAssetStatusDataset IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryNamespaceAssetStatusStream(document.RootElement, options); + return DeserializeNamespaceAssetStatusDataset(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatusStream)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatusDataset)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusDataset.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusDataset.cs similarity index 76% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusDataset.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusDataset.cs index fe9878e4310d..3293f26ba2ea 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusDataset.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusDataset.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// Defines the asset status dataset properties. - public partial class DeviceRegistryNamespaceAssetStatusDataset + public partial class NamespaceAssetStatusDataset { /// /// Keeps track of any properties unknown to the library. @@ -45,19 +45,19 @@ public partial class DeviceRegistryNamespaceAssetStatusDataset /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The name of the dataset. Must be unique within the status.datasets array. This name is used to correlate between the spec and status dataset information. - internal DeviceRegistryNamespaceAssetStatusDataset(string name) + internal NamespaceAssetStatusDataset(string name) { Name = name; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The name of the dataset. Must be unique within the status.datasets array. This name is used to correlate between the spec and status dataset information. /// The message schema reference object. /// Object to transfer and persist errors that originate from the edge. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryNamespaceAssetStatusDataset(string name, DeviceRegistryNamespaceMessageSchemaReference messageSchemaReference, DeviceRegistryStatusError error, IDictionary serializedAdditionalRawData) + internal NamespaceAssetStatusDataset(string name, NamespaceMessageSchemaReference messageSchemaReference, StatusError error, IDictionary serializedAdditionalRawData) { Name = name; MessageSchemaReference = messageSchemaReference; @@ -65,16 +65,16 @@ internal DeviceRegistryNamespaceAssetStatusDataset(string name, DeviceRegistryNa _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DeviceRegistryNamespaceAssetStatusDataset() + /// Initializes a new instance of for deserialization. + internal NamespaceAssetStatusDataset() { } /// The name of the dataset. Must be unique within the status.datasets array. This name is used to correlate between the spec and status dataset information. public string Name { get; } /// The message schema reference object. - public DeviceRegistryNamespaceMessageSchemaReference MessageSchemaReference { get; } + public NamespaceMessageSchemaReference MessageSchemaReference { get; } /// Object to transfer and persist errors that originate from the edge. - public DeviceRegistryStatusError Error { get; } + public StatusError Error { get; } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusEvent.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusEvent.Serialization.cs similarity index 62% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusEvent.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusEvent.Serialization.cs index 5d37133cc585..03350e899345 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusEvent.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusEvent.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class DeviceRegistryNamespaceAssetStatusEvent : IUtf8JsonSerializable, IJsonModel + public partial class NamespaceAssetStatusEvent : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter wr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatusEvent)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatusEvent)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -66,19 +66,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceRegistryNamespaceAssetStatusEvent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NamespaceAssetStatusEvent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatusEvent)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatusEvent)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryNamespaceAssetStatusEvent(document.RootElement, options); + return DeserializeNamespaceAssetStatusEvent(document.RootElement, options); } - internal static DeviceRegistryNamespaceAssetStatusEvent DeserializeDeviceRegistryNamespaceAssetStatusEvent(JsonElement element, ModelReaderWriterOptions options = null) + internal static NamespaceAssetStatusEvent DeserializeNamespaceAssetStatusEvent(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -87,8 +87,8 @@ internal static DeviceRegistryNamespaceAssetStatusEvent DeserializeDeviceRegistr return null; } string name = default; - DeviceRegistryNamespaceMessageSchemaReference messageSchemaReference = default; - DeviceRegistryStatusError error = default; + NamespaceMessageSchemaReference messageSchemaReference = default; + StatusError error = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -104,7 +104,7 @@ internal static DeviceRegistryNamespaceAssetStatusEvent DeserializeDeviceRegistr { continue; } - messageSchemaReference = DeviceRegistryNamespaceMessageSchemaReference.DeserializeDeviceRegistryNamespaceMessageSchemaReference(property.Value, options); + messageSchemaReference = NamespaceMessageSchemaReference.DeserializeNamespaceMessageSchemaReference(property.Value, options); continue; } if (property.NameEquals("error"u8)) @@ -113,7 +113,7 @@ internal static DeviceRegistryNamespaceAssetStatusEvent DeserializeDeviceRegistr { continue; } - error = DeviceRegistryStatusError.DeserializeDeviceRegistryStatusError(property.Value, options); + error = StatusError.DeserializeStatusError(property.Value, options); continue; } if (options.Format != "W") @@ -122,38 +122,38 @@ internal static DeviceRegistryNamespaceAssetStatusEvent DeserializeDeviceRegistr } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryNamespaceAssetStatusEvent(name, messageSchemaReference, error, serializedAdditionalRawData); + return new NamespaceAssetStatusEvent(name, messageSchemaReference, error, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatusEvent)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatusEvent)} does not support writing '{options.Format}' format."); } } - DeviceRegistryNamespaceAssetStatusEvent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NamespaceAssetStatusEvent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryNamespaceAssetStatusEvent(document.RootElement, options); + return DeserializeNamespaceAssetStatusEvent(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatusEvent)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatusEvent)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusEvent.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusEvent.cs similarity index 76% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusEvent.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusEvent.cs index 050ef186c219..69a0ab7daaf4 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusEvent.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusEvent.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// Defines the asset status event properties. - public partial class DeviceRegistryNamespaceAssetStatusEvent + public partial class NamespaceAssetStatusEvent { /// /// Keeps track of any properties unknown to the library. @@ -45,19 +45,19 @@ public partial class DeviceRegistryNamespaceAssetStatusEvent /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The name of the event. Must be unique within the status.events array. This name is used to correlate between the spec and status event information. - internal DeviceRegistryNamespaceAssetStatusEvent(string name) + internal NamespaceAssetStatusEvent(string name) { Name = name; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The name of the event. Must be unique within the status.events array. This name is used to correlate between the spec and status event information. /// The message schema reference object. /// Object to transfer and persist errors that originate from the edge. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryNamespaceAssetStatusEvent(string name, DeviceRegistryNamespaceMessageSchemaReference messageSchemaReference, DeviceRegistryStatusError error, IDictionary serializedAdditionalRawData) + internal NamespaceAssetStatusEvent(string name, NamespaceMessageSchemaReference messageSchemaReference, StatusError error, IDictionary serializedAdditionalRawData) { Name = name; MessageSchemaReference = messageSchemaReference; @@ -65,16 +65,16 @@ internal DeviceRegistryNamespaceAssetStatusEvent(string name, DeviceRegistryName _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DeviceRegistryNamespaceAssetStatusEvent() + /// Initializes a new instance of for deserialization. + internal NamespaceAssetStatusEvent() { } /// The name of the event. Must be unique within the status.events array. This name is used to correlate between the spec and status event information. public string Name { get; } /// The message schema reference object. - public DeviceRegistryNamespaceMessageSchemaReference MessageSchemaReference { get; } + public NamespaceMessageSchemaReference MessageSchemaReference { get; } /// Object to transfer and persist errors that originate from the edge. - public DeviceRegistryStatusError Error { get; } + public StatusError Error { get; } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusEventGroup.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusEventGroup.Serialization.cs similarity index 60% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusEventGroup.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusEventGroup.Serialization.cs index f8769c339744..6036b7116b76 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusEventGroup.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusEventGroup.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class DeviceRegistryNamespaceAssetStatusEventGroup : IUtf8JsonSerializable, IJsonModel + public partial class NamespaceAssetStatusEventGroup : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatusEventGroup)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatusEventGroup)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -66,19 +66,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceRegistryNamespaceAssetStatusEventGroup IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NamespaceAssetStatusEventGroup IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatusEventGroup)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatusEventGroup)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryNamespaceAssetStatusEventGroup(document.RootElement, options); + return DeserializeNamespaceAssetStatusEventGroup(document.RootElement, options); } - internal static DeviceRegistryNamespaceAssetStatusEventGroup DeserializeDeviceRegistryNamespaceAssetStatusEventGroup(JsonElement element, ModelReaderWriterOptions options = null) + internal static NamespaceAssetStatusEventGroup DeserializeNamespaceAssetStatusEventGroup(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -87,7 +87,7 @@ internal static DeviceRegistryNamespaceAssetStatusEventGroup DeserializeDeviceRe return null; } string name = default; - IReadOnlyList events = default; + IReadOnlyList events = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -103,10 +103,10 @@ internal static DeviceRegistryNamespaceAssetStatusEventGroup DeserializeDeviceRe { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(DeviceRegistryNamespaceAssetStatusEvent.DeserializeDeviceRegistryNamespaceAssetStatusEvent(item, options)); + array.Add(NamespaceAssetStatusEvent.DeserializeNamespaceAssetStatusEvent(item, options)); } events = array; continue; @@ -117,38 +117,38 @@ internal static DeviceRegistryNamespaceAssetStatusEventGroup DeserializeDeviceRe } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryNamespaceAssetStatusEventGroup(name, events ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new NamespaceAssetStatusEventGroup(name, events ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatusEventGroup)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatusEventGroup)} does not support writing '{options.Format}' format."); } } - DeviceRegistryNamespaceAssetStatusEventGroup IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NamespaceAssetStatusEventGroup IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryNamespaceAssetStatusEventGroup(document.RootElement, options); + return DeserializeNamespaceAssetStatusEventGroup(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatusEventGroup)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatusEventGroup)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusEventGroup.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusEventGroup.cs similarity index 75% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusEventGroup.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusEventGroup.cs index 9c403a43d9e6..e9b8aee24160 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusEventGroup.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusEventGroup.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// Defines the asset status event group properties. - public partial class DeviceRegistryNamespaceAssetStatusEventGroup + public partial class NamespaceAssetStatusEventGroup { /// /// Keeps track of any properties unknown to the library. @@ -45,33 +45,33 @@ public partial class DeviceRegistryNamespaceAssetStatusEventGroup /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The name of the event group. Must be unique within the status.eventGroups array. This name is used to correlate between the spec and status event group information. - internal DeviceRegistryNamespaceAssetStatusEventGroup(string name) + internal NamespaceAssetStatusEventGroup(string name) { Name = name; - Events = new ChangeTrackingList(); + Events = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The name of the event group. Must be unique within the status.eventGroups array. This name is used to correlate between the spec and status event group information. /// Array of event statuses that describe the status of each event in the event group. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryNamespaceAssetStatusEventGroup(string name, IReadOnlyList events, IDictionary serializedAdditionalRawData) + internal NamespaceAssetStatusEventGroup(string name, IReadOnlyList events, IDictionary serializedAdditionalRawData) { Name = name; Events = events; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DeviceRegistryNamespaceAssetStatusEventGroup() + /// Initializes a new instance of for deserialization. + internal NamespaceAssetStatusEventGroup() { } /// The name of the event group. Must be unique within the status.eventGroups array. This name is used to correlate between the spec and status event group information. public string Name { get; } /// Array of event statuses that describe the status of each event in the event group. - public IReadOnlyList Events { get; } + public IReadOnlyList Events { get; } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusManagementAction.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusManagementAction.Serialization.cs similarity index 60% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusManagementAction.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusManagementAction.Serialization.cs index 9c94914261d2..5b79165365e5 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusManagementAction.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusManagementAction.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class DeviceRegistryNamespaceAssetStatusManagementAction : IUtf8JsonSerializable, IJsonModel + public partial class NamespaceAssetStatusManagementAction : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8Js /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatusManagementAction)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatusManagementAction)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -71,19 +71,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceRegistryNamespaceAssetStatusManagementAction IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NamespaceAssetStatusManagementAction IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatusManagementAction)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatusManagementAction)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryNamespaceAssetStatusManagementAction(document.RootElement, options); + return DeserializeNamespaceAssetStatusManagementAction(document.RootElement, options); } - internal static DeviceRegistryNamespaceAssetStatusManagementAction DeserializeDeviceRegistryNamespaceAssetStatusManagementAction(JsonElement element, ModelReaderWriterOptions options = null) + internal static NamespaceAssetStatusManagementAction DeserializeNamespaceAssetStatusManagementAction(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -92,9 +92,9 @@ internal static DeviceRegistryNamespaceAssetStatusManagementAction DeserializeDe return null; } string name = default; - DeviceRegistryNamespaceMessageSchemaReference requestMessageSchemaReference = default; - DeviceRegistryNamespaceMessageSchemaReference responseMessageSchemaReference = default; - DeviceRegistryStatusError error = default; + NamespaceMessageSchemaReference requestMessageSchemaReference = default; + NamespaceMessageSchemaReference responseMessageSchemaReference = default; + StatusError error = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -110,7 +110,7 @@ internal static DeviceRegistryNamespaceAssetStatusManagementAction DeserializeDe { continue; } - requestMessageSchemaReference = DeviceRegistryNamespaceMessageSchemaReference.DeserializeDeviceRegistryNamespaceMessageSchemaReference(property.Value, options); + requestMessageSchemaReference = NamespaceMessageSchemaReference.DeserializeNamespaceMessageSchemaReference(property.Value, options); continue; } if (property.NameEquals("responseMessageSchemaReference"u8)) @@ -119,7 +119,7 @@ internal static DeviceRegistryNamespaceAssetStatusManagementAction DeserializeDe { continue; } - responseMessageSchemaReference = DeviceRegistryNamespaceMessageSchemaReference.DeserializeDeviceRegistryNamespaceMessageSchemaReference(property.Value, options); + responseMessageSchemaReference = NamespaceMessageSchemaReference.DeserializeNamespaceMessageSchemaReference(property.Value, options); continue; } if (property.NameEquals("error"u8)) @@ -128,7 +128,7 @@ internal static DeviceRegistryNamespaceAssetStatusManagementAction DeserializeDe { continue; } - error = DeviceRegistryStatusError.DeserializeDeviceRegistryStatusError(property.Value, options); + error = StatusError.DeserializeStatusError(property.Value, options); continue; } if (options.Format != "W") @@ -137,38 +137,38 @@ internal static DeviceRegistryNamespaceAssetStatusManagementAction DeserializeDe } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryNamespaceAssetStatusManagementAction(name, requestMessageSchemaReference, responseMessageSchemaReference, error, serializedAdditionalRawData); + return new NamespaceAssetStatusManagementAction(name, requestMessageSchemaReference, responseMessageSchemaReference, error, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatusManagementAction)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatusManagementAction)} does not support writing '{options.Format}' format."); } } - DeviceRegistryNamespaceAssetStatusManagementAction IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NamespaceAssetStatusManagementAction IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryNamespaceAssetStatusManagementAction(document.RootElement, options); + return DeserializeNamespaceAssetStatusManagementAction(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatusManagementAction)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatusManagementAction)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusManagementAction.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusManagementAction.cs similarity index 73% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusManagementAction.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusManagementAction.cs index b7d14b6e80f6..f63cd832786b 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusManagementAction.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusManagementAction.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// Defines the asset status action properties. - public partial class DeviceRegistryNamespaceAssetStatusManagementAction + public partial class NamespaceAssetStatusManagementAction { /// /// Keeps track of any properties unknown to the library. @@ -45,20 +45,20 @@ public partial class DeviceRegistryNamespaceAssetStatusManagementAction /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The name of the action. Must be unique within the status.actions array. This name is used to correlate between the spec and status event information. - internal DeviceRegistryNamespaceAssetStatusManagementAction(string name) + internal NamespaceAssetStatusManagementAction(string name) { Name = name; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The name of the action. Must be unique within the status.actions array. This name is used to correlate between the spec and status event information. /// The request message schema reference object for the action. /// The response message schema reference object for the action. /// Object to transfer and persist errors that originate from the edge. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryNamespaceAssetStatusManagementAction(string name, DeviceRegistryNamespaceMessageSchemaReference requestMessageSchemaReference, DeviceRegistryNamespaceMessageSchemaReference responseMessageSchemaReference, DeviceRegistryStatusError error, IDictionary serializedAdditionalRawData) + internal NamespaceAssetStatusManagementAction(string name, NamespaceMessageSchemaReference requestMessageSchemaReference, NamespaceMessageSchemaReference responseMessageSchemaReference, StatusError error, IDictionary serializedAdditionalRawData) { Name = name; RequestMessageSchemaReference = requestMessageSchemaReference; @@ -67,18 +67,18 @@ internal DeviceRegistryNamespaceAssetStatusManagementAction(string name, DeviceR _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DeviceRegistryNamespaceAssetStatusManagementAction() + /// Initializes a new instance of for deserialization. + internal NamespaceAssetStatusManagementAction() { } /// The name of the action. Must be unique within the status.actions array. This name is used to correlate between the spec and status event information. public string Name { get; } /// The request message schema reference object for the action. - public DeviceRegistryNamespaceMessageSchemaReference RequestMessageSchemaReference { get; } + public NamespaceMessageSchemaReference RequestMessageSchemaReference { get; } /// The response message schema reference object for the action. - public DeviceRegistryNamespaceMessageSchemaReference ResponseMessageSchemaReference { get; } + public NamespaceMessageSchemaReference ResponseMessageSchemaReference { get; } /// Object to transfer and persist errors that originate from the edge. - public DeviceRegistryStatusError Error { get; } + public StatusError Error { get; } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusManagementGroup.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusManagementGroup.Serialization.cs similarity index 59% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusManagementGroup.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusManagementGroup.Serialization.cs index e3b3f63a0460..7fa85141d409 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusManagementGroup.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusManagementGroup.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class DeviceRegistryNamespaceAssetStatusManagementGroup : IUtf8JsonSerializable, IJsonModel + public partial class NamespaceAssetStatusManagementGroup : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8Jso /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatusManagementGroup)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatusManagementGroup)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -66,19 +66,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceRegistryNamespaceAssetStatusManagementGroup IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NamespaceAssetStatusManagementGroup IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatusManagementGroup)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatusManagementGroup)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryNamespaceAssetStatusManagementGroup(document.RootElement, options); + return DeserializeNamespaceAssetStatusManagementGroup(document.RootElement, options); } - internal static DeviceRegistryNamespaceAssetStatusManagementGroup DeserializeDeviceRegistryNamespaceAssetStatusManagementGroup(JsonElement element, ModelReaderWriterOptions options = null) + internal static NamespaceAssetStatusManagementGroup DeserializeNamespaceAssetStatusManagementGroup(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -87,7 +87,7 @@ internal static DeviceRegistryNamespaceAssetStatusManagementGroup DeserializeDev return null; } string name = default; - IReadOnlyList actions = default; + IReadOnlyList actions = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -103,10 +103,10 @@ internal static DeviceRegistryNamespaceAssetStatusManagementGroup DeserializeDev { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(DeviceRegistryNamespaceAssetStatusManagementAction.DeserializeDeviceRegistryNamespaceAssetStatusManagementAction(item, options)); + array.Add(NamespaceAssetStatusManagementAction.DeserializeNamespaceAssetStatusManagementAction(item, options)); } actions = array; continue; @@ -117,38 +117,38 @@ internal static DeviceRegistryNamespaceAssetStatusManagementGroup DeserializeDev } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryNamespaceAssetStatusManagementGroup(name, actions ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new NamespaceAssetStatusManagementGroup(name, actions ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatusManagementGroup)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatusManagementGroup)} does not support writing '{options.Format}' format."); } } - DeviceRegistryNamespaceAssetStatusManagementGroup IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NamespaceAssetStatusManagementGroup IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryNamespaceAssetStatusManagementGroup(document.RootElement, options); + return DeserializeNamespaceAssetStatusManagementGroup(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatusManagementGroup)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatusManagementGroup)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusManagementGroup.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusManagementGroup.cs similarity index 73% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusManagementGroup.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusManagementGroup.cs index b4157f0b37bc..e252a8274d85 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusManagementGroup.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusManagementGroup.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// Defines the asset status management group properties. - public partial class DeviceRegistryNamespaceAssetStatusManagementGroup + public partial class NamespaceAssetStatusManagementGroup { /// /// Keeps track of any properties unknown to the library. @@ -45,33 +45,33 @@ public partial class DeviceRegistryNamespaceAssetStatusManagementGroup /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The name of the management group. Must be unique within the status.managementGroups array. This name is used to correlate between the spec and status event information. - internal DeviceRegistryNamespaceAssetStatusManagementGroup(string name) + internal NamespaceAssetStatusManagementGroup(string name) { Name = name; - Actions = new ChangeTrackingList(); + Actions = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The name of the management group. Must be unique within the status.managementGroups array. This name is used to correlate between the spec and status event information. /// Array of action statuses that describe the status of each action. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryNamespaceAssetStatusManagementGroup(string name, IReadOnlyList actions, IDictionary serializedAdditionalRawData) + internal NamespaceAssetStatusManagementGroup(string name, IReadOnlyList actions, IDictionary serializedAdditionalRawData) { Name = name; Actions = actions; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DeviceRegistryNamespaceAssetStatusManagementGroup() + /// Initializes a new instance of for deserialization. + internal NamespaceAssetStatusManagementGroup() { } /// The name of the management group. Must be unique within the status.managementGroups array. This name is used to correlate between the spec and status event information. public string Name { get; } /// Array of action statuses that describe the status of each action. - public IReadOnlyList Actions { get; } + public IReadOnlyList Actions { get; } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusDataset.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusStream.Serialization.cs similarity index 61% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusDataset.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusStream.Serialization.cs index 8973d68d3b76..8ae5a5ad1fe3 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusDataset.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusStream.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class DeviceRegistryNamespaceAssetStatusDataset : IUtf8JsonSerializable, IJsonModel + public partial class NamespaceAssetStatusStream : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatusDataset)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatusStream)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -66,19 +66,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceRegistryNamespaceAssetStatusDataset IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NamespaceAssetStatusStream IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatusDataset)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatusStream)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryNamespaceAssetStatusDataset(document.RootElement, options); + return DeserializeNamespaceAssetStatusStream(document.RootElement, options); } - internal static DeviceRegistryNamespaceAssetStatusDataset DeserializeDeviceRegistryNamespaceAssetStatusDataset(JsonElement element, ModelReaderWriterOptions options = null) + internal static NamespaceAssetStatusStream DeserializeNamespaceAssetStatusStream(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -87,8 +87,8 @@ internal static DeviceRegistryNamespaceAssetStatusDataset DeserializeDeviceRegis return null; } string name = default; - DeviceRegistryNamespaceMessageSchemaReference messageSchemaReference = default; - DeviceRegistryStatusError error = default; + NamespaceMessageSchemaReference messageSchemaReference = default; + StatusError error = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -104,7 +104,7 @@ internal static DeviceRegistryNamespaceAssetStatusDataset DeserializeDeviceRegis { continue; } - messageSchemaReference = DeviceRegistryNamespaceMessageSchemaReference.DeserializeDeviceRegistryNamespaceMessageSchemaReference(property.Value, options); + messageSchemaReference = NamespaceMessageSchemaReference.DeserializeNamespaceMessageSchemaReference(property.Value, options); continue; } if (property.NameEquals("error"u8)) @@ -113,7 +113,7 @@ internal static DeviceRegistryNamespaceAssetStatusDataset DeserializeDeviceRegis { continue; } - error = DeviceRegistryStatusError.DeserializeDeviceRegistryStatusError(property.Value, options); + error = StatusError.DeserializeStatusError(property.Value, options); continue; } if (options.Format != "W") @@ -122,38 +122,38 @@ internal static DeviceRegistryNamespaceAssetStatusDataset DeserializeDeviceRegis } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryNamespaceAssetStatusDataset(name, messageSchemaReference, error, serializedAdditionalRawData); + return new NamespaceAssetStatusStream(name, messageSchemaReference, error, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatusDataset)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatusStream)} does not support writing '{options.Format}' format."); } } - DeviceRegistryNamespaceAssetStatusDataset IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NamespaceAssetStatusStream IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryNamespaceAssetStatusDataset(document.RootElement, options); + return DeserializeNamespaceAssetStatusStream(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetStatusDataset)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetStatusStream)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusStream.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusStream.cs similarity index 76% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusStream.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusStream.cs index 827e56f05512..ef6da3b5f421 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceAssetStatusStream.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceAssetStatusStream.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// Defines the asset status stream properties. - public partial class DeviceRegistryNamespaceAssetStatusStream + public partial class NamespaceAssetStatusStream { /// /// Keeps track of any properties unknown to the library. @@ -45,19 +45,19 @@ public partial class DeviceRegistryNamespaceAssetStatusStream /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The name of the stream. Must be unique within the status.streams array. This name is used to correlate between the spec and status event information. - internal DeviceRegistryNamespaceAssetStatusStream(string name) + internal NamespaceAssetStatusStream(string name) { Name = name; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The name of the stream. Must be unique within the status.streams array. This name is used to correlate between the spec and status event information. /// The message schema reference object. /// Object to transfer and persist errors that originate from the edge. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryNamespaceAssetStatusStream(string name, DeviceRegistryNamespaceMessageSchemaReference messageSchemaReference, DeviceRegistryStatusError error, IDictionary serializedAdditionalRawData) + internal NamespaceAssetStatusStream(string name, NamespaceMessageSchemaReference messageSchemaReference, StatusError error, IDictionary serializedAdditionalRawData) { Name = name; MessageSchemaReference = messageSchemaReference; @@ -65,16 +65,16 @@ internal DeviceRegistryNamespaceAssetStatusStream(string name, DeviceRegistryNam _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DeviceRegistryNamespaceAssetStatusStream() + /// Initializes a new instance of for deserialization. + internal NamespaceAssetStatusStream() { } /// The name of the stream. Must be unique within the status.streams array. This name is used to correlate between the spec and status event information. public string Name { get; } /// The message schema reference object. - public DeviceRegistryNamespaceMessageSchemaReference MessageSchemaReference { get; } + public NamespaceMessageSchemaReference MessageSchemaReference { get; } /// Object to transfer and persist errors that originate from the edge. - public DeviceRegistryStatusError Error { get; } + public StatusError Error { get; } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDeviceListResult.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDeviceListResult.Serialization.cs index 8a4698b874c2..876eb9d935e5 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDeviceListResult.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDeviceListResult.Serialization.cs @@ -83,7 +83,7 @@ internal static NamespaceDeviceListResult DeserializeNamespaceDeviceListResult(J { return null; } - IReadOnlyList value = default; + IReadOnlyList value = default; Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -91,10 +91,10 @@ internal static NamespaceDeviceListResult DeserializeNamespaceDeviceListResult(J { if (property.NameEquals("value"u8)) { - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(DeviceRegistryNamespaceDeviceData.DeserializeDeviceRegistryNamespaceDeviceData(item, options)); + array.Add(NamespaceDeviceData.DeserializeNamespaceDeviceData(item, options)); } value = array; continue; diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDeviceListResult.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDeviceListResult.cs index a42bcea46164..99e7f17f98fb 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDeviceListResult.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDeviceListResult.cs @@ -49,7 +49,7 @@ internal partial class NamespaceDeviceListResult /// Initializes a new instance of . /// The NamespaceDevice items on this page. /// is null. - internal NamespaceDeviceListResult(IEnumerable value) + internal NamespaceDeviceListResult(IEnumerable value) { Argument.AssertNotNull(value, nameof(value)); @@ -60,7 +60,7 @@ internal NamespaceDeviceListResult(IEnumerable The NamespaceDevice items on this page. /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal NamespaceDeviceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + internal NamespaceDeviceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; @@ -73,7 +73,7 @@ internal NamespaceDeviceListResult() } /// The NamespaceDevice items on this page. - public IReadOnlyList Value { get; } + public IReadOnlyList Value { get; } /// The link to the next page of items. public Uri NextLink { get; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDevicePatch.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDevicePatch.Serialization.cs similarity index 68% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDevicePatch.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDevicePatch.Serialization.cs index f356efe00f98..820e4f7554b7 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDevicePatch.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDevicePatch.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class DeviceRegistryNamespaceDevicePatch : IUtf8JsonSerializable, IJsonModel + public partial class NamespaceDevicePatch : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDevicePatch)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceDevicePatch)} does not support writing '{format}' format."); } if (Optional.IsCollectionDefined(Tags)) @@ -67,19 +67,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceRegistryNamespaceDevicePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NamespaceDevicePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDevicePatch)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceDevicePatch)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryNamespaceDevicePatch(document.RootElement, options); + return DeserializeNamespaceDevicePatch(document.RootElement, options); } - internal static DeviceRegistryNamespaceDevicePatch DeserializeDeviceRegistryNamespaceDevicePatch(JsonElement element, ModelReaderWriterOptions options = null) + internal static NamespaceDevicePatch DeserializeNamespaceDevicePatch(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -122,38 +122,38 @@ internal static DeviceRegistryNamespaceDevicePatch DeserializeDeviceRegistryName } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryNamespaceDevicePatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); + return new NamespaceDevicePatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDevicePatch)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceDevicePatch)} does not support writing '{options.Format}' format."); } } - DeviceRegistryNamespaceDevicePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NamespaceDevicePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryNamespaceDevicePatch(document.RootElement, options); + return DeserializeNamespaceDevicePatch(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDevicePatch)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceDevicePatch)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDevicePatch.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDevicePatch.cs similarity index 82% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDevicePatch.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDevicePatch.cs index fdb96dfe09f1..eb7d314995ee 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDevicePatch.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDevicePatch.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// The type used for update operations of the NamespaceDevice. - public partial class DeviceRegistryNamespaceDevicePatch + public partial class NamespaceDevicePatch { /// /// Keeps track of any properties unknown to the library. @@ -45,17 +45,17 @@ public partial class DeviceRegistryNamespaceDevicePatch /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public DeviceRegistryNamespaceDevicePatch() + /// Initializes a new instance of . + public NamespaceDevicePatch() { Tags = new ChangeTrackingDictionary(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Resource tags. /// The resource-specific properties for this resource. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryNamespaceDevicePatch(IDictionary tags, NamespaceDeviceUpdateProperties properties, IDictionary serializedAdditionalRawData) + internal NamespaceDevicePatch(IDictionary tags, NamespaceDeviceUpdateProperties properties, IDictionary serializedAdditionalRawData) { Tags = tags; Properties = properties; diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDeviceProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDeviceProperties.Serialization.cs similarity index 84% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDeviceProperties.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDeviceProperties.Serialization.cs index 489006da15b8..7bfe6c524a11 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDeviceProperties.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDeviceProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class DeviceRegistryNamespaceDeviceProperties : IUtf8JsonSerializable, IJsonModel + public partial class NamespaceDeviceProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter wr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDeviceProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceDeviceProperties)} does not support writing '{format}' format."); } if (options.Format != "W" && Optional.IsDefined(Uuid)) @@ -139,19 +139,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceRegistryNamespaceDeviceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NamespaceDeviceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDeviceProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceDeviceProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryNamespaceDeviceProperties(document.RootElement, options); + return DeserializeNamespaceDeviceProperties(document.RootElement, options); } - internal static DeviceRegistryNamespaceDeviceProperties DeserializeDeviceRegistryNamespaceDeviceProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static NamespaceDeviceProperties DeserializeNamespaceDeviceProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -293,7 +293,7 @@ internal static DeviceRegistryNamespaceDeviceProperties DeserializeDeviceRegistr } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryNamespaceDeviceProperties( + return new NamespaceDeviceProperties( uuid, enabled, externalDeviceId, @@ -311,35 +311,35 @@ internal static DeviceRegistryNamespaceDeviceProperties DeserializeDeviceRegistr serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDeviceProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceDeviceProperties)} does not support writing '{options.Format}' format."); } } - DeviceRegistryNamespaceDeviceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NamespaceDeviceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryNamespaceDeviceProperties(document.RootElement, options); + return DeserializeNamespaceDeviceProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDeviceProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceDeviceProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDeviceProperties.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDeviceProperties.cs similarity index 89% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDeviceProperties.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDeviceProperties.cs index 59b2281d1799..a5ef4c627fb3 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDeviceProperties.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDeviceProperties.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// Defines the device properties. - public partial class DeviceRegistryNamespaceDeviceProperties + public partial class NamespaceDeviceProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,13 +45,13 @@ public partial class DeviceRegistryNamespaceDeviceProperties /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public DeviceRegistryNamespaceDeviceProperties() + /// Initializes a new instance of . + public NamespaceDeviceProperties() { Attributes = new ChangeTrackingDictionary(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// A unique identifier for the device. /// Indicates if the resource is enabled or not. /// The Device ID provided by the customer. @@ -67,7 +67,7 @@ public DeviceRegistryNamespaceDeviceProperties() /// A timestamp (in UTC) that is updated each time the resource is modified. /// Provisioning state of the resource. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryNamespaceDeviceProperties(string uuid, bool? enabled, string externalDeviceId, string discoveredDeviceRef, string manufacturer, string model, string operatingSystem, string operatingSystemVersion, MessagingEndpoints endpoints, IDictionary attributes, DeviceStatus status, long? version, DateTimeOffset? lastTransitionOn, DeviceRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + internal NamespaceDeviceProperties(string uuid, bool? enabled, string externalDeviceId, string discoveredDeviceRef, string manufacturer, string model, string operatingSystem, string operatingSystemVersion, MessagingEndpoints endpoints, IDictionary attributes, DeviceStatus status, long? version, DateTimeOffset? lastTransitionOn, DeviceRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) { Uuid = uuid; Enabled = enabled; diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredAssetListResult.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredAssetListResult.Serialization.cs index a5974b4ea909..a9edb8502b79 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredAssetListResult.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredAssetListResult.Serialization.cs @@ -83,7 +83,7 @@ internal static NamespaceDiscoveredAssetListResult DeserializeNamespaceDiscovere { return null; } - IReadOnlyList value = default; + IReadOnlyList value = default; Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -91,10 +91,10 @@ internal static NamespaceDiscoveredAssetListResult DeserializeNamespaceDiscovere { if (property.NameEquals("value"u8)) { - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(DeviceRegistryNamespaceDiscoveredAssetData.DeserializeDeviceRegistryNamespaceDiscoveredAssetData(item, options)); + array.Add(NamespaceDiscoveredAssetData.DeserializeNamespaceDiscoveredAssetData(item, options)); } value = array; continue; diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredAssetListResult.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredAssetListResult.cs index 0210282daca5..fad7014e5959 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredAssetListResult.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredAssetListResult.cs @@ -49,7 +49,7 @@ internal partial class NamespaceDiscoveredAssetListResult /// Initializes a new instance of . /// The NamespaceDiscoveredAsset items on this page. /// is null. - internal NamespaceDiscoveredAssetListResult(IEnumerable value) + internal NamespaceDiscoveredAssetListResult(IEnumerable value) { Argument.AssertNotNull(value, nameof(value)); @@ -60,7 +60,7 @@ internal NamespaceDiscoveredAssetListResult(IEnumerable The NamespaceDiscoveredAsset items on this page. /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal NamespaceDiscoveredAssetListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + internal NamespaceDiscoveredAssetListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; @@ -73,7 +73,7 @@ internal NamespaceDiscoveredAssetListResult() } /// The NamespaceDiscoveredAsset items on this page. - public IReadOnlyList Value { get; } + public IReadOnlyList Value { get; } /// The link to the next page of items. public Uri NextLink { get; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDiscoveredAssetPatch.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredAssetPatch.Serialization.cs similarity index 66% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDiscoveredAssetPatch.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredAssetPatch.Serialization.cs index 778d3fd791c6..36ae23fd8bbe 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDiscoveredAssetPatch.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredAssetPatch.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class DeviceRegistryNamespaceDiscoveredAssetPatch : IUtf8JsonSerializable, IJsonModel + public partial class NamespaceDiscoveredAssetPatch : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWrite /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDiscoveredAssetPatch)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceDiscoveredAssetPatch)} does not support writing '{format}' format."); } if (Optional.IsCollectionDefined(Tags)) @@ -67,19 +67,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceRegistryNamespaceDiscoveredAssetPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NamespaceDiscoveredAssetPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDiscoveredAssetPatch)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceDiscoveredAssetPatch)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryNamespaceDiscoveredAssetPatch(document.RootElement, options); + return DeserializeNamespaceDiscoveredAssetPatch(document.RootElement, options); } - internal static DeviceRegistryNamespaceDiscoveredAssetPatch DeserializeDeviceRegistryNamespaceDiscoveredAssetPatch(JsonElement element, ModelReaderWriterOptions options = null) + internal static NamespaceDiscoveredAssetPatch DeserializeNamespaceDiscoveredAssetPatch(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -122,38 +122,38 @@ internal static DeviceRegistryNamespaceDiscoveredAssetPatch DeserializeDeviceReg } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryNamespaceDiscoveredAssetPatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); + return new NamespaceDiscoveredAssetPatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDiscoveredAssetPatch)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceDiscoveredAssetPatch)} does not support writing '{options.Format}' format."); } } - DeviceRegistryNamespaceDiscoveredAssetPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NamespaceDiscoveredAssetPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryNamespaceDiscoveredAssetPatch(document.RootElement, options); + return DeserializeNamespaceDiscoveredAssetPatch(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDiscoveredAssetPatch)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceDiscoveredAssetPatch)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDiscoveredAssetPatch.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredAssetPatch.cs similarity index 81% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDiscoveredAssetPatch.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredAssetPatch.cs index 4a7bc6864629..c394af6542f6 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDiscoveredAssetPatch.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredAssetPatch.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// The type used for update operations of the NamespaceDiscoveredAsset. - public partial class DeviceRegistryNamespaceDiscoveredAssetPatch + public partial class NamespaceDiscoveredAssetPatch { /// /// Keeps track of any properties unknown to the library. @@ -45,17 +45,17 @@ public partial class DeviceRegistryNamespaceDiscoveredAssetPatch /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public DeviceRegistryNamespaceDiscoveredAssetPatch() + /// Initializes a new instance of . + public NamespaceDiscoveredAssetPatch() { Tags = new ChangeTrackingDictionary(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Resource tags. /// The resource-specific properties for this resource. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryNamespaceDiscoveredAssetPatch(IDictionary tags, NamespaceDiscoveredAssetUpdateProperties properties, IDictionary serializedAdditionalRawData) + internal NamespaceDiscoveredAssetPatch(IDictionary tags, NamespaceDiscoveredAssetUpdateProperties properties, IDictionary serializedAdditionalRawData) { Tags = tags; Properties = properties; diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDiscoveredAssetProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredAssetProperties.Serialization.cs similarity index 90% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDiscoveredAssetProperties.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredAssetProperties.Serialization.cs index 58b5c6d0f078..3e433d04bd29 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDiscoveredAssetProperties.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredAssetProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class DeviceRegistryNamespaceDiscoveredAssetProperties : IUtf8JsonSerializable, IJsonModel + public partial class NamespaceDiscoveredAssetProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8Json /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDiscoveredAssetProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceDiscoveredAssetProperties)} does not support writing '{format}' format."); } writer.WritePropertyName("deviceRef"u8); @@ -240,19 +240,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceRegistryNamespaceDiscoveredAssetProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NamespaceDiscoveredAssetProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDiscoveredAssetProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceDiscoveredAssetProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryNamespaceDiscoveredAssetProperties(document.RootElement, options); + return DeserializeNamespaceDiscoveredAssetProperties(document.RootElement, options); } - internal static DeviceRegistryNamespaceDiscoveredAssetProperties DeserializeDeviceRegistryNamespaceDiscoveredAssetProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static NamespaceDiscoveredAssetProperties DeserializeNamespaceDiscoveredAssetProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -530,7 +530,7 @@ internal static DeviceRegistryNamespaceDiscoveredAssetProperties DeserializeDevi } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryNamespaceDiscoveredAssetProperties( + return new NamespaceDiscoveredAssetProperties( deviceRef, displayName, assetTypeRefs ?? new ChangeTrackingList(), @@ -562,35 +562,35 @@ internal static DeviceRegistryNamespaceDiscoveredAssetProperties DeserializeDevi serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDiscoveredAssetProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceDiscoveredAssetProperties)} does not support writing '{options.Format}' format."); } } - DeviceRegistryNamespaceDiscoveredAssetProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NamespaceDiscoveredAssetProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryNamespaceDiscoveredAssetProperties(document.RootElement, options); + return DeserializeNamespaceDiscoveredAssetProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDiscoveredAssetProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceDiscoveredAssetProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDiscoveredAssetProperties.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredAssetProperties.cs similarity index 90% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDiscoveredAssetProperties.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredAssetProperties.cs index 8ac2999d8ce3..f43734e36bda 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDiscoveredAssetProperties.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredAssetProperties.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// Defines the discovered asset properties. - public partial class DeviceRegistryNamespaceDiscoveredAssetProperties + public partial class NamespaceDiscoveredAssetProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,12 +45,12 @@ public partial class DeviceRegistryNamespaceDiscoveredAssetProperties /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Reference to the device that provides data for this asset. Must provide device name & endpoint on the device to use. /// Identifier used to detect changes in the asset. /// An integer that is incremented each time the resource is modified. /// or is null. - public DeviceRegistryNamespaceDiscoveredAssetProperties(DeviceRef deviceRef, string discoveryId, long version) + public NamespaceDiscoveredAssetProperties(DeviceRef deviceRef, string discoveryId, long version) { Argument.AssertNotNull(deviceRef, nameof(deviceRef)); Argument.AssertNotNull(discoveryId, nameof(discoveryId)); @@ -69,7 +69,7 @@ public DeviceRegistryNamespaceDiscoveredAssetProperties(DeviceRef deviceRef, str ManagementGroups = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Reference to the device that provides data for this asset. Must provide device name & endpoint on the device to use. /// Human-readable display name. /// URIs or type definition IDs. @@ -111,7 +111,7 @@ public DeviceRegistryNamespaceDiscoveredAssetProperties(DeviceRef deviceRef, str /// Array of management groups that are part of the asset. Each management group can have a per-group configuration. /// Provisioning state of the resource. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryNamespaceDiscoveredAssetProperties(DeviceRef deviceRef, string displayName, IList assetTypeRefs, string description, string discoveryId, string externalAssetId, long version, string manufacturer, string manufacturerUri, string model, string productCode, string hardwareRevision, string softwareRevision, string documentationUri, string serialNumber, IDictionary attributes, string defaultDatasetsConfiguration, string defaultEventsConfiguration, string defaultStreamsConfiguration, string defaultManagementGroupsConfiguration, IList defaultDatasetsDestinations, IList defaultEventsDestinations, IList defaultStreamsDestinations, IList datasets, IList eventGroups, IList streams, IList managementGroups, DeviceRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + internal NamespaceDiscoveredAssetProperties(DeviceRef deviceRef, string displayName, IList assetTypeRefs, string description, string discoveryId, string externalAssetId, long version, string manufacturer, string manufacturerUri, string model, string productCode, string hardwareRevision, string softwareRevision, string documentationUri, string serialNumber, IDictionary attributes, string defaultDatasetsConfiguration, string defaultEventsConfiguration, string defaultStreamsConfiguration, string defaultManagementGroupsConfiguration, IList defaultDatasetsDestinations, IList defaultEventsDestinations, IList defaultStreamsDestinations, IList datasets, IList eventGroups, IList streams, IList managementGroups, DeviceRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) { DeviceRef = deviceRef; DisplayName = displayName; @@ -144,8 +144,8 @@ internal DeviceRegistryNamespaceDiscoveredAssetProperties(DeviceRef deviceRef, s _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DeviceRegistryNamespaceDiscoveredAssetProperties() + /// Initializes a new instance of for deserialization. + internal NamespaceDiscoveredAssetProperties() { } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredDeviceListResult.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredDeviceListResult.Serialization.cs index b53f9a38a2b6..5eb93d6b9059 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredDeviceListResult.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredDeviceListResult.Serialization.cs @@ -83,7 +83,7 @@ internal static NamespaceDiscoveredDeviceListResult DeserializeNamespaceDiscover { return null; } - IReadOnlyList value = default; + IReadOnlyList value = default; Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -91,10 +91,10 @@ internal static NamespaceDiscoveredDeviceListResult DeserializeNamespaceDiscover { if (property.NameEquals("value"u8)) { - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(DeviceRegistryNamespaceDiscoveredDeviceData.DeserializeDeviceRegistryNamespaceDiscoveredDeviceData(item, options)); + array.Add(NamespaceDiscoveredDeviceData.DeserializeNamespaceDiscoveredDeviceData(item, options)); } value = array; continue; diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredDeviceListResult.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredDeviceListResult.cs index dd4e03dde601..bc6f972b1a5e 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredDeviceListResult.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredDeviceListResult.cs @@ -49,7 +49,7 @@ internal partial class NamespaceDiscoveredDeviceListResult /// Initializes a new instance of . /// The NamespaceDiscoveredDevice items on this page. /// is null. - internal NamespaceDiscoveredDeviceListResult(IEnumerable value) + internal NamespaceDiscoveredDeviceListResult(IEnumerable value) { Argument.AssertNotNull(value, nameof(value)); @@ -60,7 +60,7 @@ internal NamespaceDiscoveredDeviceListResult(IEnumerable The NamespaceDiscoveredDevice items on this page. /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal NamespaceDiscoveredDeviceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + internal NamespaceDiscoveredDeviceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; @@ -73,7 +73,7 @@ internal NamespaceDiscoveredDeviceListResult() } /// The NamespaceDiscoveredDevice items on this page. - public IReadOnlyList Value { get; } + public IReadOnlyList Value { get; } /// The link to the next page of items. public Uri NextLink { get; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDiscoveredDevicePatch.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredDevicePatch.Serialization.cs similarity index 66% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDiscoveredDevicePatch.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredDevicePatch.Serialization.cs index 65d5c44bac31..033e60f7e06c 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDiscoveredDevicePatch.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredDevicePatch.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class DeviceRegistryNamespaceDiscoveredDevicePatch : IUtf8JsonSerializable, IJsonModel + public partial class NamespaceDiscoveredDevicePatch : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDiscoveredDevicePatch)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceDiscoveredDevicePatch)} does not support writing '{format}' format."); } if (Optional.IsCollectionDefined(Tags)) @@ -67,19 +67,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceRegistryNamespaceDiscoveredDevicePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NamespaceDiscoveredDevicePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDiscoveredDevicePatch)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceDiscoveredDevicePatch)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryNamespaceDiscoveredDevicePatch(document.RootElement, options); + return DeserializeNamespaceDiscoveredDevicePatch(document.RootElement, options); } - internal static DeviceRegistryNamespaceDiscoveredDevicePatch DeserializeDeviceRegistryNamespaceDiscoveredDevicePatch(JsonElement element, ModelReaderWriterOptions options = null) + internal static NamespaceDiscoveredDevicePatch DeserializeNamespaceDiscoveredDevicePatch(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -122,38 +122,38 @@ internal static DeviceRegistryNamespaceDiscoveredDevicePatch DeserializeDeviceRe } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryNamespaceDiscoveredDevicePatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); + return new NamespaceDiscoveredDevicePatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDiscoveredDevicePatch)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceDiscoveredDevicePatch)} does not support writing '{options.Format}' format."); } } - DeviceRegistryNamespaceDiscoveredDevicePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NamespaceDiscoveredDevicePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryNamespaceDiscoveredDevicePatch(document.RootElement, options); + return DeserializeNamespaceDiscoveredDevicePatch(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDiscoveredDevicePatch)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceDiscoveredDevicePatch)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDiscoveredDevicePatch.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredDevicePatch.cs similarity index 81% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDiscoveredDevicePatch.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredDevicePatch.cs index 0217973b9a1e..714f301ec1c6 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDiscoveredDevicePatch.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredDevicePatch.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// The type used for update operations of the NamespaceDiscoveredDevice. - public partial class DeviceRegistryNamespaceDiscoveredDevicePatch + public partial class NamespaceDiscoveredDevicePatch { /// /// Keeps track of any properties unknown to the library. @@ -45,17 +45,17 @@ public partial class DeviceRegistryNamespaceDiscoveredDevicePatch /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public DeviceRegistryNamespaceDiscoveredDevicePatch() + /// Initializes a new instance of . + public NamespaceDiscoveredDevicePatch() { Tags = new ChangeTrackingDictionary(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Resource tags. /// The resource-specific properties for this resource. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryNamespaceDiscoveredDevicePatch(IDictionary tags, NamespaceDiscoveredDeviceUpdateProperties properties, IDictionary serializedAdditionalRawData) + internal NamespaceDiscoveredDevicePatch(IDictionary tags, NamespaceDiscoveredDeviceUpdateProperties properties, IDictionary serializedAdditionalRawData) { Tags = tags; Properties = properties; diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDiscoveredDeviceProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredDeviceProperties.Serialization.cs similarity index 79% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDiscoveredDeviceProperties.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredDeviceProperties.Serialization.cs index 4e30448c8b58..58dd5ff8c372 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDiscoveredDeviceProperties.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredDeviceProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class DeviceRegistryNamespaceDiscoveredDeviceProperties : IUtf8JsonSerializable, IJsonModel + public partial class NamespaceDiscoveredDeviceProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8Jso /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDiscoveredDeviceProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceDiscoveredDeviceProperties)} does not support writing '{format}' format."); } if (Optional.IsDefined(ExternalDeviceId)) @@ -113,19 +113,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceRegistryNamespaceDiscoveredDeviceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NamespaceDiscoveredDeviceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDiscoveredDeviceProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceDiscoveredDeviceProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryNamespaceDiscoveredDeviceProperties(document.RootElement, options); + return DeserializeNamespaceDiscoveredDeviceProperties(document.RootElement, options); } - internal static DeviceRegistryNamespaceDiscoveredDeviceProperties DeserializeDeviceRegistryNamespaceDiscoveredDeviceProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static NamespaceDiscoveredDeviceProperties DeserializeNamespaceDiscoveredDeviceProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -227,7 +227,7 @@ internal static DeviceRegistryNamespaceDiscoveredDeviceProperties DeserializeDev } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryNamespaceDiscoveredDeviceProperties( + return new NamespaceDiscoveredDeviceProperties( externalDeviceId, endpoints, manufacturer, @@ -241,35 +241,35 @@ internal static DeviceRegistryNamespaceDiscoveredDeviceProperties DeserializeDev serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDiscoveredDeviceProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceDiscoveredDeviceProperties)} does not support writing '{options.Format}' format."); } } - DeviceRegistryNamespaceDiscoveredDeviceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NamespaceDiscoveredDeviceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryNamespaceDiscoveredDeviceProperties(document.RootElement, options); + return DeserializeNamespaceDiscoveredDeviceProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDiscoveredDeviceProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceDiscoveredDeviceProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDiscoveredDeviceProperties.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredDeviceProperties.cs similarity index 85% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDiscoveredDeviceProperties.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredDeviceProperties.cs index 1146aecc427f..a26e0fddd178 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceDiscoveredDeviceProperties.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceDiscoveredDeviceProperties.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// Defines the discovered device properties. - public partial class DeviceRegistryNamespaceDiscoveredDeviceProperties + public partial class NamespaceDiscoveredDeviceProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,11 +45,11 @@ public partial class DeviceRegistryNamespaceDiscoveredDeviceProperties /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Identifier used to detect changes in the discovered device. /// An integer that is incremented each time the resource is modified. /// is null. - public DeviceRegistryNamespaceDiscoveredDeviceProperties(string discoveryId, long version) + public NamespaceDiscoveredDeviceProperties(string discoveryId, long version) { Argument.AssertNotNull(discoveryId, nameof(discoveryId)); @@ -58,7 +58,7 @@ public DeviceRegistryNamespaceDiscoveredDeviceProperties(string discoveryId, lon Version = version; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// A device ID that represents the device in a system external to Azure. Unique within scope of an Azure tenant. /// Endpoints for discovered devices. /// Device manufacturer. @@ -70,7 +70,7 @@ public DeviceRegistryNamespaceDiscoveredDeviceProperties(string discoveryId, lon /// An integer that is incremented each time the resource is modified. /// Provisioning state of the resource. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryNamespaceDiscoveredDeviceProperties(string externalDeviceId, DiscoveredMessagingEndpoints endpoints, string manufacturer, string model, string operatingSystem, string operatingSystemVersion, IDictionary attributes, string discoveryId, long version, DeviceRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + internal NamespaceDiscoveredDeviceProperties(string externalDeviceId, DiscoveredMessagingEndpoints endpoints, string manufacturer, string model, string operatingSystem, string operatingSystemVersion, IDictionary attributes, string discoveryId, long version, DeviceRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) { ExternalDeviceId = externalDeviceId; Endpoints = endpoints; @@ -85,8 +85,8 @@ internal DeviceRegistryNamespaceDiscoveredDeviceProperties(string externalDevice _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DeviceRegistryNamespaceDiscoveredDeviceProperties() + /// Initializes a new instance of for deserialization. + internal NamespaceDiscoveredDeviceProperties() { } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceListResult.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceListResult.Serialization.cs index 1758444162c9..ddba1c5ef954 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceListResult.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceListResult.Serialization.cs @@ -83,7 +83,7 @@ internal static NamespaceListResult DeserializeNamespaceListResult(JsonElement e { return null; } - IReadOnlyList value = default; + IReadOnlyList value = default; Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -91,10 +91,10 @@ internal static NamespaceListResult DeserializeNamespaceListResult(JsonElement e { if (property.NameEquals("value"u8)) { - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(DeviceRegistryNamespaceData.DeserializeDeviceRegistryNamespaceData(item, options)); + array.Add(NamespaceData.DeserializeNamespaceData(item, options)); } value = array; continue; diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceListResult.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceListResult.cs index fd131679ba8e..4958007e0983 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceListResult.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceListResult.cs @@ -49,7 +49,7 @@ internal partial class NamespaceListResult /// Initializes a new instance of . /// The Namespace items on this page. /// is null. - internal NamespaceListResult(IEnumerable value) + internal NamespaceListResult(IEnumerable value) { Argument.AssertNotNull(value, nameof(value)); @@ -60,7 +60,7 @@ internal NamespaceListResult(IEnumerable value) /// The Namespace items on this page. /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal NamespaceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + internal NamespaceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; @@ -73,7 +73,7 @@ internal NamespaceListResult() } /// The Namespace items on this page. - public IReadOnlyList Value { get; } + public IReadOnlyList Value { get; } /// The link to the next page of items. public Uri NextLink { get; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceMessageSchemaReference.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceMessageSchemaReference.Serialization.cs similarity index 64% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceMessageSchemaReference.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceMessageSchemaReference.Serialization.cs index 4d9f37a189e1..02d0f4e3334e 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceMessageSchemaReference.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceMessageSchemaReference.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class DeviceRegistryNamespaceMessageSchemaReference : IUtf8JsonSerializable, IJsonModel + public partial class NamespaceMessageSchemaReference : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceMessageSchemaReference)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceMessageSchemaReference)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -66,19 +66,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceRegistryNamespaceMessageSchemaReference IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NamespaceMessageSchemaReference IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceMessageSchemaReference)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceMessageSchemaReference)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryNamespaceMessageSchemaReference(document.RootElement, options); + return DeserializeNamespaceMessageSchemaReference(document.RootElement, options); } - internal static DeviceRegistryNamespaceMessageSchemaReference DeserializeDeviceRegistryNamespaceMessageSchemaReference(JsonElement element, ModelReaderWriterOptions options = null) + internal static NamespaceMessageSchemaReference DeserializeNamespaceMessageSchemaReference(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -114,38 +114,38 @@ internal static DeviceRegistryNamespaceMessageSchemaReference DeserializeDeviceR } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryNamespaceMessageSchemaReference(schemaRegistryNamespace, schemaName, schemaVersion, serializedAdditionalRawData); + return new NamespaceMessageSchemaReference(schemaRegistryNamespace, schemaName, schemaVersion, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceMessageSchemaReference)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceMessageSchemaReference)} does not support writing '{options.Format}' format."); } } - DeviceRegistryNamespaceMessageSchemaReference IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NamespaceMessageSchemaReference IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryNamespaceMessageSchemaReference(document.RootElement, options); + return DeserializeNamespaceMessageSchemaReference(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceMessageSchemaReference)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceMessageSchemaReference)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceMessageSchemaReference.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceMessageSchemaReference.cs similarity index 78% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceMessageSchemaReference.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceMessageSchemaReference.cs index 377c67b5e131..fd189c68a30e 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceMessageSchemaReference.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceMessageSchemaReference.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// Defines the message schema reference properties. - public partial class DeviceRegistryNamespaceMessageSchemaReference + public partial class NamespaceMessageSchemaReference { /// /// Keeps track of any properties unknown to the library. @@ -45,23 +45,23 @@ public partial class DeviceRegistryNamespaceMessageSchemaReference /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The message schema registry namespace. /// The message schema name. /// The message schema version. - internal DeviceRegistryNamespaceMessageSchemaReference(string schemaRegistryNamespace, string schemaName, string schemaVersion) + internal NamespaceMessageSchemaReference(string schemaRegistryNamespace, string schemaName, string schemaVersion) { SchemaRegistryNamespace = schemaRegistryNamespace; SchemaName = schemaName; SchemaVersion = schemaVersion; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The message schema registry namespace. /// The message schema name. /// The message schema version. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryNamespaceMessageSchemaReference(string schemaRegistryNamespace, string schemaName, string schemaVersion, IDictionary serializedAdditionalRawData) + internal NamespaceMessageSchemaReference(string schemaRegistryNamespace, string schemaName, string schemaVersion, IDictionary serializedAdditionalRawData) { SchemaRegistryNamespace = schemaRegistryNamespace; SchemaName = schemaName; @@ -69,8 +69,8 @@ internal DeviceRegistryNamespaceMessageSchemaReference(string schemaRegistryName _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DeviceRegistryNamespaceMessageSchemaReference() + /// Initializes a new instance of for deserialization. + internal NamespaceMessageSchemaReference() { } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespacePatch.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespacePatch.Serialization.cs similarity index 72% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespacePatch.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespacePatch.Serialization.cs index 5ceb164bb6dc..fc4d53f61d5a 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespacePatch.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespacePatch.Serialization.cs @@ -15,11 +15,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class DeviceRegistryNamespacePatch : IUtf8JsonSerializable, IJsonModel + public partial class NamespacePatch : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -30,10 +30,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespacePatch)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NamespacePatch)} does not support writing '{format}' format."); } if (Optional.IsDefined(Identity)) @@ -74,19 +74,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceRegistryNamespacePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NamespacePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespacePatch)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NamespacePatch)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryNamespacePatch(document.RootElement, options); + return DeserializeNamespacePatch(document.RootElement, options); } - internal static DeviceRegistryNamespacePatch DeserializeDeviceRegistryNamespacePatch(JsonElement element, ModelReaderWriterOptions options = null) + internal static NamespacePatch DeserializeNamespacePatch(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -139,38 +139,38 @@ internal static DeviceRegistryNamespacePatch DeserializeDeviceRegistryNamespaceP } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryNamespacePatch(identity, tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); + return new NamespacePatch(identity, tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespacePatch)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespacePatch)} does not support writing '{options.Format}' format."); } } - DeviceRegistryNamespacePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NamespacePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryNamespacePatch(document.RootElement, options); + return DeserializeNamespacePatch(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespacePatch)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespacePatch)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespacePatch.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespacePatch.cs similarity index 86% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespacePatch.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespacePatch.cs index 1f8ecc5867c6..7718ae9ca701 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespacePatch.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespacePatch.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// The type used for update operations of the Namespace. - public partial class DeviceRegistryNamespacePatch + public partial class NamespacePatch { /// /// Keeps track of any properties unknown to the library. @@ -46,18 +46,18 @@ public partial class DeviceRegistryNamespacePatch /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public DeviceRegistryNamespacePatch() + /// Initializes a new instance of . + public NamespacePatch() { Tags = new ChangeTrackingDictionary(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The managed service identities assigned to this resource. Current supported identity types: None, SystemAssigned. /// Resource tags. /// The resource-specific properties for this resource. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryNamespacePatch(ManagedServiceIdentity identity, IDictionary tags, NamespaceUpdateProperties properties, IDictionary serializedAdditionalRawData) + internal NamespacePatch(ManagedServiceIdentity identity, IDictionary tags, NamespaceUpdateProperties properties, IDictionary serializedAdditionalRawData) { Identity = identity; Tags = tags; diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceProperties.Serialization.cs similarity index 68% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceProperties.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceProperties.Serialization.cs index d99d6c827787..c9da5ed1be73 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceProperties.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class DeviceRegistryNamespaceProperties : IUtf8JsonSerializable, IJsonModel + public partial class NamespaceProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceProperties)} does not support writing '{format}' format."); } if (options.Format != "W" && Optional.IsDefined(Uuid)) @@ -66,19 +66,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceRegistryNamespaceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NamespaceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryNamespaceProperties(document.RootElement, options); + return DeserializeNamespaceProperties(document.RootElement, options); } - internal static DeviceRegistryNamespaceProperties DeserializeDeviceRegistryNamespaceProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static NamespaceProperties DeserializeNamespaceProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -122,38 +122,38 @@ internal static DeviceRegistryNamespaceProperties DeserializeDeviceRegistryNames } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryNamespaceProperties(uuid, messaging, provisioningState, serializedAdditionalRawData); + return new NamespaceProperties(uuid, messaging, provisioningState, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceProperties)} does not support writing '{options.Format}' format."); } } - DeviceRegistryNamespaceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NamespaceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryNamespaceProperties(document.RootElement, options); + return DeserializeNamespaceProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceProperties.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceProperties.cs similarity index 85% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceProperties.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceProperties.cs index f393fb3ce0ca..bd94dca7dea5 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryNamespaceProperties.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/NamespaceProperties.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// The namespace properties model. - public partial class DeviceRegistryNamespaceProperties + public partial class NamespaceProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,17 +45,17 @@ public partial class DeviceRegistryNamespaceProperties /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public DeviceRegistryNamespaceProperties() + /// Initializes a new instance of . + public NamespaceProperties() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Globally unique, immutable, non-reusable ID. /// Assigned and unassigned messaging endpoints. /// Provisioning state of the resource. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryNamespaceProperties(string uuid, Messaging messaging, DeviceRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + internal NamespaceProperties(string uuid, Messaging messaging, DeviceRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) { Uuid = uuid; Messaging = messaging; diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryStatusConfig.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/StatusConfig.Serialization.cs similarity index 68% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryStatusConfig.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/StatusConfig.Serialization.cs index 67a2795fdbb8..e55fb16af9f5 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryStatusConfig.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/StatusConfig.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class DeviceRegistryStatusConfig : IUtf8JsonSerializable, IJsonModel + public partial class StatusConfig : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryStatusConfig)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(StatusConfig)} does not support writing '{format}' format."); } if (options.Format != "W" && Optional.IsDefined(Version)) @@ -66,19 +66,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceRegistryStatusConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + StatusConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryStatusConfig)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(StatusConfig)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryStatusConfig(document.RootElement, options); + return DeserializeStatusConfig(document.RootElement, options); } - internal static DeviceRegistryStatusConfig DeserializeDeviceRegistryStatusConfig(JsonElement element, ModelReaderWriterOptions options = null) + internal static StatusConfig DeserializeStatusConfig(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -88,7 +88,7 @@ internal static DeviceRegistryStatusConfig DeserializeDeviceRegistryStatusConfig } long? version = default; DateTimeOffset? lastTransitionTime = default; - DeviceRegistryStatusError error = default; + StatusError error = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -117,7 +117,7 @@ internal static DeviceRegistryStatusConfig DeserializeDeviceRegistryStatusConfig { continue; } - error = DeviceRegistryStatusError.DeserializeDeviceRegistryStatusError(property.Value, options); + error = StatusError.DeserializeStatusError(property.Value, options); continue; } if (options.Format != "W") @@ -126,38 +126,38 @@ internal static DeviceRegistryStatusConfig DeserializeDeviceRegistryStatusConfig } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryStatusConfig(version, lastTransitionTime, error, serializedAdditionalRawData); + return new StatusConfig(version, lastTransitionTime, error, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryStatusConfig)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(StatusConfig)} does not support writing '{options.Format}' format."); } } - DeviceRegistryStatusConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + StatusConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryStatusConfig(document.RootElement, options); + return DeserializeStatusConfig(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryStatusConfig)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(StatusConfig)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryStatusConfig.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/StatusConfig.cs similarity index 86% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryStatusConfig.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/StatusConfig.cs index fe20731b52cf..fa41592729fd 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryStatusConfig.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/StatusConfig.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// Defines the status config properties. - public partial class DeviceRegistryStatusConfig + public partial class StatusConfig { /// /// Keeps track of any properties unknown to the library. @@ -45,17 +45,17 @@ public partial class DeviceRegistryStatusConfig /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal DeviceRegistryStatusConfig() + /// Initializes a new instance of . + internal StatusConfig() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// A read-only incremental counter indicating the number of times the configuration has been modified from the perspective of the current actual (edge) state of the CRD. Edge would be the only writer of this value and would sync back up to the cloud. In steady state, this should equal version. /// A read-only timestamp indicating the last time the configuration has been modified from the perspective of the current actual (edge) state of the CRD. Edge would be the only writer of this value and would sync back up to the cloud. /// Object to transfer and persist errors that originate from the edge. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryStatusConfig(long? version, DateTimeOffset? lastTransitionOn, DeviceRegistryStatusError error, IDictionary serializedAdditionalRawData) + internal StatusConfig(long? version, DateTimeOffset? lastTransitionOn, StatusError error, IDictionary serializedAdditionalRawData) { Version = version; LastTransitionOn = lastTransitionOn; @@ -68,6 +68,6 @@ internal DeviceRegistryStatusConfig(long? version, DateTimeOffset? lastTransitio /// A read-only timestamp indicating the last time the configuration has been modified from the perspective of the current actual (edge) state of the CRD. Edge would be the only writer of this value and would sync back up to the cloud. public DateTimeOffset? LastTransitionOn { get; } /// Object to transfer and persist errors that originate from the edge. - public DeviceRegistryStatusError Error { get; } + public StatusError Error { get; } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryStatusError.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/StatusError.Serialization.cs similarity index 67% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryStatusError.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/StatusError.Serialization.cs index 7acb10f39680..1527e26e228f 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryStatusError.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/StatusError.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class DeviceRegistryStatusError : IUtf8JsonSerializable, IJsonModel + public partial class StatusError : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryStatusError)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(StatusError)} does not support writing '{format}' format."); } if (options.Format != "W" && Optional.IsDefined(Code)) @@ -71,19 +71,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceRegistryStatusError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + StatusError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryStatusError)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(StatusError)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryStatusError(document.RootElement, options); + return DeserializeStatusError(document.RootElement, options); } - internal static DeviceRegistryStatusError DeserializeDeviceRegistryStatusError(JsonElement element, ModelReaderWriterOptions options = null) + internal static StatusError DeserializeStatusError(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -93,7 +93,7 @@ internal static DeviceRegistryStatusError DeserializeDeviceRegistryStatusError(J } string code = default; string message = default; - IReadOnlyList details = default; + IReadOnlyList details = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -114,10 +114,10 @@ internal static DeviceRegistryStatusError DeserializeDeviceRegistryStatusError(J { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(DeviceRegistryErrorDetails.DeserializeDeviceRegistryErrorDetails(item, options)); + array.Add(ErrorDetails.DeserializeErrorDetails(item, options)); } details = array; continue; @@ -128,38 +128,38 @@ internal static DeviceRegistryStatusError DeserializeDeviceRegistryStatusError(J } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryStatusError(code, message, details ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new StatusError(code, message, details ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryStatusError)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(StatusError)} does not support writing '{options.Format}' format."); } } - DeviceRegistryStatusError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + StatusError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryStatusError(document.RootElement, options); + return DeserializeStatusError(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryStatusError)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(StatusError)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryStatusError.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/StatusError.cs similarity index 81% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryStatusError.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/StatusError.cs index d3613c995f05..94a64bc82768 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryStatusError.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/StatusError.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// Defines the status config error properties. - public partial class DeviceRegistryStatusError + public partial class StatusError { /// /// Keeps track of any properties unknown to the library. @@ -45,18 +45,18 @@ public partial class DeviceRegistryStatusError /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal DeviceRegistryStatusError() + /// Initializes a new instance of . + internal StatusError() { - Details = new ChangeTrackingList(); + Details = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Error code for classification of errors (ex: '400', '404', '500', etc.). /// Human-readable helpful error message to provide additional context for error (e.g.,: “Capability ID 'foo' does not exist”). /// Array of error details that describe the status of each error. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryStatusError(string code, string message, IReadOnlyList details, IDictionary serializedAdditionalRawData) + internal StatusError(string code, string message, IReadOnlyList details, IDictionary serializedAdditionalRawData) { Code = code; Message = message; @@ -69,6 +69,6 @@ internal DeviceRegistryStatusError(string code, string message, IReadOnlyList Human-readable helpful error message to provide additional context for error (e.g.,: “Capability ID 'foo' does not exist”). public string Message { get; } /// Array of error details that describe the status of each error. - public IReadOnlyList Details { get; } + public IReadOnlyList Details { get; } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceAssetCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceAssetCollection.cs similarity index 62% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceAssetCollection.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceAssetCollection.cs index ebf3be0474c1..e4adef78ef24 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceAssetCollection.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceAssetCollection.cs @@ -18,28 +18,28 @@ namespace Azure.ResourceManager.DeviceRegistry { /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetDeviceRegistryNamespaceAssets method from an instance of . + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetNamespaceAssets method from an instance of . /// - public partial class DeviceRegistryNamespaceAssetCollection : ArmCollection, IEnumerable, IAsyncEnumerable + public partial class NamespaceAssetCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics; - private readonly NamespaceAssetsRestOperations _deviceRegistryNamespaceAssetNamespaceAssetsRestClient; + private readonly ClientDiagnostics _namespaceAssetClientDiagnostics; + private readonly NamespaceAssetsRestOperations _namespaceAssetRestClient; - /// Initializes a new instance of the class for mocking. - protected DeviceRegistryNamespaceAssetCollection() + /// Initializes a new instance of the class for mocking. + protected NamespaceAssetCollection() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the parent resource that is the target of operations. - internal DeviceRegistryNamespaceAssetCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + internal NamespaceAssetCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistryNamespaceAssetResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(DeviceRegistryNamespaceAssetResource.ResourceType, out string deviceRegistryNamespaceAssetNamespaceAssetsApiVersion); - _deviceRegistryNamespaceAssetNamespaceAssetsRestClient = new NamespaceAssetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistryNamespaceAssetNamespaceAssetsApiVersion); + _namespaceAssetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", NamespaceAssetResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(NamespaceAssetResource.ResourceType, out string namespaceAssetApiVersion); + _namespaceAssetRestClient = new NamespaceAssetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, namespaceAssetApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -47,8 +47,8 @@ internal DeviceRegistryNamespaceAssetCollection(ArmClient client, ResourceIdenti internal static void ValidateResourceId(ResourceIdentifier id) { - if (id.ResourceType != DeviceRegistryNamespaceResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DeviceRegistryNamespaceResource.ResourceType), nameof(id)); + if (id.ResourceType != NamespaceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, NamespaceResource.ResourceType), nameof(id)); } /// @@ -68,7 +68,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Resource - /// + /// /// /// /// @@ -78,17 +78,17 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string assetName, DeviceRegistryNamespaceAssetData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string assetName, NamespaceAssetData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(assetName, nameof(assetName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceAssetCollection.CreateOrUpdate"); + using var scope = _namespaceAssetClientDiagnostics.CreateScope("NamespaceAssetCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.CreateOrReplaceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assetName, data, cancellationToken).ConfigureAwait(false); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryNamespaceAssetOperationSource(Client), _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics, Pipeline, _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _namespaceAssetRestClient.CreateOrReplaceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assetName, data, cancellationToken).ConfigureAwait(false); + var operation = new DeviceRegistryArmOperation(new NamespaceAssetOperationSource(Client), _namespaceAssetClientDiagnostics, Pipeline, _namespaceAssetRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -117,7 +117,7 @@ public virtual async Task> Cr /// /// /// Resource - /// + /// /// /// /// @@ -127,17 +127,17 @@ public virtual async Task> Cr /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string assetName, DeviceRegistryNamespaceAssetData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string assetName, NamespaceAssetData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(assetName, nameof(assetName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceAssetCollection.CreateOrUpdate"); + using var scope = _namespaceAssetClientDiagnostics.CreateScope("NamespaceAssetCollection.CreateOrUpdate"); scope.Start(); try { - var response = _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.CreateOrReplace(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assetName, data, cancellationToken); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryNamespaceAssetOperationSource(Client), _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics, Pipeline, _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _namespaceAssetRestClient.CreateOrReplace(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assetName, data, cancellationToken); + var operation = new DeviceRegistryArmOperation(new NamespaceAssetOperationSource(Client), _namespaceAssetClientDiagnostics, Pipeline, _namespaceAssetRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Resource - /// + /// /// /// /// @@ -174,18 +174,18 @@ public virtual ArmOperation CreateOrUpdate /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetAsync(string assetName, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(string assetName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(assetName, nameof(assetName)); - using var scope = _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceAssetCollection.Get"); + using var scope = _namespaceAssetClientDiagnostics.CreateScope("NamespaceAssetCollection.Get"); scope.Start(); try { - var response = await _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assetName, cancellationToken).ConfigureAwait(false); + var response = await _namespaceAssetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assetName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceAssetResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new NamespaceAssetResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -211,7 +211,7 @@ public virtual async Task> GetAsy /// /// /// Resource - /// + /// /// /// /// @@ -219,18 +219,18 @@ public virtual async Task> GetAsy /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual Response Get(string assetName, CancellationToken cancellationToken = default) + public virtual Response Get(string assetName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(assetName, nameof(assetName)); - using var scope = _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceAssetCollection.Get"); + using var scope = _namespaceAssetClientDiagnostics.CreateScope("NamespaceAssetCollection.Get"); scope.Start(); try { - var response = _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assetName, cancellationToken); + var response = _namespaceAssetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assetName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceAssetResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new NamespaceAssetResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -256,17 +256,17 @@ public virtual Response Get(string assetNa /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryNamespaceAssetResource(Client, DeviceRegistryNamespaceAssetData.DeserializeDeviceRegistryNamespaceAssetData(e)), _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics, Pipeline, "DeviceRegistryNamespaceAssetCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _namespaceAssetRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _namespaceAssetRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NamespaceAssetResource(Client, NamespaceAssetData.DeserializeNamespaceAssetData(e)), _namespaceAssetClientDiagnostics, Pipeline, "NamespaceAssetCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -286,17 +286,17 @@ public virtual AsyncPageable GetAllAsync(C /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryNamespaceAssetResource(Client, DeviceRegistryNamespaceAssetData.DeserializeDeviceRegistryNamespaceAssetData(e)), _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics, Pipeline, "DeviceRegistryNamespaceAssetCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _namespaceAssetRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _namespaceAssetRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NamespaceAssetResource(Client, NamespaceAssetData.DeserializeNamespaceAssetData(e)), _namespaceAssetClientDiagnostics, Pipeline, "NamespaceAssetCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -316,7 +316,7 @@ public virtual Pageable GetAll(Cancellatio /// /// /// Resource - /// + /// /// /// /// @@ -328,11 +328,11 @@ public virtual async Task> ExistsAsync(string assetName, Cancella { Argument.AssertNotNullOrEmpty(assetName, nameof(assetName)); - using var scope = _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceAssetCollection.Exists"); + using var scope = _namespaceAssetClientDiagnostics.CreateScope("NamespaceAssetCollection.Exists"); scope.Start(); try { - var response = await _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assetName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _namespaceAssetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assetName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string assetName, Cancella /// /// /// Resource - /// + /// /// /// /// @@ -371,11 +371,11 @@ public virtual Response Exists(string assetName, CancellationToken cancell { Argument.AssertNotNullOrEmpty(assetName, nameof(assetName)); - using var scope = _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceAssetCollection.Exists"); + using var scope = _namespaceAssetClientDiagnostics.CreateScope("NamespaceAssetCollection.Exists"); scope.Start(); try { - var response = _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assetName, cancellationToken: cancellationToken); + var response = _namespaceAssetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assetName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -402,7 +402,7 @@ public virtual Response Exists(string assetName, CancellationToken cancell /// /// /// Resource - /// + /// /// /// /// @@ -410,18 +410,18 @@ public virtual Response Exists(string assetName, CancellationToken cancell /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetIfExistsAsync(string assetName, CancellationToken cancellationToken = default) + public virtual async Task> GetIfExistsAsync(string assetName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(assetName, nameof(assetName)); - using var scope = _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceAssetCollection.GetIfExists"); + using var scope = _namespaceAssetClientDiagnostics.CreateScope("NamespaceAssetCollection.GetIfExists"); scope.Start(); try { - var response = await _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assetName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _namespaceAssetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assetName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceAssetResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new NamespaceAssetResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -447,7 +447,7 @@ public virtual async Task /// /// /// Resource - /// + /// /// /// /// @@ -455,18 +455,18 @@ public virtual async Task /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual NullableResponse GetIfExists(string assetName, CancellationToken cancellationToken = default) + public virtual NullableResponse GetIfExists(string assetName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(assetName, nameof(assetName)); - using var scope = _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceAssetCollection.GetIfExists"); + using var scope = _namespaceAssetClientDiagnostics.CreateScope("NamespaceAssetCollection.GetIfExists"); scope.Start(); try { - var response = _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assetName, cancellationToken: cancellationToken); + var response = _namespaceAssetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assetName, cancellationToken: cancellationToken); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceAssetResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new NamespaceAssetResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -475,7 +475,7 @@ public virtual NullableResponse GetIfExist } } - IEnumerator IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetAll().GetEnumerator(); } @@ -485,7 +485,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceAssetData.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceAssetData.Serialization.cs similarity index 72% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceAssetData.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceAssetData.Serialization.cs index 4f6aa14ec22d..9bc5bac51c82 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceAssetData.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceAssetData.Serialization.cs @@ -16,11 +16,11 @@ namespace Azure.ResourceManager.DeviceRegistry { - public partial class DeviceRegistryNamespaceAssetData : IUtf8JsonSerializable, IJsonModel + public partial class NamespaceAssetData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -31,10 +31,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, M /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetData)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); @@ -47,19 +47,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteObjectValue(ExtendedLocation, options); } - DeviceRegistryNamespaceAssetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NamespaceAssetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryNamespaceAssetData(document.RootElement, options); + return DeserializeNamespaceAssetData(document.RootElement, options); } - internal static DeviceRegistryNamespaceAssetData DeserializeDeviceRegistryNamespaceAssetData(JsonElement element, ModelReaderWriterOptions options = null) + internal static NamespaceAssetData DeserializeNamespaceAssetData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -67,7 +67,7 @@ internal static DeviceRegistryNamespaceAssetData DeserializeDeviceRegistryNamesp { return null; } - DeviceRegistryNamespaceAssetProperties properties = default; + NamespaceAssetProperties properties = default; DeviceRegistryExtendedLocation extendedLocation = default; IDictionary tags = default; AzureLocation location = default; @@ -85,7 +85,7 @@ internal static DeviceRegistryNamespaceAssetData DeserializeDeviceRegistryNamesp { continue; } - properties = DeviceRegistryNamespaceAssetProperties.DeserializeDeviceRegistryNamespaceAssetProperties(property.Value, options); + properties = NamespaceAssetProperties.DeserializeNamespaceAssetProperties(property.Value, options); continue; } if (property.NameEquals("extendedLocation"u8)) @@ -142,7 +142,7 @@ internal static DeviceRegistryNamespaceAssetData DeserializeDeviceRegistryNamesp } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryNamespaceAssetData( + return new NamespaceAssetData( id, name, type, @@ -154,35 +154,35 @@ internal static DeviceRegistryNamespaceAssetData DeserializeDeviceRegistryNamesp serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetData)} does not support writing '{options.Format}' format."); } } - DeviceRegistryNamespaceAssetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NamespaceAssetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryNamespaceAssetData(document.RootElement, options); + return DeserializeNamespaceAssetData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceAssetData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceAssetData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceAssetData.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceAssetData.cs similarity index 73% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceAssetData.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceAssetData.cs index 75ae799a6b93..3723d9cfdbb9 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceAssetData.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceAssetData.cs @@ -14,10 +14,10 @@ namespace Azure.ResourceManager.DeviceRegistry { /// - /// A class representing the DeviceRegistryNamespaceAsset data model. + /// A class representing the NamespaceAsset data model. /// Asset definition. /// - public partial class DeviceRegistryNamespaceAssetData : TrackedResourceData + public partial class NamespaceAssetData : TrackedResourceData { /// /// Keeps track of any properties unknown to the library. @@ -51,18 +51,18 @@ public partial class DeviceRegistryNamespaceAssetData : TrackedResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The location. /// The extended location. /// is null. - public DeviceRegistryNamespaceAssetData(AzureLocation location, DeviceRegistryExtendedLocation extendedLocation) : base(location) + public NamespaceAssetData(AzureLocation location, DeviceRegistryExtendedLocation extendedLocation) : base(location) { Argument.AssertNotNull(extendedLocation, nameof(extendedLocation)); ExtendedLocation = extendedLocation; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -72,20 +72,20 @@ public DeviceRegistryNamespaceAssetData(AzureLocation location, DeviceRegistryEx /// The resource-specific properties for this resource. /// The extended location. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryNamespaceAssetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, DeviceRegistryNamespaceAssetProperties properties, DeviceRegistryExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal NamespaceAssetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, NamespaceAssetProperties properties, DeviceRegistryExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Properties = properties; ExtendedLocation = extendedLocation; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DeviceRegistryNamespaceAssetData() + /// Initializes a new instance of for deserialization. + internal NamespaceAssetData() { } /// The resource-specific properties for this resource. - public DeviceRegistryNamespaceAssetProperties Properties { get; set; } + public NamespaceAssetProperties Properties { get; set; } /// The extended location. public DeviceRegistryExtendedLocation ExtendedLocation { get; set; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceAssetResource.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceAssetResource.Serialization.cs new file mode 100644 index 000000000000..e4c1b4f8033c --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceAssetResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.DeviceRegistry +{ + public partial class NamespaceAssetResource : IJsonModel + { + private static NamespaceAssetData s_dataDeserializationInstance; + private static NamespaceAssetData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + NamespaceAssetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerDeviceRegistryContext.Default); + + NamespaceAssetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerDeviceRegistryContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceAssetResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceAssetResource.cs similarity index 69% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceAssetResource.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceAssetResource.cs index 62ba51eb5328..4477a6e9c7e3 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceAssetResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceAssetResource.cs @@ -17,14 +17,14 @@ namespace Azure.ResourceManager.DeviceRegistry { /// - /// A Class representing a DeviceRegistryNamespaceAsset along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetDeviceRegistryNamespaceAssetResource method. - /// Otherwise you can get one from its parent resource using the GetDeviceRegistryNamespaceAsset method. + /// A Class representing a NamespaceAsset along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetNamespaceAssetResource method. + /// Otherwise you can get one from its parent resource using the GetNamespaceAsset method. /// - public partial class DeviceRegistryNamespaceAssetResource : ArmResource + public partial class NamespaceAssetResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The subscriptionId. /// The resourceGroupName. /// The namespaceName. @@ -35,35 +35,35 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics; - private readonly NamespaceAssetsRestOperations _deviceRegistryNamespaceAssetNamespaceAssetsRestClient; - private readonly DeviceRegistryNamespaceAssetData _data; + private readonly ClientDiagnostics _namespaceAssetClientDiagnostics; + private readonly NamespaceAssetsRestOperations _namespaceAssetRestClient; + private readonly NamespaceAssetData _data; /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Microsoft.DeviceRegistry/namespaces/assets"; - /// Initializes a new instance of the class for mocking. - protected DeviceRegistryNamespaceAssetResource() + /// Initializes a new instance of the class for mocking. + protected NamespaceAssetResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal DeviceRegistryNamespaceAssetResource(ArmClient client, DeviceRegistryNamespaceAssetData data) : this(client, data.Id) + internal NamespaceAssetResource(ArmClient client, NamespaceAssetData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. - internal DeviceRegistryNamespaceAssetResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal NamespaceAssetResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string deviceRegistryNamespaceAssetNamespaceAssetsApiVersion); - _deviceRegistryNamespaceAssetNamespaceAssetsRestClient = new NamespaceAssetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistryNamespaceAssetNamespaceAssetsApiVersion); + _namespaceAssetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string namespaceAssetApiVersion); + _namespaceAssetRestClient = new NamespaceAssetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, namespaceAssetApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -74,7 +74,7 @@ internal DeviceRegistryNamespaceAssetResource(ArmClient client, ResourceIdentifi /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual DeviceRegistryNamespaceAssetData Data + public virtual NamespaceAssetData Data { get { @@ -107,21 +107,21 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceAssetResource.Get"); + using var scope = _namespaceAssetClientDiagnostics.CreateScope("NamespaceAssetResource.Get"); scope.Start(); try { - var response = await _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _namespaceAssetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceAssetResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new NamespaceAssetResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -147,21 +147,21 @@ public virtual async Task> GetAsy /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceAssetResource.Get"); + using var scope = _namespaceAssetClientDiagnostics.CreateScope("NamespaceAssetResource.Get"); scope.Start(); try { - var response = _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _namespaceAssetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceAssetResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new NamespaceAssetResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -187,7 +187,7 @@ public virtual Response Get(CancellationTo /// /// /// Resource - /// + /// /// /// /// @@ -195,12 +195,12 @@ public virtual Response Get(CancellationTo /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceAssetResource.Delete"); + using var scope = _namespaceAssetClientDiagnostics.CreateScope("NamespaceAssetResource.Delete"); scope.Start(); try { - var response = await _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new DeviceRegistryArmOperation(_deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics, Pipeline, _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _namespaceAssetRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DeviceRegistryArmOperation(_namespaceAssetClientDiagnostics, Pipeline, _namespaceAssetRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -229,7 +229,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Resource - /// + /// /// /// /// @@ -237,12 +237,12 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceAssetResource.Delete"); + using var scope = _namespaceAssetClientDiagnostics.CreateScope("NamespaceAssetResource.Delete"); scope.Start(); try { - var response = _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new DeviceRegistryArmOperation(_deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics, Pipeline, _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _namespaceAssetRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DeviceRegistryArmOperation(_namespaceAssetClientDiagnostics, Pipeline, _namespaceAssetRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -271,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Resource - /// + /// /// /// /// @@ -279,16 +279,16 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// The resource properties to be updated. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, DeviceRegistryNamespaceAssetPatch patch, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, NamespaceAssetPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceAssetResource.Update"); + using var scope = _namespaceAssetClientDiagnostics.CreateScope("NamespaceAssetResource.Update"); scope.Start(); try { - var response = await _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryNamespaceAssetOperationSource(Client), _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics, Pipeline, _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = await _namespaceAssetRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new DeviceRegistryArmOperation(new NamespaceAssetOperationSource(Client), _namespaceAssetClientDiagnostics, Pipeline, _namespaceAssetRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -317,7 +317,7 @@ public virtual async Task> Up /// /// /// Resource - /// + /// /// /// /// @@ -325,16 +325,16 @@ public virtual async Task> Up /// The resource properties to be updated. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, DeviceRegistryNamespaceAssetPatch patch, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, NamespaceAssetPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceAssetResource.Update"); + using var scope = _namespaceAssetClientDiagnostics.CreateScope("NamespaceAssetResource.Update"); scope.Start(); try { - var response = _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryNamespaceAssetOperationSource(Client), _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics, Pipeline, _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = _namespaceAssetRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new DeviceRegistryArmOperation(new NamespaceAssetOperationSource(Client), _namespaceAssetClientDiagnostics, Pipeline, _namespaceAssetRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -363,7 +363,7 @@ public virtual ArmOperation Update(WaitUnt /// /// /// Resource - /// + /// /// /// /// @@ -371,12 +371,12 @@ public virtual ArmOperation Update(WaitUnt /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceAssetResource.AddTag"); + using var scope = _namespaceAssetClientDiagnostics.CreateScope("NamespaceAssetResource.AddTag"); scope.Start(); try { @@ -385,13 +385,13 @@ public virtual async Task> AddTag var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DeviceRegistryNamespaceAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _namespaceAssetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new NamespaceAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new DeviceRegistryNamespaceAssetPatch(); + var patch = new NamespaceAssetPatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -425,7 +425,7 @@ public virtual async Task> AddTag /// /// /// Resource - /// + /// /// /// /// @@ -433,12 +433,12 @@ public virtual async Task> AddTag /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceAssetResource.AddTag"); + using var scope = _namespaceAssetClientDiagnostics.CreateScope("NamespaceAssetResource.AddTag"); scope.Start(); try { @@ -447,13 +447,13 @@ public virtual Response AddTag(string key, var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new DeviceRegistryNamespaceAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _namespaceAssetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new NamespaceAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DeviceRegistryNamespaceAssetPatch(); + var patch = new NamespaceAssetPatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -487,18 +487,18 @@ public virtual Response AddTag(string key, /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceAssetResource.SetTags"); + using var scope = _namespaceAssetClientDiagnostics.CreateScope("NamespaceAssetResource.SetTags"); scope.Start(); try { @@ -508,13 +508,13 @@ public virtual async Task> SetTag var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DeviceRegistryNamespaceAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _namespaceAssetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new NamespaceAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new DeviceRegistryNamespaceAssetPatch(); + var patch = new NamespaceAssetPatch(); patch.Tags.ReplaceWith(tags); var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(result.Value, result.GetRawResponse()); @@ -544,18 +544,18 @@ public virtual async Task> SetTag /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceAssetResource.SetTags"); + using var scope = _namespaceAssetClientDiagnostics.CreateScope("NamespaceAssetResource.SetTags"); scope.Start(); try { @@ -565,13 +565,13 @@ public virtual Response SetTags(IDictionar var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.ReplaceWith(tags); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new DeviceRegistryNamespaceAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _namespaceAssetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new NamespaceAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DeviceRegistryNamespaceAssetPatch(); + var patch = new NamespaceAssetPatch(); patch.Tags.ReplaceWith(tags); var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); return Response.FromValue(result.Value, result.GetRawResponse()); @@ -601,18 +601,18 @@ public virtual Response SetTags(IDictionar /// /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceAssetResource.RemoveTag"); + using var scope = _namespaceAssetClientDiagnostics.CreateScope("NamespaceAssetResource.RemoveTag"); scope.Start(); try { @@ -621,13 +621,13 @@ public virtual async Task> Remove var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DeviceRegistryNamespaceAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _namespaceAssetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new NamespaceAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new DeviceRegistryNamespaceAssetPatch(); + var patch = new NamespaceAssetPatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -661,18 +661,18 @@ public virtual async Task> Remove /// /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _deviceRegistryNamespaceAssetNamespaceAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceAssetResource.RemoveTag"); + using var scope = _namespaceAssetClientDiagnostics.CreateScope("NamespaceAssetResource.RemoveTag"); scope.Start(); try { @@ -681,13 +681,13 @@ public virtual Response RemoveTag(string k var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deviceRegistryNamespaceAssetNamespaceAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new DeviceRegistryNamespaceAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _namespaceAssetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new NamespaceAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DeviceRegistryNamespaceAssetPatch(); + var patch = new NamespaceAssetPatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceCollection.cs similarity index 64% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceCollection.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceCollection.cs index d48f0b7c4893..03e45fbd95c2 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceCollection.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceCollection.cs @@ -19,28 +19,28 @@ namespace Azure.ResourceManager.DeviceRegistry { /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetDeviceRegistryNamespaces method from an instance of . + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetNamespaces method from an instance of . /// - public partial class DeviceRegistryNamespaceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + public partial class NamespaceCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _deviceRegistryNamespaceNamespacesClientDiagnostics; - private readonly NamespacesRestOperations _deviceRegistryNamespaceNamespacesRestClient; + private readonly ClientDiagnostics _namespaceClientDiagnostics; + private readonly NamespacesRestOperations _namespaceRestClient; - /// Initializes a new instance of the class for mocking. - protected DeviceRegistryNamespaceCollection() + /// Initializes a new instance of the class for mocking. + protected NamespaceCollection() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the parent resource that is the target of operations. - internal DeviceRegistryNamespaceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + internal NamespaceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _deviceRegistryNamespaceNamespacesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistryNamespaceResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(DeviceRegistryNamespaceResource.ResourceType, out string deviceRegistryNamespaceNamespacesApiVersion); - _deviceRegistryNamespaceNamespacesRestClient = new NamespacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistryNamespaceNamespacesApiVersion); + _namespaceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", NamespaceResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(NamespaceResource.ResourceType, out string namespaceApiVersion); + _namespaceRestClient = new NamespacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, namespaceApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -69,7 +69,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Resource - /// + /// /// /// /// @@ -79,17 +79,17 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string namespaceName, DeviceRegistryNamespaceData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string namespaceName, NamespaceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _deviceRegistryNamespaceNamespacesClientDiagnostics.CreateScope("DeviceRegistryNamespaceCollection.CreateOrUpdate"); + using var scope = _namespaceClientDiagnostics.CreateScope("NamespaceCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _deviceRegistryNamespaceNamespacesRestClient.CreateOrReplaceAsync(Id.SubscriptionId, Id.ResourceGroupName, namespaceName, data, cancellationToken).ConfigureAwait(false); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryNamespaceOperationSource(Client), _deviceRegistryNamespaceNamespacesClientDiagnostics, Pipeline, _deviceRegistryNamespaceNamespacesRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, namespaceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _namespaceRestClient.CreateOrReplaceAsync(Id.SubscriptionId, Id.ResourceGroupName, namespaceName, data, cancellationToken).ConfigureAwait(false); + var operation = new DeviceRegistryArmOperation(new NamespaceOperationSource(Client), _namespaceClientDiagnostics, Pipeline, _namespaceRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, namespaceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -118,7 +118,7 @@ public virtual async Task> CreateO /// /// /// Resource - /// + /// /// /// /// @@ -128,17 +128,17 @@ public virtual async Task> CreateO /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string namespaceName, DeviceRegistryNamespaceData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string namespaceName, NamespaceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _deviceRegistryNamespaceNamespacesClientDiagnostics.CreateScope("DeviceRegistryNamespaceCollection.CreateOrUpdate"); + using var scope = _namespaceClientDiagnostics.CreateScope("NamespaceCollection.CreateOrUpdate"); scope.Start(); try { - var response = _deviceRegistryNamespaceNamespacesRestClient.CreateOrReplace(Id.SubscriptionId, Id.ResourceGroupName, namespaceName, data, cancellationToken); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryNamespaceOperationSource(Client), _deviceRegistryNamespaceNamespacesClientDiagnostics, Pipeline, _deviceRegistryNamespaceNamespacesRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, namespaceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _namespaceRestClient.CreateOrReplace(Id.SubscriptionId, Id.ResourceGroupName, namespaceName, data, cancellationToken); + var operation = new DeviceRegistryArmOperation(new NamespaceOperationSource(Client), _namespaceClientDiagnostics, Pipeline, _namespaceRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, namespaceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(Wait /// /// /// Resource - /// + /// /// /// /// @@ -175,18 +175,18 @@ public virtual ArmOperation CreateOrUpdate(Wait /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetAsync(string namespaceName, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(string namespaceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); - using var scope = _deviceRegistryNamespaceNamespacesClientDiagnostics.CreateScope("DeviceRegistryNamespaceCollection.Get"); + using var scope = _namespaceClientDiagnostics.CreateScope("NamespaceCollection.Get"); scope.Start(); try { - var response = await _deviceRegistryNamespaceNamespacesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, namespaceName, cancellationToken).ConfigureAwait(false); + var response = await _namespaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, namespaceName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new NamespaceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(st /// /// /// Resource - /// + /// /// /// /// @@ -220,18 +220,18 @@ public virtual async Task> GetAsync(st /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual Response Get(string namespaceName, CancellationToken cancellationToken = default) + public virtual Response Get(string namespaceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); - using var scope = _deviceRegistryNamespaceNamespacesClientDiagnostics.CreateScope("DeviceRegistryNamespaceCollection.Get"); + using var scope = _namespaceClientDiagnostics.CreateScope("NamespaceCollection.Get"); scope.Start(); try { - var response = _deviceRegistryNamespaceNamespacesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, namespaceName, cancellationToken); + var response = _namespaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, namespaceName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new NamespaceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -257,17 +257,17 @@ public virtual Response Get(string namespaceNam /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistryNamespaceNamespacesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistryNamespaceNamespacesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryNamespaceResource(Client, DeviceRegistryNamespaceData.DeserializeDeviceRegistryNamespaceData(e)), _deviceRegistryNamespaceNamespacesClientDiagnostics, Pipeline, "DeviceRegistryNamespaceCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _namespaceRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _namespaceRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NamespaceResource(Client, NamespaceData.DeserializeNamespaceData(e)), _namespaceClientDiagnostics, Pipeline, "NamespaceCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -287,17 +287,17 @@ public virtual AsyncPageable GetAllAsync(Cancel /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistryNamespaceNamespacesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistryNamespaceNamespacesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryNamespaceResource(Client, DeviceRegistryNamespaceData.DeserializeDeviceRegistryNamespaceData(e)), _deviceRegistryNamespaceNamespacesClientDiagnostics, Pipeline, "DeviceRegistryNamespaceCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _namespaceRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _namespaceRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NamespaceResource(Client, NamespaceData.DeserializeNamespaceData(e)), _namespaceClientDiagnostics, Pipeline, "NamespaceCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -317,7 +317,7 @@ public virtual Pageable GetAll(CancellationToke /// /// /// Resource - /// + /// /// /// /// @@ -329,11 +329,11 @@ public virtual async Task> ExistsAsync(string namespaceName, Canc { Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); - using var scope = _deviceRegistryNamespaceNamespacesClientDiagnostics.CreateScope("DeviceRegistryNamespaceCollection.Exists"); + using var scope = _namespaceClientDiagnostics.CreateScope("NamespaceCollection.Exists"); scope.Start(); try { - var response = await _deviceRegistryNamespaceNamespacesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, namespaceName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _namespaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, namespaceName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string namespaceName, Canc /// /// /// Resource - /// + /// /// /// /// @@ -372,11 +372,11 @@ public virtual Response Exists(string namespaceName, CancellationToken can { Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); - using var scope = _deviceRegistryNamespaceNamespacesClientDiagnostics.CreateScope("DeviceRegistryNamespaceCollection.Exists"); + using var scope = _namespaceClientDiagnostics.CreateScope("NamespaceCollection.Exists"); scope.Start(); try { - var response = _deviceRegistryNamespaceNamespacesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, namespaceName, cancellationToken: cancellationToken); + var response = _namespaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, namespaceName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -403,7 +403,7 @@ public virtual Response Exists(string namespaceName, CancellationToken can /// /// /// Resource - /// + /// /// /// /// @@ -411,18 +411,18 @@ public virtual Response Exists(string namespaceName, CancellationToken can /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetIfExistsAsync(string namespaceName, CancellationToken cancellationToken = default) + public virtual async Task> GetIfExistsAsync(string namespaceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); - using var scope = _deviceRegistryNamespaceNamespacesClientDiagnostics.CreateScope("DeviceRegistryNamespaceCollection.GetIfExists"); + using var scope = _namespaceClientDiagnostics.CreateScope("NamespaceCollection.GetIfExists"); scope.Start(); try { - var response = await _deviceRegistryNamespaceNamespacesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, namespaceName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _namespaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, namespaceName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new NamespaceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -448,7 +448,7 @@ public virtual async Task> Get /// /// /// Resource - /// + /// /// /// /// @@ -456,18 +456,18 @@ public virtual async Task> Get /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual NullableResponse GetIfExists(string namespaceName, CancellationToken cancellationToken = default) + public virtual NullableResponse GetIfExists(string namespaceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); - using var scope = _deviceRegistryNamespaceNamespacesClientDiagnostics.CreateScope("DeviceRegistryNamespaceCollection.GetIfExists"); + using var scope = _namespaceClientDiagnostics.CreateScope("NamespaceCollection.GetIfExists"); scope.Start(); try { - var response = _deviceRegistryNamespaceNamespacesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, namespaceName, cancellationToken: cancellationToken); + var response = _namespaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, namespaceName, cancellationToken: cancellationToken); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new NamespaceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -476,7 +476,7 @@ public virtual NullableResponse GetIfExists(str } } - IEnumerator IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetAll().GetEnumerator(); } @@ -486,7 +486,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceData.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceData.Serialization.cs similarity index 74% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceData.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceData.Serialization.cs index 8b13b34cea16..0528049e2977 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceData.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceData.Serialization.cs @@ -16,11 +16,11 @@ namespace Azure.ResourceManager.DeviceRegistry { - public partial class DeviceRegistryNamespaceData : IUtf8JsonSerializable, IJsonModel + public partial class NamespaceData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -31,10 +31,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceData)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); @@ -50,19 +50,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - DeviceRegistryNamespaceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NamespaceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryNamespaceData(document.RootElement, options); + return DeserializeNamespaceData(document.RootElement, options); } - internal static DeviceRegistryNamespaceData DeserializeDeviceRegistryNamespaceData(JsonElement element, ModelReaderWriterOptions options = null) + internal static NamespaceData DeserializeNamespaceData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -70,7 +70,7 @@ internal static DeviceRegistryNamespaceData DeserializeDeviceRegistryNamespaceDa { return null; } - DeviceRegistryNamespaceProperties properties = default; + NamespaceProperties properties = default; ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; @@ -88,7 +88,7 @@ internal static DeviceRegistryNamespaceData DeserializeDeviceRegistryNamespaceDa { continue; } - properties = DeviceRegistryNamespaceProperties.DeserializeDeviceRegistryNamespaceProperties(property.Value, options); + properties = NamespaceProperties.DeserializeNamespaceProperties(property.Value, options); continue; } if (property.NameEquals("identity"u8)) @@ -149,7 +149,7 @@ internal static DeviceRegistryNamespaceData DeserializeDeviceRegistryNamespaceDa } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryNamespaceData( + return new NamespaceData( id, name, type, @@ -161,35 +161,35 @@ internal static DeviceRegistryNamespaceData DeserializeDeviceRegistryNamespaceDa serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceData)} does not support writing '{options.Format}' format."); } } - DeviceRegistryNamespaceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NamespaceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryNamespaceData(document.RootElement, options); + return DeserializeNamespaceData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceData.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceData.cs similarity index 74% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceData.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceData.cs index 8769b03b4eda..c1256fc96119 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceData.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceData.cs @@ -14,10 +14,10 @@ namespace Azure.ResourceManager.DeviceRegistry { /// - /// A class representing the DeviceRegistryNamespace data model. + /// A class representing the Namespace data model. /// Namespace definition. /// - public partial class DeviceRegistryNamespaceData : TrackedResourceData + public partial class NamespaceData : TrackedResourceData { /// /// Keeps track of any properties unknown to the library. @@ -51,13 +51,13 @@ public partial class DeviceRegistryNamespaceData : TrackedResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The location. - public DeviceRegistryNamespaceData(AzureLocation location) : base(location) + public NamespaceData(AzureLocation location) : base(location) { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -67,20 +67,20 @@ public DeviceRegistryNamespaceData(AzureLocation location) : base(location) /// The resource-specific properties for this resource. /// The managed service identities assigned to this resource. Current supported identity types: None, SystemAssigned. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryNamespaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, DeviceRegistryNamespaceProperties properties, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal NamespaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, NamespaceProperties properties, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Properties = properties; Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DeviceRegistryNamespaceData() + /// Initializes a new instance of for deserialization. + internal NamespaceData() { } /// The resource-specific properties for this resource. - public DeviceRegistryNamespaceProperties Properties { get; set; } + public NamespaceProperties Properties { get; set; } /// The managed service identities assigned to this resource. Current supported identity types: None, SystemAssigned. public ManagedServiceIdentity Identity { get; set; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDeviceCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDeviceCollection.cs similarity index 62% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDeviceCollection.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDeviceCollection.cs index 5d798334c6f6..1a1d2cceed2d 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDeviceCollection.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDeviceCollection.cs @@ -18,28 +18,28 @@ namespace Azure.ResourceManager.DeviceRegistry { /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetDeviceRegistryNamespaceDevices method from an instance of . + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetNamespaceDevices method from an instance of . /// - public partial class DeviceRegistryNamespaceDeviceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + public partial class NamespaceDeviceCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics; - private readonly NamespaceDevicesRestOperations _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient; + private readonly ClientDiagnostics _namespaceDeviceClientDiagnostics; + private readonly NamespaceDevicesRestOperations _namespaceDeviceRestClient; - /// Initializes a new instance of the class for mocking. - protected DeviceRegistryNamespaceDeviceCollection() + /// Initializes a new instance of the class for mocking. + protected NamespaceDeviceCollection() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the parent resource that is the target of operations. - internal DeviceRegistryNamespaceDeviceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + internal NamespaceDeviceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistryNamespaceDeviceResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(DeviceRegistryNamespaceDeviceResource.ResourceType, out string deviceRegistryNamespaceDeviceNamespaceDevicesApiVersion); - _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient = new NamespaceDevicesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistryNamespaceDeviceNamespaceDevicesApiVersion); + _namespaceDeviceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", NamespaceDeviceResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(NamespaceDeviceResource.ResourceType, out string namespaceDeviceApiVersion); + _namespaceDeviceRestClient = new NamespaceDevicesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, namespaceDeviceApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -47,8 +47,8 @@ internal DeviceRegistryNamespaceDeviceCollection(ArmClient client, ResourceIdent internal static void ValidateResourceId(ResourceIdentifier id) { - if (id.ResourceType != DeviceRegistryNamespaceResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DeviceRegistryNamespaceResource.ResourceType), nameof(id)); + if (id.ResourceType != NamespaceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, NamespaceResource.ResourceType), nameof(id)); } /// @@ -68,7 +68,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Resource - /// + /// /// /// /// @@ -78,17 +78,17 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string deviceName, DeviceRegistryNamespaceDeviceData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string deviceName, NamespaceDeviceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deviceName, nameof(deviceName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDeviceCollection.CreateOrUpdate"); + using var scope = _namespaceDeviceClientDiagnostics.CreateScope("NamespaceDeviceCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.CreateOrReplaceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, deviceName, data, cancellationToken).ConfigureAwait(false); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryNamespaceDeviceOperationSource(Client), _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics, Pipeline, _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, deviceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _namespaceDeviceRestClient.CreateOrReplaceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, deviceName, data, cancellationToken).ConfigureAwait(false); + var operation = new DeviceRegistryArmOperation(new NamespaceDeviceOperationSource(Client), _namespaceDeviceClientDiagnostics, Pipeline, _namespaceDeviceRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, deviceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -117,7 +117,7 @@ public virtual async Task> C /// /// /// Resource - /// + /// /// /// /// @@ -127,17 +127,17 @@ public virtual async Task> C /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string deviceName, DeviceRegistryNamespaceDeviceData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string deviceName, NamespaceDeviceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deviceName, nameof(deviceName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDeviceCollection.CreateOrUpdate"); + using var scope = _namespaceDeviceClientDiagnostics.CreateScope("NamespaceDeviceCollection.CreateOrUpdate"); scope.Start(); try { - var response = _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.CreateOrReplace(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, deviceName, data, cancellationToken); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryNamespaceDeviceOperationSource(Client), _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics, Pipeline, _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, deviceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _namespaceDeviceRestClient.CreateOrReplace(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, deviceName, data, cancellationToken); + var operation = new DeviceRegistryArmOperation(new NamespaceDeviceOperationSource(Client), _namespaceDeviceClientDiagnostics, Pipeline, _namespaceDeviceRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, deviceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUpdat /// /// /// Resource - /// + /// /// /// /// @@ -174,18 +174,18 @@ public virtual ArmOperation CreateOrUpdat /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetAsync(string deviceName, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(string deviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deviceName, nameof(deviceName)); - using var scope = _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDeviceCollection.Get"); + using var scope = _namespaceDeviceClientDiagnostics.CreateScope("NamespaceDeviceCollection.Get"); scope.Start(); try { - var response = await _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, deviceName, cancellationToken).ConfigureAwait(false); + var response = await _namespaceDeviceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, deviceName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceDeviceResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new NamespaceDeviceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -211,7 +211,7 @@ public virtual async Task> GetAs /// /// /// Resource - /// + /// /// /// /// @@ -219,18 +219,18 @@ public virtual async Task> GetAs /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual Response Get(string deviceName, CancellationToken cancellationToken = default) + public virtual Response Get(string deviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deviceName, nameof(deviceName)); - using var scope = _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDeviceCollection.Get"); + using var scope = _namespaceDeviceClientDiagnostics.CreateScope("NamespaceDeviceCollection.Get"); scope.Start(); try { - var response = _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, deviceName, cancellationToken); + var response = _namespaceDeviceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, deviceName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceDeviceResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new NamespaceDeviceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -256,17 +256,17 @@ public virtual Response Get(string device /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryNamespaceDeviceResource(Client, DeviceRegistryNamespaceDeviceData.DeserializeDeviceRegistryNamespaceDeviceData(e)), _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics, Pipeline, "DeviceRegistryNamespaceDeviceCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _namespaceDeviceRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _namespaceDeviceRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NamespaceDeviceResource(Client, NamespaceDeviceData.DeserializeNamespaceDeviceData(e)), _namespaceDeviceClientDiagnostics, Pipeline, "NamespaceDeviceCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -286,17 +286,17 @@ public virtual AsyncPageable GetAllAsync( /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryNamespaceDeviceResource(Client, DeviceRegistryNamespaceDeviceData.DeserializeDeviceRegistryNamespaceDeviceData(e)), _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics, Pipeline, "DeviceRegistryNamespaceDeviceCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _namespaceDeviceRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _namespaceDeviceRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NamespaceDeviceResource(Client, NamespaceDeviceData.DeserializeNamespaceDeviceData(e)), _namespaceDeviceClientDiagnostics, Pipeline, "NamespaceDeviceCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -316,7 +316,7 @@ public virtual Pageable GetAll(Cancellati /// /// /// Resource - /// + /// /// /// /// @@ -328,11 +328,11 @@ public virtual async Task> ExistsAsync(string deviceName, Cancell { Argument.AssertNotNullOrEmpty(deviceName, nameof(deviceName)); - using var scope = _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDeviceCollection.Exists"); + using var scope = _namespaceDeviceClientDiagnostics.CreateScope("NamespaceDeviceCollection.Exists"); scope.Start(); try { - var response = await _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, deviceName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _namespaceDeviceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, deviceName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string deviceName, Cancell /// /// /// Resource - /// + /// /// /// /// @@ -371,11 +371,11 @@ public virtual Response Exists(string deviceName, CancellationToken cancel { Argument.AssertNotNullOrEmpty(deviceName, nameof(deviceName)); - using var scope = _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDeviceCollection.Exists"); + using var scope = _namespaceDeviceClientDiagnostics.CreateScope("NamespaceDeviceCollection.Exists"); scope.Start(); try { - var response = _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, deviceName, cancellationToken: cancellationToken); + var response = _namespaceDeviceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, deviceName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -402,7 +402,7 @@ public virtual Response Exists(string deviceName, CancellationToken cancel /// /// /// Resource - /// + /// /// /// /// @@ -410,18 +410,18 @@ public virtual Response Exists(string deviceName, CancellationToken cancel /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetIfExistsAsync(string deviceName, CancellationToken cancellationToken = default) + public virtual async Task> GetIfExistsAsync(string deviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deviceName, nameof(deviceName)); - using var scope = _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDeviceCollection.GetIfExists"); + using var scope = _namespaceDeviceClientDiagnostics.CreateScope("NamespaceDeviceCollection.GetIfExists"); scope.Start(); try { - var response = await _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, deviceName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _namespaceDeviceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, deviceName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceDeviceResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new NamespaceDeviceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -447,7 +447,7 @@ public virtual async Task /// /// Resource - /// + /// /// /// /// @@ -455,18 +455,18 @@ public virtual async Task The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual NullableResponse GetIfExists(string deviceName, CancellationToken cancellationToken = default) + public virtual NullableResponse GetIfExists(string deviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deviceName, nameof(deviceName)); - using var scope = _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDeviceCollection.GetIfExists"); + using var scope = _namespaceDeviceClientDiagnostics.CreateScope("NamespaceDeviceCollection.GetIfExists"); scope.Start(); try { - var response = _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, deviceName, cancellationToken: cancellationToken); + var response = _namespaceDeviceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, deviceName, cancellationToken: cancellationToken); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceDeviceResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new NamespaceDeviceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -475,7 +475,7 @@ public virtual NullableResponse GetIfExis } } - IEnumerator IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetAll().GetEnumerator(); } @@ -485,7 +485,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDeviceData.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDeviceData.Serialization.cs similarity index 74% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDeviceData.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDeviceData.Serialization.cs index 5b654728fccd..67a754600446 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDeviceData.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDeviceData.Serialization.cs @@ -16,11 +16,11 @@ namespace Azure.ResourceManager.DeviceRegistry { - public partial class DeviceRegistryNamespaceDeviceData : IUtf8JsonSerializable, IJsonModel + public partial class NamespaceDeviceData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -31,10 +31,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDeviceData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceDeviceData)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); @@ -55,19 +55,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - DeviceRegistryNamespaceDeviceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NamespaceDeviceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDeviceData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceDeviceData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryNamespaceDeviceData(document.RootElement, options); + return DeserializeNamespaceDeviceData(document.RootElement, options); } - internal static DeviceRegistryNamespaceDeviceData DeserializeDeviceRegistryNamespaceDeviceData(JsonElement element, ModelReaderWriterOptions options = null) + internal static NamespaceDeviceData DeserializeNamespaceDeviceData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -75,7 +75,7 @@ internal static DeviceRegistryNamespaceDeviceData DeserializeDeviceRegistryNames { return null; } - DeviceRegistryNamespaceDeviceProperties properties = default; + NamespaceDeviceProperties properties = default; string etag = default; DeviceRegistryExtendedLocation extendedLocation = default; IDictionary tags = default; @@ -94,7 +94,7 @@ internal static DeviceRegistryNamespaceDeviceData DeserializeDeviceRegistryNames { continue; } - properties = DeviceRegistryNamespaceDeviceProperties.DeserializeDeviceRegistryNamespaceDeviceProperties(property.Value, options); + properties = NamespaceDeviceProperties.DeserializeNamespaceDeviceProperties(property.Value, options); continue; } if (property.NameEquals("etag"u8)) @@ -160,7 +160,7 @@ internal static DeviceRegistryNamespaceDeviceData DeserializeDeviceRegistryNames } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryNamespaceDeviceData( + return new NamespaceDeviceData( id, name, type, @@ -173,35 +173,35 @@ internal static DeviceRegistryNamespaceDeviceData DeserializeDeviceRegistryNames serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDeviceData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceDeviceData)} does not support writing '{options.Format}' format."); } } - DeviceRegistryNamespaceDeviceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NamespaceDeviceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryNamespaceDeviceData(document.RootElement, options); + return DeserializeNamespaceDeviceData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDeviceData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceDeviceData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDeviceData.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDeviceData.cs similarity index 72% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDeviceData.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDeviceData.cs index b44fe5dd402c..2b5e0dad1107 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDeviceData.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDeviceData.cs @@ -14,10 +14,10 @@ namespace Azure.ResourceManager.DeviceRegistry { /// - /// A class representing the DeviceRegistryNamespaceDevice data model. + /// A class representing the NamespaceDevice data model. /// Device definition. /// - public partial class DeviceRegistryNamespaceDeviceData : TrackedResourceData + public partial class NamespaceDeviceData : TrackedResourceData { /// /// Keeps track of any properties unknown to the library. @@ -51,13 +51,13 @@ public partial class DeviceRegistryNamespaceDeviceData : TrackedResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The location. - public DeviceRegistryNamespaceDeviceData(AzureLocation location) : base(location) + public NamespaceDeviceData(AzureLocation location) : base(location) { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -68,7 +68,7 @@ public DeviceRegistryNamespaceDeviceData(AzureLocation location) : base(location /// Resource Tag. /// The extended location. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryNamespaceDeviceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, DeviceRegistryNamespaceDeviceProperties properties, string etag, DeviceRegistryExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal NamespaceDeviceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, NamespaceDeviceProperties properties, string etag, DeviceRegistryExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Properties = properties; ETag = etag; @@ -76,13 +76,13 @@ internal DeviceRegistryNamespaceDeviceData(ResourceIdentifier id, string name, R _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DeviceRegistryNamespaceDeviceData() + /// Initializes a new instance of for deserialization. + internal NamespaceDeviceData() { } /// The resource-specific properties for this resource. - public DeviceRegistryNamespaceDeviceProperties Properties { get; set; } + public NamespaceDeviceProperties Properties { get; set; } /// Resource Tag. public string ETag { get; } /// The extended location. diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDeviceResource.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDeviceResource.Serialization.cs new file mode 100644 index 000000000000..89d5b9b1aaaf --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDeviceResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.DeviceRegistry +{ + public partial class NamespaceDeviceResource : IJsonModel + { + private static NamespaceDeviceData s_dataDeserializationInstance; + private static NamespaceDeviceData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + NamespaceDeviceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerDeviceRegistryContext.Default); + + NamespaceDeviceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerDeviceRegistryContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDeviceResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDeviceResource.cs similarity index 69% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDeviceResource.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDeviceResource.cs index e66941d1aa12..ee8fc13d1203 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDeviceResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDeviceResource.cs @@ -17,14 +17,14 @@ namespace Azure.ResourceManager.DeviceRegistry { /// - /// A Class representing a DeviceRegistryNamespaceDevice along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetDeviceRegistryNamespaceDeviceResource method. - /// Otherwise you can get one from its parent resource using the GetDeviceRegistryNamespaceDevice method. + /// A Class representing a NamespaceDevice along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetNamespaceDeviceResource method. + /// Otherwise you can get one from its parent resource using the GetNamespaceDevice method. /// - public partial class DeviceRegistryNamespaceDeviceResource : ArmResource + public partial class NamespaceDeviceResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The subscriptionId. /// The resourceGroupName. /// The namespaceName. @@ -35,35 +35,35 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics; - private readonly NamespaceDevicesRestOperations _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient; - private readonly DeviceRegistryNamespaceDeviceData _data; + private readonly ClientDiagnostics _namespaceDeviceClientDiagnostics; + private readonly NamespaceDevicesRestOperations _namespaceDeviceRestClient; + private readonly NamespaceDeviceData _data; /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Microsoft.DeviceRegistry/namespaces/devices"; - /// Initializes a new instance of the class for mocking. - protected DeviceRegistryNamespaceDeviceResource() + /// Initializes a new instance of the class for mocking. + protected NamespaceDeviceResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal DeviceRegistryNamespaceDeviceResource(ArmClient client, DeviceRegistryNamespaceDeviceData data) : this(client, data.Id) + internal NamespaceDeviceResource(ArmClient client, NamespaceDeviceData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. - internal DeviceRegistryNamespaceDeviceResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal NamespaceDeviceResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string deviceRegistryNamespaceDeviceNamespaceDevicesApiVersion); - _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient = new NamespaceDevicesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistryNamespaceDeviceNamespaceDevicesApiVersion); + _namespaceDeviceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string namespaceDeviceApiVersion); + _namespaceDeviceRestClient = new NamespaceDevicesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, namespaceDeviceApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -74,7 +74,7 @@ internal DeviceRegistryNamespaceDeviceResource(ArmClient client, ResourceIdentif /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual DeviceRegistryNamespaceDeviceData Data + public virtual NamespaceDeviceData Data { get { @@ -107,21 +107,21 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDeviceResource.Get"); + using var scope = _namespaceDeviceClientDiagnostics.CreateScope("NamespaceDeviceResource.Get"); scope.Start(); try { - var response = await _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _namespaceDeviceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceDeviceResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new NamespaceDeviceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -147,21 +147,21 @@ public virtual async Task> GetAs /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDeviceResource.Get"); + using var scope = _namespaceDeviceClientDiagnostics.CreateScope("NamespaceDeviceResource.Get"); scope.Start(); try { - var response = _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _namespaceDeviceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceDeviceResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new NamespaceDeviceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -187,7 +187,7 @@ public virtual Response Get(CancellationT /// /// /// Resource - /// + /// /// /// /// @@ -195,12 +195,12 @@ public virtual Response Get(CancellationT /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDeviceResource.Delete"); + using var scope = _namespaceDeviceClientDiagnostics.CreateScope("NamespaceDeviceResource.Delete"); scope.Start(); try { - var response = await _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new DeviceRegistryArmOperation(_deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics, Pipeline, _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _namespaceDeviceRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DeviceRegistryArmOperation(_namespaceDeviceClientDiagnostics, Pipeline, _namespaceDeviceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -229,7 +229,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Resource - /// + /// /// /// /// @@ -237,12 +237,12 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDeviceResource.Delete"); + using var scope = _namespaceDeviceClientDiagnostics.CreateScope("NamespaceDeviceResource.Delete"); scope.Start(); try { - var response = _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new DeviceRegistryArmOperation(_deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics, Pipeline, _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _namespaceDeviceRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DeviceRegistryArmOperation(_namespaceDeviceClientDiagnostics, Pipeline, _namespaceDeviceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -271,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Resource - /// + /// /// /// /// @@ -279,16 +279,16 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// The resource properties to be updated. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, DeviceRegistryNamespaceDevicePatch patch, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, NamespaceDevicePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDeviceResource.Update"); + using var scope = _namespaceDeviceClientDiagnostics.CreateScope("NamespaceDeviceResource.Update"); scope.Start(); try { - var response = await _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryNamespaceDeviceOperationSource(Client), _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics, Pipeline, _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = await _namespaceDeviceRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new DeviceRegistryArmOperation(new NamespaceDeviceOperationSource(Client), _namespaceDeviceClientDiagnostics, Pipeline, _namespaceDeviceRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -317,7 +317,7 @@ public virtual async Task> U /// /// /// Resource - /// + /// /// /// /// @@ -325,16 +325,16 @@ public virtual async Task> U /// The resource properties to be updated. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, DeviceRegistryNamespaceDevicePatch patch, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, NamespaceDevicePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDeviceResource.Update"); + using var scope = _namespaceDeviceClientDiagnostics.CreateScope("NamespaceDeviceResource.Update"); scope.Start(); try { - var response = _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryNamespaceDeviceOperationSource(Client), _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics, Pipeline, _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = _namespaceDeviceRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new DeviceRegistryArmOperation(new NamespaceDeviceOperationSource(Client), _namespaceDeviceClientDiagnostics, Pipeline, _namespaceDeviceRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -363,7 +363,7 @@ public virtual ArmOperation Update(WaitUn /// /// /// Resource - /// + /// /// /// /// @@ -371,12 +371,12 @@ public virtual ArmOperation Update(WaitUn /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDeviceResource.AddTag"); + using var scope = _namespaceDeviceClientDiagnostics.CreateScope("NamespaceDeviceResource.AddTag"); scope.Start(); try { @@ -385,13 +385,13 @@ public virtual async Task> AddTa var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DeviceRegistryNamespaceDeviceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _namespaceDeviceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new NamespaceDeviceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new DeviceRegistryNamespaceDevicePatch(); + var patch = new NamespaceDevicePatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -425,7 +425,7 @@ public virtual async Task> AddTa /// /// /// Resource - /// + /// /// /// /// @@ -433,12 +433,12 @@ public virtual async Task> AddTa /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDeviceResource.AddTag"); + using var scope = _namespaceDeviceClientDiagnostics.CreateScope("NamespaceDeviceResource.AddTag"); scope.Start(); try { @@ -447,13 +447,13 @@ public virtual Response AddTag(string key var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new DeviceRegistryNamespaceDeviceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _namespaceDeviceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new NamespaceDeviceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DeviceRegistryNamespaceDevicePatch(); + var patch = new NamespaceDevicePatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -487,18 +487,18 @@ public virtual Response AddTag(string key /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDeviceResource.SetTags"); + using var scope = _namespaceDeviceClientDiagnostics.CreateScope("NamespaceDeviceResource.SetTags"); scope.Start(); try { @@ -508,13 +508,13 @@ public virtual async Task> SetTa var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DeviceRegistryNamespaceDeviceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _namespaceDeviceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new NamespaceDeviceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new DeviceRegistryNamespaceDevicePatch(); + var patch = new NamespaceDevicePatch(); patch.Tags.ReplaceWith(tags); var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(result.Value, result.GetRawResponse()); @@ -544,18 +544,18 @@ public virtual async Task> SetTa /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDeviceResource.SetTags"); + using var scope = _namespaceDeviceClientDiagnostics.CreateScope("NamespaceDeviceResource.SetTags"); scope.Start(); try { @@ -565,13 +565,13 @@ public virtual Response SetTags(IDictiona var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.ReplaceWith(tags); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new DeviceRegistryNamespaceDeviceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _namespaceDeviceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new NamespaceDeviceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DeviceRegistryNamespaceDevicePatch(); + var patch = new NamespaceDevicePatch(); patch.Tags.ReplaceWith(tags); var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); return Response.FromValue(result.Value, result.GetRawResponse()); @@ -601,18 +601,18 @@ public virtual Response SetTags(IDictiona /// /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDeviceResource.RemoveTag"); + using var scope = _namespaceDeviceClientDiagnostics.CreateScope("NamespaceDeviceResource.RemoveTag"); scope.Start(); try { @@ -621,13 +621,13 @@ public virtual async Task> Remov var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DeviceRegistryNamespaceDeviceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _namespaceDeviceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new NamespaceDeviceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new DeviceRegistryNamespaceDevicePatch(); + var patch = new NamespaceDevicePatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -661,18 +661,18 @@ public virtual async Task> Remov /// /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _deviceRegistryNamespaceDeviceNamespaceDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDeviceResource.RemoveTag"); + using var scope = _namespaceDeviceClientDiagnostics.CreateScope("NamespaceDeviceResource.RemoveTag"); scope.Start(); try { @@ -681,13 +681,13 @@ public virtual Response RemoveTag(string var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deviceRegistryNamespaceDeviceNamespaceDevicesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new DeviceRegistryNamespaceDeviceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _namespaceDeviceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new NamespaceDeviceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DeviceRegistryNamespaceDevicePatch(); + var patch = new NamespaceDevicePatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredAssetCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredAssetCollection.cs similarity index 60% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredAssetCollection.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredAssetCollection.cs index 94cd9a383f2a..56bc330157cd 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredAssetCollection.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredAssetCollection.cs @@ -18,28 +18,28 @@ namespace Azure.ResourceManager.DeviceRegistry { /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetDeviceRegistryNamespaceDiscoveredAssets method from an instance of . + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetNamespaceDiscoveredAssets method from an instance of . /// - public partial class DeviceRegistryNamespaceDiscoveredAssetCollection : ArmCollection, IEnumerable, IAsyncEnumerable + public partial class NamespaceDiscoveredAssetCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics; - private readonly NamespaceDiscoveredAssetsRestOperations _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient; + private readonly ClientDiagnostics _namespaceDiscoveredAssetClientDiagnostics; + private readonly NamespaceDiscoveredAssetsRestOperations _namespaceDiscoveredAssetRestClient; - /// Initializes a new instance of the class for mocking. - protected DeviceRegistryNamespaceDiscoveredAssetCollection() + /// Initializes a new instance of the class for mocking. + protected NamespaceDiscoveredAssetCollection() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the parent resource that is the target of operations. - internal DeviceRegistryNamespaceDiscoveredAssetCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + internal NamespaceDiscoveredAssetCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistryNamespaceDiscoveredAssetResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(DeviceRegistryNamespaceDiscoveredAssetResource.ResourceType, out string deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsApiVersion); - _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient = new NamespaceDiscoveredAssetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsApiVersion); + _namespaceDiscoveredAssetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", NamespaceDiscoveredAssetResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(NamespaceDiscoveredAssetResource.ResourceType, out string namespaceDiscoveredAssetApiVersion); + _namespaceDiscoveredAssetRestClient = new NamespaceDiscoveredAssetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, namespaceDiscoveredAssetApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -47,8 +47,8 @@ internal DeviceRegistryNamespaceDiscoveredAssetCollection(ArmClient client, Reso internal static void ValidateResourceId(ResourceIdentifier id) { - if (id.ResourceType != DeviceRegistryNamespaceResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DeviceRegistryNamespaceResource.ResourceType), nameof(id)); + if (id.ResourceType != NamespaceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, NamespaceResource.ResourceType), nameof(id)); } /// @@ -68,7 +68,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Resource - /// + /// /// /// /// @@ -78,17 +78,17 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string discoveredAssetName, DeviceRegistryNamespaceDiscoveredAssetData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string discoveredAssetName, NamespaceDiscoveredAssetData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredAssetCollection.CreateOrUpdate"); + using var scope = _namespaceDiscoveredAssetClientDiagnostics.CreateScope("NamespaceDiscoveredAssetCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.CreateOrReplaceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredAssetName, data, cancellationToken).ConfigureAwait(false); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryNamespaceDiscoveredAssetOperationSource(Client), _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics, Pipeline, _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredAssetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _namespaceDiscoveredAssetRestClient.CreateOrReplaceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredAssetName, data, cancellationToken).ConfigureAwait(false); + var operation = new DeviceRegistryArmOperation(new NamespaceDiscoveredAssetOperationSource(Client), _namespaceDiscoveredAssetClientDiagnostics, Pipeline, _namespaceDiscoveredAssetRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredAssetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -117,7 +117,7 @@ public virtual async Task /// /// Resource - /// + /// /// /// /// @@ -127,17 +127,17 @@ public virtual async Task The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string discoveredAssetName, DeviceRegistryNamespaceDiscoveredAssetData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string discoveredAssetName, NamespaceDiscoveredAssetData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredAssetCollection.CreateOrUpdate"); + using var scope = _namespaceDiscoveredAssetClientDiagnostics.CreateScope("NamespaceDiscoveredAssetCollection.CreateOrUpdate"); scope.Start(); try { - var response = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.CreateOrReplace(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredAssetName, data, cancellationToken); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryNamespaceDiscoveredAssetOperationSource(Client), _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics, Pipeline, _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredAssetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _namespaceDiscoveredAssetRestClient.CreateOrReplace(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredAssetName, data, cancellationToken); + var operation = new DeviceRegistryArmOperation(new NamespaceDiscoveredAssetOperationSource(Client), _namespaceDiscoveredAssetClientDiagnostics, Pipeline, _namespaceDiscoveredAssetRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredAssetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -166,7 +166,7 @@ public virtual ArmOperation Crea /// /// /// Resource - /// + /// /// /// /// @@ -174,18 +174,18 @@ public virtual ArmOperation Crea /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetAsync(string discoveredAssetName, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(string discoveredAssetName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); - using var scope = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredAssetCollection.Get"); + using var scope = _namespaceDiscoveredAssetClientDiagnostics.CreateScope("NamespaceDiscoveredAssetCollection.Get"); scope.Start(); try { - var response = await _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredAssetName, cancellationToken).ConfigureAwait(false); + var response = await _namespaceDiscoveredAssetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredAssetName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceDiscoveredAssetResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new NamespaceDiscoveredAssetResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -211,7 +211,7 @@ public virtual async Task /// /// Resource - /// + /// /// /// /// @@ -219,18 +219,18 @@ public virtual async Task The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual Response Get(string discoveredAssetName, CancellationToken cancellationToken = default) + public virtual Response Get(string discoveredAssetName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); - using var scope = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredAssetCollection.Get"); + using var scope = _namespaceDiscoveredAssetClientDiagnostics.CreateScope("NamespaceDiscoveredAssetCollection.Get"); scope.Start(); try { - var response = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredAssetName, cancellationToken); + var response = _namespaceDiscoveredAssetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredAssetName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceDiscoveredAssetResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new NamespaceDiscoveredAssetResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -256,17 +256,17 @@ public virtual Response Get(stri /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryNamespaceDiscoveredAssetResource(Client, DeviceRegistryNamespaceDiscoveredAssetData.DeserializeDeviceRegistryNamespaceDiscoveredAssetData(e)), _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics, Pipeline, "DeviceRegistryNamespaceDiscoveredAssetCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _namespaceDiscoveredAssetRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _namespaceDiscoveredAssetRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NamespaceDiscoveredAssetResource(Client, NamespaceDiscoveredAssetData.DeserializeNamespaceDiscoveredAssetData(e)), _namespaceDiscoveredAssetClientDiagnostics, Pipeline, "NamespaceDiscoveredAssetCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -286,17 +286,17 @@ public virtual AsyncPageable Get /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryNamespaceDiscoveredAssetResource(Client, DeviceRegistryNamespaceDiscoveredAssetData.DeserializeDeviceRegistryNamespaceDiscoveredAssetData(e)), _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics, Pipeline, "DeviceRegistryNamespaceDiscoveredAssetCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _namespaceDiscoveredAssetRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _namespaceDiscoveredAssetRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NamespaceDiscoveredAssetResource(Client, NamespaceDiscoveredAssetData.DeserializeNamespaceDiscoveredAssetData(e)), _namespaceDiscoveredAssetClientDiagnostics, Pipeline, "NamespaceDiscoveredAssetCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -316,7 +316,7 @@ public virtual Pageable GetAll(C /// /// /// Resource - /// + /// /// /// /// @@ -328,11 +328,11 @@ public virtual async Task> ExistsAsync(string discoveredAssetName { Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); - using var scope = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredAssetCollection.Exists"); + using var scope = _namespaceDiscoveredAssetClientDiagnostics.CreateScope("NamespaceDiscoveredAssetCollection.Exists"); scope.Start(); try { - var response = await _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredAssetName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _namespaceDiscoveredAssetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredAssetName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string discoveredAssetName /// /// /// Resource - /// + /// /// /// /// @@ -371,11 +371,11 @@ public virtual Response Exists(string discoveredAssetName, CancellationTok { Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); - using var scope = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredAssetCollection.Exists"); + using var scope = _namespaceDiscoveredAssetClientDiagnostics.CreateScope("NamespaceDiscoveredAssetCollection.Exists"); scope.Start(); try { - var response = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredAssetName, cancellationToken: cancellationToken); + var response = _namespaceDiscoveredAssetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredAssetName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -402,7 +402,7 @@ public virtual Response Exists(string discoveredAssetName, CancellationTok /// /// /// Resource - /// + /// /// /// /// @@ -410,18 +410,18 @@ public virtual Response Exists(string discoveredAssetName, CancellationTok /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetIfExistsAsync(string discoveredAssetName, CancellationToken cancellationToken = default) + public virtual async Task> GetIfExistsAsync(string discoveredAssetName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); - using var scope = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredAssetCollection.GetIfExists"); + using var scope = _namespaceDiscoveredAssetClientDiagnostics.CreateScope("NamespaceDiscoveredAssetCollection.GetIfExists"); scope.Start(); try { - var response = await _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredAssetName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _namespaceDiscoveredAssetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredAssetName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceDiscoveredAssetResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new NamespaceDiscoveredAssetResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -447,7 +447,7 @@ public virtual async Task /// /// Resource - /// + /// /// /// /// @@ -455,18 +455,18 @@ public virtual async Task The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual NullableResponse GetIfExists(string discoveredAssetName, CancellationToken cancellationToken = default) + public virtual NullableResponse GetIfExists(string discoveredAssetName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); - using var scope = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredAssetCollection.GetIfExists"); + using var scope = _namespaceDiscoveredAssetClientDiagnostics.CreateScope("NamespaceDiscoveredAssetCollection.GetIfExists"); scope.Start(); try { - var response = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredAssetName, cancellationToken: cancellationToken); + var response = _namespaceDiscoveredAssetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredAssetName, cancellationToken: cancellationToken); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceDiscoveredAssetResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new NamespaceDiscoveredAssetResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -475,7 +475,7 @@ public virtual NullableResponse } } - IEnumerator IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetAll().GetEnumerator(); } @@ -485,7 +485,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredAssetData.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredAssetData.Serialization.cs similarity index 70% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredAssetData.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredAssetData.Serialization.cs index 74125c3f445b..5a5623531e62 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredAssetData.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredAssetData.Serialization.cs @@ -16,11 +16,11 @@ namespace Azure.ResourceManager.DeviceRegistry { - public partial class DeviceRegistryNamespaceDiscoveredAssetData : IUtf8JsonSerializable, IJsonModel + public partial class NamespaceDiscoveredAssetData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -31,10 +31,10 @@ void IJsonModel.Write(Utf8JsonWriter /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDiscoveredAssetData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceDiscoveredAssetData)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); @@ -47,19 +47,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteObjectValue(ExtendedLocation, options); } - DeviceRegistryNamespaceDiscoveredAssetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NamespaceDiscoveredAssetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDiscoveredAssetData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceDiscoveredAssetData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryNamespaceDiscoveredAssetData(document.RootElement, options); + return DeserializeNamespaceDiscoveredAssetData(document.RootElement, options); } - internal static DeviceRegistryNamespaceDiscoveredAssetData DeserializeDeviceRegistryNamespaceDiscoveredAssetData(JsonElement element, ModelReaderWriterOptions options = null) + internal static NamespaceDiscoveredAssetData DeserializeNamespaceDiscoveredAssetData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -67,7 +67,7 @@ internal static DeviceRegistryNamespaceDiscoveredAssetData DeserializeDeviceRegi { return null; } - DeviceRegistryNamespaceDiscoveredAssetProperties properties = default; + NamespaceDiscoveredAssetProperties properties = default; DeviceRegistryExtendedLocation extendedLocation = default; IDictionary tags = default; AzureLocation location = default; @@ -85,7 +85,7 @@ internal static DeviceRegistryNamespaceDiscoveredAssetData DeserializeDeviceRegi { continue; } - properties = DeviceRegistryNamespaceDiscoveredAssetProperties.DeserializeDeviceRegistryNamespaceDiscoveredAssetProperties(property.Value, options); + properties = NamespaceDiscoveredAssetProperties.DeserializeNamespaceDiscoveredAssetProperties(property.Value, options); continue; } if (property.NameEquals("extendedLocation"u8)) @@ -142,7 +142,7 @@ internal static DeviceRegistryNamespaceDiscoveredAssetData DeserializeDeviceRegi } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryNamespaceDiscoveredAssetData( + return new NamespaceDiscoveredAssetData( id, name, type, @@ -154,35 +154,35 @@ internal static DeviceRegistryNamespaceDiscoveredAssetData DeserializeDeviceRegi serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDiscoveredAssetData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceDiscoveredAssetData)} does not support writing '{options.Format}' format."); } } - DeviceRegistryNamespaceDiscoveredAssetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NamespaceDiscoveredAssetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryNamespaceDiscoveredAssetData(document.RootElement, options); + return DeserializeNamespaceDiscoveredAssetData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDiscoveredAssetData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceDiscoveredAssetData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredAssetData.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredAssetData.cs similarity index 71% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredAssetData.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredAssetData.cs index 231130ed5876..d07b4c8bd2aa 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredAssetData.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredAssetData.cs @@ -14,10 +14,10 @@ namespace Azure.ResourceManager.DeviceRegistry { /// - /// A class representing the DeviceRegistryNamespaceDiscoveredAsset data model. + /// A class representing the NamespaceDiscoveredAsset data model. /// Discovered asset definition. /// - public partial class DeviceRegistryNamespaceDiscoveredAssetData : TrackedResourceData + public partial class NamespaceDiscoveredAssetData : TrackedResourceData { /// /// Keeps track of any properties unknown to the library. @@ -51,18 +51,18 @@ public partial class DeviceRegistryNamespaceDiscoveredAssetData : TrackedResourc /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The location. /// The extended location. /// is null. - public DeviceRegistryNamespaceDiscoveredAssetData(AzureLocation location, DeviceRegistryExtendedLocation extendedLocation) : base(location) + public NamespaceDiscoveredAssetData(AzureLocation location, DeviceRegistryExtendedLocation extendedLocation) : base(location) { Argument.AssertNotNull(extendedLocation, nameof(extendedLocation)); ExtendedLocation = extendedLocation; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -72,20 +72,20 @@ public DeviceRegistryNamespaceDiscoveredAssetData(AzureLocation location, Device /// The resource-specific properties for this resource. /// The extended location. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryNamespaceDiscoveredAssetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, DeviceRegistryNamespaceDiscoveredAssetProperties properties, DeviceRegistryExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal NamespaceDiscoveredAssetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, NamespaceDiscoveredAssetProperties properties, DeviceRegistryExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Properties = properties; ExtendedLocation = extendedLocation; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DeviceRegistryNamespaceDiscoveredAssetData() + /// Initializes a new instance of for deserialization. + internal NamespaceDiscoveredAssetData() { } /// The resource-specific properties for this resource. - public DeviceRegistryNamespaceDiscoveredAssetProperties Properties { get; set; } + public NamespaceDiscoveredAssetProperties Properties { get; set; } /// The extended location. public DeviceRegistryExtendedLocation ExtendedLocation { get; set; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredAssetResource.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredAssetResource.Serialization.cs new file mode 100644 index 000000000000..ff4c5ecbe74e --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredAssetResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.DeviceRegistry +{ + public partial class NamespaceDiscoveredAssetResource : IJsonModel + { + private static NamespaceDiscoveredAssetData s_dataDeserializationInstance; + private static NamespaceDiscoveredAssetData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + NamespaceDiscoveredAssetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerDeviceRegistryContext.Default); + + NamespaceDiscoveredAssetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerDeviceRegistryContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredAssetResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredAssetResource.cs similarity index 67% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredAssetResource.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredAssetResource.cs index ac0cd04131ef..18ab7ccffbdb 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredAssetResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredAssetResource.cs @@ -17,14 +17,14 @@ namespace Azure.ResourceManager.DeviceRegistry { /// - /// A Class representing a DeviceRegistryNamespaceDiscoveredAsset along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetDeviceRegistryNamespaceDiscoveredAssetResource method. - /// Otherwise you can get one from its parent resource using the GetDeviceRegistryNamespaceDiscoveredAsset method. + /// A Class representing a NamespaceDiscoveredAsset along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetNamespaceDiscoveredAssetResource method. + /// Otherwise you can get one from its parent resource using the GetNamespaceDiscoveredAsset method. /// - public partial class DeviceRegistryNamespaceDiscoveredAssetResource : ArmResource + public partial class NamespaceDiscoveredAssetResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The subscriptionId. /// The resourceGroupName. /// The namespaceName. @@ -35,35 +35,35 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics; - private readonly NamespaceDiscoveredAssetsRestOperations _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient; - private readonly DeviceRegistryNamespaceDiscoveredAssetData _data; + private readonly ClientDiagnostics _namespaceDiscoveredAssetClientDiagnostics; + private readonly NamespaceDiscoveredAssetsRestOperations _namespaceDiscoveredAssetRestClient; + private readonly NamespaceDiscoveredAssetData _data; /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Microsoft.DeviceRegistry/namespaces/discoveredAssets"; - /// Initializes a new instance of the class for mocking. - protected DeviceRegistryNamespaceDiscoveredAssetResource() + /// Initializes a new instance of the class for mocking. + protected NamespaceDiscoveredAssetResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal DeviceRegistryNamespaceDiscoveredAssetResource(ArmClient client, DeviceRegistryNamespaceDiscoveredAssetData data) : this(client, data.Id) + internal NamespaceDiscoveredAssetResource(ArmClient client, NamespaceDiscoveredAssetData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. - internal DeviceRegistryNamespaceDiscoveredAssetResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal NamespaceDiscoveredAssetResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsApiVersion); - _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient = new NamespaceDiscoveredAssetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsApiVersion); + _namespaceDiscoveredAssetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string namespaceDiscoveredAssetApiVersion); + _namespaceDiscoveredAssetRestClient = new NamespaceDiscoveredAssetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, namespaceDiscoveredAssetApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -74,7 +74,7 @@ internal DeviceRegistryNamespaceDiscoveredAssetResource(ArmClient client, Resour /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual DeviceRegistryNamespaceDiscoveredAssetData Data + public virtual NamespaceDiscoveredAssetData Data { get { @@ -107,21 +107,21 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredAssetResource.Get"); + using var scope = _namespaceDiscoveredAssetClientDiagnostics.CreateScope("NamespaceDiscoveredAssetResource.Get"); scope.Start(); try { - var response = await _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _namespaceDiscoveredAssetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceDiscoveredAssetResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new NamespaceDiscoveredAssetResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -147,21 +147,21 @@ public virtual async Task /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredAssetResource.Get"); + using var scope = _namespaceDiscoveredAssetClientDiagnostics.CreateScope("NamespaceDiscoveredAssetResource.Get"); scope.Start(); try { - var response = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _namespaceDiscoveredAssetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceDiscoveredAssetResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new NamespaceDiscoveredAssetResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -187,7 +187,7 @@ public virtual Response Get(Canc /// /// /// Resource - /// + /// /// /// /// @@ -195,12 +195,12 @@ public virtual Response Get(Canc /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredAssetResource.Delete"); + using var scope = _namespaceDiscoveredAssetClientDiagnostics.CreateScope("NamespaceDiscoveredAssetResource.Delete"); scope.Start(); try { - var response = await _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new DeviceRegistryArmOperation(_deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics, Pipeline, _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _namespaceDiscoveredAssetRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DeviceRegistryArmOperation(_namespaceDiscoveredAssetClientDiagnostics, Pipeline, _namespaceDiscoveredAssetRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -229,7 +229,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Resource - /// + /// /// /// /// @@ -237,12 +237,12 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredAssetResource.Delete"); + using var scope = _namespaceDiscoveredAssetClientDiagnostics.CreateScope("NamespaceDiscoveredAssetResource.Delete"); scope.Start(); try { - var response = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new DeviceRegistryArmOperation(_deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics, Pipeline, _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _namespaceDiscoveredAssetRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DeviceRegistryArmOperation(_namespaceDiscoveredAssetClientDiagnostics, Pipeline, _namespaceDiscoveredAssetRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -271,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Resource - /// + /// /// /// /// @@ -279,16 +279,16 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// The resource properties to be updated. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, DeviceRegistryNamespaceDiscoveredAssetPatch patch, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, NamespaceDiscoveredAssetPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredAssetResource.Update"); + using var scope = _namespaceDiscoveredAssetClientDiagnostics.CreateScope("NamespaceDiscoveredAssetResource.Update"); scope.Start(); try { - var response = await _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryNamespaceDiscoveredAssetOperationSource(Client), _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics, Pipeline, _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = await _namespaceDiscoveredAssetRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new DeviceRegistryArmOperation(new NamespaceDiscoveredAssetOperationSource(Client), _namespaceDiscoveredAssetClientDiagnostics, Pipeline, _namespaceDiscoveredAssetRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -317,7 +317,7 @@ public virtual async Task /// /// Resource - /// + /// /// /// /// @@ -325,16 +325,16 @@ public virtual async Task The resource properties to be updated. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, DeviceRegistryNamespaceDiscoveredAssetPatch patch, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, NamespaceDiscoveredAssetPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredAssetResource.Update"); + using var scope = _namespaceDiscoveredAssetClientDiagnostics.CreateScope("NamespaceDiscoveredAssetResource.Update"); scope.Start(); try { - var response = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryNamespaceDiscoveredAssetOperationSource(Client), _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics, Pipeline, _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = _namespaceDiscoveredAssetRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new DeviceRegistryArmOperation(new NamespaceDiscoveredAssetOperationSource(Client), _namespaceDiscoveredAssetClientDiagnostics, Pipeline, _namespaceDiscoveredAssetRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -363,7 +363,7 @@ public virtual ArmOperation Upda /// /// /// Resource - /// + /// /// /// /// @@ -371,12 +371,12 @@ public virtual ArmOperation Upda /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredAssetResource.AddTag"); + using var scope = _namespaceDiscoveredAssetClientDiagnostics.CreateScope("NamespaceDiscoveredAssetResource.AddTag"); scope.Start(); try { @@ -385,13 +385,13 @@ public virtual async Task /// /// Resource - /// + /// /// /// /// @@ -433,12 +433,12 @@ public virtual async Task The value for the tag. /// The cancellation token to use. /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredAssetResource.AddTag"); + using var scope = _namespaceDiscoveredAssetClientDiagnostics.CreateScope("NamespaceDiscoveredAssetResource.AddTag"); scope.Start(); try { @@ -447,13 +447,13 @@ public virtual Response AddTag(s var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new DeviceRegistryNamespaceDiscoveredAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _namespaceDiscoveredAssetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new NamespaceDiscoveredAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DeviceRegistryNamespaceDiscoveredAssetPatch(); + var patch = new NamespaceDiscoveredAssetPatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -487,18 +487,18 @@ public virtual Response AddTag(s /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredAssetResource.SetTags"); + using var scope = _namespaceDiscoveredAssetClientDiagnostics.CreateScope("NamespaceDiscoveredAssetResource.SetTags"); scope.Start(); try { @@ -508,13 +508,13 @@ public virtual async Task /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredAssetResource.SetTags"); + using var scope = _namespaceDiscoveredAssetClientDiagnostics.CreateScope("NamespaceDiscoveredAssetResource.SetTags"); scope.Start(); try { @@ -565,13 +565,13 @@ public virtual Response SetTags( var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.ReplaceWith(tags); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new DeviceRegistryNamespaceDiscoveredAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _namespaceDiscoveredAssetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new NamespaceDiscoveredAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DeviceRegistryNamespaceDiscoveredAssetPatch(); + var patch = new NamespaceDiscoveredAssetPatch(); patch.Tags.ReplaceWith(tags); var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); return Response.FromValue(result.Value, result.GetRawResponse()); @@ -601,18 +601,18 @@ public virtual Response SetTags( /// /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredAssetResource.RemoveTag"); + using var scope = _namespaceDiscoveredAssetClientDiagnostics.CreateScope("NamespaceDiscoveredAssetResource.RemoveTag"); scope.Start(); try { @@ -621,13 +621,13 @@ public virtual async Task /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredAssetResource.RemoveTag"); + using var scope = _namespaceDiscoveredAssetClientDiagnostics.CreateScope("NamespaceDiscoveredAssetResource.RemoveTag"); scope.Start(); try { @@ -681,13 +681,13 @@ public virtual Response RemoveTa var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deviceRegistryNamespaceDiscoveredAssetNamespaceDiscoveredAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new DeviceRegistryNamespaceDiscoveredAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _namespaceDiscoveredAssetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new NamespaceDiscoveredAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DeviceRegistryNamespaceDiscoveredAssetPatch(); + var patch = new NamespaceDiscoveredAssetPatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredDeviceCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredDeviceCollection.cs similarity index 60% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredDeviceCollection.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredDeviceCollection.cs index 803c25c7734c..7bb01a2390b9 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredDeviceCollection.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredDeviceCollection.cs @@ -18,28 +18,28 @@ namespace Azure.ResourceManager.DeviceRegistry { /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetDeviceRegistryNamespaceDiscoveredDevices method from an instance of . + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetNamespaceDiscoveredDevices method from an instance of . /// - public partial class DeviceRegistryNamespaceDiscoveredDeviceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + public partial class NamespaceDiscoveredDeviceCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics; - private readonly NamespaceDiscoveredDevicesRestOperations _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient; + private readonly ClientDiagnostics _namespaceDiscoveredDeviceClientDiagnostics; + private readonly NamespaceDiscoveredDevicesRestOperations _namespaceDiscoveredDeviceRestClient; - /// Initializes a new instance of the class for mocking. - protected DeviceRegistryNamespaceDiscoveredDeviceCollection() + /// Initializes a new instance of the class for mocking. + protected NamespaceDiscoveredDeviceCollection() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the parent resource that is the target of operations. - internal DeviceRegistryNamespaceDiscoveredDeviceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + internal NamespaceDiscoveredDeviceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistryNamespaceDiscoveredDeviceResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(DeviceRegistryNamespaceDiscoveredDeviceResource.ResourceType, out string deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesApiVersion); - _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient = new NamespaceDiscoveredDevicesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesApiVersion); + _namespaceDiscoveredDeviceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", NamespaceDiscoveredDeviceResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(NamespaceDiscoveredDeviceResource.ResourceType, out string namespaceDiscoveredDeviceApiVersion); + _namespaceDiscoveredDeviceRestClient = new NamespaceDiscoveredDevicesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, namespaceDiscoveredDeviceApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -47,8 +47,8 @@ internal DeviceRegistryNamespaceDiscoveredDeviceCollection(ArmClient client, Res internal static void ValidateResourceId(ResourceIdentifier id) { - if (id.ResourceType != DeviceRegistryNamespaceResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DeviceRegistryNamespaceResource.ResourceType), nameof(id)); + if (id.ResourceType != NamespaceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, NamespaceResource.ResourceType), nameof(id)); } /// @@ -68,7 +68,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Resource - /// + /// /// /// /// @@ -78,17 +78,17 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string discoveredDeviceName, DeviceRegistryNamespaceDiscoveredDeviceData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string discoveredDeviceName, NamespaceDiscoveredDeviceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(discoveredDeviceName, nameof(discoveredDeviceName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredDeviceCollection.CreateOrUpdate"); + using var scope = _namespaceDiscoveredDeviceClientDiagnostics.CreateScope("NamespaceDiscoveredDeviceCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.CreateOrReplaceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredDeviceName, data, cancellationToken).ConfigureAwait(false); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryNamespaceDiscoveredDeviceOperationSource(Client), _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics, Pipeline, _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredDeviceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _namespaceDiscoveredDeviceRestClient.CreateOrReplaceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredDeviceName, data, cancellationToken).ConfigureAwait(false); + var operation = new DeviceRegistryArmOperation(new NamespaceDiscoveredDeviceOperationSource(Client), _namespaceDiscoveredDeviceClientDiagnostics, Pipeline, _namespaceDiscoveredDeviceRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredDeviceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -117,7 +117,7 @@ public virtual async Task /// /// Resource - /// + /// /// /// /// @@ -127,17 +127,17 @@ public virtual async Task The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string discoveredDeviceName, DeviceRegistryNamespaceDiscoveredDeviceData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string discoveredDeviceName, NamespaceDiscoveredDeviceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(discoveredDeviceName, nameof(discoveredDeviceName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredDeviceCollection.CreateOrUpdate"); + using var scope = _namespaceDiscoveredDeviceClientDiagnostics.CreateScope("NamespaceDiscoveredDeviceCollection.CreateOrUpdate"); scope.Start(); try { - var response = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.CreateOrReplace(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredDeviceName, data, cancellationToken); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryNamespaceDiscoveredDeviceOperationSource(Client), _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics, Pipeline, _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredDeviceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _namespaceDiscoveredDeviceRestClient.CreateOrReplace(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredDeviceName, data, cancellationToken); + var operation = new DeviceRegistryArmOperation(new NamespaceDiscoveredDeviceOperationSource(Client), _namespaceDiscoveredDeviceClientDiagnostics, Pipeline, _namespaceDiscoveredDeviceRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredDeviceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -166,7 +166,7 @@ public virtual ArmOperation Cre /// /// /// Resource - /// + /// /// /// /// @@ -174,18 +174,18 @@ public virtual ArmOperation Cre /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetAsync(string discoveredDeviceName, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(string discoveredDeviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(discoveredDeviceName, nameof(discoveredDeviceName)); - using var scope = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredDeviceCollection.Get"); + using var scope = _namespaceDiscoveredDeviceClientDiagnostics.CreateScope("NamespaceDiscoveredDeviceCollection.Get"); scope.Start(); try { - var response = await _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredDeviceName, cancellationToken).ConfigureAwait(false); + var response = await _namespaceDiscoveredDeviceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredDeviceName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceDiscoveredDeviceResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new NamespaceDiscoveredDeviceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -211,7 +211,7 @@ public virtual async Task /// /// Resource - /// + /// /// /// /// @@ -219,18 +219,18 @@ public virtual async Task The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual Response Get(string discoveredDeviceName, CancellationToken cancellationToken = default) + public virtual Response Get(string discoveredDeviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(discoveredDeviceName, nameof(discoveredDeviceName)); - using var scope = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredDeviceCollection.Get"); + using var scope = _namespaceDiscoveredDeviceClientDiagnostics.CreateScope("NamespaceDiscoveredDeviceCollection.Get"); scope.Start(); try { - var response = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredDeviceName, cancellationToken); + var response = _namespaceDiscoveredDeviceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredDeviceName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceDiscoveredDeviceResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new NamespaceDiscoveredDeviceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -256,17 +256,17 @@ public virtual Response Get(str /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryNamespaceDiscoveredDeviceResource(Client, DeviceRegistryNamespaceDiscoveredDeviceData.DeserializeDeviceRegistryNamespaceDiscoveredDeviceData(e)), _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics, Pipeline, "DeviceRegistryNamespaceDiscoveredDeviceCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _namespaceDiscoveredDeviceRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _namespaceDiscoveredDeviceRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NamespaceDiscoveredDeviceResource(Client, NamespaceDiscoveredDeviceData.DeserializeNamespaceDiscoveredDeviceData(e)), _namespaceDiscoveredDeviceClientDiagnostics, Pipeline, "NamespaceDiscoveredDeviceCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -286,17 +286,17 @@ public virtual AsyncPageable Ge /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryNamespaceDiscoveredDeviceResource(Client, DeviceRegistryNamespaceDiscoveredDeviceData.DeserializeDeviceRegistryNamespaceDiscoveredDeviceData(e)), _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics, Pipeline, "DeviceRegistryNamespaceDiscoveredDeviceCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _namespaceDiscoveredDeviceRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _namespaceDiscoveredDeviceRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NamespaceDiscoveredDeviceResource(Client, NamespaceDiscoveredDeviceData.DeserializeNamespaceDiscoveredDeviceData(e)), _namespaceDiscoveredDeviceClientDiagnostics, Pipeline, "NamespaceDiscoveredDeviceCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -316,7 +316,7 @@ public virtual Pageable GetAll( /// /// /// Resource - /// + /// /// /// /// @@ -328,11 +328,11 @@ public virtual async Task> ExistsAsync(string discoveredDeviceNam { Argument.AssertNotNullOrEmpty(discoveredDeviceName, nameof(discoveredDeviceName)); - using var scope = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredDeviceCollection.Exists"); + using var scope = _namespaceDiscoveredDeviceClientDiagnostics.CreateScope("NamespaceDiscoveredDeviceCollection.Exists"); scope.Start(); try { - var response = await _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredDeviceName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _namespaceDiscoveredDeviceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredDeviceName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string discoveredDeviceNam /// /// /// Resource - /// + /// /// /// /// @@ -371,11 +371,11 @@ public virtual Response Exists(string discoveredDeviceName, CancellationTo { Argument.AssertNotNullOrEmpty(discoveredDeviceName, nameof(discoveredDeviceName)); - using var scope = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredDeviceCollection.Exists"); + using var scope = _namespaceDiscoveredDeviceClientDiagnostics.CreateScope("NamespaceDiscoveredDeviceCollection.Exists"); scope.Start(); try { - var response = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredDeviceName, cancellationToken: cancellationToken); + var response = _namespaceDiscoveredDeviceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredDeviceName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -402,7 +402,7 @@ public virtual Response Exists(string discoveredDeviceName, CancellationTo /// /// /// Resource - /// + /// /// /// /// @@ -410,18 +410,18 @@ public virtual Response Exists(string discoveredDeviceName, CancellationTo /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetIfExistsAsync(string discoveredDeviceName, CancellationToken cancellationToken = default) + public virtual async Task> GetIfExistsAsync(string discoveredDeviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(discoveredDeviceName, nameof(discoveredDeviceName)); - using var scope = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredDeviceCollection.GetIfExists"); + using var scope = _namespaceDiscoveredDeviceClientDiagnostics.CreateScope("NamespaceDiscoveredDeviceCollection.GetIfExists"); scope.Start(); try { - var response = await _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredDeviceName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _namespaceDiscoveredDeviceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredDeviceName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceDiscoveredDeviceResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new NamespaceDiscoveredDeviceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -447,7 +447,7 @@ public virtual async Task /// /// Resource - /// + /// /// /// /// @@ -455,18 +455,18 @@ public virtual async Task The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual NullableResponse GetIfExists(string discoveredDeviceName, CancellationToken cancellationToken = default) + public virtual NullableResponse GetIfExists(string discoveredDeviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(discoveredDeviceName, nameof(discoveredDeviceName)); - using var scope = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredDeviceCollection.GetIfExists"); + using var scope = _namespaceDiscoveredDeviceClientDiagnostics.CreateScope("NamespaceDiscoveredDeviceCollection.GetIfExists"); scope.Start(); try { - var response = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredDeviceName, cancellationToken: cancellationToken); + var response = _namespaceDiscoveredDeviceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveredDeviceName, cancellationToken: cancellationToken); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceDiscoveredDeviceResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new NamespaceDiscoveredDeviceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -475,7 +475,7 @@ public virtual NullableResponse } } - IEnumerator IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetAll().GetEnumerator(); } @@ -485,7 +485,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredDeviceData.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredDeviceData.Serialization.cs similarity index 69% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredDeviceData.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredDeviceData.Serialization.cs index 4ec4decd55d6..06164da76dcd 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredDeviceData.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredDeviceData.Serialization.cs @@ -16,11 +16,11 @@ namespace Azure.ResourceManager.DeviceRegistry { - public partial class DeviceRegistryNamespaceDiscoveredDeviceData : IUtf8JsonSerializable, IJsonModel + public partial class NamespaceDiscoveredDeviceData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -31,10 +31,10 @@ void IJsonModel.Write(Utf8JsonWrite /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDiscoveredDeviceData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceDiscoveredDeviceData)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); @@ -47,19 +47,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteObjectValue(ExtendedLocation, options); } - DeviceRegistryNamespaceDiscoveredDeviceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NamespaceDiscoveredDeviceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDiscoveredDeviceData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NamespaceDiscoveredDeviceData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryNamespaceDiscoveredDeviceData(document.RootElement, options); + return DeserializeNamespaceDiscoveredDeviceData(document.RootElement, options); } - internal static DeviceRegistryNamespaceDiscoveredDeviceData DeserializeDeviceRegistryNamespaceDiscoveredDeviceData(JsonElement element, ModelReaderWriterOptions options = null) + internal static NamespaceDiscoveredDeviceData DeserializeNamespaceDiscoveredDeviceData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -67,7 +67,7 @@ internal static DeviceRegistryNamespaceDiscoveredDeviceData DeserializeDeviceReg { return null; } - DeviceRegistryNamespaceDiscoveredDeviceProperties properties = default; + NamespaceDiscoveredDeviceProperties properties = default; DeviceRegistryExtendedLocation extendedLocation = default; IDictionary tags = default; AzureLocation location = default; @@ -85,7 +85,7 @@ internal static DeviceRegistryNamespaceDiscoveredDeviceData DeserializeDeviceReg { continue; } - properties = DeviceRegistryNamespaceDiscoveredDeviceProperties.DeserializeDeviceRegistryNamespaceDiscoveredDeviceProperties(property.Value, options); + properties = NamespaceDiscoveredDeviceProperties.DeserializeNamespaceDiscoveredDeviceProperties(property.Value, options); continue; } if (property.NameEquals("extendedLocation"u8)) @@ -142,7 +142,7 @@ internal static DeviceRegistryNamespaceDiscoveredDeviceData DeserializeDeviceReg } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryNamespaceDiscoveredDeviceData( + return new NamespaceDiscoveredDeviceData( id, name, type, @@ -154,35 +154,35 @@ internal static DeviceRegistryNamespaceDiscoveredDeviceData DeserializeDeviceReg serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDeviceRegistryContext.Default); default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDiscoveredDeviceData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceDiscoveredDeviceData)} does not support writing '{options.Format}' format."); } } - DeviceRegistryNamespaceDiscoveredDeviceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NamespaceDiscoveredDeviceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceRegistryNamespaceDiscoveredDeviceData(document.RootElement, options); + return DeserializeNamespaceDiscoveredDeviceData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeviceRegistryNamespaceDiscoveredDeviceData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NamespaceDiscoveredDeviceData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredDeviceData.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredDeviceData.cs similarity index 71% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredDeviceData.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredDeviceData.cs index 3baa59b0e927..36c11b2d5ff8 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredDeviceData.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredDeviceData.cs @@ -14,10 +14,10 @@ namespace Azure.ResourceManager.DeviceRegistry { /// - /// A class representing the DeviceRegistryNamespaceDiscoveredDevice data model. + /// A class representing the NamespaceDiscoveredDevice data model. /// Discovered device definition. /// - public partial class DeviceRegistryNamespaceDiscoveredDeviceData : TrackedResourceData + public partial class NamespaceDiscoveredDeviceData : TrackedResourceData { /// /// Keeps track of any properties unknown to the library. @@ -51,18 +51,18 @@ public partial class DeviceRegistryNamespaceDiscoveredDeviceData : TrackedResour /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The location. /// The extended location. /// is null. - public DeviceRegistryNamespaceDiscoveredDeviceData(AzureLocation location, DeviceRegistryExtendedLocation extendedLocation) : base(location) + public NamespaceDiscoveredDeviceData(AzureLocation location, DeviceRegistryExtendedLocation extendedLocation) : base(location) { Argument.AssertNotNull(extendedLocation, nameof(extendedLocation)); ExtendedLocation = extendedLocation; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -72,20 +72,20 @@ public DeviceRegistryNamespaceDiscoveredDeviceData(AzureLocation location, Devic /// The resource-specific properties for this resource. /// The extended location. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryNamespaceDiscoveredDeviceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, DeviceRegistryNamespaceDiscoveredDeviceProperties properties, DeviceRegistryExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal NamespaceDiscoveredDeviceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, NamespaceDiscoveredDeviceProperties properties, DeviceRegistryExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Properties = properties; ExtendedLocation = extendedLocation; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DeviceRegistryNamespaceDiscoveredDeviceData() + /// Initializes a new instance of for deserialization. + internal NamespaceDiscoveredDeviceData() { } /// The resource-specific properties for this resource. - public DeviceRegistryNamespaceDiscoveredDeviceProperties Properties { get; set; } + public NamespaceDiscoveredDeviceProperties Properties { get; set; } /// The extended location. public DeviceRegistryExtendedLocation ExtendedLocation { get; set; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredDeviceResource.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredDeviceResource.Serialization.cs new file mode 100644 index 000000000000..292d732f8cc6 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredDeviceResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.DeviceRegistry +{ + public partial class NamespaceDiscoveredDeviceResource : IJsonModel + { + private static NamespaceDiscoveredDeviceData s_dataDeserializationInstance; + private static NamespaceDiscoveredDeviceData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + NamespaceDiscoveredDeviceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerDeviceRegistryContext.Default); + + NamespaceDiscoveredDeviceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerDeviceRegistryContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredDeviceResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredDeviceResource.cs similarity index 67% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredDeviceResource.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredDeviceResource.cs index 79166324e119..64d15f8a690d 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceDiscoveredDeviceResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceDiscoveredDeviceResource.cs @@ -17,14 +17,14 @@ namespace Azure.ResourceManager.DeviceRegistry { /// - /// A Class representing a DeviceRegistryNamespaceDiscoveredDevice along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetDeviceRegistryNamespaceDiscoveredDeviceResource method. - /// Otherwise you can get one from its parent resource using the GetDeviceRegistryNamespaceDiscoveredDevice method. + /// A Class representing a NamespaceDiscoveredDevice along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetNamespaceDiscoveredDeviceResource method. + /// Otherwise you can get one from its parent resource using the GetNamespaceDiscoveredDevice method. /// - public partial class DeviceRegistryNamespaceDiscoveredDeviceResource : ArmResource + public partial class NamespaceDiscoveredDeviceResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The subscriptionId. /// The resourceGroupName. /// The namespaceName. @@ -35,35 +35,35 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics; - private readonly NamespaceDiscoveredDevicesRestOperations _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient; - private readonly DeviceRegistryNamespaceDiscoveredDeviceData _data; + private readonly ClientDiagnostics _namespaceDiscoveredDeviceClientDiagnostics; + private readonly NamespaceDiscoveredDevicesRestOperations _namespaceDiscoveredDeviceRestClient; + private readonly NamespaceDiscoveredDeviceData _data; /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Microsoft.DeviceRegistry/namespaces/discoveredDevices"; - /// Initializes a new instance of the class for mocking. - protected DeviceRegistryNamespaceDiscoveredDeviceResource() + /// Initializes a new instance of the class for mocking. + protected NamespaceDiscoveredDeviceResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal DeviceRegistryNamespaceDiscoveredDeviceResource(ArmClient client, DeviceRegistryNamespaceDiscoveredDeviceData data) : this(client, data.Id) + internal NamespaceDiscoveredDeviceResource(ArmClient client, NamespaceDiscoveredDeviceData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. - internal DeviceRegistryNamespaceDiscoveredDeviceResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal NamespaceDiscoveredDeviceResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesApiVersion); - _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient = new NamespaceDiscoveredDevicesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesApiVersion); + _namespaceDiscoveredDeviceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string namespaceDiscoveredDeviceApiVersion); + _namespaceDiscoveredDeviceRestClient = new NamespaceDiscoveredDevicesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, namespaceDiscoveredDeviceApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -74,7 +74,7 @@ internal DeviceRegistryNamespaceDiscoveredDeviceResource(ArmClient client, Resou /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual DeviceRegistryNamespaceDiscoveredDeviceData Data + public virtual NamespaceDiscoveredDeviceData Data { get { @@ -107,21 +107,21 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredDeviceResource.Get"); + using var scope = _namespaceDiscoveredDeviceClientDiagnostics.CreateScope("NamespaceDiscoveredDeviceResource.Get"); scope.Start(); try { - var response = await _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _namespaceDiscoveredDeviceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceDiscoveredDeviceResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new NamespaceDiscoveredDeviceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -147,21 +147,21 @@ public virtual async Task /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredDeviceResource.Get"); + using var scope = _namespaceDiscoveredDeviceClientDiagnostics.CreateScope("NamespaceDiscoveredDeviceResource.Get"); scope.Start(); try { - var response = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _namespaceDiscoveredDeviceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceDiscoveredDeviceResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new NamespaceDiscoveredDeviceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -187,7 +187,7 @@ public virtual Response Get(Can /// /// /// Resource - /// + /// /// /// /// @@ -195,12 +195,12 @@ public virtual Response Get(Can /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredDeviceResource.Delete"); + using var scope = _namespaceDiscoveredDeviceClientDiagnostics.CreateScope("NamespaceDiscoveredDeviceResource.Delete"); scope.Start(); try { - var response = await _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new DeviceRegistryArmOperation(_deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics, Pipeline, _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _namespaceDiscoveredDeviceRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DeviceRegistryArmOperation(_namespaceDiscoveredDeviceClientDiagnostics, Pipeline, _namespaceDiscoveredDeviceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -229,7 +229,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Resource - /// + /// /// /// /// @@ -237,12 +237,12 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredDeviceResource.Delete"); + using var scope = _namespaceDiscoveredDeviceClientDiagnostics.CreateScope("NamespaceDiscoveredDeviceResource.Delete"); scope.Start(); try { - var response = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new DeviceRegistryArmOperation(_deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics, Pipeline, _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _namespaceDiscoveredDeviceRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DeviceRegistryArmOperation(_namespaceDiscoveredDeviceClientDiagnostics, Pipeline, _namespaceDiscoveredDeviceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -271,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Resource - /// + /// /// /// /// @@ -279,16 +279,16 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// The resource properties to be updated. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, DeviceRegistryNamespaceDiscoveredDevicePatch patch, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, NamespaceDiscoveredDevicePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredDeviceResource.Update"); + using var scope = _namespaceDiscoveredDeviceClientDiagnostics.CreateScope("NamespaceDiscoveredDeviceResource.Update"); scope.Start(); try { - var response = await _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryNamespaceDiscoveredDeviceOperationSource(Client), _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics, Pipeline, _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = await _namespaceDiscoveredDeviceRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new DeviceRegistryArmOperation(new NamespaceDiscoveredDeviceOperationSource(Client), _namespaceDiscoveredDeviceClientDiagnostics, Pipeline, _namespaceDiscoveredDeviceRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -317,7 +317,7 @@ public virtual async Task /// /// Resource - /// + /// /// /// /// @@ -325,16 +325,16 @@ public virtual async Task The resource properties to be updated. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, DeviceRegistryNamespaceDiscoveredDevicePatch patch, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, NamespaceDiscoveredDevicePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredDeviceResource.Update"); + using var scope = _namespaceDiscoveredDeviceClientDiagnostics.CreateScope("NamespaceDiscoveredDeviceResource.Update"); scope.Start(); try { - var response = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryNamespaceDiscoveredDeviceOperationSource(Client), _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics, Pipeline, _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = _namespaceDiscoveredDeviceRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new DeviceRegistryArmOperation(new NamespaceDiscoveredDeviceOperationSource(Client), _namespaceDiscoveredDeviceClientDiagnostics, Pipeline, _namespaceDiscoveredDeviceRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -363,7 +363,7 @@ public virtual ArmOperation Upd /// /// /// Resource - /// + /// /// /// /// @@ -371,12 +371,12 @@ public virtual ArmOperation Upd /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredDeviceResource.AddTag"); + using var scope = _namespaceDiscoveredDeviceClientDiagnostics.CreateScope("NamespaceDiscoveredDeviceResource.AddTag"); scope.Start(); try { @@ -385,13 +385,13 @@ public virtual async Task /// /// Resource - /// + /// /// /// /// @@ -433,12 +433,12 @@ public virtual async Task The value for the tag. /// The cancellation token to use. /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredDeviceResource.AddTag"); + using var scope = _namespaceDiscoveredDeviceClientDiagnostics.CreateScope("NamespaceDiscoveredDeviceResource.AddTag"); scope.Start(); try { @@ -447,13 +447,13 @@ public virtual Response AddTag( var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new DeviceRegistryNamespaceDiscoveredDeviceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _namespaceDiscoveredDeviceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new NamespaceDiscoveredDeviceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DeviceRegistryNamespaceDiscoveredDevicePatch(); + var patch = new NamespaceDiscoveredDevicePatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -487,18 +487,18 @@ public virtual Response AddTag( /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredDeviceResource.SetTags"); + using var scope = _namespaceDiscoveredDeviceClientDiagnostics.CreateScope("NamespaceDiscoveredDeviceResource.SetTags"); scope.Start(); try { @@ -508,13 +508,13 @@ public virtual async Task /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredDeviceResource.SetTags"); + using var scope = _namespaceDiscoveredDeviceClientDiagnostics.CreateScope("NamespaceDiscoveredDeviceResource.SetTags"); scope.Start(); try { @@ -565,13 +565,13 @@ public virtual Response SetTags var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.ReplaceWith(tags); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new DeviceRegistryNamespaceDiscoveredDeviceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _namespaceDiscoveredDeviceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new NamespaceDiscoveredDeviceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DeviceRegistryNamespaceDiscoveredDevicePatch(); + var patch = new NamespaceDiscoveredDevicePatch(); patch.Tags.ReplaceWith(tags); var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); return Response.FromValue(result.Value, result.GetRawResponse()); @@ -601,18 +601,18 @@ public virtual Response SetTags /// /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredDeviceResource.RemoveTag"); + using var scope = _namespaceDiscoveredDeviceClientDiagnostics.CreateScope("NamespaceDiscoveredDeviceResource.RemoveTag"); scope.Start(); try { @@ -621,13 +621,13 @@ public virtual async Task /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesClientDiagnostics.CreateScope("DeviceRegistryNamespaceDiscoveredDeviceResource.RemoveTag"); + using var scope = _namespaceDiscoveredDeviceClientDiagnostics.CreateScope("NamespaceDiscoveredDeviceResource.RemoveTag"); scope.Start(); try { @@ -681,13 +681,13 @@ public virtual Response RemoveT var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deviceRegistryNamespaceDiscoveredDeviceNamespaceDiscoveredDevicesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new DeviceRegistryNamespaceDiscoveredDeviceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _namespaceDiscoveredDeviceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new NamespaceDiscoveredDeviceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DeviceRegistryNamespaceDiscoveredDevicePatch(); + var patch = new NamespaceDiscoveredDevicePatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceResource.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceResource.Serialization.cs new file mode 100644 index 000000000000..d2e911e17559 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.DeviceRegistry +{ + public partial class NamespaceResource : IJsonModel + { + private static NamespaceData s_dataDeserializationInstance; + private static NamespaceData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + NamespaceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerDeviceRegistryContext.Default); + + NamespaceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerDeviceRegistryContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceResource.cs similarity index 70% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceResource.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceResource.cs index 6481e2da66dd..969f7be34951 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryNamespaceResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/NamespaceResource.cs @@ -18,14 +18,14 @@ namespace Azure.ResourceManager.DeviceRegistry { /// - /// A Class representing a DeviceRegistryNamespace along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetDeviceRegistryNamespaceResource method. - /// Otherwise you can get one from its parent resource using the GetDeviceRegistryNamespace method. + /// A Class representing a Namespace along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetNamespaceResource method. + /// Otherwise you can get one from its parent resource using the GetNamespace method. /// - public partial class DeviceRegistryNamespaceResource : ArmResource + public partial class NamespaceResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The subscriptionId. /// The resourceGroupName. /// The namespaceName. @@ -35,35 +35,35 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _deviceRegistryNamespaceNamespacesClientDiagnostics; - private readonly NamespacesRestOperations _deviceRegistryNamespaceNamespacesRestClient; - private readonly DeviceRegistryNamespaceData _data; + private readonly ClientDiagnostics _namespaceClientDiagnostics; + private readonly NamespacesRestOperations _namespaceRestClient; + private readonly NamespaceData _data; /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Microsoft.DeviceRegistry/namespaces"; - /// Initializes a new instance of the class for mocking. - protected DeviceRegistryNamespaceResource() + /// Initializes a new instance of the class for mocking. + protected NamespaceResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal DeviceRegistryNamespaceResource(ArmClient client, DeviceRegistryNamespaceData data) : this(client, data.Id) + internal NamespaceResource(ArmClient client, NamespaceData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. - internal DeviceRegistryNamespaceResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal NamespaceResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _deviceRegistryNamespaceNamespacesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string deviceRegistryNamespaceNamespacesApiVersion); - _deviceRegistryNamespaceNamespacesRestClient = new NamespacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistryNamespaceNamespacesApiVersion); + _namespaceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string namespaceApiVersion); + _namespaceRestClient = new NamespacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, namespaceApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -74,7 +74,7 @@ internal DeviceRegistryNamespaceResource(ArmClient client, ResourceIdentifier id /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual DeviceRegistryNamespaceData Data + public virtual NamespaceData Data { get { @@ -90,11 +90,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } - /// Gets a collection of DeviceRegistryNamespaceAssetResources in the DeviceRegistryNamespace. - /// An object representing collection of DeviceRegistryNamespaceAssetResources and their operations over a DeviceRegistryNamespaceAssetResource. - public virtual DeviceRegistryNamespaceAssetCollection GetDeviceRegistryNamespaceAssets() + /// Gets a collection of NamespaceAssetResources in the Namespace. + /// An object representing collection of NamespaceAssetResources and their operations over a NamespaceAssetResource. + public virtual NamespaceAssetCollection GetNamespaceAssets() { - return GetCachedClient(client => new DeviceRegistryNamespaceAssetCollection(client, Id)); + return GetCachedClient(client => new NamespaceAssetCollection(client, Id)); } /// @@ -114,7 +114,7 @@ public virtual DeviceRegistryNamespaceAssetCollection GetDeviceRegistryNamespace /// /// /// Resource - /// + /// /// /// /// @@ -123,9 +123,9 @@ public virtual DeviceRegistryNamespaceAssetCollection GetDeviceRegistryNamespace /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetDeviceRegistryNamespaceAssetAsync(string assetName, CancellationToken cancellationToken = default) + public virtual async Task> GetNamespaceAssetAsync(string assetName, CancellationToken cancellationToken = default) { - return await GetDeviceRegistryNamespaceAssets().GetAsync(assetName, cancellationToken).ConfigureAwait(false); + return await GetNamespaceAssets().GetAsync(assetName, cancellationToken).ConfigureAwait(false); } /// @@ -145,7 +145,7 @@ public virtual async Task> GetDev /// /// /// Resource - /// + /// /// /// /// @@ -154,16 +154,16 @@ public virtual async Task> GetDev /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetDeviceRegistryNamespaceAsset(string assetName, CancellationToken cancellationToken = default) + public virtual Response GetNamespaceAsset(string assetName, CancellationToken cancellationToken = default) { - return GetDeviceRegistryNamespaceAssets().Get(assetName, cancellationToken); + return GetNamespaceAssets().Get(assetName, cancellationToken); } - /// Gets a collection of DeviceRegistryNamespaceDeviceResources in the DeviceRegistryNamespace. - /// An object representing collection of DeviceRegistryNamespaceDeviceResources and their operations over a DeviceRegistryNamespaceDeviceResource. - public virtual DeviceRegistryNamespaceDeviceCollection GetDeviceRegistryNamespaceDevices() + /// Gets a collection of NamespaceDeviceResources in the Namespace. + /// An object representing collection of NamespaceDeviceResources and their operations over a NamespaceDeviceResource. + public virtual NamespaceDeviceCollection GetNamespaceDevices() { - return GetCachedClient(client => new DeviceRegistryNamespaceDeviceCollection(client, Id)); + return GetCachedClient(client => new NamespaceDeviceCollection(client, Id)); } /// @@ -183,7 +183,7 @@ public virtual DeviceRegistryNamespaceDeviceCollection GetDeviceRegistryNamespac /// /// /// Resource - /// + /// /// /// /// @@ -192,9 +192,9 @@ public virtual DeviceRegistryNamespaceDeviceCollection GetDeviceRegistryNamespac /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetDeviceRegistryNamespaceDeviceAsync(string deviceName, CancellationToken cancellationToken = default) + public virtual async Task> GetNamespaceDeviceAsync(string deviceName, CancellationToken cancellationToken = default) { - return await GetDeviceRegistryNamespaceDevices().GetAsync(deviceName, cancellationToken).ConfigureAwait(false); + return await GetNamespaceDevices().GetAsync(deviceName, cancellationToken).ConfigureAwait(false); } /// @@ -214,7 +214,7 @@ public virtual async Task> GetDe /// /// /// Resource - /// + /// /// /// /// @@ -223,16 +223,16 @@ public virtual async Task> GetDe /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetDeviceRegistryNamespaceDevice(string deviceName, CancellationToken cancellationToken = default) + public virtual Response GetNamespaceDevice(string deviceName, CancellationToken cancellationToken = default) { - return GetDeviceRegistryNamespaceDevices().Get(deviceName, cancellationToken); + return GetNamespaceDevices().Get(deviceName, cancellationToken); } - /// Gets a collection of DeviceRegistryNamespaceDiscoveredAssetResources in the DeviceRegistryNamespace. - /// An object representing collection of DeviceRegistryNamespaceDiscoveredAssetResources and their operations over a DeviceRegistryNamespaceDiscoveredAssetResource. - public virtual DeviceRegistryNamespaceDiscoveredAssetCollection GetDeviceRegistryNamespaceDiscoveredAssets() + /// Gets a collection of NamespaceDiscoveredAssetResources in the Namespace. + /// An object representing collection of NamespaceDiscoveredAssetResources and their operations over a NamespaceDiscoveredAssetResource. + public virtual NamespaceDiscoveredAssetCollection GetNamespaceDiscoveredAssets() { - return GetCachedClient(client => new DeviceRegistryNamespaceDiscoveredAssetCollection(client, Id)); + return GetCachedClient(client => new NamespaceDiscoveredAssetCollection(client, Id)); } /// @@ -252,7 +252,7 @@ public virtual DeviceRegistryNamespaceDiscoveredAssetCollection GetDeviceRegistr /// /// /// Resource - /// + /// /// /// /// @@ -261,9 +261,9 @@ public virtual DeviceRegistryNamespaceDiscoveredAssetCollection GetDeviceRegistr /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetDeviceRegistryNamespaceDiscoveredAssetAsync(string discoveredAssetName, CancellationToken cancellationToken = default) + public virtual async Task> GetNamespaceDiscoveredAssetAsync(string discoveredAssetName, CancellationToken cancellationToken = default) { - return await GetDeviceRegistryNamespaceDiscoveredAssets().GetAsync(discoveredAssetName, cancellationToken).ConfigureAwait(false); + return await GetNamespaceDiscoveredAssets().GetAsync(discoveredAssetName, cancellationToken).ConfigureAwait(false); } /// @@ -283,7 +283,7 @@ public virtual async Task /// /// Resource - /// + /// /// /// /// @@ -292,16 +292,16 @@ public virtual async Task is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetDeviceRegistryNamespaceDiscoveredAsset(string discoveredAssetName, CancellationToken cancellationToken = default) + public virtual Response GetNamespaceDiscoveredAsset(string discoveredAssetName, CancellationToken cancellationToken = default) { - return GetDeviceRegistryNamespaceDiscoveredAssets().Get(discoveredAssetName, cancellationToken); + return GetNamespaceDiscoveredAssets().Get(discoveredAssetName, cancellationToken); } - /// Gets a collection of DeviceRegistryNamespaceDiscoveredDeviceResources in the DeviceRegistryNamespace. - /// An object representing collection of DeviceRegistryNamespaceDiscoveredDeviceResources and their operations over a DeviceRegistryNamespaceDiscoveredDeviceResource. - public virtual DeviceRegistryNamespaceDiscoveredDeviceCollection GetDeviceRegistryNamespaceDiscoveredDevices() + /// Gets a collection of NamespaceDiscoveredDeviceResources in the Namespace. + /// An object representing collection of NamespaceDiscoveredDeviceResources and their operations over a NamespaceDiscoveredDeviceResource. + public virtual NamespaceDiscoveredDeviceCollection GetNamespaceDiscoveredDevices() { - return GetCachedClient(client => new DeviceRegistryNamespaceDiscoveredDeviceCollection(client, Id)); + return GetCachedClient(client => new NamespaceDiscoveredDeviceCollection(client, Id)); } /// @@ -321,7 +321,7 @@ public virtual DeviceRegistryNamespaceDiscoveredDeviceCollection GetDeviceRegist /// /// /// Resource - /// + /// /// /// /// @@ -330,9 +330,9 @@ public virtual DeviceRegistryNamespaceDiscoveredDeviceCollection GetDeviceRegist /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetDeviceRegistryNamespaceDiscoveredDeviceAsync(string discoveredDeviceName, CancellationToken cancellationToken = default) + public virtual async Task> GetNamespaceDiscoveredDeviceAsync(string discoveredDeviceName, CancellationToken cancellationToken = default) { - return await GetDeviceRegistryNamespaceDiscoveredDevices().GetAsync(discoveredDeviceName, cancellationToken).ConfigureAwait(false); + return await GetNamespaceDiscoveredDevices().GetAsync(discoveredDeviceName, cancellationToken).ConfigureAwait(false); } /// @@ -352,7 +352,7 @@ public virtual async Task /// /// Resource - /// + /// /// /// /// @@ -361,9 +361,9 @@ public virtual async Task is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetDeviceRegistryNamespaceDiscoveredDevice(string discoveredDeviceName, CancellationToken cancellationToken = default) + public virtual Response GetNamespaceDiscoveredDevice(string discoveredDeviceName, CancellationToken cancellationToken = default) { - return GetDeviceRegistryNamespaceDiscoveredDevices().Get(discoveredDeviceName, cancellationToken); + return GetNamespaceDiscoveredDevices().Get(discoveredDeviceName, cancellationToken); } /// @@ -383,21 +383,21 @@ public virtual Response GetDevi /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _deviceRegistryNamespaceNamespacesClientDiagnostics.CreateScope("DeviceRegistryNamespaceResource.Get"); + using var scope = _namespaceClientDiagnostics.CreateScope("NamespaceResource.Get"); scope.Start(); try { - var response = await _deviceRegistryNamespaceNamespacesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _namespaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new NamespaceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -423,21 +423,21 @@ public virtual async Task> GetAsync(Ca /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _deviceRegistryNamespaceNamespacesClientDiagnostics.CreateScope("DeviceRegistryNamespaceResource.Get"); + using var scope = _namespaceClientDiagnostics.CreateScope("NamespaceResource.Get"); scope.Start(); try { - var response = _deviceRegistryNamespaceNamespacesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var response = _namespaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryNamespaceResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new NamespaceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -463,7 +463,7 @@ public virtual Response Get(CancellationToken c /// /// /// Resource - /// + /// /// /// /// @@ -471,12 +471,12 @@ public virtual Response Get(CancellationToken c /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _deviceRegistryNamespaceNamespacesClientDiagnostics.CreateScope("DeviceRegistryNamespaceResource.Delete"); + using var scope = _namespaceClientDiagnostics.CreateScope("NamespaceResource.Delete"); scope.Start(); try { - var response = await _deviceRegistryNamespaceNamespacesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new DeviceRegistryArmOperation(_deviceRegistryNamespaceNamespacesClientDiagnostics, Pipeline, _deviceRegistryNamespaceNamespacesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _namespaceRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DeviceRegistryArmOperation(_namespaceClientDiagnostics, Pipeline, _namespaceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -505,7 +505,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Resource - /// + /// /// /// /// @@ -513,12 +513,12 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _deviceRegistryNamespaceNamespacesClientDiagnostics.CreateScope("DeviceRegistryNamespaceResource.Delete"); + using var scope = _namespaceClientDiagnostics.CreateScope("NamespaceResource.Delete"); scope.Start(); try { - var response = _deviceRegistryNamespaceNamespacesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new DeviceRegistryArmOperation(_deviceRegistryNamespaceNamespacesClientDiagnostics, Pipeline, _deviceRegistryNamespaceNamespacesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _namespaceRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new DeviceRegistryArmOperation(_namespaceClientDiagnostics, Pipeline, _namespaceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -547,7 +547,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Resource - /// + /// /// /// /// @@ -555,16 +555,16 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// The resource properties to be updated. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, DeviceRegistryNamespacePatch patch, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, NamespacePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _deviceRegistryNamespaceNamespacesClientDiagnostics.CreateScope("DeviceRegistryNamespaceResource.Update"); + using var scope = _namespaceClientDiagnostics.CreateScope("NamespaceResource.Update"); scope.Start(); try { - var response = await _deviceRegistryNamespaceNamespacesRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryNamespaceOperationSource(Client), _deviceRegistryNamespaceNamespacesClientDiagnostics, Pipeline, _deviceRegistryNamespaceNamespacesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = await _namespaceRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new DeviceRegistryArmOperation(new NamespaceOperationSource(Client), _namespaceClientDiagnostics, Pipeline, _namespaceRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -593,7 +593,7 @@ public virtual async Task> UpdateA /// /// /// Resource - /// + /// /// /// /// @@ -601,16 +601,16 @@ public virtual async Task> UpdateA /// The resource properties to be updated. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, DeviceRegistryNamespacePatch patch, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, NamespacePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _deviceRegistryNamespaceNamespacesClientDiagnostics.CreateScope("DeviceRegistryNamespaceResource.Update"); + using var scope = _namespaceClientDiagnostics.CreateScope("NamespaceResource.Update"); scope.Start(); try { - var response = _deviceRegistryNamespaceNamespacesRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryNamespaceOperationSource(Client), _deviceRegistryNamespaceNamespacesClientDiagnostics, Pipeline, _deviceRegistryNamespaceNamespacesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = _namespaceRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new DeviceRegistryArmOperation(new NamespaceOperationSource(Client), _namespaceClientDiagnostics, Pipeline, _namespaceRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -639,7 +639,7 @@ public virtual ArmOperation Update(WaitUntil wa /// /// /// Resource - /// + /// /// /// /// @@ -651,12 +651,12 @@ public virtual async Task MigrateAsync(WaitUntil waitUntil, Namesp { Argument.AssertNotNull(content, nameof(content)); - using var scope = _deviceRegistryNamespaceNamespacesClientDiagnostics.CreateScope("DeviceRegistryNamespaceResource.Migrate"); + using var scope = _namespaceClientDiagnostics.CreateScope("NamespaceResource.Migrate"); scope.Start(); try { - var response = await _deviceRegistryNamespaceNamespacesRestClient.MigrateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new DeviceRegistryArmOperation(_deviceRegistryNamespaceNamespacesClientDiagnostics, Pipeline, _deviceRegistryNamespaceNamespacesRestClient.CreateMigrateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = await _namespaceRestClient.MigrateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new DeviceRegistryArmOperation(_namespaceClientDiagnostics, Pipeline, _namespaceRestClient.CreateMigrateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -685,7 +685,7 @@ public virtual async Task MigrateAsync(WaitUntil waitUntil, Namesp /// /// /// Resource - /// + /// /// /// /// @@ -697,12 +697,12 @@ public virtual ArmOperation Migrate(WaitUntil waitUntil, NamespaceMigrateContent { Argument.AssertNotNull(content, nameof(content)); - using var scope = _deviceRegistryNamespaceNamespacesClientDiagnostics.CreateScope("DeviceRegistryNamespaceResource.Migrate"); + using var scope = _namespaceClientDiagnostics.CreateScope("NamespaceResource.Migrate"); scope.Start(); try { - var response = _deviceRegistryNamespaceNamespacesRestClient.Migrate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new DeviceRegistryArmOperation(_deviceRegistryNamespaceNamespacesClientDiagnostics, Pipeline, _deviceRegistryNamespaceNamespacesRestClient.CreateMigrateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = _namespaceRestClient.Migrate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new DeviceRegistryArmOperation(_namespaceClientDiagnostics, Pipeline, _namespaceRestClient.CreateMigrateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -731,7 +731,7 @@ public virtual ArmOperation Migrate(WaitUntil waitUntil, NamespaceMigrateContent /// /// /// Resource - /// + /// /// /// /// @@ -739,12 +739,12 @@ public virtual ArmOperation Migrate(WaitUntil waitUntil, NamespaceMigrateContent /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _deviceRegistryNamespaceNamespacesClientDiagnostics.CreateScope("DeviceRegistryNamespaceResource.AddTag"); + using var scope = _namespaceClientDiagnostics.CreateScope("NamespaceResource.AddTag"); scope.Start(); try { @@ -753,13 +753,13 @@ public virtual async Task> AddTagAsync var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _deviceRegistryNamespaceNamespacesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DeviceRegistryNamespaceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _namespaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new NamespaceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new DeviceRegistryNamespacePatch(); + var patch = new NamespacePatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -793,7 +793,7 @@ public virtual async Task> AddTagAsync /// /// /// Resource - /// + /// /// /// /// @@ -801,12 +801,12 @@ public virtual async Task> AddTagAsync /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _deviceRegistryNamespaceNamespacesClientDiagnostics.CreateScope("DeviceRegistryNamespaceResource.AddTag"); + using var scope = _namespaceClientDiagnostics.CreateScope("NamespaceResource.AddTag"); scope.Start(); try { @@ -815,13 +815,13 @@ public virtual Response AddTag(string key, stri var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deviceRegistryNamespaceNamespacesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new DeviceRegistryNamespaceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _namespaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new NamespaceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DeviceRegistryNamespacePatch(); + var patch = new NamespacePatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -855,18 +855,18 @@ public virtual Response AddTag(string key, stri /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _deviceRegistryNamespaceNamespacesClientDiagnostics.CreateScope("DeviceRegistryNamespaceResource.SetTags"); + using var scope = _namespaceClientDiagnostics.CreateScope("NamespaceResource.SetTags"); scope.Start(); try { @@ -876,13 +876,13 @@ public virtual async Task> SetTagsAsyn var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _deviceRegistryNamespaceNamespacesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DeviceRegistryNamespaceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _namespaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new NamespaceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new DeviceRegistryNamespacePatch(); + var patch = new NamespacePatch(); patch.Tags.ReplaceWith(tags); var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(result.Value, result.GetRawResponse()); @@ -912,18 +912,18 @@ public virtual async Task> SetTagsAsyn /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _deviceRegistryNamespaceNamespacesClientDiagnostics.CreateScope("DeviceRegistryNamespaceResource.SetTags"); + using var scope = _namespaceClientDiagnostics.CreateScope("NamespaceResource.SetTags"); scope.Start(); try { @@ -933,13 +933,13 @@ public virtual Response SetTags(IDictionary SetTags(IDictionary /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _deviceRegistryNamespaceNamespacesClientDiagnostics.CreateScope("DeviceRegistryNamespaceResource.RemoveTag"); + using var scope = _namespaceClientDiagnostics.CreateScope("NamespaceResource.RemoveTag"); scope.Start(); try { @@ -989,13 +989,13 @@ public virtual async Task> RemoveTagAs var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _deviceRegistryNamespaceNamespacesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DeviceRegistryNamespaceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _namespaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new NamespaceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new DeviceRegistryNamespacePatch(); + var patch = new NamespacePatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -1029,18 +1029,18 @@ public virtual async Task> RemoveTagAs /// /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _deviceRegistryNamespaceNamespacesClientDiagnostics.CreateScope("DeviceRegistryNamespaceResource.RemoveTag"); + using var scope = _namespaceClientDiagnostics.CreateScope("NamespaceResource.RemoveTag"); scope.Start(); try { @@ -1049,13 +1049,13 @@ public virtual Response RemoveTag(string key, C var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deviceRegistryNamespaceNamespacesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new DeviceRegistryNamespaceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _namespaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new NamespaceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DeviceRegistryNamespacePatch(); + var patch = new NamespacePatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/NamespaceAssetsRestOperations.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/NamespaceAssetsRestOperations.cs index 327a3762619a..87012492f42f 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/NamespaceAssetsRestOperations.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/NamespaceAssetsRestOperations.cs @@ -82,7 +82,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -95,13 +95,13 @@ public async Task> GetAsync(string su { case 200: { - DeviceRegistryNamespaceAssetData value = default; + NamespaceAssetData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DeviceRegistryNamespaceAssetData.DeserializeDeviceRegistryNamespaceAssetData(document.RootElement); + value = NamespaceAssetData.DeserializeNamespaceAssetData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((DeviceRegistryNamespaceAssetData)null, message.Response); + return Response.FromValue((NamespaceAssetData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -115,7 +115,7 @@ public async Task> GetAsync(string su /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -128,19 +128,19 @@ public Response Get(string subscriptionId, str { case 200: { - DeviceRegistryNamespaceAssetData value = default; + NamespaceAssetData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DeviceRegistryNamespaceAssetData.DeserializeDeviceRegistryNamespaceAssetData(document.RootElement); + value = NamespaceAssetData.DeserializeNamespaceAssetData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((DeviceRegistryNamespaceAssetData)null, message.Response); + return Response.FromValue((NamespaceAssetData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, DeviceRegistryNamespaceAssetData data) + internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, NamespaceAssetData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -156,7 +156,7 @@ internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId return uri; } - internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, DeviceRegistryNamespaceAssetData data) + internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, NamespaceAssetData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -191,7 +191,7 @@ internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateOrReplaceAsync(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, DeviceRegistryNamespaceAssetData data, CancellationToken cancellationToken = default) + public async Task CreateOrReplaceAsync(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, NamespaceAssetData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -220,7 +220,7 @@ public async Task CreateOrReplaceAsync(string subscriptionId, string r /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrReplace(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, DeviceRegistryNamespaceAssetData data, CancellationToken cancellationToken = default) + public Response CreateOrReplace(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, NamespaceAssetData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -240,7 +240,7 @@ public Response CreateOrReplace(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, DeviceRegistryNamespaceAssetPatch patch) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, NamespaceAssetPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -256,7 +256,7 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, DeviceRegistryNamespaceAssetPatch patch) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, NamespaceAssetPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -291,7 +291,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, DeviceRegistryNamespaceAssetPatch patch, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, NamespaceAssetPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -320,7 +320,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, DeviceRegistryNamespaceAssetPatch patch, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string namespaceName, string assetName, NamespaceAssetPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/NamespaceDevicesRestOperations.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/NamespaceDevicesRestOperations.cs index 235a3ff4b4ef..c4f19ac7215b 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/NamespaceDevicesRestOperations.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/NamespaceDevicesRestOperations.cs @@ -82,7 +82,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -95,13 +95,13 @@ public async Task> GetAsync(string s { case 200: { - DeviceRegistryNamespaceDeviceData value = default; + NamespaceDeviceData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DeviceRegistryNamespaceDeviceData.DeserializeDeviceRegistryNamespaceDeviceData(document.RootElement); + value = NamespaceDeviceData.DeserializeNamespaceDeviceData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((DeviceRegistryNamespaceDeviceData)null, message.Response); + return Response.FromValue((NamespaceDeviceData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -115,7 +115,7 @@ public async Task> GetAsync(string s /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -128,19 +128,19 @@ public Response Get(string subscriptionId, st { case 200: { - DeviceRegistryNamespaceDeviceData value = default; + NamespaceDeviceData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DeviceRegistryNamespaceDeviceData.DeserializeDeviceRegistryNamespaceDeviceData(document.RootElement); + value = NamespaceDeviceData.DeserializeNamespaceDeviceData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((DeviceRegistryNamespaceDeviceData)null, message.Response); + return Response.FromValue((NamespaceDeviceData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, DeviceRegistryNamespaceDeviceData data) + internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, NamespaceDeviceData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -156,7 +156,7 @@ internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId return uri; } - internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, DeviceRegistryNamespaceDeviceData data) + internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, NamespaceDeviceData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -191,7 +191,7 @@ internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateOrReplaceAsync(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, DeviceRegistryNamespaceDeviceData data, CancellationToken cancellationToken = default) + public async Task CreateOrReplaceAsync(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, NamespaceDeviceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -220,7 +220,7 @@ public async Task CreateOrReplaceAsync(string subscriptionId, string r /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrReplace(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, DeviceRegistryNamespaceDeviceData data, CancellationToken cancellationToken = default) + public Response CreateOrReplace(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, NamespaceDeviceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -240,7 +240,7 @@ public Response CreateOrReplace(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, DeviceRegistryNamespaceDevicePatch patch) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, NamespaceDevicePatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -256,7 +256,7 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, DeviceRegistryNamespaceDevicePatch patch) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, NamespaceDevicePatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -291,7 +291,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, DeviceRegistryNamespaceDevicePatch patch, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, NamespaceDevicePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -320,7 +320,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, DeviceRegistryNamespaceDevicePatch patch, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string namespaceName, string deviceName, NamespaceDevicePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/NamespaceDiscoveredAssetsRestOperations.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/NamespaceDiscoveredAssetsRestOperations.cs index 752de762522a..6ff546a94205 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/NamespaceDiscoveredAssetsRestOperations.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/NamespaceDiscoveredAssetsRestOperations.cs @@ -82,7 +82,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -95,13 +95,13 @@ public async Task> GetAsync { case 200: { - DeviceRegistryNamespaceDiscoveredAssetData value = default; + NamespaceDiscoveredAssetData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DeviceRegistryNamespaceDiscoveredAssetData.DeserializeDeviceRegistryNamespaceDiscoveredAssetData(document.RootElement); + value = NamespaceDiscoveredAssetData.DeserializeNamespaceDiscoveredAssetData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((DeviceRegistryNamespaceDiscoveredAssetData)null, message.Response); + return Response.FromValue((NamespaceDiscoveredAssetData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -115,7 +115,7 @@ public async Task> GetAsync /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -128,19 +128,19 @@ public Response Get(string subscript { case 200: { - DeviceRegistryNamespaceDiscoveredAssetData value = default; + NamespaceDiscoveredAssetData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DeviceRegistryNamespaceDiscoveredAssetData.DeserializeDeviceRegistryNamespaceDiscoveredAssetData(document.RootElement); + value = NamespaceDiscoveredAssetData.DeserializeNamespaceDiscoveredAssetData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((DeviceRegistryNamespaceDiscoveredAssetData)null, message.Response); + return Response.FromValue((NamespaceDiscoveredAssetData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, DeviceRegistryNamespaceDiscoveredAssetData data) + internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, NamespaceDiscoveredAssetData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -156,7 +156,7 @@ internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId return uri; } - internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, DeviceRegistryNamespaceDiscoveredAssetData data) + internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, NamespaceDiscoveredAssetData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -191,7 +191,7 @@ internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateOrReplaceAsync(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, DeviceRegistryNamespaceDiscoveredAssetData data, CancellationToken cancellationToken = default) + public async Task CreateOrReplaceAsync(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, NamespaceDiscoveredAssetData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -220,7 +220,7 @@ public async Task CreateOrReplaceAsync(string subscriptionId, string r /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrReplace(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, DeviceRegistryNamespaceDiscoveredAssetData data, CancellationToken cancellationToken = default) + public Response CreateOrReplace(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, NamespaceDiscoveredAssetData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -240,7 +240,7 @@ public Response CreateOrReplace(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, DeviceRegistryNamespaceDiscoveredAssetPatch patch) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, NamespaceDiscoveredAssetPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -256,7 +256,7 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, DeviceRegistryNamespaceDiscoveredAssetPatch patch) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, NamespaceDiscoveredAssetPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -291,7 +291,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, DeviceRegistryNamespaceDiscoveredAssetPatch patch, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, NamespaceDiscoveredAssetPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -320,7 +320,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, DeviceRegistryNamespaceDiscoveredAssetPatch patch, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredAssetName, NamespaceDiscoveredAssetPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/NamespaceDiscoveredDevicesRestOperations.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/NamespaceDiscoveredDevicesRestOperations.cs index d463a7cd7878..ae47540e6120 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/NamespaceDiscoveredDevicesRestOperations.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/NamespaceDiscoveredDevicesRestOperations.cs @@ -82,7 +82,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -95,13 +95,13 @@ public async Task> GetAsyn { case 200: { - DeviceRegistryNamespaceDiscoveredDeviceData value = default; + NamespaceDiscoveredDeviceData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DeviceRegistryNamespaceDiscoveredDeviceData.DeserializeDeviceRegistryNamespaceDiscoveredDeviceData(document.RootElement); + value = NamespaceDiscoveredDeviceData.DeserializeNamespaceDiscoveredDeviceData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((DeviceRegistryNamespaceDiscoveredDeviceData)null, message.Response); + return Response.FromValue((NamespaceDiscoveredDeviceData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -115,7 +115,7 @@ public async Task> GetAsyn /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -128,19 +128,19 @@ public Response Get(string subscrip { case 200: { - DeviceRegistryNamespaceDiscoveredDeviceData value = default; + NamespaceDiscoveredDeviceData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DeviceRegistryNamespaceDiscoveredDeviceData.DeserializeDeviceRegistryNamespaceDiscoveredDeviceData(document.RootElement); + value = NamespaceDiscoveredDeviceData.DeserializeNamespaceDiscoveredDeviceData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((DeviceRegistryNamespaceDiscoveredDeviceData)null, message.Response); + return Response.FromValue((NamespaceDiscoveredDeviceData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, DeviceRegistryNamespaceDiscoveredDeviceData data) + internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, NamespaceDiscoveredDeviceData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -156,7 +156,7 @@ internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId return uri; } - internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, DeviceRegistryNamespaceDiscoveredDeviceData data) + internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, NamespaceDiscoveredDeviceData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -191,7 +191,7 @@ internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateOrReplaceAsync(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, DeviceRegistryNamespaceDiscoveredDeviceData data, CancellationToken cancellationToken = default) + public async Task CreateOrReplaceAsync(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, NamespaceDiscoveredDeviceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -220,7 +220,7 @@ public async Task CreateOrReplaceAsync(string subscriptionId, string r /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrReplace(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, DeviceRegistryNamespaceDiscoveredDeviceData data, CancellationToken cancellationToken = default) + public Response CreateOrReplace(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, NamespaceDiscoveredDeviceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -240,7 +240,7 @@ public Response CreateOrReplace(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, DeviceRegistryNamespaceDiscoveredDevicePatch patch) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, NamespaceDiscoveredDevicePatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -256,7 +256,7 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, DeviceRegistryNamespaceDiscoveredDevicePatch patch) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, NamespaceDiscoveredDevicePatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -291,7 +291,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, DeviceRegistryNamespaceDiscoveredDevicePatch patch, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, NamespaceDiscoveredDevicePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -320,7 +320,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, DeviceRegistryNamespaceDiscoveredDevicePatch patch, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string namespaceName, string discoveredDeviceName, NamespaceDiscoveredDevicePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/NamespacesRestOperations.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/NamespacesRestOperations.cs index 540f852ce3ff..b6531bd55085 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/NamespacesRestOperations.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/NamespacesRestOperations.cs @@ -77,7 +77,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -89,13 +89,13 @@ public async Task> GetAsync(string subscri { case 200: { - DeviceRegistryNamespaceData value = default; + NamespaceData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DeviceRegistryNamespaceData.DeserializeDeviceRegistryNamespaceData(document.RootElement); + value = NamespaceData.DeserializeNamespaceData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((DeviceRegistryNamespaceData)null, message.Response); + return Response.FromValue((NamespaceData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -108,7 +108,7 @@ public async Task> GetAsync(string subscri /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -120,19 +120,19 @@ public Response Get(string subscriptionId, string r { case 200: { - DeviceRegistryNamespaceData value = default; + NamespaceData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DeviceRegistryNamespaceData.DeserializeDeviceRegistryNamespaceData(document.RootElement); + value = NamespaceData.DeserializeNamespaceData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((DeviceRegistryNamespaceData)null, message.Response); + return Response.FromValue((NamespaceData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId, string resourceGroupName, string namespaceName, DeviceRegistryNamespaceData data) + internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId, string resourceGroupName, string namespaceName, NamespaceData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -146,7 +146,7 @@ internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId return uri; } - internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string resourceGroupName, string namespaceName, DeviceRegistryNamespaceData data) + internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string resourceGroupName, string namespaceName, NamespaceData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -178,7 +178,7 @@ internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task CreateOrReplaceAsync(string subscriptionId, string resourceGroupName, string namespaceName, DeviceRegistryNamespaceData data, CancellationToken cancellationToken = default) + public async Task CreateOrReplaceAsync(string subscriptionId, string resourceGroupName, string namespaceName, NamespaceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -205,7 +205,7 @@ public async Task CreateOrReplaceAsync(string subscriptionId, string r /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response CreateOrReplace(string subscriptionId, string resourceGroupName, string namespaceName, DeviceRegistryNamespaceData data, CancellationToken cancellationToken = default) + public Response CreateOrReplace(string subscriptionId, string resourceGroupName, string namespaceName, NamespaceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -224,7 +224,7 @@ public Response CreateOrReplace(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string namespaceName, DeviceRegistryNamespacePatch patch) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string namespaceName, NamespacePatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -238,7 +238,7 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string namespaceName, DeviceRegistryNamespacePatch patch) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string namespaceName, NamespacePatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -270,7 +270,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string namespaceName, DeviceRegistryNamespacePatch patch, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string namespaceName, NamespacePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -297,7 +297,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string namespaceName, DeviceRegistryNamespacePatch patch, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string namespaceName, NamespacePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceAssetCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceAssetCollection.cs similarity index 69% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceAssetCollection.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceAssetCollection.cs index 0e7b6fb173ad..79f6ba49e2a2 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceAssetCollection.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceAssetCollection.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Samples { - public partial class Sample_DeviceRegistryNamespaceAssetCollection + public partial class Sample_NamespaceAssetCollection { [Test] [Ignore("Only validating compilation of examples")] @@ -28,22 +28,22 @@ public async Task CreateOrUpdate_CreateOrReplaceNamespaceAsset() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceAssetResource - DeviceRegistryNamespaceAssetCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceAssets(); + // get the collection of this NamespaceAssetResource + NamespaceAssetCollection collection = @namespace.GetNamespaceAssets(); // invoke the operation string assetName = "my-asset-1"; - DeviceRegistryNamespaceAssetData data = new DeviceRegistryNamespaceAssetData(new AzureLocation("West Europe"), new DeviceRegistryExtendedLocation("CustomLocation", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1")) + NamespaceAssetData data = new NamespaceAssetData(new AzureLocation("West Europe"), new DeviceRegistryExtendedLocation("CustomLocation", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1")) { - Properties = new DeviceRegistryNamespaceAssetProperties(new DeviceRef("device1", "opcuaendpointname")) + Properties = new NamespaceAssetProperties(new DeviceRef("device1", "opcuaendpointname")) { Enabled = true, ExternalAssetId = "8ZBA6LRHU0A458969", @@ -156,12 +156,12 @@ public async Task CreateOrUpdate_CreateOrReplaceNamespaceAsset() ["site"] = "building-1" }, }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, assetName, data); - DeviceRegistryNamespaceAssetResource result = lro.Value; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, assetName, data); + NamespaceAssetResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceAssetData resourceData = result.Data; + NamespaceAssetData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -178,24 +178,24 @@ public async Task Get_GetNamespaceAsset() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceAssetResource - DeviceRegistryNamespaceAssetCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceAssets(); + // get the collection of this NamespaceAssetResource + NamespaceAssetCollection collection = @namespace.GetNamespaceAssets(); // invoke the operation string assetName = "my-asset-1"; - DeviceRegistryNamespaceAssetResource result = await collection.GetAsync(assetName); + NamespaceAssetResource result = await collection.GetAsync(assetName); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceAssetData resourceData = result.Data; + NamespaceAssetData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -212,23 +212,23 @@ public async Task GetAll_ListNamespaceAssetsByResourceGroup() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "adr-namespace-gbk0925-n01"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceAssetResource - DeviceRegistryNamespaceAssetCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceAssets(); + // get the collection of this NamespaceAssetResource + NamespaceAssetCollection collection = @namespace.GetNamespaceAssets(); // invoke the operation and iterate over the result - await foreach (DeviceRegistryNamespaceAssetResource item in collection.GetAllAsync()) + await foreach (NamespaceAssetResource item in collection.GetAllAsync()) { // the variable item is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceAssetData resourceData = item.Data; + NamespaceAssetData resourceData = item.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -248,16 +248,16 @@ public async Task Exists_GetNamespaceAsset() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceAssetResource - DeviceRegistryNamespaceAssetCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceAssets(); + // get the collection of this NamespaceAssetResource + NamespaceAssetCollection collection = @namespace.GetNamespaceAssets(); // invoke the operation string assetName = "my-asset-1"; @@ -278,21 +278,21 @@ public async Task GetIfExists_GetNamespaceAsset() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceAssetResource - DeviceRegistryNamespaceAssetCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceAssets(); + // get the collection of this NamespaceAssetResource + NamespaceAssetCollection collection = @namespace.GetNamespaceAssets(); // invoke the operation string assetName = "my-asset-1"; - NullableResponse response = await collection.GetIfExistsAsync(assetName); - DeviceRegistryNamespaceAssetResource result = response.HasValue ? response.Value : null; + NullableResponse response = await collection.GetIfExistsAsync(assetName); + NamespaceAssetResource result = response.HasValue ? response.Value : null; if (result == null) { @@ -302,7 +302,7 @@ public async Task GetIfExists_GetNamespaceAsset() { // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceAssetData resourceData = result.Data; + NamespaceAssetData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceAssetResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceAssetResource.cs similarity index 62% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceAssetResource.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceAssetResource.cs index 57672b2ab740..f7965f4efc36 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceAssetResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceAssetResource.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Samples { - public partial class Sample_DeviceRegistryNamespaceAssetResource + public partial class Sample_NamespaceAssetResource { [Test] [Ignore("Only validating compilation of examples")] @@ -28,21 +28,21 @@ public async Task Get_GetNamespaceAsset() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceAssetResource created on azure - // for more information of creating DeviceRegistryNamespaceAssetResource, please refer to the document of DeviceRegistryNamespaceAssetResource + // this example assumes you already have this NamespaceAssetResource created on azure + // for more information of creating NamespaceAssetResource, please refer to the document of NamespaceAssetResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; string assetName = "my-asset-1"; - ResourceIdentifier deviceRegistryNamespaceAssetResourceId = DeviceRegistryNamespaceAssetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, assetName); - DeviceRegistryNamespaceAssetResource deviceRegistryNamespaceAsset = client.GetDeviceRegistryNamespaceAssetResource(deviceRegistryNamespaceAssetResourceId); + ResourceIdentifier namespaceAssetResourceId = NamespaceAssetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, assetName); + NamespaceAssetResource namespaceAsset = client.GetNamespaceAssetResource(namespaceAssetResourceId); // invoke the operation - DeviceRegistryNamespaceAssetResource result = await deviceRegistryNamespaceAsset.GetAsync(); + NamespaceAssetResource result = await namespaceAsset.GetAsync(); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceAssetData resourceData = result.Data; + NamespaceAssetData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -59,17 +59,17 @@ public async Task Delete_DeleteNamespaceAsset() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceAssetResource created on azure - // for more information of creating DeviceRegistryNamespaceAssetResource, please refer to the document of DeviceRegistryNamespaceAssetResource + // this example assumes you already have this NamespaceAssetResource created on azure + // for more information of creating NamespaceAssetResource, please refer to the document of NamespaceAssetResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "adr-namespace-gbk0925-n01"; string assetName = "adr-asset-gbk0925-n01"; - ResourceIdentifier deviceRegistryNamespaceAssetResourceId = DeviceRegistryNamespaceAssetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, assetName); - DeviceRegistryNamespaceAssetResource deviceRegistryNamespaceAsset = client.GetDeviceRegistryNamespaceAssetResource(deviceRegistryNamespaceAssetResourceId); + ResourceIdentifier namespaceAssetResourceId = NamespaceAssetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, assetName); + NamespaceAssetResource namespaceAsset = client.GetNamespaceAssetResource(namespaceAssetResourceId); // invoke the operation - await deviceRegistryNamespaceAsset.DeleteAsync(WaitUntil.Completed); + await namespaceAsset.DeleteAsync(WaitUntil.Completed); Console.WriteLine("Succeeded"); } @@ -86,17 +86,17 @@ public async Task Update_UpdateNamespaceAssets() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceAssetResource created on azure - // for more information of creating DeviceRegistryNamespaceAssetResource, please refer to the document of DeviceRegistryNamespaceAssetResource + // this example assumes you already have this NamespaceAssetResource created on azure + // for more information of creating NamespaceAssetResource, please refer to the document of NamespaceAssetResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; string assetName = "my-asset-1"; - ResourceIdentifier deviceRegistryNamespaceAssetResourceId = DeviceRegistryNamespaceAssetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, assetName); - DeviceRegistryNamespaceAssetResource deviceRegistryNamespaceAsset = client.GetDeviceRegistryNamespaceAssetResource(deviceRegistryNamespaceAssetResourceId); + ResourceIdentifier namespaceAssetResourceId = NamespaceAssetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, assetName); + NamespaceAssetResource namespaceAsset = client.GetNamespaceAssetResource(namespaceAssetResourceId); // invoke the operation - DeviceRegistryNamespaceAssetPatch patch = new DeviceRegistryNamespaceAssetPatch + NamespaceAssetPatch patch = new NamespaceAssetPatch { Properties = new NamespaceAssetUpdateProperties { @@ -105,12 +105,12 @@ public async Task Update_UpdateNamespaceAssets() Description = "This is a sample updated Asset", }, }; - ArmOperation lro = await deviceRegistryNamespaceAsset.UpdateAsync(WaitUntil.Completed, patch); - DeviceRegistryNamespaceAssetResource result = lro.Value; + ArmOperation lro = await namespaceAsset.UpdateAsync(WaitUntil.Completed, patch); + NamespaceAssetResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceAssetData resourceData = result.Data; + NamespaceAssetData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceCollection.cs similarity index 82% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceCollection.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceCollection.cs index 86a14b24464a..2caf52a3734b 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceCollection.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceCollection.cs @@ -16,7 +16,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Samples { - public partial class Sample_DeviceRegistryNamespaceCollection + public partial class Sample_NamespaceCollection { [Test] [Ignore("Only validating compilation of examples")] @@ -37,14 +37,14 @@ public async Task CreateOrUpdate_CreateOrReplaceNamespaceWithEndpoints() ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - // get the collection of this DeviceRegistryNamespaceResource - DeviceRegistryNamespaceCollection collection = resourceGroupResource.GetDeviceRegistryNamespaces(); + // get the collection of this NamespaceResource + NamespaceCollection collection = resourceGroupResource.GetNamespaces(); // invoke the operation string namespaceName = "adr-namespace-gbk0925-n01"; - DeviceRegistryNamespaceData data = new DeviceRegistryNamespaceData(new AzureLocation("North Europe")) + NamespaceData data = new NamespaceData(new AzureLocation("North Europe")) { - Properties = new DeviceRegistryNamespaceProperties + Properties = new NamespaceProperties { MessagingEndpoints = { @@ -60,12 +60,12 @@ public async Task CreateOrUpdate_CreateOrReplaceNamespaceWithEndpoints() }, Identity = new ManagedServiceIdentity("SystemAssigned"), }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, namespaceName, data); - DeviceRegistryNamespaceResource result = lro.Value; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, namespaceName, data); + NamespaceResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceData resourceData = result.Data; + NamespaceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -89,16 +89,16 @@ public async Task Get_GetNamespace() ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - // get the collection of this DeviceRegistryNamespaceResource - DeviceRegistryNamespaceCollection collection = resourceGroupResource.GetDeviceRegistryNamespaces(); + // get the collection of this NamespaceResource + NamespaceCollection collection = resourceGroupResource.GetNamespaces(); // invoke the operation string namespaceName = "adr-namespace-gbk0925-n01"; - DeviceRegistryNamespaceResource result = await collection.GetAsync(namespaceName); + NamespaceResource result = await collection.GetAsync(namespaceName); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceData resourceData = result.Data; + NamespaceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -122,15 +122,15 @@ public async Task GetAll_ListNamespacesByResourceGroup() ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - // get the collection of this DeviceRegistryNamespaceResource - DeviceRegistryNamespaceCollection collection = resourceGroupResource.GetDeviceRegistryNamespaces(); + // get the collection of this NamespaceResource + NamespaceCollection collection = resourceGroupResource.GetNamespaces(); // invoke the operation and iterate over the result - await foreach (DeviceRegistryNamespaceResource item in collection.GetAllAsync()) + await foreach (NamespaceResource item in collection.GetAllAsync()) { // the variable item is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceData resourceData = item.Data; + NamespaceData resourceData = item.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -157,8 +157,8 @@ public async Task Exists_GetNamespace() ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - // get the collection of this DeviceRegistryNamespaceResource - DeviceRegistryNamespaceCollection collection = resourceGroupResource.GetDeviceRegistryNamespaces(); + // get the collection of this NamespaceResource + NamespaceCollection collection = resourceGroupResource.GetNamespaces(); // invoke the operation string namespaceName = "adr-namespace-gbk0925-n01"; @@ -186,13 +186,13 @@ public async Task GetIfExists_GetNamespace() ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - // get the collection of this DeviceRegistryNamespaceResource - DeviceRegistryNamespaceCollection collection = resourceGroupResource.GetDeviceRegistryNamespaces(); + // get the collection of this NamespaceResource + NamespaceCollection collection = resourceGroupResource.GetNamespaces(); // invoke the operation string namespaceName = "adr-namespace-gbk0925-n01"; - NullableResponse response = await collection.GetIfExistsAsync(namespaceName); - DeviceRegistryNamespaceResource result = response.HasValue ? response.Value : null; + NullableResponse response = await collection.GetIfExistsAsync(namespaceName); + NamespaceResource result = response.HasValue ? response.Value : null; if (result == null) { @@ -202,7 +202,7 @@ public async Task GetIfExists_GetNamespace() { // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceData resourceData = result.Data; + NamespaceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceDeviceCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceDeviceCollection.cs similarity index 63% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceDeviceCollection.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceDeviceCollection.cs index 19299ae9f755..9b28a2038ca5 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceDeviceCollection.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceDeviceCollection.cs @@ -15,7 +15,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Samples { - public partial class Sample_DeviceRegistryNamespaceDeviceCollection + public partial class Sample_NamespaceDeviceCollection { [Test] [Ignore("Only validating compilation of examples")] @@ -29,22 +29,22 @@ public async Task CreateOrUpdate_CreateOrReplaceNamespaceDevices() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "adr-namespace-gbk0925-n01"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceDeviceResource - DeviceRegistryNamespaceDeviceCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceDevices(); + // get the collection of this NamespaceDeviceResource + NamespaceDeviceCollection collection = @namespace.GetNamespaceDevices(); // invoke the operation string deviceName = "dev-namespace-gbk0925-n01"; - DeviceRegistryNamespaceDeviceData data = new DeviceRegistryNamespaceDeviceData(new AzureLocation("West Europe")) + NamespaceDeviceData data = new NamespaceDeviceData(new AzureLocation("West Europe")) { - Properties = new DeviceRegistryNamespaceDeviceProperties + Properties = new NamespaceDeviceProperties { Enabled = true, ExternalDeviceId = "adr-smart-device3-7a848b15-af47-40a7-8c06-a3f43314d44f", @@ -66,12 +66,12 @@ public async Task CreateOrUpdate_CreateOrReplaceNamespaceDevices() }, }, }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, deviceName, data); - DeviceRegistryNamespaceDeviceResource result = lro.Value; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, deviceName, data); + NamespaceDeviceResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceDeviceData resourceData = result.Data; + NamespaceDeviceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -88,22 +88,22 @@ public async Task CreateOrUpdate_CreateEdgeEnabledDeviceWithAnonymousHostAuthent // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "adr-namespace-gbk0925-n01"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceDeviceResource - DeviceRegistryNamespaceDeviceCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceDevices(); + // get the collection of this NamespaceDeviceResource + NamespaceDeviceCollection collection = @namespace.GetNamespaceDevices(); // invoke the operation string deviceName = "namespace-device-on-edge"; - DeviceRegistryNamespaceDeviceData data = new DeviceRegistryNamespaceDeviceData(new AzureLocation("West Europe")) + NamespaceDeviceData data = new NamespaceDeviceData(new AzureLocation("West Europe")) { - Properties = new DeviceRegistryNamespaceDeviceProperties + Properties = new NamespaceDeviceProperties { Enabled = true, ExternalDeviceId = "unique-edge-device-identifier", @@ -127,12 +127,12 @@ public async Task CreateOrUpdate_CreateEdgeEnabledDeviceWithAnonymousHostAuthent }, ExtendedLocation = new DeviceRegistryExtendedLocation("CustomLocation", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"), }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, deviceName, data); - DeviceRegistryNamespaceDeviceResource result = lro.Value; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, deviceName, data); + NamespaceDeviceResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceDeviceData resourceData = result.Data; + NamespaceDeviceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -149,22 +149,22 @@ public async Task CreateOrUpdate_CreateEdgeEnabledDeviceWithUsernamesPasswordInb // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "adr-namespace-gbk0925-n01"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceDeviceResource - DeviceRegistryNamespaceDeviceCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceDevices(); + // get the collection of this NamespaceDeviceResource + NamespaceDeviceCollection collection = @namespace.GetNamespaceDevices(); // invoke the operation string deviceName = "namespace-device-on-edge"; - DeviceRegistryNamespaceDeviceData data = new DeviceRegistryNamespaceDeviceData(new AzureLocation("West Europe")) + NamespaceDeviceData data = new NamespaceDeviceData(new AzureLocation("West Europe")) { - Properties = new DeviceRegistryNamespaceDeviceProperties + Properties = new NamespaceDeviceProperties { Enabled = true, ExternalDeviceId = "unique-edge-device-identifier", @@ -191,12 +191,12 @@ public async Task CreateOrUpdate_CreateEdgeEnabledDeviceWithUsernamesPasswordInb }, ExtendedLocation = new DeviceRegistryExtendedLocation("CustomLocation", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"), }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, deviceName, data); - DeviceRegistryNamespaceDeviceResource result = lro.Value; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, deviceName, data); + NamespaceDeviceResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceDeviceData resourceData = result.Data; + NamespaceDeviceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -213,22 +213,22 @@ public async Task CreateOrUpdate_CreateEdgeEnabledDeviceWithX509InboundAuthentic // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "adr-namespace-gbk0925-n01"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceDeviceResource - DeviceRegistryNamespaceDeviceCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceDevices(); + // get the collection of this NamespaceDeviceResource + NamespaceDeviceCollection collection = @namespace.GetNamespaceDevices(); // invoke the operation string deviceName = "namespace-device-on-edge"; - DeviceRegistryNamespaceDeviceData data = new DeviceRegistryNamespaceDeviceData(new AzureLocation("West Europe")) + NamespaceDeviceData data = new NamespaceDeviceData(new AzureLocation("West Europe")) { - Properties = new DeviceRegistryNamespaceDeviceProperties + Properties = new NamespaceDeviceProperties { Enabled = true, ExternalDeviceId = "unique-edge-device-identifier", @@ -268,12 +268,12 @@ public async Task CreateOrUpdate_CreateEdgeEnabledDeviceWithX509InboundAuthentic }, ExtendedLocation = new DeviceRegistryExtendedLocation("CustomLocation", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"), }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, deviceName, data); - DeviceRegistryNamespaceDeviceResource result = lro.Value; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, deviceName, data); + NamespaceDeviceResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceDeviceData resourceData = result.Data; + NamespaceDeviceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -290,24 +290,24 @@ public async Task Get_GetNamespaceDevice() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceDeviceResource - DeviceRegistryNamespaceDeviceCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceDevices(); + // get the collection of this NamespaceDeviceResource + NamespaceDeviceCollection collection = @namespace.GetNamespaceDevices(); // invoke the operation string deviceName = "my-device-name"; - DeviceRegistryNamespaceDeviceResource result = await collection.GetAsync(deviceName); + NamespaceDeviceResource result = await collection.GetAsync(deviceName); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceDeviceData resourceData = result.Data; + NamespaceDeviceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -324,24 +324,24 @@ public async Task Get_GetNamespaceDeviceWithEndpointErrorStatus() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceDeviceResource - DeviceRegistryNamespaceDeviceCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceDevices(); + // get the collection of this NamespaceDeviceResource + NamespaceDeviceCollection collection = @namespace.GetNamespaceDevices(); // invoke the operation string deviceName = "my-device-name"; - DeviceRegistryNamespaceDeviceResource result = await collection.GetAsync(deviceName); + NamespaceDeviceResource result = await collection.GetAsync(deviceName); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceDeviceData resourceData = result.Data; + NamespaceDeviceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -358,23 +358,23 @@ public async Task GetAll_ListNamespaceDevicesByResourceGroup() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "adr-namespace-gbk0925-n01"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceDeviceResource - DeviceRegistryNamespaceDeviceCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceDevices(); + // get the collection of this NamespaceDeviceResource + NamespaceDeviceCollection collection = @namespace.GetNamespaceDevices(); // invoke the operation and iterate over the result - await foreach (DeviceRegistryNamespaceDeviceResource item in collection.GetAllAsync()) + await foreach (NamespaceDeviceResource item in collection.GetAllAsync()) { // the variable item is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceDeviceData resourceData = item.Data; + NamespaceDeviceData resourceData = item.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -394,16 +394,16 @@ public async Task Exists_GetNamespaceDevice() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceDeviceResource - DeviceRegistryNamespaceDeviceCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceDevices(); + // get the collection of this NamespaceDeviceResource + NamespaceDeviceCollection collection = @namespace.GetNamespaceDevices(); // invoke the operation string deviceName = "my-device-name"; @@ -424,16 +424,16 @@ public async Task Exists_GetNamespaceDeviceWithEndpointErrorStatus() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceDeviceResource - DeviceRegistryNamespaceDeviceCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceDevices(); + // get the collection of this NamespaceDeviceResource + NamespaceDeviceCollection collection = @namespace.GetNamespaceDevices(); // invoke the operation string deviceName = "my-device-name"; @@ -454,21 +454,21 @@ public async Task GetIfExists_GetNamespaceDevice() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceDeviceResource - DeviceRegistryNamespaceDeviceCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceDevices(); + // get the collection of this NamespaceDeviceResource + NamespaceDeviceCollection collection = @namespace.GetNamespaceDevices(); // invoke the operation string deviceName = "my-device-name"; - NullableResponse response = await collection.GetIfExistsAsync(deviceName); - DeviceRegistryNamespaceDeviceResource result = response.HasValue ? response.Value : null; + NullableResponse response = await collection.GetIfExistsAsync(deviceName); + NamespaceDeviceResource result = response.HasValue ? response.Value : null; if (result == null) { @@ -478,7 +478,7 @@ public async Task GetIfExists_GetNamespaceDevice() { // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceDeviceData resourceData = result.Data; + NamespaceDeviceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -496,21 +496,21 @@ public async Task GetIfExists_GetNamespaceDeviceWithEndpointErrorStatus() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceDeviceResource - DeviceRegistryNamespaceDeviceCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceDevices(); + // get the collection of this NamespaceDeviceResource + NamespaceDeviceCollection collection = @namespace.GetNamespaceDevices(); // invoke the operation string deviceName = "my-device-name"; - NullableResponse response = await collection.GetIfExistsAsync(deviceName); - DeviceRegistryNamespaceDeviceResource result = response.HasValue ? response.Value : null; + NullableResponse response = await collection.GetIfExistsAsync(deviceName); + NamespaceDeviceResource result = response.HasValue ? response.Value : null; if (result == null) { @@ -520,7 +520,7 @@ public async Task GetIfExists_GetNamespaceDeviceWithEndpointErrorStatus() { // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceDeviceData resourceData = result.Data; + NamespaceDeviceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceDeviceResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceDeviceResource.cs similarity index 65% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceDeviceResource.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceDeviceResource.cs index b60702a65902..a182f3c32cfc 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceDeviceResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceDeviceResource.cs @@ -15,7 +15,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Samples { - public partial class Sample_DeviceRegistryNamespaceDeviceResource + public partial class Sample_NamespaceDeviceResource { [Test] [Ignore("Only validating compilation of examples")] @@ -29,21 +29,21 @@ public async Task Get_GetNamespaceDevice() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceDeviceResource created on azure - // for more information of creating DeviceRegistryNamespaceDeviceResource, please refer to the document of DeviceRegistryNamespaceDeviceResource + // this example assumes you already have this NamespaceDeviceResource created on azure + // for more information of creating NamespaceDeviceResource, please refer to the document of NamespaceDeviceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; string deviceName = "my-device-name"; - ResourceIdentifier deviceRegistryNamespaceDeviceResourceId = DeviceRegistryNamespaceDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, deviceName); - DeviceRegistryNamespaceDeviceResource deviceRegistryNamespaceDevice = client.GetDeviceRegistryNamespaceDeviceResource(deviceRegistryNamespaceDeviceResourceId); + ResourceIdentifier namespaceDeviceResourceId = NamespaceDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, deviceName); + NamespaceDeviceResource namespaceDevice = client.GetNamespaceDeviceResource(namespaceDeviceResourceId); // invoke the operation - DeviceRegistryNamespaceDeviceResource result = await deviceRegistryNamespaceDevice.GetAsync(); + NamespaceDeviceResource result = await namespaceDevice.GetAsync(); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceDeviceData resourceData = result.Data; + NamespaceDeviceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -60,21 +60,21 @@ public async Task Get_GetNamespaceDeviceWithEndpointErrorStatus() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceDeviceResource created on azure - // for more information of creating DeviceRegistryNamespaceDeviceResource, please refer to the document of DeviceRegistryNamespaceDeviceResource + // this example assumes you already have this NamespaceDeviceResource created on azure + // for more information of creating NamespaceDeviceResource, please refer to the document of NamespaceDeviceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; string deviceName = "my-device-name"; - ResourceIdentifier deviceRegistryNamespaceDeviceResourceId = DeviceRegistryNamespaceDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, deviceName); - DeviceRegistryNamespaceDeviceResource deviceRegistryNamespaceDevice = client.GetDeviceRegistryNamespaceDeviceResource(deviceRegistryNamespaceDeviceResourceId); + ResourceIdentifier namespaceDeviceResourceId = NamespaceDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, deviceName); + NamespaceDeviceResource namespaceDevice = client.GetNamespaceDeviceResource(namespaceDeviceResourceId); // invoke the operation - DeviceRegistryNamespaceDeviceResource result = await deviceRegistryNamespaceDevice.GetAsync(); + NamespaceDeviceResource result = await namespaceDevice.GetAsync(); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceDeviceData resourceData = result.Data; + NamespaceDeviceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -91,17 +91,17 @@ public async Task Delete_DeleteNamespaceDevice() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceDeviceResource created on azure - // for more information of creating DeviceRegistryNamespaceDeviceResource, please refer to the document of DeviceRegistryNamespaceDeviceResource + // this example assumes you already have this NamespaceDeviceResource created on azure + // for more information of creating NamespaceDeviceResource, please refer to the document of NamespaceDeviceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "adr-namespace-gbk0925-n01"; string deviceName = "adr-device-gbk0925-n01"; - ResourceIdentifier deviceRegistryNamespaceDeviceResourceId = DeviceRegistryNamespaceDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, deviceName); - DeviceRegistryNamespaceDeviceResource deviceRegistryNamespaceDevice = client.GetDeviceRegistryNamespaceDeviceResource(deviceRegistryNamespaceDeviceResourceId); + ResourceIdentifier namespaceDeviceResourceId = NamespaceDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, deviceName); + NamespaceDeviceResource namespaceDevice = client.GetNamespaceDeviceResource(namespaceDeviceResourceId); // invoke the operation - await deviceRegistryNamespaceDevice.DeleteAsync(WaitUntil.Completed); + await namespaceDevice.DeleteAsync(WaitUntil.Completed); Console.WriteLine("Succeeded"); } @@ -118,17 +118,17 @@ public async Task Update_UpdateNamespaceDevices() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceDeviceResource created on azure - // for more information of creating DeviceRegistryNamespaceDeviceResource, please refer to the document of DeviceRegistryNamespaceDeviceResource + // this example assumes you already have this NamespaceDeviceResource created on azure + // for more information of creating NamespaceDeviceResource, please refer to the document of NamespaceDeviceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "adr-namespace-gbk0925-n01"; string deviceName = "dev-namespace-gbk0925-n01"; - ResourceIdentifier deviceRegistryNamespaceDeviceResourceId = DeviceRegistryNamespaceDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, deviceName); - DeviceRegistryNamespaceDeviceResource deviceRegistryNamespaceDevice = client.GetDeviceRegistryNamespaceDeviceResource(deviceRegistryNamespaceDeviceResourceId); + ResourceIdentifier namespaceDeviceResourceId = NamespaceDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, deviceName); + NamespaceDeviceResource namespaceDevice = client.GetNamespaceDeviceResource(namespaceDeviceResourceId); // invoke the operation - DeviceRegistryNamespaceDevicePatch patch = new DeviceRegistryNamespaceDevicePatch + NamespaceDevicePatch patch = new NamespaceDevicePatch { Properties = new NamespaceDeviceUpdateProperties { @@ -151,12 +151,12 @@ public async Task Update_UpdateNamespaceDevices() Enabled = true, }, }; - ArmOperation lro = await deviceRegistryNamespaceDevice.UpdateAsync(WaitUntil.Completed, patch); - DeviceRegistryNamespaceDeviceResource result = lro.Value; + ArmOperation lro = await namespaceDevice.UpdateAsync(WaitUntil.Completed, patch); + NamespaceDeviceResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceDeviceData resourceData = result.Data; + NamespaceDeviceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceDiscoveredAssetCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceDiscoveredAssetCollection.cs similarity index 69% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceDiscoveredAssetCollection.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceDiscoveredAssetCollection.cs index 020201f3f30e..e6185c4ecdcf 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceDiscoveredAssetCollection.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceDiscoveredAssetCollection.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Samples { - public partial class Sample_DeviceRegistryNamespaceDiscoveredAssetCollection + public partial class Sample_NamespaceDiscoveredAssetCollection { [Test] [Ignore("Only validating compilation of examples")] @@ -28,22 +28,22 @@ public async Task CreateOrUpdate_CreateOrReplaceNamespaceDiscoveredAsset() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceDiscoveredAssetResource - DeviceRegistryNamespaceDiscoveredAssetCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceDiscoveredAssets(); + // get the collection of this NamespaceDiscoveredAssetResource + NamespaceDiscoveredAssetCollection collection = @namespace.GetNamespaceDiscoveredAssets(); // invoke the operation string discoveredAssetName = "my-discoveredasset-1"; - DeviceRegistryNamespaceDiscoveredAssetData data = new DeviceRegistryNamespaceDiscoveredAssetData(new AzureLocation("West Europe"), new DeviceRegistryExtendedLocation("CustomLocation", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1")) + NamespaceDiscoveredAssetData data = new NamespaceDiscoveredAssetData(new AzureLocation("West Europe"), new DeviceRegistryExtendedLocation("CustomLocation", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1")) { - Properties = new DeviceRegistryNamespaceDiscoveredAssetProperties(new DeviceRef("myDevice", "opcuaendpointname"), "11111111-1111-1111-1111-111111111111", 73766L) + Properties = new NamespaceDiscoveredAssetProperties(new DeviceRef("myDevice", "opcuaendpointname"), "11111111-1111-1111-1111-111111111111", 73766L) { AssetTypeRefs = { "myAssetTypeRef1", "myAssetTypeRef2" }, Manufacturer = "Contoso", @@ -161,12 +161,12 @@ public async Task CreateOrUpdate_CreateOrReplaceNamespaceDiscoveredAsset() ["site"] = "building-1" }, }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, discoveredAssetName, data); - DeviceRegistryNamespaceDiscoveredAssetResource result = lro.Value; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, discoveredAssetName, data); + NamespaceDiscoveredAssetResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceDiscoveredAssetData resourceData = result.Data; + NamespaceDiscoveredAssetData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -183,24 +183,24 @@ public async Task Get_GetNamespaceDiscoveredAsset() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceDiscoveredAssetResource - DeviceRegistryNamespaceDiscoveredAssetCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceDiscoveredAssets(); + // get the collection of this NamespaceDiscoveredAssetResource + NamespaceDiscoveredAssetCollection collection = @namespace.GetNamespaceDiscoveredAssets(); // invoke the operation string discoveredAssetName = "my-discoveredasset-1"; - DeviceRegistryNamespaceDiscoveredAssetResource result = await collection.GetAsync(discoveredAssetName); + NamespaceDiscoveredAssetResource result = await collection.GetAsync(discoveredAssetName); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceDiscoveredAssetData resourceData = result.Data; + NamespaceDiscoveredAssetData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -217,23 +217,23 @@ public async Task GetAll_ListNamespaceDiscoveredAssetsByResourceGroup() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceDiscoveredAssetResource - DeviceRegistryNamespaceDiscoveredAssetCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceDiscoveredAssets(); + // get the collection of this NamespaceDiscoveredAssetResource + NamespaceDiscoveredAssetCollection collection = @namespace.GetNamespaceDiscoveredAssets(); // invoke the operation and iterate over the result - await foreach (DeviceRegistryNamespaceDiscoveredAssetResource item in collection.GetAllAsync()) + await foreach (NamespaceDiscoveredAssetResource item in collection.GetAllAsync()) { // the variable item is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceDiscoveredAssetData resourceData = item.Data; + NamespaceDiscoveredAssetData resourceData = item.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -253,16 +253,16 @@ public async Task Exists_GetNamespaceDiscoveredAsset() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceDiscoveredAssetResource - DeviceRegistryNamespaceDiscoveredAssetCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceDiscoveredAssets(); + // get the collection of this NamespaceDiscoveredAssetResource + NamespaceDiscoveredAssetCollection collection = @namespace.GetNamespaceDiscoveredAssets(); // invoke the operation string discoveredAssetName = "my-discoveredasset-1"; @@ -283,21 +283,21 @@ public async Task GetIfExists_GetNamespaceDiscoveredAsset() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceDiscoveredAssetResource - DeviceRegistryNamespaceDiscoveredAssetCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceDiscoveredAssets(); + // get the collection of this NamespaceDiscoveredAssetResource + NamespaceDiscoveredAssetCollection collection = @namespace.GetNamespaceDiscoveredAssets(); // invoke the operation string discoveredAssetName = "my-discoveredasset-1"; - NullableResponse response = await collection.GetIfExistsAsync(discoveredAssetName); - DeviceRegistryNamespaceDiscoveredAssetResource result = response.HasValue ? response.Value : null; + NullableResponse response = await collection.GetIfExistsAsync(discoveredAssetName); + NamespaceDiscoveredAssetResource result = response.HasValue ? response.Value : null; if (result == null) { @@ -307,7 +307,7 @@ public async Task GetIfExists_GetNamespaceDiscoveredAsset() { // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceDiscoveredAssetData resourceData = result.Data; + NamespaceDiscoveredAssetData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceDiscoveredAssetResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceDiscoveredAssetResource.cs similarity index 59% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceDiscoveredAssetResource.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceDiscoveredAssetResource.cs index 98ce9ebb3e30..927a28333e18 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceDiscoveredAssetResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceDiscoveredAssetResource.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Samples { - public partial class Sample_DeviceRegistryNamespaceDiscoveredAssetResource + public partial class Sample_NamespaceDiscoveredAssetResource { [Test] [Ignore("Only validating compilation of examples")] @@ -28,21 +28,21 @@ public async Task Get_GetNamespaceDiscoveredAsset() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceDiscoveredAssetResource created on azure - // for more information of creating DeviceRegistryNamespaceDiscoveredAssetResource, please refer to the document of DeviceRegistryNamespaceDiscoveredAssetResource + // this example assumes you already have this NamespaceDiscoveredAssetResource created on azure + // for more information of creating NamespaceDiscoveredAssetResource, please refer to the document of NamespaceDiscoveredAssetResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; string discoveredAssetName = "my-discoveredasset-1"; - ResourceIdentifier deviceRegistryNamespaceDiscoveredAssetResourceId = DeviceRegistryNamespaceDiscoveredAssetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, discoveredAssetName); - DeviceRegistryNamespaceDiscoveredAssetResource deviceRegistryNamespaceDiscoveredAsset = client.GetDeviceRegistryNamespaceDiscoveredAssetResource(deviceRegistryNamespaceDiscoveredAssetResourceId); + ResourceIdentifier namespaceDiscoveredAssetResourceId = NamespaceDiscoveredAssetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, discoveredAssetName); + NamespaceDiscoveredAssetResource namespaceDiscoveredAsset = client.GetNamespaceDiscoveredAssetResource(namespaceDiscoveredAssetResourceId); // invoke the operation - DeviceRegistryNamespaceDiscoveredAssetResource result = await deviceRegistryNamespaceDiscoveredAsset.GetAsync(); + NamespaceDiscoveredAssetResource result = await namespaceDiscoveredAsset.GetAsync(); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceDiscoveredAssetData resourceData = result.Data; + NamespaceDiscoveredAssetData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -59,17 +59,17 @@ public async Task Delete_DeleteNamespaceDiscoveredAsset() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceDiscoveredAssetResource created on azure - // for more information of creating DeviceRegistryNamespaceDiscoveredAssetResource, please refer to the document of DeviceRegistryNamespaceDiscoveredAssetResource + // this example assumes you already have this NamespaceDiscoveredAssetResource created on azure + // for more information of creating NamespaceDiscoveredAssetResource, please refer to the document of NamespaceDiscoveredAssetResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; string discoveredAssetName = "my-discoveredasset-1"; - ResourceIdentifier deviceRegistryNamespaceDiscoveredAssetResourceId = DeviceRegistryNamespaceDiscoveredAssetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, discoveredAssetName); - DeviceRegistryNamespaceDiscoveredAssetResource deviceRegistryNamespaceDiscoveredAsset = client.GetDeviceRegistryNamespaceDiscoveredAssetResource(deviceRegistryNamespaceDiscoveredAssetResourceId); + ResourceIdentifier namespaceDiscoveredAssetResourceId = NamespaceDiscoveredAssetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, discoveredAssetName); + NamespaceDiscoveredAssetResource namespaceDiscoveredAsset = client.GetNamespaceDiscoveredAssetResource(namespaceDiscoveredAssetResourceId); // invoke the operation - await deviceRegistryNamespaceDiscoveredAsset.DeleteAsync(WaitUntil.Completed); + await namespaceDiscoveredAsset.DeleteAsync(WaitUntil.Completed); Console.WriteLine("Succeeded"); } @@ -86,29 +86,29 @@ public async Task Update_UpdateNamespaceDiscoveredAsset() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceDiscoveredAssetResource created on azure - // for more information of creating DeviceRegistryNamespaceDiscoveredAssetResource, please refer to the document of DeviceRegistryNamespaceDiscoveredAssetResource + // this example assumes you already have this NamespaceDiscoveredAssetResource created on azure + // for more information of creating NamespaceDiscoveredAssetResource, please refer to the document of NamespaceDiscoveredAssetResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; string discoveredAssetName = "my-discoveredasset-1"; - ResourceIdentifier deviceRegistryNamespaceDiscoveredAssetResourceId = DeviceRegistryNamespaceDiscoveredAssetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, discoveredAssetName); - DeviceRegistryNamespaceDiscoveredAssetResource deviceRegistryNamespaceDiscoveredAsset = client.GetDeviceRegistryNamespaceDiscoveredAssetResource(deviceRegistryNamespaceDiscoveredAssetResourceId); + ResourceIdentifier namespaceDiscoveredAssetResourceId = NamespaceDiscoveredAssetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, discoveredAssetName); + NamespaceDiscoveredAssetResource namespaceDiscoveredAsset = client.GetNamespaceDiscoveredAssetResource(namespaceDiscoveredAssetResourceId); // invoke the operation - DeviceRegistryNamespaceDiscoveredAssetPatch patch = new DeviceRegistryNamespaceDiscoveredAssetPatch + NamespaceDiscoveredAssetPatch patch = new NamespaceDiscoveredAssetPatch { Properties = new NamespaceDiscoveredAssetUpdateProperties { DocumentationUri = "https://www.example.com/manual-2", }, }; - ArmOperation lro = await deviceRegistryNamespaceDiscoveredAsset.UpdateAsync(WaitUntil.Completed, patch); - DeviceRegistryNamespaceDiscoveredAssetResource result = lro.Value; + ArmOperation lro = await namespaceDiscoveredAsset.UpdateAsync(WaitUntil.Completed, patch); + NamespaceDiscoveredAssetResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceDiscoveredAssetData resourceData = result.Data; + NamespaceDiscoveredAssetData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceDiscoveredDeviceCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceDiscoveredDeviceCollection.cs similarity index 58% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceDiscoveredDeviceCollection.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceDiscoveredDeviceCollection.cs index 986b39b2b1b0..4c421783f4b2 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceDiscoveredDeviceCollection.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceDiscoveredDeviceCollection.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Samples { - public partial class Sample_DeviceRegistryNamespaceDiscoveredDeviceCollection + public partial class Sample_NamespaceDiscoveredDeviceCollection { [Test] [Ignore("Only validating compilation of examples")] @@ -28,22 +28,22 @@ public async Task CreateOrUpdate_CreateOrReplaceNamespaceDiscoveredDevice() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceDiscoveredDeviceResource - DeviceRegistryNamespaceDiscoveredDeviceCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceDiscoveredDevices(); + // get the collection of this NamespaceDiscoveredDeviceResource + NamespaceDiscoveredDeviceCollection collection = @namespace.GetNamespaceDiscoveredDevices(); // invoke the operation string discoveredDeviceName = "my-discovereddevice-1"; - DeviceRegistryNamespaceDiscoveredDeviceData data = new DeviceRegistryNamespaceDiscoveredDeviceData(new AzureLocation("West Europe"), new DeviceRegistryExtendedLocation("CustomLocation", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1")) + NamespaceDiscoveredDeviceData data = new NamespaceDiscoveredDeviceData(new AzureLocation("West Europe"), new DeviceRegistryExtendedLocation("CustomLocation", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1")) { - Properties = new DeviceRegistryNamespaceDiscoveredDeviceProperties("discoveryId1", 1L) + Properties = new NamespaceDiscoveredDeviceProperties("discoveryId1", 1L) { Endpoints = new DiscoveredMessagingEndpoints { @@ -61,12 +61,12 @@ public async Task CreateOrUpdate_CreateOrReplaceNamespaceDiscoveredDevice() ["site"] = "building-1" }, }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, discoveredDeviceName, data); - DeviceRegistryNamespaceDiscoveredDeviceResource result = lro.Value; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, discoveredDeviceName, data); + NamespaceDiscoveredDeviceResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceDiscoveredDeviceData resourceData = result.Data; + NamespaceDiscoveredDeviceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -83,24 +83,24 @@ public async Task Get_GetNamespaceDiscoveredDevice() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceDiscoveredDeviceResource - DeviceRegistryNamespaceDiscoveredDeviceCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceDiscoveredDevices(); + // get the collection of this NamespaceDiscoveredDeviceResource + NamespaceDiscoveredDeviceCollection collection = @namespace.GetNamespaceDiscoveredDevices(); // invoke the operation string discoveredDeviceName = "my-discovereddevice-1"; - DeviceRegistryNamespaceDiscoveredDeviceResource result = await collection.GetAsync(discoveredDeviceName); + NamespaceDiscoveredDeviceResource result = await collection.GetAsync(discoveredDeviceName); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceDiscoveredDeviceData resourceData = result.Data; + NamespaceDiscoveredDeviceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -117,23 +117,23 @@ public async Task GetAll_ListNamespaceDiscoveredDevicesByResourceGroup() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceDiscoveredDeviceResource - DeviceRegistryNamespaceDiscoveredDeviceCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceDiscoveredDevices(); + // get the collection of this NamespaceDiscoveredDeviceResource + NamespaceDiscoveredDeviceCollection collection = @namespace.GetNamespaceDiscoveredDevices(); // invoke the operation and iterate over the result - await foreach (DeviceRegistryNamespaceDiscoveredDeviceResource item in collection.GetAllAsync()) + await foreach (NamespaceDiscoveredDeviceResource item in collection.GetAllAsync()) { // the variable item is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceDiscoveredDeviceData resourceData = item.Data; + NamespaceDiscoveredDeviceData resourceData = item.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -153,16 +153,16 @@ public async Task Exists_GetNamespaceDiscoveredDevice() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceDiscoveredDeviceResource - DeviceRegistryNamespaceDiscoveredDeviceCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceDiscoveredDevices(); + // get the collection of this NamespaceDiscoveredDeviceResource + NamespaceDiscoveredDeviceCollection collection = @namespace.GetNamespaceDiscoveredDevices(); // invoke the operation string discoveredDeviceName = "my-discovereddevice-1"; @@ -183,21 +183,21 @@ public async Task GetIfExists_GetNamespaceDiscoveredDevice() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); - // get the collection of this DeviceRegistryNamespaceDiscoveredDeviceResource - DeviceRegistryNamespaceDiscoveredDeviceCollection collection = deviceRegistryNamespace.GetDeviceRegistryNamespaceDiscoveredDevices(); + // get the collection of this NamespaceDiscoveredDeviceResource + NamespaceDiscoveredDeviceCollection collection = @namespace.GetNamespaceDiscoveredDevices(); // invoke the operation string discoveredDeviceName = "my-discovereddevice-1"; - NullableResponse response = await collection.GetIfExistsAsync(discoveredDeviceName); - DeviceRegistryNamespaceDiscoveredDeviceResource result = response.HasValue ? response.Value : null; + NullableResponse response = await collection.GetIfExistsAsync(discoveredDeviceName); + NamespaceDiscoveredDeviceResource result = response.HasValue ? response.Value : null; if (result == null) { @@ -207,7 +207,7 @@ public async Task GetIfExists_GetNamespaceDiscoveredDevice() { // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceDiscoveredDeviceData resourceData = result.Data; + NamespaceDiscoveredDeviceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceDiscoveredDeviceResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceDiscoveredDeviceResource.cs similarity index 60% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceDiscoveredDeviceResource.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceDiscoveredDeviceResource.cs index c2e2fe52f7e9..a2e944872df8 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceDiscoveredDeviceResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceDiscoveredDeviceResource.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Samples { - public partial class Sample_DeviceRegistryNamespaceDiscoveredDeviceResource + public partial class Sample_NamespaceDiscoveredDeviceResource { [Test] [Ignore("Only validating compilation of examples")] @@ -28,21 +28,21 @@ public async Task Get_GetNamespaceDiscoveredDevice() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceDiscoveredDeviceResource created on azure - // for more information of creating DeviceRegistryNamespaceDiscoveredDeviceResource, please refer to the document of DeviceRegistryNamespaceDiscoveredDeviceResource + // this example assumes you already have this NamespaceDiscoveredDeviceResource created on azure + // for more information of creating NamespaceDiscoveredDeviceResource, please refer to the document of NamespaceDiscoveredDeviceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; string discoveredDeviceName = "my-discovereddevice-1"; - ResourceIdentifier deviceRegistryNamespaceDiscoveredDeviceResourceId = DeviceRegistryNamespaceDiscoveredDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, discoveredDeviceName); - DeviceRegistryNamespaceDiscoveredDeviceResource deviceRegistryNamespaceDiscoveredDevice = client.GetDeviceRegistryNamespaceDiscoveredDeviceResource(deviceRegistryNamespaceDiscoveredDeviceResourceId); + ResourceIdentifier namespaceDiscoveredDeviceResourceId = NamespaceDiscoveredDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, discoveredDeviceName); + NamespaceDiscoveredDeviceResource namespaceDiscoveredDevice = client.GetNamespaceDiscoveredDeviceResource(namespaceDiscoveredDeviceResourceId); // invoke the operation - DeviceRegistryNamespaceDiscoveredDeviceResource result = await deviceRegistryNamespaceDiscoveredDevice.GetAsync(); + NamespaceDiscoveredDeviceResource result = await namespaceDiscoveredDevice.GetAsync(); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceDiscoveredDeviceData resourceData = result.Data; + NamespaceDiscoveredDeviceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -59,17 +59,17 @@ public async Task Delete_DeleteNamespaceDiscoveredDevice() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceDiscoveredDeviceResource created on azure - // for more information of creating DeviceRegistryNamespaceDiscoveredDeviceResource, please refer to the document of DeviceRegistryNamespaceDiscoveredDeviceResource + // this example assumes you already have this NamespaceDiscoveredDeviceResource created on azure + // for more information of creating NamespaceDiscoveredDeviceResource, please refer to the document of NamespaceDiscoveredDeviceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; string discoveredDeviceName = "my-discovereddevice-1"; - ResourceIdentifier deviceRegistryNamespaceDiscoveredDeviceResourceId = DeviceRegistryNamespaceDiscoveredDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, discoveredDeviceName); - DeviceRegistryNamespaceDiscoveredDeviceResource deviceRegistryNamespaceDiscoveredDevice = client.GetDeviceRegistryNamespaceDiscoveredDeviceResource(deviceRegistryNamespaceDiscoveredDeviceResourceId); + ResourceIdentifier namespaceDiscoveredDeviceResourceId = NamespaceDiscoveredDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, discoveredDeviceName); + NamespaceDiscoveredDeviceResource namespaceDiscoveredDevice = client.GetNamespaceDiscoveredDeviceResource(namespaceDiscoveredDeviceResourceId); // invoke the operation - await deviceRegistryNamespaceDiscoveredDevice.DeleteAsync(WaitUntil.Completed); + await namespaceDiscoveredDevice.DeleteAsync(WaitUntil.Completed); Console.WriteLine("Succeeded"); } @@ -86,17 +86,17 @@ public async Task Update_UpdateNamespaceDiscoveredDevice() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceDiscoveredDeviceResource created on azure - // for more information of creating DeviceRegistryNamespaceDiscoveredDeviceResource, please refer to the document of DeviceRegistryNamespaceDiscoveredDeviceResource + // this example assumes you already have this NamespaceDiscoveredDeviceResource created on azure + // for more information of creating NamespaceDiscoveredDeviceResource, please refer to the document of NamespaceDiscoveredDeviceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; string discoveredDeviceName = "my-discovereddevice-1"; - ResourceIdentifier deviceRegistryNamespaceDiscoveredDeviceResourceId = DeviceRegistryNamespaceDiscoveredDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, discoveredDeviceName); - DeviceRegistryNamespaceDiscoveredDeviceResource deviceRegistryNamespaceDiscoveredDevice = client.GetDeviceRegistryNamespaceDiscoveredDeviceResource(deviceRegistryNamespaceDiscoveredDeviceResourceId); + ResourceIdentifier namespaceDiscoveredDeviceResourceId = NamespaceDiscoveredDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName, discoveredDeviceName); + NamespaceDiscoveredDeviceResource namespaceDiscoveredDevice = client.GetNamespaceDiscoveredDeviceResource(namespaceDiscoveredDeviceResourceId); // invoke the operation - DeviceRegistryNamespaceDiscoveredDevicePatch patch = new DeviceRegistryNamespaceDiscoveredDevicePatch + NamespaceDiscoveredDevicePatch patch = new NamespaceDiscoveredDevicePatch { Properties = new NamespaceDiscoveredDeviceUpdateProperties { @@ -112,12 +112,12 @@ public async Task Update_UpdateNamespaceDiscoveredDevice() }, }, }; - ArmOperation lro = await deviceRegistryNamespaceDiscoveredDevice.UpdateAsync(WaitUntil.Completed, patch); - DeviceRegistryNamespaceDiscoveredDeviceResource result = lro.Value; + ArmOperation lro = await namespaceDiscoveredDevice.UpdateAsync(WaitUntil.Completed, patch); + NamespaceDiscoveredDeviceResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceDiscoveredDeviceData resourceData = result.Data; + NamespaceDiscoveredDeviceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceResource.cs similarity index 65% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceResource.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceResource.cs index 83287468888c..582543f9490d 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_DeviceRegistryNamespaceResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_NamespaceResource.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Samples { - public partial class Sample_DeviceRegistryNamespaceResource + public partial class Sample_NamespaceResource { [Test] [Ignore("Only validating compilation of examples")] @@ -28,20 +28,20 @@ public async Task Get_GetNamespace() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "adr-namespace-gbk0925-n01"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); // invoke the operation - DeviceRegistryNamespaceResource result = await deviceRegistryNamespace.GetAsync(); + NamespaceResource result = await @namespace.GetAsync(); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceData resourceData = result.Data; + NamespaceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -58,16 +58,16 @@ public async Task Delete_DeleteNamespace() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "adr-namespace-gbk0925-n01"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); // invoke the operation - await deviceRegistryNamespace.DeleteAsync(WaitUntil.Completed); + await @namespace.DeleteAsync(WaitUntil.Completed); Console.WriteLine("Succeeded"); } @@ -84,16 +84,16 @@ public async Task Update_UpdateNamespaceEndpoints() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "adr-namespace-gbk0925-n01"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); // invoke the operation - DeviceRegistryNamespacePatch patch = new DeviceRegistryNamespacePatch + NamespacePatch patch = new NamespacePatch { MessagingEndpoints = { @@ -103,12 +103,12 @@ public async Task Update_UpdateNamespaceEndpoints() } }, }; - ArmOperation lro = await deviceRegistryNamespace.UpdateAsync(WaitUntil.Completed, patch); - DeviceRegistryNamespaceResource result = lro.Value; + ArmOperation lro = await @namespace.UpdateAsync(WaitUntil.Completed, patch); + NamespaceResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceData resourceData = result.Data; + NamespaceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -125,13 +125,13 @@ public async Task Migrate_NamespaceMigrate() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this DeviceRegistryNamespaceResource created on azure - // for more information of creating DeviceRegistryNamespaceResource, please refer to the document of DeviceRegistryNamespaceResource + // this example assumes you already have this NamespaceResource created on azure + // for more information of creating NamespaceResource, please refer to the document of NamespaceResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string namespaceName = "my-namespace-1"; - ResourceIdentifier deviceRegistryNamespaceResourceId = DeviceRegistryNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); - DeviceRegistryNamespaceResource deviceRegistryNamespace = client.GetDeviceRegistryNamespaceResource(deviceRegistryNamespaceResourceId); + ResourceIdentifier namespaceResourceId = NamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName); + NamespaceResource @namespace = client.GetNamespaceResource(namespaceResourceId); // invoke the operation NamespaceMigrateContent content = new NamespaceMigrateContent @@ -139,7 +139,7 @@ public async Task Migrate_NamespaceMigrate() Scope = Scope.Resources, ResourceIds = { "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assets/my-asset-1", "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assets/my-asset-2", "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assets/my-asset-3" }, }; - await deviceRegistryNamespace.MigrateAsync(WaitUntil.Completed, content); + await @namespace.MigrateAsync(WaitUntil.Completed, content); Console.WriteLine("Succeeded"); } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 8442f7ccc36d..1d10eb3018c2 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -80,7 +80,7 @@ public async Task GetDeviceRegistryAssetEndpointProfiles_ListAssetEndpointProfil [Test] [Ignore("Only validating compilation of examples")] - public async Task GetDeviceRegistryNamespaces_ListNamespacesBySubscription() + public async Task GetNamespaces_ListNamespacesBySubscription() { // Generated from example definition: 2025-10-01/List_Namespace_BySubscription.json // this example is just showing the usage of "Namespace_ListBySubscription" operation, for the dependent resources, they will have to be created separately. @@ -97,11 +97,11 @@ public async Task GetDeviceRegistryNamespaces_ListNamespacesBySubscription() SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation and iterate over the result - await foreach (DeviceRegistryNamespaceResource item in subscriptionResource.GetDeviceRegistryNamespacesAsync()) + await foreach (NamespaceResource item in subscriptionResource.GetNamespacesAsync()) { // the variable item is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryNamespaceData resourceData = item.Data; + NamespaceData resourceData = item.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tsp-location.yaml b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tsp-location.yaml index b0cff0bd043c..43bbd7f58efe 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tsp-location.yaml +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tsp-location.yaml @@ -1,3 +1,3 @@ directory: specification\deviceregistry\DeviceRegistry.Management -commit: 52fc376d009c4d96b89cfc410c11a38358a18f5b +commit: be34b3dfc14f90d51e071cd3fd7cea8d1fa6f32f repo: Azure/azure-rest-api-specs