From 5b4316b1acbafa8bf97d3af9a2b21c7ce751136c Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 6 Feb 2025 22:37:26 +0000 Subject: [PATCH] CodeGen from PR 32479 in Azure/azure-rest-api-specs Merge e78d8c8fee1c5f56c41928114c15025c2cee0859 into cdd0874bc93c651e711e2f06a866e5f9358a443e --- ...e.ResourceManager.DeviceRegistry.net8.0.cs | 572 ------------- ...ceManager.DeviceRegistry.netstandard2.0.cs | 572 ------------- .../Sample_DeviceRegistryAssetCollection.cs | 22 +- ...eRegistryAssetEndpointProfileCollection.cs | 18 +- ...iceRegistryAssetEndpointProfileResource.cs | 8 +- .../Sample_DeviceRegistryAssetResource.cs | 8 +- ...eviceRegistryBillingContainerCollection.cs | 8 +- ..._DeviceRegistryBillingContainerResource.cs | 2 +- .../Sample_SubscriptionResourceExtensions.cs | 97 +-- .../ArmDeviceRegistryModelFactory.cs | 245 ------ .../DeviceRegistryAssetCollection.cs | 20 +- ...eRegistryAssetEndpointProfileCollection.cs | 20 +- ...iceRegistryAssetEndpointProfileResource.cs | 24 +- .../Generated/DeviceRegistryAssetResource.cs | 24 +- ...eviceRegistryBillingContainerCollection.cs | 16 +- .../DeviceRegistryBillingContainerResource.cs | 4 +- ...DeviceRegistryDiscoveredAssetCollection.cs | 494 ----------- ...gistryDiscoveredAssetData.Serialization.cs | 187 ----- .../DeviceRegistryDiscoveredAssetData.cs | 92 --- ...iscoveredAssetEndpointProfileCollection.cs | 494 ----------- ...dAssetEndpointProfileData.Serialization.cs | 187 ----- ...istryDiscoveredAssetEndpointProfileData.cs | 92 --- ...etEndpointProfileResource.Serialization.cs | 26 - ...yDiscoveredAssetEndpointProfileResource.cs | 707 ---------------- ...ryDiscoveredAssetResource.Serialization.cs | 26 - .../DeviceRegistryDiscoveredAssetResource.cs | 707 ---------------- .../DeviceRegistrySchemaCollection.cs | 497 ----------- .../DeviceRegistrySchemaData.Serialization.cs | 155 ---- .../src/Generated/DeviceRegistrySchemaData.cs | 75 -- .../DeviceRegistrySchemaRegistryCollection.cs | 494 ----------- ...egistrySchemaRegistryData.Serialization.cs | 194 ----- .../DeviceRegistrySchemaRegistryData.cs | 87 -- ...trySchemaRegistryResource.Serialization.cs | 26 - .../DeviceRegistrySchemaRegistryResource.cs | 776 ------------------ ...iceRegistrySchemaResource.Serialization.cs | 26 - .../Generated/DeviceRegistrySchemaResource.cs | 424 ---------- .../DeviceRegistrySchemaVersionCollection.cs | 497 ----------- ...RegistrySchemaVersionData.Serialization.cs | 155 ---- .../DeviceRegistrySchemaVersionData.cs | 75 -- ...strySchemaVersionResource.Serialization.cs | 26 - .../DeviceRegistrySchemaVersionResource.cs | 356 -------- .../Extensions/DeviceRegistryExtensions.cs | 610 +------------- .../MockableDeviceRegistryArmClient.cs | 60 -- ...ableDeviceRegistryResourceGroupResource.cs | 215 +---- ...kableDeviceRegistrySubscriptionResource.cs | 204 +---- ...eredAssetEndpointProfileOperationSource.cs | 38 - ...eRegistryDiscoveredAssetOperationSource.cs | 38 - ...ceRegistrySchemaRegistryOperationSource.cs | 38 - ...AssetEndpointProfilePatch.Serialization.cs | 159 ---- ...stryDiscoveredAssetEndpointProfilePatch.cs | 70 -- ...istryDiscoveredAssetPatch.Serialization.cs | 159 ---- .../DeviceRegistryDiscoveredAssetPatch.cs | 70 -- ...DiscoveredAssetProperties.Serialization.cs | 358 -------- ...DeviceRegistryDiscoveredAssetProperties.cs | 146 ---- .../Models/DeviceRegistrySchemaFormat.cs | 51 -- ...eRegistrySchemaProperties.Serialization.cs | 216 ----- .../Models/DeviceRegistrySchemaProperties.cs | 99 --- ...gistrySchemaRegistryPatch.Serialization.cs | 175 ---- .../DeviceRegistrySchemaRegistryPatch.cs | 75 -- ...ySchemaRegistryProperties.Serialization.cs | 189 ----- .../DeviceRegistrySchemaRegistryProperties.cs | 98 --- .../Models/DeviceRegistrySchemaType.cs | 48 -- ...rySchemaVersionProperties.Serialization.cs | 180 ---- .../DeviceRegistrySchemaVersionProperties.cs | 91 -- ...EndpointProfileListResult.Serialization.cs | 151 ---- ...iscoveredAssetEndpointProfileListResult.cs | 80 -- ...EndpointProfileProperties.Serialization.cs | 209 ----- ...iscoveredAssetEndpointProfileProperties.cs | 108 --- ...ntProfileUpdateProperties.Serialization.cs | 213 ----- ...redAssetEndpointProfileUpdateProperties.cs | 86 -- ...DiscoveredAssetListResult.Serialization.cs | 151 ---- .../Models/DiscoveredAssetListResult.cs | 80 -- ...eredAssetUpdateProperties.Serialization.cs | 343 -------- .../Models/DiscoveredAssetUpdateProperties.cs | 123 --- .../DiscoveredDataPoint.Serialization.cs | 160 ---- .../Generated/Models/DiscoveredDataPoint.cs | 90 -- .../Models/DiscoveredDataset.Serialization.cs | 177 ---- .../src/Generated/Models/DiscoveredDataset.cs | 88 -- .../Models/DiscoveredEvent.Serialization.cs | 181 ---- .../src/Generated/Models/DiscoveredEvent.cs | 94 --- .../Models/SchemaListResult.Serialization.cs | 151 ---- .../src/Generated/Models/SchemaListResult.cs | 80 -- .../SchemaRegistryListResult.Serialization.cs | 151 ---- .../Models/SchemaRegistryListResult.cs | 80 -- ...aRegistryUpdateProperties.Serialization.cs | 140 ---- .../Models/SchemaRegistryUpdateProperties.cs | 69 -- .../SchemaVersionListResult.Serialization.cs | 151 ---- .../Models/SchemaVersionListResult.cs | 80 -- .../AssetEndpointProfilesRestOperations.cs | 2 +- .../RestOperations/AssetsRestOperations.cs | 2 +- .../BillingContainersRestOperations.cs | 2 +- ...eredAssetEndpointProfilesRestOperations.cs | 723 ---------------- .../DiscoveredAssetsRestOperations.cs | 723 ---------------- .../SchemaRegistriesRestOperations.cs | 723 ---------------- .../SchemaVersionsRestOperations.cs | 559 ------------- .../RestOperations/SchemasRestOperations.cs | 523 ------------ .../tsp-location.yaml | 7 +- sdk/resourcemanager/ci.mgmt.yml | 4 +- 98 files changed, 118 insertions(+), 18308 deletions(-) delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetCollection.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetData.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetData.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileCollection.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileData.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileData.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileResource.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileResource.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetResource.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetResource.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaCollection.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaData.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaData.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryCollection.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryData.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryData.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryResource.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryResource.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaResource.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaResource.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionCollection.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionData.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionData.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionResource.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionResource.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryDiscoveredAssetEndpointProfileOperationSource.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryDiscoveredAssetOperationSource.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistrySchemaRegistryOperationSource.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetEndpointProfilePatch.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetEndpointProfilePatch.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetPatch.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetPatch.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetProperties.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetProperties.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaFormat.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaProperties.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaProperties.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryPatch.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryPatch.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryProperties.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryProperties.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaType.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaVersionProperties.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaVersionProperties.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileListResult.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileListResult.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileProperties.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileProperties.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileUpdateProperties.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileUpdateProperties.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetListResult.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetListResult.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetUpdateProperties.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetUpdateProperties.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataPoint.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataPoint.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataset.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataset.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredEvent.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredEvent.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaListResult.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaListResult.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryListResult.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryListResult.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryUpdateProperties.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryUpdateProperties.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaVersionListResult.Serialization.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaVersionListResult.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/DiscoveredAssetEndpointProfilesRestOperations.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/DiscoveredAssetsRestOperations.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/SchemaRegistriesRestOperations.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/SchemaVersionsRestOperations.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/SchemasRestOperations.cs diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/api/Azure.ResourceManager.DeviceRegistry.net8.0.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/api/Azure.ResourceManager.DeviceRegistry.net8.0.cs index d8dce9c4d766..ed80db26a520 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/api/Azure.ResourceManager.DeviceRegistry.net8.0.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/api/Azure.ResourceManager.DeviceRegistry.net8.0.cs @@ -150,114 +150,6 @@ protected DeviceRegistryBillingContainerResource() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DeviceRegistryDiscoveredAssetCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected DeviceRegistryDiscoveredAssetCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string discoveredAssetName, Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string discoveredAssetName, Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Exists(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class DeviceRegistryDiscoveredAssetData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DeviceRegistryDiscoveredAssetData(Azure.Core.AzureLocation location, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation) { } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation ExtendedLocation { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetProperties Properties { get { throw null; } set { } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DeviceRegistryDiscoveredAssetEndpointProfileCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected DeviceRegistryDiscoveredAssetEndpointProfileCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string discoveredAssetEndpointProfileName, Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string discoveredAssetEndpointProfileName, Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Exists(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class DeviceRegistryDiscoveredAssetEndpointProfileData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DeviceRegistryDiscoveredAssetEndpointProfileData(Azure.Core.AzureLocation location, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation) { } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation ExtendedLocation { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileProperties Properties { get { throw null; } set { } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DeviceRegistryDiscoveredAssetEndpointProfileResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public static readonly Azure.Core.ResourceType ResourceType; - protected DeviceRegistryDiscoveredAssetEndpointProfileResource() { } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetEndpointProfilePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetEndpointProfilePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } - public partial class DeviceRegistryDiscoveredAssetResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public static readonly Azure.Core.ResourceType ResourceType; - protected DeviceRegistryDiscoveredAssetResource() { } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string discoveredAssetName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } public static partial class DeviceRegistryExtensions { public static Azure.Response GetDeviceRegistryAsset(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string assetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -276,180 +168,6 @@ public static partial class DeviceRegistryExtensions public static System.Threading.Tasks.Task> GetDeviceRegistryBillingContainerAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerResource GetDeviceRegistryBillingContainerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerCollection GetDeviceRegistryBillingContainers(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource) { throw null; } - public static Azure.Response GetDeviceRegistryDiscoveredAsset(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetDeviceRegistryDiscoveredAssetAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Response GetDeviceRegistryDiscoveredAssetEndpointProfile(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetDeviceRegistryDiscoveredAssetEndpointProfileAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileResource GetDeviceRegistryDiscoveredAssetEndpointProfileResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileCollection GetDeviceRegistryDiscoveredAssetEndpointProfiles(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } - public static Azure.Pageable GetDeviceRegistryDiscoveredAssetEndpointProfiles(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.AsyncPageable GetDeviceRegistryDiscoveredAssetEndpointProfilesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetResource GetDeviceRegistryDiscoveredAssetResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetCollection GetDeviceRegistryDiscoveredAssets(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } - public static Azure.Pageable GetDeviceRegistryDiscoveredAssets(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.AsyncPageable GetDeviceRegistryDiscoveredAssetsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryCollection GetDeviceRegistrySchemaRegistries(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } - public static Azure.Pageable GetDeviceRegistrySchemaRegistries(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.AsyncPageable GetDeviceRegistrySchemaRegistriesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Response GetDeviceRegistrySchemaRegistry(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetDeviceRegistrySchemaRegistryAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryResource GetDeviceRegistrySchemaRegistryResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaResource GetDeviceRegistrySchemaResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionResource GetDeviceRegistrySchemaVersionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - } - public partial class DeviceRegistrySchemaCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected DeviceRegistrySchemaCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string schemaName, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string schemaName, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Exists(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class DeviceRegistrySchemaData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DeviceRegistrySchemaData() { } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaProperties Properties { get { throw null; } set { } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DeviceRegistrySchemaRegistryCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected DeviceRegistrySchemaRegistryCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string schemaRegistryName, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string schemaRegistryName, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Exists(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class DeviceRegistrySchemaRegistryData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DeviceRegistrySchemaRegistryData(Azure.Core.AzureLocation location) { } - public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryProperties Properties { get { throw null; } set { } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DeviceRegistrySchemaRegistryResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public static readonly Azure.Core.ResourceType ResourceType; - protected DeviceRegistrySchemaRegistryResource() { } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string schemaRegistryName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetDeviceRegistrySchema(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetDeviceRegistrySchemaAsync(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaCollection GetDeviceRegistrySchemas() { throw null; } - public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } - public partial class DeviceRegistrySchemaResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public static readonly Azure.Core.ResourceType ResourceType; - protected DeviceRegistrySchemaResource() { } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetDeviceRegistrySchemaVersion(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetDeviceRegistrySchemaVersionAsync(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionCollection GetDeviceRegistrySchemaVersions() { throw null; } - Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } - public partial class DeviceRegistrySchemaVersionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected DeviceRegistrySchemaVersionCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string schemaVersionName, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string schemaVersionName, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Exists(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class DeviceRegistrySchemaVersionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DeviceRegistrySchemaVersionData() { } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaVersionProperties Properties { get { throw null; } set { } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DeviceRegistrySchemaVersionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public static readonly Azure.Core.ResourceType ResourceType; - protected DeviceRegistrySchemaVersionResource() { } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.DeviceRegistry.Mocking @@ -460,11 +178,6 @@ protected MockableDeviceRegistryArmClient() { } public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetEndpointProfileResource GetDeviceRegistryAssetEndpointProfileResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetResource GetDeviceRegistryAssetResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerResource GetDeviceRegistryBillingContainerResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileResource GetDeviceRegistryDiscoveredAssetEndpointProfileResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetResource GetDeviceRegistryDiscoveredAssetResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryResource GetDeviceRegistrySchemaRegistryResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaResource GetDeviceRegistrySchemaResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionResource GetDeviceRegistrySchemaVersionResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableDeviceRegistryResourceGroupResource : Azure.ResourceManager.ArmResource { @@ -475,15 +188,6 @@ protected MockableDeviceRegistryResourceGroupResource() { } public virtual System.Threading.Tasks.Task> GetDeviceRegistryAssetEndpointProfileAsync(string assetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetEndpointProfileCollection GetDeviceRegistryAssetEndpointProfiles() { throw null; } public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetCollection GetDeviceRegistryAssets() { throw null; } - public virtual Azure.Response GetDeviceRegistryDiscoveredAsset(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetDeviceRegistryDiscoveredAssetAsync(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetDeviceRegistryDiscoveredAssetEndpointProfile(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetDeviceRegistryDiscoveredAssetEndpointProfileAsync(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileCollection GetDeviceRegistryDiscoveredAssetEndpointProfiles() { throw null; } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetCollection GetDeviceRegistryDiscoveredAssets() { throw null; } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryCollection GetDeviceRegistrySchemaRegistries() { throw null; } - public virtual Azure.Response GetDeviceRegistrySchemaRegistry(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetDeviceRegistrySchemaRegistryAsync(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class MockableDeviceRegistrySubscriptionResource : Azure.ResourceManager.ArmResource { @@ -495,12 +199,6 @@ protected MockableDeviceRegistrySubscriptionResource() { } public virtual Azure.Response GetDeviceRegistryBillingContainer(string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetDeviceRegistryBillingContainerAsync(string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerCollection GetDeviceRegistryBillingContainers() { throw null; } - public virtual Azure.Pageable GetDeviceRegistryDiscoveredAssetEndpointProfiles(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetDeviceRegistryDiscoveredAssetEndpointProfilesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetDeviceRegistryDiscoveredAssets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetDeviceRegistryDiscoveredAssetsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetDeviceRegistrySchemaRegistries(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetDeviceRegistrySchemaRegistriesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.DeviceRegistry.Models @@ -517,16 +215,6 @@ public static partial class ArmDeviceRegistryModelFactory public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatusError DeviceRegistryAssetStatusError(int? code = default(int?), string message = null) { throw null; } public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatusEvent DeviceRegistryAssetStatusEvent(string name = null, Azure.ResourceManager.DeviceRegistry.Models.MessageSchemaReference messageSchemaReference = null) { throw null; } public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerData DeviceRegistryBillingContainerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? billingContainerProvisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData DeviceRegistryDiscoveredAssetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetProperties properties = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation = null) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData DeviceRegistryDiscoveredAssetEndpointProfileData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileProperties properties = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation = null) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetProperties DeviceRegistryDiscoveredAssetProperties(string assetEndpointProfileRef = null, string discoveryId = null, long version = (long)0, string manufacturer = null, System.Uri manufacturerUri = null, string model = null, string productCode = null, string hardwareRevision = null, string softwareRevision = null, System.Uri documentationUri = null, string serialNumber = null, string defaultDatasetsConfiguration = null, string defaultEventsConfiguration = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic defaultTopic = null, System.Collections.Generic.IEnumerable datasets = null, System.Collections.Generic.IEnumerable events = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?)) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData DeviceRegistrySchemaData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaProperties properties = null) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaProperties DeviceRegistrySchemaProperties(string uuid = null, string displayName = null, string description = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat format = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat), Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType schemaType = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType), Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?), System.Collections.Generic.IDictionary tags = null) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData DeviceRegistrySchemaRegistryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryProperties DeviceRegistrySchemaRegistryProperties(string uuid = null, string @namespace = null, string displayName = null, string description = null, System.Uri storageAccountContainerUri = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?)) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData DeviceRegistrySchemaVersionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaVersionProperties properties = null) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaVersionProperties DeviceRegistrySchemaVersionProperties(string uuid = null, string description = null, string schemaContent = null, string hash = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?)) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileProperties DiscoveredAssetEndpointProfileProperties(System.Uri targetAddress = null, string additionalConfiguration = null, System.Collections.Generic.IEnumerable supportedAuthenticationMethods = null, string endpointProfileType = null, string discoveryId = null, long version = (long)0, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?)) { throw null; } public static Azure.ResourceManager.DeviceRegistry.Models.MessageSchemaReference MessageSchemaReference(string schemaRegistryNamespace = null, string schemaName = null, string schemaVersion = null) { throw null; } } public partial class AssetEndpointProfileStatusError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel @@ -799,57 +487,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DeviceRegistryDiscoveredAssetEndpointProfilePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DeviceRegistryDiscoveredAssetEndpointProfilePatch() { } - public Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileUpdateProperties Properties { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Tags { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetEndpointProfilePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetEndpointProfilePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DeviceRegistryDiscoveredAssetPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DeviceRegistryDiscoveredAssetPatch() { } - public Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetUpdateProperties Properties { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Tags { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DeviceRegistryDiscoveredAssetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DeviceRegistryDiscoveredAssetProperties(string assetEndpointProfileRef, string discoveryId, long version) { } - public string AssetEndpointProfileRef { get { throw null; } set { } } - public System.Collections.Generic.IList Datasets { get { throw null; } } - public string DefaultDatasetsConfiguration { get { throw null; } set { } } - public string DefaultEventsConfiguration { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic DefaultTopic { get { throw null; } set { } } - public string DiscoveryId { get { throw null; } set { } } - public System.Uri DocumentationUri { get { throw null; } set { } } - public System.Collections.Generic.IList Events { get { throw null; } } - public string HardwareRevision { get { throw null; } set { } } - public string Manufacturer { get { throw null; } set { } } - public System.Uri ManufacturerUri { get { throw null; } set { } } - public string Model { get { throw null; } set { } } - public string ProductCode { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } - public string SerialNumber { get { throw null; } set { } } - public string SoftwareRevision { get { throw null; } set { } } - public long Version { get { throw null; } set { } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class DeviceRegistryEvent : Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryEventBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DeviceRegistryEvent(string name, string eventNotifier) : base (default(string), default(string)) { } @@ -908,102 +545,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState left, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState right) { throw null; } public override string ToString() { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct DeviceRegistrySchemaFormat : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public DeviceRegistrySchemaFormat(string value) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat Delta10 { get { throw null; } } - public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat JsonSchemaDraft7 { get { throw null; } } - public bool Equals(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat left, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat right) { throw null; } - public static implicit operator Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat left, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat right) { throw null; } - public override string ToString() { throw null; } - } - public partial class DeviceRegistrySchemaProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DeviceRegistrySchemaProperties(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat format, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType schemaType) { } - public string Description { get { throw null; } set { } } - public string DisplayName { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat Format { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType SchemaType { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Tags { get { throw null; } } - public string Uuid { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DeviceRegistrySchemaRegistryPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DeviceRegistrySchemaRegistryPatch() { } - public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.SchemaRegistryUpdateProperties Properties { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Tags { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DeviceRegistrySchemaRegistryProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DeviceRegistrySchemaRegistryProperties(string @namespace, System.Uri storageAccountContainerUri) { } - public string Description { get { throw null; } set { } } - public string DisplayName { get { throw null; } set { } } - public string Namespace { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } - public System.Uri StorageAccountContainerUri { get { throw null; } set { } } - public string Uuid { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct DeviceRegistrySchemaType : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public DeviceRegistrySchemaType(string value) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType MessageSchema { get { throw null; } } - public bool Equals(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType left, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType right) { throw null; } - public static implicit operator Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType left, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType right) { throw null; } - public override string ToString() { throw null; } - } - public partial class DeviceRegistrySchemaVersionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DeviceRegistrySchemaVersionProperties(string schemaContent) { } - public string Description { get { throw null; } set { } } - public string Hash { get { throw null; } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } - public string SchemaContent { get { throw null; } set { } } - public string Uuid { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaVersionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaVersionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class DeviceRegistryTopic : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DeviceRegistryTopic(string path) { } @@ -1046,107 +587,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DiscoveredAssetEndpointProfileProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DiscoveredAssetEndpointProfileProperties(System.Uri targetAddress, string endpointProfileType, string discoveryId, long version) { } - public string AdditionalConfiguration { get { throw null; } set { } } - public string DiscoveryId { get { throw null; } set { } } - public string EndpointProfileType { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } - public System.Collections.Generic.IList SupportedAuthenticationMethods { get { throw null; } } - public System.Uri TargetAddress { get { throw null; } set { } } - public long Version { get { throw null; } set { } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DiscoveredAssetEndpointProfileUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DiscoveredAssetEndpointProfileUpdateProperties() { } - public string AdditionalConfiguration { get { throw null; } set { } } - public string DiscoveryId { get { throw null; } set { } } - public string EndpointProfileType { get { throw null; } set { } } - public System.Collections.Generic.IList SupportedAuthenticationMethods { get { throw null; } } - public System.Uri TargetAddress { get { throw null; } set { } } - public long? Version { get { throw null; } set { } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DiscoveredAssetUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DiscoveredAssetUpdateProperties() { } - public System.Collections.Generic.IList Datasets { get { throw null; } } - public string DefaultDatasetsConfiguration { get { throw null; } set { } } - public string DefaultEventsConfiguration { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic DefaultTopic { get { throw null; } set { } } - public string DiscoveryId { get { throw null; } set { } } - public System.Uri DocumentationUri { get { throw null; } set { } } - public System.Collections.Generic.IList Events { get { throw null; } } - public string HardwareRevision { get { throw null; } set { } } - public string Manufacturer { get { throw null; } set { } } - public System.Uri ManufacturerUri { get { throw null; } set { } } - public string Model { get { throw null; } set { } } - public string ProductCode { get { throw null; } set { } } - public string SerialNumber { get { throw null; } set { } } - public string SoftwareRevision { get { throw null; } set { } } - public long? Version { get { throw null; } set { } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DiscoveredDataPoint : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DiscoveredDataPoint(string name, string dataSource) { } - public string DataPointConfiguration { get { throw null; } set { } } - public string DataSource { get { throw null; } set { } } - public System.DateTimeOffset? LastUpdatedOn { get { throw null; } set { } } - public string Name { get { throw null; } set { } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DiscoveredDataPoint System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DiscoveredDataPoint System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DiscoveredDataset : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DiscoveredDataset(string name) { } - public System.Collections.Generic.IList DataPoints { get { throw null; } } - public string DatasetConfiguration { get { throw null; } set { } } - public string Name { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic Topic { get { throw null; } set { } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DiscoveredDataset System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DiscoveredDataset System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DiscoveredEvent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DiscoveredEvent(string name, string eventNotifier) { } - public string EventConfiguration { get { throw null; } set { } } - public string EventNotifier { get { throw null; } set { } } - public System.DateTimeOffset? LastUpdatedOn { get { throw null; } set { } } - public string Name { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic Topic { get { throw null; } set { } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DiscoveredEvent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DiscoveredEvent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct EventObservabilityMode : System.IEquatable { @@ -1178,16 +618,4 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class SchemaRegistryUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public SchemaRegistryUpdateProperties() { } - public string Description { get { throw null; } set { } } - public string DisplayName { get { throw null; } set { } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.SchemaRegistryUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.SchemaRegistryUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/api/Azure.ResourceManager.DeviceRegistry.netstandard2.0.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/api/Azure.ResourceManager.DeviceRegistry.netstandard2.0.cs index d8dce9c4d766..ed80db26a520 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/api/Azure.ResourceManager.DeviceRegistry.netstandard2.0.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/api/Azure.ResourceManager.DeviceRegistry.netstandard2.0.cs @@ -150,114 +150,6 @@ protected DeviceRegistryBillingContainerResource() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DeviceRegistryDiscoveredAssetCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected DeviceRegistryDiscoveredAssetCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string discoveredAssetName, Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string discoveredAssetName, Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Exists(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class DeviceRegistryDiscoveredAssetData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DeviceRegistryDiscoveredAssetData(Azure.Core.AzureLocation location, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation) { } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation ExtendedLocation { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetProperties Properties { get { throw null; } set { } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DeviceRegistryDiscoveredAssetEndpointProfileCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected DeviceRegistryDiscoveredAssetEndpointProfileCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string discoveredAssetEndpointProfileName, Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string discoveredAssetEndpointProfileName, Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Exists(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class DeviceRegistryDiscoveredAssetEndpointProfileData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DeviceRegistryDiscoveredAssetEndpointProfileData(Azure.Core.AzureLocation location, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation) { } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation ExtendedLocation { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileProperties Properties { get { throw null; } set { } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DeviceRegistryDiscoveredAssetEndpointProfileResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public static readonly Azure.Core.ResourceType ResourceType; - protected DeviceRegistryDiscoveredAssetEndpointProfileResource() { } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetEndpointProfilePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetEndpointProfilePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } - public partial class DeviceRegistryDiscoveredAssetResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public static readonly Azure.Core.ResourceType ResourceType; - protected DeviceRegistryDiscoveredAssetResource() { } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string discoveredAssetName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } public static partial class DeviceRegistryExtensions { public static Azure.Response GetDeviceRegistryAsset(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string assetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -276,180 +168,6 @@ public static partial class DeviceRegistryExtensions public static System.Threading.Tasks.Task> GetDeviceRegistryBillingContainerAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerResource GetDeviceRegistryBillingContainerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerCollection GetDeviceRegistryBillingContainers(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource) { throw null; } - public static Azure.Response GetDeviceRegistryDiscoveredAsset(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetDeviceRegistryDiscoveredAssetAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Response GetDeviceRegistryDiscoveredAssetEndpointProfile(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetDeviceRegistryDiscoveredAssetEndpointProfileAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileResource GetDeviceRegistryDiscoveredAssetEndpointProfileResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileCollection GetDeviceRegistryDiscoveredAssetEndpointProfiles(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } - public static Azure.Pageable GetDeviceRegistryDiscoveredAssetEndpointProfiles(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.AsyncPageable GetDeviceRegistryDiscoveredAssetEndpointProfilesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetResource GetDeviceRegistryDiscoveredAssetResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetCollection GetDeviceRegistryDiscoveredAssets(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } - public static Azure.Pageable GetDeviceRegistryDiscoveredAssets(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.AsyncPageable GetDeviceRegistryDiscoveredAssetsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryCollection GetDeviceRegistrySchemaRegistries(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } - public static Azure.Pageable GetDeviceRegistrySchemaRegistries(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.AsyncPageable GetDeviceRegistrySchemaRegistriesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Response GetDeviceRegistrySchemaRegistry(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetDeviceRegistrySchemaRegistryAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryResource GetDeviceRegistrySchemaRegistryResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaResource GetDeviceRegistrySchemaResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionResource GetDeviceRegistrySchemaVersionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - } - public partial class DeviceRegistrySchemaCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected DeviceRegistrySchemaCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string schemaName, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string schemaName, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Exists(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class DeviceRegistrySchemaData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DeviceRegistrySchemaData() { } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaProperties Properties { get { throw null; } set { } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DeviceRegistrySchemaRegistryCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected DeviceRegistrySchemaRegistryCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string schemaRegistryName, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string schemaRegistryName, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Exists(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class DeviceRegistrySchemaRegistryData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DeviceRegistrySchemaRegistryData(Azure.Core.AzureLocation location) { } - public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryProperties Properties { get { throw null; } set { } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DeviceRegistrySchemaRegistryResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public static readonly Azure.Core.ResourceType ResourceType; - protected DeviceRegistrySchemaRegistryResource() { } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string schemaRegistryName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetDeviceRegistrySchema(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetDeviceRegistrySchemaAsync(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaCollection GetDeviceRegistrySchemas() { throw null; } - public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } - public partial class DeviceRegistrySchemaResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public static readonly Azure.Core.ResourceType ResourceType; - protected DeviceRegistrySchemaResource() { } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetDeviceRegistrySchemaVersion(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetDeviceRegistrySchemaVersionAsync(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionCollection GetDeviceRegistrySchemaVersions() { throw null; } - Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } - public partial class DeviceRegistrySchemaVersionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected DeviceRegistrySchemaVersionCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string schemaVersionName, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string schemaVersionName, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Exists(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class DeviceRegistrySchemaVersionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DeviceRegistrySchemaVersionData() { } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaVersionProperties Properties { get { throw null; } set { } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DeviceRegistrySchemaVersionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public static readonly Azure.Core.ResourceType ResourceType; - protected DeviceRegistrySchemaVersionResource() { } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.DeviceRegistry.Mocking @@ -460,11 +178,6 @@ protected MockableDeviceRegistryArmClient() { } public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetEndpointProfileResource GetDeviceRegistryAssetEndpointProfileResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetResource GetDeviceRegistryAssetResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerResource GetDeviceRegistryBillingContainerResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileResource GetDeviceRegistryDiscoveredAssetEndpointProfileResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetResource GetDeviceRegistryDiscoveredAssetResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryResource GetDeviceRegistrySchemaRegistryResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaResource GetDeviceRegistrySchemaResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionResource GetDeviceRegistrySchemaVersionResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableDeviceRegistryResourceGroupResource : Azure.ResourceManager.ArmResource { @@ -475,15 +188,6 @@ protected MockableDeviceRegistryResourceGroupResource() { } public virtual System.Threading.Tasks.Task> GetDeviceRegistryAssetEndpointProfileAsync(string assetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetEndpointProfileCollection GetDeviceRegistryAssetEndpointProfiles() { throw null; } public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetCollection GetDeviceRegistryAssets() { throw null; } - public virtual Azure.Response GetDeviceRegistryDiscoveredAsset(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetDeviceRegistryDiscoveredAssetAsync(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetDeviceRegistryDiscoveredAssetEndpointProfile(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetDeviceRegistryDiscoveredAssetEndpointProfileAsync(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileCollection GetDeviceRegistryDiscoveredAssetEndpointProfiles() { throw null; } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetCollection GetDeviceRegistryDiscoveredAssets() { throw null; } - public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryCollection GetDeviceRegistrySchemaRegistries() { throw null; } - public virtual Azure.Response GetDeviceRegistrySchemaRegistry(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetDeviceRegistrySchemaRegistryAsync(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class MockableDeviceRegistrySubscriptionResource : Azure.ResourceManager.ArmResource { @@ -495,12 +199,6 @@ protected MockableDeviceRegistrySubscriptionResource() { } public virtual Azure.Response GetDeviceRegistryBillingContainer(string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetDeviceRegistryBillingContainerAsync(string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerCollection GetDeviceRegistryBillingContainers() { throw null; } - public virtual Azure.Pageable GetDeviceRegistryDiscoveredAssetEndpointProfiles(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetDeviceRegistryDiscoveredAssetEndpointProfilesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetDeviceRegistryDiscoveredAssets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetDeviceRegistryDiscoveredAssetsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetDeviceRegistrySchemaRegistries(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetDeviceRegistrySchemaRegistriesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.DeviceRegistry.Models @@ -517,16 +215,6 @@ public static partial class ArmDeviceRegistryModelFactory public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatusError DeviceRegistryAssetStatusError(int? code = default(int?), string message = null) { throw null; } public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatusEvent DeviceRegistryAssetStatusEvent(string name = null, Azure.ResourceManager.DeviceRegistry.Models.MessageSchemaReference messageSchemaReference = null) { throw null; } public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerData DeviceRegistryBillingContainerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? billingContainerProvisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData DeviceRegistryDiscoveredAssetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetProperties properties = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation = null) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData DeviceRegistryDiscoveredAssetEndpointProfileData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileProperties properties = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation = null) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetProperties DeviceRegistryDiscoveredAssetProperties(string assetEndpointProfileRef = null, string discoveryId = null, long version = (long)0, string manufacturer = null, System.Uri manufacturerUri = null, string model = null, string productCode = null, string hardwareRevision = null, string softwareRevision = null, System.Uri documentationUri = null, string serialNumber = null, string defaultDatasetsConfiguration = null, string defaultEventsConfiguration = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic defaultTopic = null, System.Collections.Generic.IEnumerable datasets = null, System.Collections.Generic.IEnumerable events = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?)) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData DeviceRegistrySchemaData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaProperties properties = null) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaProperties DeviceRegistrySchemaProperties(string uuid = null, string displayName = null, string description = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat format = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat), Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType schemaType = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType), Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?), System.Collections.Generic.IDictionary tags = null) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData DeviceRegistrySchemaRegistryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryProperties DeviceRegistrySchemaRegistryProperties(string uuid = null, string @namespace = null, string displayName = null, string description = null, System.Uri storageAccountContainerUri = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?)) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData DeviceRegistrySchemaVersionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaVersionProperties properties = null) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaVersionProperties DeviceRegistrySchemaVersionProperties(string uuid = null, string description = null, string schemaContent = null, string hash = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?)) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileProperties DiscoveredAssetEndpointProfileProperties(System.Uri targetAddress = null, string additionalConfiguration = null, System.Collections.Generic.IEnumerable supportedAuthenticationMethods = null, string endpointProfileType = null, string discoveryId = null, long version = (long)0, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?)) { throw null; } public static Azure.ResourceManager.DeviceRegistry.Models.MessageSchemaReference MessageSchemaReference(string schemaRegistryNamespace = null, string schemaName = null, string schemaVersion = null) { throw null; } } public partial class AssetEndpointProfileStatusError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel @@ -799,57 +487,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DeviceRegistryDiscoveredAssetEndpointProfilePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DeviceRegistryDiscoveredAssetEndpointProfilePatch() { } - public Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileUpdateProperties Properties { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Tags { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetEndpointProfilePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetEndpointProfilePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DeviceRegistryDiscoveredAssetPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DeviceRegistryDiscoveredAssetPatch() { } - public Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetUpdateProperties Properties { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Tags { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DeviceRegistryDiscoveredAssetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DeviceRegistryDiscoveredAssetProperties(string assetEndpointProfileRef, string discoveryId, long version) { } - public string AssetEndpointProfileRef { get { throw null; } set { } } - public System.Collections.Generic.IList Datasets { get { throw null; } } - public string DefaultDatasetsConfiguration { get { throw null; } set { } } - public string DefaultEventsConfiguration { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic DefaultTopic { get { throw null; } set { } } - public string DiscoveryId { get { throw null; } set { } } - public System.Uri DocumentationUri { get { throw null; } set { } } - public System.Collections.Generic.IList Events { get { throw null; } } - public string HardwareRevision { get { throw null; } set { } } - public string Manufacturer { get { throw null; } set { } } - public System.Uri ManufacturerUri { get { throw null; } set { } } - public string Model { get { throw null; } set { } } - public string ProductCode { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } - public string SerialNumber { get { throw null; } set { } } - public string SoftwareRevision { get { throw null; } set { } } - public long Version { get { throw null; } set { } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class DeviceRegistryEvent : Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryEventBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DeviceRegistryEvent(string name, string eventNotifier) : base (default(string), default(string)) { } @@ -908,102 +545,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState left, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState right) { throw null; } public override string ToString() { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct DeviceRegistrySchemaFormat : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public DeviceRegistrySchemaFormat(string value) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat Delta10 { get { throw null; } } - public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat JsonSchemaDraft7 { get { throw null; } } - public bool Equals(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat left, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat right) { throw null; } - public static implicit operator Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat left, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat right) { throw null; } - public override string ToString() { throw null; } - } - public partial class DeviceRegistrySchemaProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DeviceRegistrySchemaProperties(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat format, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType schemaType) { } - public string Description { get { throw null; } set { } } - public string DisplayName { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat Format { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType SchemaType { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Tags { get { throw null; } } - public string Uuid { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DeviceRegistrySchemaRegistryPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DeviceRegistrySchemaRegistryPatch() { } - public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.SchemaRegistryUpdateProperties Properties { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Tags { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DeviceRegistrySchemaRegistryProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DeviceRegistrySchemaRegistryProperties(string @namespace, System.Uri storageAccountContainerUri) { } - public string Description { get { throw null; } set { } } - public string DisplayName { get { throw null; } set { } } - public string Namespace { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } - public System.Uri StorageAccountContainerUri { get { throw null; } set { } } - public string Uuid { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct DeviceRegistrySchemaType : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public DeviceRegistrySchemaType(string value) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType MessageSchema { get { throw null; } } - public bool Equals(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType left, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType right) { throw null; } - public static implicit operator Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType left, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType right) { throw null; } - public override string ToString() { throw null; } - } - public partial class DeviceRegistrySchemaVersionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DeviceRegistrySchemaVersionProperties(string schemaContent) { } - public string Description { get { throw null; } set { } } - public string Hash { get { throw null; } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } - public string SchemaContent { get { throw null; } set { } } - public string Uuid { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaVersionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaVersionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class DeviceRegistryTopic : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DeviceRegistryTopic(string path) { } @@ -1046,107 +587,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DiscoveredAssetEndpointProfileProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DiscoveredAssetEndpointProfileProperties(System.Uri targetAddress, string endpointProfileType, string discoveryId, long version) { } - public string AdditionalConfiguration { get { throw null; } set { } } - public string DiscoveryId { get { throw null; } set { } } - public string EndpointProfileType { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } - public System.Collections.Generic.IList SupportedAuthenticationMethods { get { throw null; } } - public System.Uri TargetAddress { get { throw null; } set { } } - public long Version { get { throw null; } set { } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DiscoveredAssetEndpointProfileUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DiscoveredAssetEndpointProfileUpdateProperties() { } - public string AdditionalConfiguration { get { throw null; } set { } } - public string DiscoveryId { get { throw null; } set { } } - public string EndpointProfileType { get { throw null; } set { } } - public System.Collections.Generic.IList SupportedAuthenticationMethods { get { throw null; } } - public System.Uri TargetAddress { get { throw null; } set { } } - public long? Version { get { throw null; } set { } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DiscoveredAssetUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DiscoveredAssetUpdateProperties() { } - public System.Collections.Generic.IList Datasets { get { throw null; } } - public string DefaultDatasetsConfiguration { get { throw null; } set { } } - public string DefaultEventsConfiguration { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic DefaultTopic { get { throw null; } set { } } - public string DiscoveryId { get { throw null; } set { } } - public System.Uri DocumentationUri { get { throw null; } set { } } - public System.Collections.Generic.IList Events { get { throw null; } } - public string HardwareRevision { get { throw null; } set { } } - public string Manufacturer { get { throw null; } set { } } - public System.Uri ManufacturerUri { get { throw null; } set { } } - public string Model { get { throw null; } set { } } - public string ProductCode { get { throw null; } set { } } - public string SerialNumber { get { throw null; } set { } } - public string SoftwareRevision { get { throw null; } set { } } - public long? Version { get { throw null; } set { } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DiscoveredDataPoint : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DiscoveredDataPoint(string name, string dataSource) { } - public string DataPointConfiguration { get { throw null; } set { } } - public string DataSource { get { throw null; } set { } } - public System.DateTimeOffset? LastUpdatedOn { get { throw null; } set { } } - public string Name { get { throw null; } set { } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DiscoveredDataPoint System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DiscoveredDataPoint System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DiscoveredDataset : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DiscoveredDataset(string name) { } - public System.Collections.Generic.IList DataPoints { get { throw null; } } - public string DatasetConfiguration { get { throw null; } set { } } - public string Name { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic Topic { get { throw null; } set { } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DiscoveredDataset System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DiscoveredDataset System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DiscoveredEvent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public DiscoveredEvent(string name, string eventNotifier) { } - public string EventConfiguration { get { throw null; } set { } } - public string EventNotifier { get { throw null; } set { } } - public System.DateTimeOffset? LastUpdatedOn { get { throw null; } set { } } - public string Name { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic Topic { get { throw null; } set { } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DiscoveredEvent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DiscoveredEvent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct EventObservabilityMode : System.IEquatable { @@ -1178,16 +618,4 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class SchemaRegistryUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public SchemaRegistryUpdateProperties() { } - public string Description { get { throw null; } set { } } - public string DisplayName { get { throw null; } set { } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.SchemaRegistryUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.SchemaRegistryUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetCollection.cs index 9fca956e22da..9fd6d4505bbb 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetCollection.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_DeviceRegistryAssetCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAssetWithDiscoveredAssetRefs() { - // Generated from example definition: 2024-09-01-preview/Create_Asset_With_DiscoveredAssetRef.json + // Generated from example definition: 2024-11-01/Create_Asset_With_DiscoveredAssetRef.json // this example is just showing the usage of "Asset_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -114,7 +114,7 @@ public async Task CreateOrUpdate_CreateAssetWithDiscoveredAssetRefs() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAssetWithExternalAssetId() { - // Generated from example definition: 2024-09-01-preview/Create_Asset_With_ExternalAssetId.json + // Generated from example definition: 2024-11-01/Create_Asset_With_ExternalAssetId.json // this example is just showing the usage of "Asset_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -206,7 +206,7 @@ public async Task CreateOrUpdate_CreateAssetWithExternalAssetId() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAssetWithoutDisplayName() { - // Generated from example definition: 2024-09-01-preview/Create_Asset_Without_DisplayName.json + // Generated from example definition: 2024-11-01/Create_Asset_Without_DisplayName.json // this example is just showing the usage of "Asset_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -297,7 +297,7 @@ public async Task CreateOrUpdate_CreateAssetWithoutDisplayName() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAssetWithoutExternalAssetId() { - // Generated from example definition: 2024-09-01-preview/Create_Asset_Without_ExternalAssetId.json + // Generated from example definition: 2024-11-01/Create_Asset_Without_ExternalAssetId.json // this example is just showing the usage of "Asset_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -388,7 +388,7 @@ public async Task CreateOrUpdate_CreateAssetWithoutExternalAssetId() [Ignore("Only validating compilation of examples")] public async Task Get_GetAsset() { - // Generated from example definition: 2024-09-01-preview/Get_Asset.json + // Generated from example definition: 2024-11-01/Get_Asset.json // this example is just showing the usage of "Asset_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -421,7 +421,7 @@ public async Task Get_GetAsset() [Ignore("Only validating compilation of examples")] public async Task Get_GetAssetWithSyncStatus() { - // Generated from example definition: 2024-09-01-preview/Get_Asset_With_SyncStatus.json + // Generated from example definition: 2024-11-01/Get_Asset_With_SyncStatus.json // this example is just showing the usage of "Asset_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -454,7 +454,7 @@ public async Task Get_GetAssetWithSyncStatus() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListAssetsResourceGroup() { - // Generated from example definition: 2024-09-01-preview/List_Assets_ResourceGroup.json + // Generated from example definition: 2024-11-01/List_Assets_ResourceGroup.json // this example is just showing the usage of "Asset_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -489,7 +489,7 @@ public async Task GetAll_ListAssetsResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAsset() { - // Generated from example definition: 2024-09-01-preview/Get_Asset.json + // Generated from example definition: 2024-11-01/Get_Asset.json // this example is just showing the usage of "Asset_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -518,7 +518,7 @@ public async Task Exists_GetAsset() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAssetWithSyncStatus() { - // Generated from example definition: 2024-09-01-preview/Get_Asset_With_SyncStatus.json + // Generated from example definition: 2024-11-01/Get_Asset_With_SyncStatus.json // this example is just showing the usage of "Asset_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -547,7 +547,7 @@ public async Task Exists_GetAssetWithSyncStatus() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAsset() { - // Generated from example definition: 2024-09-01-preview/Get_Asset.json + // Generated from example definition: 2024-11-01/Get_Asset.json // this example is just showing the usage of "Asset_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -588,7 +588,7 @@ public async Task GetIfExists_GetAsset() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAssetWithSyncStatus() { - // Generated from example definition: 2024-09-01-preview/Get_Asset_With_SyncStatus.json + // Generated from example definition: 2024-11-01/Get_Asset_With_SyncStatus.json // this example is just showing the usage of "Asset_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetEndpointProfileCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetEndpointProfileCollection.cs index 305a6d8dbc7c..d5a0deef8c7e 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetEndpointProfileCollection.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetEndpointProfileCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_DeviceRegistryAssetEndpointProfileCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAssetEndpointProfile() { - // Generated from example definition: 2024-09-01-preview/Create_AssetEndpointProfile.json + // Generated from example definition: 2024-11-01/Create_AssetEndpointProfile.json // this example is just showing the usage of "AssetEndpointProfile_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -66,7 +66,7 @@ public async Task CreateOrUpdate_CreateAssetEndpointProfile() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAssetEndpointProfileWithDiscoveredAepRef() { - // Generated from example definition: 2024-09-01-preview/Create_AssetEndpointProfile_With_DiscoveredAepRef.json + // Generated from example definition: 2024-11-01/Create_AssetEndpointProfile_With_DiscoveredAepRef.json // this example is just showing the usage of "AssetEndpointProfile_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -112,7 +112,7 @@ public async Task CreateOrUpdate_CreateAssetEndpointProfileWithDiscoveredAepRef( [Ignore("Only validating compilation of examples")] public async Task Get_GetAssetEndpointProfile() { - // Generated from example definition: 2024-09-01-preview/Get_AssetEndpointProfile.json + // Generated from example definition: 2024-11-01/Get_AssetEndpointProfile.json // this example is just showing the usage of "AssetEndpointProfile_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -145,7 +145,7 @@ public async Task Get_GetAssetEndpointProfile() [Ignore("Only validating compilation of examples")] public async Task Get_GetAssetEndpointProfileWithSyncStatus() { - // Generated from example definition: 2024-09-01-preview/Get_AssetEndpointProfile_With_SyncStatus.json + // Generated from example definition: 2024-11-01/Get_AssetEndpointProfile_With_SyncStatus.json // this example is just showing the usage of "AssetEndpointProfile_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -178,7 +178,7 @@ public async Task Get_GetAssetEndpointProfileWithSyncStatus() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListAssetEndpointProfilesResourceGroup() { - // Generated from example definition: 2024-09-01-preview/List_AssetEndpointProfiles_ResourceGroup.json + // Generated from example definition: 2024-11-01/List_AssetEndpointProfiles_ResourceGroup.json // this example is just showing the usage of "AssetEndpointProfile_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -213,7 +213,7 @@ public async Task GetAll_ListAssetEndpointProfilesResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAssetEndpointProfile() { - // Generated from example definition: 2024-09-01-preview/Get_AssetEndpointProfile.json + // Generated from example definition: 2024-11-01/Get_AssetEndpointProfile.json // this example is just showing the usage of "AssetEndpointProfile_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -242,7 +242,7 @@ public async Task Exists_GetAssetEndpointProfile() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAssetEndpointProfileWithSyncStatus() { - // Generated from example definition: 2024-09-01-preview/Get_AssetEndpointProfile_With_SyncStatus.json + // Generated from example definition: 2024-11-01/Get_AssetEndpointProfile_With_SyncStatus.json // this example is just showing the usage of "AssetEndpointProfile_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -271,7 +271,7 @@ public async Task Exists_GetAssetEndpointProfileWithSyncStatus() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAssetEndpointProfile() { - // Generated from example definition: 2024-09-01-preview/Get_AssetEndpointProfile.json + // Generated from example definition: 2024-11-01/Get_AssetEndpointProfile.json // this example is just showing the usage of "AssetEndpointProfile_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -312,7 +312,7 @@ public async Task GetIfExists_GetAssetEndpointProfile() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAssetEndpointProfileWithSyncStatus() { - // Generated from example definition: 2024-09-01-preview/Get_AssetEndpointProfile_With_SyncStatus.json + // Generated from example definition: 2024-11-01/Get_AssetEndpointProfile_With_SyncStatus.json // this example is just showing the usage of "AssetEndpointProfile_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetEndpointProfileResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetEndpointProfileResource.cs index b05163bf29cd..e1a316580627 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetEndpointProfileResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetEndpointProfileResource.cs @@ -20,7 +20,7 @@ public partial class Sample_DeviceRegistryAssetEndpointProfileResource [Ignore("Only validating compilation of examples")] public async Task Get_GetAssetEndpointProfile() { - // Generated from example definition: 2024-09-01-preview/Get_AssetEndpointProfile.json + // Generated from example definition: 2024-11-01/Get_AssetEndpointProfile.json // this example is just showing the usage of "AssetEndpointProfile_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_GetAssetEndpointProfile() [Ignore("Only validating compilation of examples")] public async Task Get_GetAssetEndpointProfileWithSyncStatus() { - // Generated from example definition: 2024-09-01-preview/Get_AssetEndpointProfile_With_SyncStatus.json + // Generated from example definition: 2024-11-01/Get_AssetEndpointProfile_With_SyncStatus.json // this example is just showing the usage of "AssetEndpointProfile_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Get_GetAssetEndpointProfileWithSyncStatus() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteAssetEndpointProfile() { - // Generated from example definition: 2024-09-01-preview/Delete_AssetEndpointProfile.json + // Generated from example definition: 2024-11-01/Delete_AssetEndpointProfile.json // this example is just showing the usage of "AssetEndpointProfile_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -106,7 +106,7 @@ public async Task Delete_DeleteAssetEndpointProfile() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateAssetEndpointProfile() { - // Generated from example definition: 2024-09-01-preview/Update_AssetEndpointProfile.json + // Generated from example definition: 2024-11-01/Update_AssetEndpointProfile.json // this example is just showing the usage of "AssetEndpointProfile_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetResource.cs index 0cc013e53b30..7c439f084562 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetResource.cs @@ -20,7 +20,7 @@ public partial class Sample_DeviceRegistryAssetResource [Ignore("Only validating compilation of examples")] public async Task Get_GetAsset() { - // Generated from example definition: 2024-09-01-preview/Get_Asset.json + // Generated from example definition: 2024-11-01/Get_Asset.json // this example is just showing the usage of "Asset_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_GetAsset() [Ignore("Only validating compilation of examples")] public async Task Get_GetAssetWithSyncStatus() { - // Generated from example definition: 2024-09-01-preview/Get_Asset_With_SyncStatus.json + // Generated from example definition: 2024-11-01/Get_Asset_With_SyncStatus.json // this example is just showing the usage of "Asset_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Get_GetAssetWithSyncStatus() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteAsset() { - // Generated from example definition: 2024-09-01-preview/Delete_Asset.json + // Generated from example definition: 2024-11-01/Delete_Asset.json // this example is just showing the usage of "Asset_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -106,7 +106,7 @@ public async Task Delete_DeleteAsset() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateAsset() { - // Generated from example definition: 2024-09-01-preview/Update_Asset.json + // Generated from example definition: 2024-11-01/Update_Asset.json // this example is just showing the usage of "Asset_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryBillingContainerCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryBillingContainerCollection.cs index 4f7ecc39d9db..87e3c4fd09da 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryBillingContainerCollection.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryBillingContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_DeviceRegistryBillingContainerCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetBillingContainer() { - // Generated from example definition: 2024-09-01-preview/Get_BillingContainer.json + // Generated from example definition: 2024-11-01/Get_BillingContainer.json // this example is just showing the usage of "BillingContainer_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_GetBillingContainer() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListBillingContainersSubscription() { - // Generated from example definition: 2024-09-01-preview/List_BillingContainers_Subscription.json + // Generated from example definition: 2024-11-01/List_BillingContainers_Subscription.json // this example is just showing the usage of "BillingContainer_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task GetAll_ListBillingContainersSubscription() [Ignore("Only validating compilation of examples")] public async Task Exists_GetBillingContainer() { - // Generated from example definition: 2024-09-01-preview/Get_BillingContainer.json + // Generated from example definition: 2024-11-01/Get_BillingContainer.json // this example is just showing the usage of "BillingContainer_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -114,7 +114,7 @@ public async Task Exists_GetBillingContainer() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetBillingContainer() { - // Generated from example definition: 2024-09-01-preview/Get_BillingContainer.json + // Generated from example definition: 2024-11-01/Get_BillingContainer.json // this example is just showing the usage of "BillingContainer_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryBillingContainerResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryBillingContainerResource.cs index 1b6a22f1cd99..5a5df44883df 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryBillingContainerResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryBillingContainerResource.cs @@ -19,7 +19,7 @@ public partial class Sample_DeviceRegistryBillingContainerResource [Ignore("Only validating compilation of examples")] public async Task Get_GetBillingContainer() { - // Generated from example definition: 2024-09-01-preview/Get_BillingContainer.json + // Generated from example definition: 2024-11-01/Get_BillingContainer.json // this example is just showing the usage of "BillingContainer_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 3dc49dd86e3a..df6e464131f2 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -20,7 +20,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetDeviceRegistryAssets_ListAssetsSubscription() { - // Generated from example definition: 2024-09-01-preview/List_Assets_Subscription.json + // Generated from example definition: 2024-11-01/List_Assets_Subscription.json // this example is just showing the usage of "Asset_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task GetDeviceRegistryAssets_ListAssetsSubscription() [Ignore("Only validating compilation of examples")] public async Task GetDeviceRegistryAssetEndpointProfiles_ListAssetEndpointProfilesSubscription() { - // Generated from example definition: 2024-09-01-preview/List_AssetEndpointProfiles_Subscription.json + // Generated from example definition: 2024-11-01/List_AssetEndpointProfiles_Subscription.json // this example is just showing the usage of "AssetEndpointProfile_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -77,98 +77,5 @@ public async Task GetDeviceRegistryAssetEndpointProfiles_ListAssetEndpointProfil Console.WriteLine("Succeeded"); } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetDeviceRegistryDiscoveredAssets_ListDiscoveredAssetsSubscription() - { - // Generated from example definition: 2024-09-01-preview/List_DiscoveredAssets_Subscription.json - // this example is just showing the usage of "DiscoveredAsset_ListBySubscription" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // invoke the operation and iterate over the result - await foreach (DeviceRegistryDiscoveredAssetResource item in subscriptionResource.GetDeviceRegistryDiscoveredAssetsAsync()) - { - // 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 - DeviceRegistryDiscoveredAssetData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine("Succeeded"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetDeviceRegistryDiscoveredAssetEndpointProfiles_ListDiscoveredAssetEndpointProfilesSubscription() - { - // Generated from example definition: 2024-09-01-preview/List_DiscoveredAssetEndpointProfiles_Subscription.json - // this example is just showing the usage of "DiscoveredAssetEndpointProfile_ListBySubscription" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // invoke the operation and iterate over the result - await foreach (DeviceRegistryDiscoveredAssetEndpointProfileResource item in subscriptionResource.GetDeviceRegistryDiscoveredAssetEndpointProfilesAsync()) - { - // 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 - DeviceRegistryDiscoveredAssetEndpointProfileData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine("Succeeded"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetDeviceRegistrySchemaRegistries_ListSchemaRegistriesSubscription() - { - // Generated from example definition: 2024-09-01-preview/List_SchemaRegistries_Subscription.json - // this example is just showing the usage of "SchemaRegistry_ListBySubscription" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // invoke the operation and iterate over the result - await foreach (DeviceRegistrySchemaRegistryResource item in subscriptionResource.GetDeviceRegistrySchemaRegistriesAsync()) - { - // 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 - DeviceRegistrySchemaRegistryData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine("Succeeded"); - } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/ArmDeviceRegistryModelFactory.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/ArmDeviceRegistryModelFactory.cs index d90426b2570c..aa2b1b78779a 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/ArmDeviceRegistryModelFactory.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/ArmDeviceRegistryModelFactory.cs @@ -16,251 +16,6 @@ namespace Azure.ResourceManager.DeviceRegistry.Models /// Model factory for models. public static partial class ArmDeviceRegistryModelFactory { - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The resource-specific properties for this resource. - /// A new instance for mocking. - public static DeviceRegistrySchemaVersionData DeviceRegistrySchemaVersionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DeviceRegistrySchemaVersionProperties properties = null) - { - return new DeviceRegistrySchemaVersionData( - id, - name, - resourceType, - systemData, - properties, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Globally unique, immutable, non-reusable id. - /// Human-readable description of the schema. - /// Schema content. - /// Hash of the schema content. - /// Provisioning state of the resource. - /// A new instance for mocking. - public static DeviceRegistrySchemaVersionProperties DeviceRegistrySchemaVersionProperties(string uuid = null, string description = null, string schemaContent = null, string hash = null, DeviceRegistryProvisioningState? provisioningState = null) - { - return new DeviceRegistrySchemaVersionProperties( - uuid, - description, - schemaContent, - hash, - provisioningState, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The resource-specific properties for this resource. - /// A new instance for mocking. - public static DeviceRegistrySchemaData DeviceRegistrySchemaData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DeviceRegistrySchemaProperties properties = null) - { - return new DeviceRegistrySchemaData( - id, - name, - resourceType, - systemData, - properties, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Globally unique, immutable, non-reusable id. - /// Human-readable display name. - /// Human-readable description of the schema. - /// Format of the schema. - /// Type of the schema. - /// Provisioning state of the resource. - /// Schema tags. - /// A new instance for mocking. - public static DeviceRegistrySchemaProperties DeviceRegistrySchemaProperties(string uuid = null, string displayName = null, string description = null, DeviceRegistrySchemaFormat format = default, DeviceRegistrySchemaType schemaType = default, DeviceRegistryProvisioningState? provisioningState = null, IDictionary tags = null) - { - tags ??= new Dictionary(); - - return new DeviceRegistrySchemaProperties( - uuid, - displayName, - description, - format, - schemaType, - provisioningState, - tags, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// 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 DeviceRegistrySchemaRegistryData DeviceRegistrySchemaRegistryData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, DeviceRegistrySchemaRegistryProperties properties = null, ManagedServiceIdentity identity = null) - { - tags ??= new Dictionary(); - - return new DeviceRegistrySchemaRegistryData( - id, - name, - resourceType, - systemData, - tags, - location, - properties, - identity, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Globally unique, immutable, non-reusable id. - /// Schema registry namespace. Uniquely identifies a schema registry within a tenant. - /// Human-readable display name. - /// Human-readable description of the schema registry. - /// The Storage Account's Container URL where schemas will be stored. - /// Provisioning state of the resource. - /// A new instance for mocking. - public static DeviceRegistrySchemaRegistryProperties DeviceRegistrySchemaRegistryProperties(string uuid = null, string @namespace = null, string displayName = null, string description = null, Uri storageAccountContainerUri = null, DeviceRegistryProvisioningState? provisioningState = null) - { - return new DeviceRegistrySchemaRegistryProperties( - uuid, - @namespace, - displayName, - description, - storageAccountContainerUri, - provisioningState, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The resource-specific properties for this resource. - /// The extended location. - /// A new instance for mocking. - public static DeviceRegistryDiscoveredAssetEndpointProfileData DeviceRegistryDiscoveredAssetEndpointProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, DiscoveredAssetEndpointProfileProperties properties = null, DeviceRegistryExtendedLocation extendedLocation = null) - { - tags ??= new Dictionary(); - - return new DeviceRegistryDiscoveredAssetEndpointProfileData( - id, - name, - resourceType, - systemData, - tags, - location, - properties, - extendedLocation, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. - /// Stringified JSON that contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF). - /// List of supported authentication methods supported by the target server. - /// Defines the configuration for the connector type that is being used with the endpoint profile. - /// Identifier used to detect changes in the asset endpoint profile. - /// An integer that is incremented each time the resource is modified. - /// Provisioning state of the resource. - /// A new instance for mocking. - public static DiscoveredAssetEndpointProfileProperties DiscoveredAssetEndpointProfileProperties(Uri targetAddress = null, string additionalConfiguration = null, IEnumerable supportedAuthenticationMethods = null, string endpointProfileType = null, string discoveryId = null, long version = default, DeviceRegistryProvisioningState? provisioningState = null) - { - supportedAuthenticationMethods ??= new List(); - - return new DiscoveredAssetEndpointProfileProperties( - targetAddress, - additionalConfiguration, - supportedAuthenticationMethods?.ToList(), - endpointProfileType, - discoveryId, - version, - provisioningState, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The resource-specific properties for this resource. - /// The extended location. - /// A new instance for mocking. - public static DeviceRegistryDiscoveredAssetData DeviceRegistryDiscoveredAssetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, DeviceRegistryDiscoveredAssetProperties properties = null, DeviceRegistryExtendedLocation extendedLocation = null) - { - tags ??= new Dictionary(); - - return new DeviceRegistryDiscoveredAssetData( - id, - name, - resourceType, - systemData, - tags, - location, - properties, - extendedLocation, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// A reference to the asset endpoint profile (connection information) used by brokers to connect to an endpoint that provides data points for this asset. Must provide asset endpoint profile name. - /// Identifier used to detect changes in the asset. - /// An integer that is incremented each time the resource is modified. - /// Asset manufacturer name. - /// Asset manufacturer URI. - /// Asset model name. - /// Asset product code. - /// Revision number of the hardware. - /// Revision number of the software. - /// Reference to the documentation. - /// Asset serial number. - /// Stringified JSON that contains connector-specific default configuration for all datasets. Each dataset can have its own configuration that overrides the default settings here. - /// Stringified JSON that contains connector-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here. - /// Object that describes the default topic information for the asset. - /// Array of datasets that are part of the asset. Each dataset spec describes the data points that make up the set. - /// Array of events that are part of the asset. Each event can have per-event configuration. - /// Provisioning state of the resource. - /// A new instance for mocking. - public static DeviceRegistryDiscoveredAssetProperties DeviceRegistryDiscoveredAssetProperties(string assetEndpointProfileRef = null, string discoveryId = null, long version = default, string manufacturer = null, Uri manufacturerUri = null, string model = null, string productCode = null, string hardwareRevision = null, string softwareRevision = null, Uri documentationUri = null, string serialNumber = null, string defaultDatasetsConfiguration = null, string defaultEventsConfiguration = null, DeviceRegistryTopic defaultTopic = null, IEnumerable datasets = null, IEnumerable events = null, DeviceRegistryProvisioningState? provisioningState = null) - { - datasets ??= new List(); - events ??= new List(); - - return new DeviceRegistryDiscoveredAssetProperties( - assetEndpointProfileRef, - discoveryId, - version, - manufacturer, - manufacturerUri, - model, - productCode, - hardwareRevision, - softwareRevision, - documentationUri, - serialNumber, - defaultDatasetsConfiguration, - defaultEventsConfiguration, - defaultTopic, - datasets?.ToList(), - events?.ToList(), - provisioningState, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetCollection.cs index b3772dc0f191..343df2e3e812 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetCollection.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpd /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnti /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string assetName, Cance /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string assetName, Cancella /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string assetName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetEndpointProfileCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetEndpointProfileCollection.cs index 177901e6383c..b0d45763268e 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetEndpointProfileCollection.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetEndpointProfileCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOr /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string a /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllA /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(Cance /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string assetEndpointProfil /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string assetEndpointProfileName, Cancellati /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetEndpointProfileResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetEndpointProfileResource.cs index ce93bf73a83d..4dacd3f65003 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetEndpointProfileResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetEndpointProfileResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancella /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(W /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -421,7 +421,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -483,7 +483,7 @@ public virtual Response AddTag(strin /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -540,7 +540,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -597,7 +597,7 @@ public virtual Response SetTags(IDic /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -657,7 +657,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetResource.cs index b4c422ebbf56..9e0af2faf5ef 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cance /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> UpdateAsync /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(WaitUntil waitUn /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -421,7 +421,7 @@ public virtual async Task> AddTagAsync(str /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -483,7 +483,7 @@ public virtual Response AddTag(string key, string v /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -540,7 +540,7 @@ public virtual async Task> SetTagsAsync(ID /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -597,7 +597,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -657,7 +657,7 @@ public virtual async Task> RemoveTagAsync( /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerCollection.cs index c988a875118e..4edfef83cefd 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerCollection.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -110,7 +110,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -155,7 +155,7 @@ public virtual Response Get(string billi /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -215,7 +215,7 @@ public virtual Pageable GetAll(Cancellat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -258,7 +258,7 @@ public virtual async Task> ExistsAsync(string billingContainerNam /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -301,7 +301,7 @@ public virtual Response Exists(string billingContainerName, CancellationTo /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -346,7 +346,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerResource.cs index 042cd94d743e..ec91cbe02813 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerResource.cs @@ -100,7 +100,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -140,7 +140,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetCollection.cs deleted file mode 100644 index ca4ac6e34ea6..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetCollection.cs +++ /dev/null @@ -1,494 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.Resources; - -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 GetDeviceRegistryDiscoveredAssets method from an instance of . - /// - public partial class DeviceRegistryDiscoveredAssetCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics; - private readonly DiscoveredAssetsRestOperations _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient; - - /// Initializes a new instance of the class for mocking. - protected DeviceRegistryDiscoveredAssetCollection() - { - } - - /// 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 DeviceRegistryDiscoveredAssetCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistryDiscoveredAssetResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(DeviceRegistryDiscoveredAssetResource.ResourceType, out string deviceRegistryDiscoveredAssetDiscoveredAssetsApiVersion); - _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient = new DiscoveredAssetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistryDiscoveredAssetDiscoveredAssetsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); - } - - /// - /// Create a DiscoveredAsset - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} - /// - /// - /// Operation Id - /// DiscoveredAsset_CreateOrReplace - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Discovered Asset name parameter. - /// Resource create parameters. - /// 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, DeviceRegistryDiscoveredAssetData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateOrReplaceAsync(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetName, data, cancellationToken).ConfigureAwait(false); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryDiscoveredAssetOperationSource(Client), _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics, Pipeline, _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create a DiscoveredAsset - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} - /// - /// - /// Operation Id - /// DiscoveredAsset_CreateOrReplace - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Discovered Asset name parameter. - /// Resource create parameters. - /// 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, DeviceRegistryDiscoveredAssetData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateOrReplace(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetName, data, cancellationToken); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryDiscoveredAssetOperationSource(Client), _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics, Pipeline, _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a DiscoveredAsset - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} - /// - /// - /// Operation Id - /// DiscoveredAsset_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Discovered Asset name parameter. - /// 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) - { - Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); - - using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetCollection.Get"); - scope.Start(); - try - { - var response = await _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryDiscoveredAssetResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a DiscoveredAsset - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} - /// - /// - /// Operation Id - /// DiscoveredAsset_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Discovered Asset name parameter. - /// 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) - { - Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); - - using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetCollection.Get"); - scope.Start(); - try - { - var response = _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryDiscoveredAssetResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// List DiscoveredAsset resources by resource group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets - /// - /// - /// Operation Id - /// DiscoveredAsset_ListByResourceGroup - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// 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) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryDiscoveredAssetResource(Client, DeviceRegistryDiscoveredAssetData.DeserializeDeviceRegistryDiscoveredAssetData(e)), _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics, Pipeline, "DeviceRegistryDiscoveredAssetCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// List DiscoveredAsset resources by resource group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets - /// - /// - /// Operation Id - /// DiscoveredAsset_ListByResourceGroup - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// 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) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryDiscoveredAssetResource(Client, DeviceRegistryDiscoveredAssetData.DeserializeDeviceRegistryDiscoveredAssetData(e)), _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics, Pipeline, "DeviceRegistryDiscoveredAssetCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} - /// - /// - /// Operation Id - /// DiscoveredAsset_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Discovered Asset name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string discoveredAssetName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); - - using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetCollection.Exists"); - scope.Start(); - try - { - var response = await _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} - /// - /// - /// Operation Id - /// DiscoveredAsset_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Discovered Asset name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string discoveredAssetName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); - - using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetCollection.Exists"); - scope.Start(); - try - { - var response = _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} - /// - /// - /// Operation Id - /// DiscoveredAsset_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Discovered Asset name parameter. - /// 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) - { - Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); - - using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryDiscoveredAssetResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} - /// - /// - /// Operation Id - /// DiscoveredAsset_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Discovered Asset name parameter. - /// 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) - { - Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); - - using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetCollection.GetIfExists"); - scope.Start(); - try - { - var response = _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryDiscoveredAssetResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetData.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetData.Serialization.cs deleted file mode 100644 index 2784870791b5..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetData.Serialization.cs +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.DeviceRegistry.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.DeviceRegistry -{ - public partial class DeviceRegistryDiscoveredAssetData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetData)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); - } - writer.WritePropertyName("extendedLocation"u8); - writer.WriteObjectValue(ExtendedLocation, options); - } - - DeviceRegistryDiscoveredAssetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryDiscoveredAssetData(document.RootElement, options); - } - - internal static DeviceRegistryDiscoveredAssetData DeserializeDeviceRegistryDiscoveredAssetData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DeviceRegistryDiscoveredAssetProperties properties = default; - DeviceRegistryExtendedLocation extendedLocation = default; - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = DeviceRegistryDiscoveredAssetProperties.DeserializeDeviceRegistryDiscoveredAssetProperties(property.Value, options); - continue; - } - if (property.NameEquals("extendedLocation"u8)) - { - extendedLocation = DeviceRegistryExtendedLocation.DeserializeDeviceRegistryExtendedLocation(property.Value, options); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryDiscoveredAssetData( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - properties, - extendedLocation, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetData)} does not support writing '{options.Format}' format."); - } - } - - DeviceRegistryDiscoveredAssetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeviceRegistryDiscoveredAssetData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetData.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetData.cs deleted file mode 100644 index 5c9852ce6783..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetData.cs +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.DeviceRegistry.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.DeviceRegistry -{ - /// - /// A class representing the DeviceRegistryDiscoveredAsset data model. - /// Discovered Asset definition. - /// - public partial class DeviceRegistryDiscoveredAssetData : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - /// The extended location. - /// is null. - public DeviceRegistryDiscoveredAssetData(AzureLocation location, DeviceRegistryExtendedLocation extendedLocation) : base(location) - { - Argument.AssertNotNull(extendedLocation, nameof(extendedLocation)); - - ExtendedLocation = extendedLocation; - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The resource-specific properties for this resource. - /// The extended location. - /// Keeps track of any properties unknown to the library. - internal DeviceRegistryDiscoveredAssetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, DeviceRegistryDiscoveredAssetProperties 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 DeviceRegistryDiscoveredAssetData() - { - } - - /// The resource-specific properties for this resource. - public DeviceRegistryDiscoveredAssetProperties Properties { get; set; } - /// The extended location. - public DeviceRegistryExtendedLocation ExtendedLocation { get; set; } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileCollection.cs deleted file mode 100644 index c072b948605e..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileCollection.cs +++ /dev/null @@ -1,494 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.Resources; - -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 GetDeviceRegistryDiscoveredAssetEndpointProfiles method from an instance of . - /// - public partial class DeviceRegistryDiscoveredAssetEndpointProfileCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics; - private readonly DiscoveredAssetEndpointProfilesRestOperations _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient; - - /// Initializes a new instance of the class for mocking. - protected DeviceRegistryDiscoveredAssetEndpointProfileCollection() - { - } - - /// 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 DeviceRegistryDiscoveredAssetEndpointProfileCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistryDiscoveredAssetEndpointProfileResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(DeviceRegistryDiscoveredAssetEndpointProfileResource.ResourceType, out string deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesApiVersion); - _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient = new DiscoveredAssetEndpointProfilesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); - } - - /// - /// Create a DiscoveredAssetEndpointProfile - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_CreateOrReplace - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Discovered Asset Endpoint Profile name parameter. - /// Resource create parameters. - /// 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 discoveredAssetEndpointProfileName, DeviceRegistryDiscoveredAssetEndpointProfileData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateOrReplaceAsync(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetEndpointProfileName, data, cancellationToken).ConfigureAwait(false); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryDiscoveredAssetEndpointProfileOperationSource(Client), _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics, Pipeline, _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetEndpointProfileName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create a DiscoveredAssetEndpointProfile - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_CreateOrReplace - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Discovered Asset Endpoint Profile name parameter. - /// Resource create parameters. - /// 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 discoveredAssetEndpointProfileName, DeviceRegistryDiscoveredAssetEndpointProfileData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateOrReplace(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetEndpointProfileName, data, cancellationToken); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryDiscoveredAssetEndpointProfileOperationSource(Client), _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics, Pipeline, _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetEndpointProfileName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a DiscoveredAssetEndpointProfile - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Discovered Asset Endpoint Profile name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); - - using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileCollection.Get"); - scope.Start(); - try - { - var response = await _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetEndpointProfileName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a DiscoveredAssetEndpointProfile - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Discovered Asset Endpoint Profile name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); - - using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileCollection.Get"); - scope.Start(); - try - { - var response = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetEndpointProfileName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// List DiscoveredAssetEndpointProfile resources by resource group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_ListByResourceGroup - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// 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) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, DeviceRegistryDiscoveredAssetEndpointProfileData.DeserializeDeviceRegistryDiscoveredAssetEndpointProfileData(e)), _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics, Pipeline, "DeviceRegistryDiscoveredAssetEndpointProfileCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// List DiscoveredAssetEndpointProfile resources by resource group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_ListByResourceGroup - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// 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) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, DeviceRegistryDiscoveredAssetEndpointProfileData.DeserializeDeviceRegistryDiscoveredAssetEndpointProfileData(e)), _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics, Pipeline, "DeviceRegistryDiscoveredAssetEndpointProfileCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Discovered Asset Endpoint Profile name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); - - using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileCollection.Exists"); - scope.Start(); - try - { - var response = await _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetEndpointProfileName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Discovered Asset Endpoint Profile name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); - - using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileCollection.Exists"); - scope.Start(); - try - { - var response = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetEndpointProfileName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Discovered Asset Endpoint Profile name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); - - using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetEndpointProfileName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Discovered Asset Endpoint Profile name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); - - using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileCollection.GetIfExists"); - scope.Start(); - try - { - var response = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetEndpointProfileName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileData.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileData.Serialization.cs deleted file mode 100644 index 7ce6d93e075a..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileData.Serialization.cs +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.DeviceRegistry.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.DeviceRegistry -{ - public partial class DeviceRegistryDiscoveredAssetEndpointProfileData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetEndpointProfileData)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); - } - writer.WritePropertyName("extendedLocation"u8); - writer.WriteObjectValue(ExtendedLocation, options); - } - - DeviceRegistryDiscoveredAssetEndpointProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetEndpointProfileData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryDiscoveredAssetEndpointProfileData(document.RootElement, options); - } - - internal static DeviceRegistryDiscoveredAssetEndpointProfileData DeserializeDeviceRegistryDiscoveredAssetEndpointProfileData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DiscoveredAssetEndpointProfileProperties properties = default; - DeviceRegistryExtendedLocation extendedLocation = default; - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = DiscoveredAssetEndpointProfileProperties.DeserializeDiscoveredAssetEndpointProfileProperties(property.Value, options); - continue; - } - if (property.NameEquals("extendedLocation"u8)) - { - extendedLocation = DeviceRegistryExtendedLocation.DeserializeDeviceRegistryExtendedLocation(property.Value, options); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryDiscoveredAssetEndpointProfileData( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - properties, - extendedLocation, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetEndpointProfileData)} does not support writing '{options.Format}' format."); - } - } - - DeviceRegistryDiscoveredAssetEndpointProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeviceRegistryDiscoveredAssetEndpointProfileData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetEndpointProfileData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileData.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileData.cs deleted file mode 100644 index 9f487d88541a..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileData.cs +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.DeviceRegistry.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.DeviceRegistry -{ - /// - /// A class representing the DeviceRegistryDiscoveredAssetEndpointProfile data model. - /// Discovered Asset Endpoint Profile definition. - /// - public partial class DeviceRegistryDiscoveredAssetEndpointProfileData : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - /// The extended location. - /// is null. - public DeviceRegistryDiscoveredAssetEndpointProfileData(AzureLocation location, DeviceRegistryExtendedLocation extendedLocation) : base(location) - { - Argument.AssertNotNull(extendedLocation, nameof(extendedLocation)); - - ExtendedLocation = extendedLocation; - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The resource-specific properties for this resource. - /// The extended location. - /// Keeps track of any properties unknown to the library. - internal DeviceRegistryDiscoveredAssetEndpointProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, DiscoveredAssetEndpointProfileProperties 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 DeviceRegistryDiscoveredAssetEndpointProfileData() - { - } - - /// The resource-specific properties for this resource. - public DiscoveredAssetEndpointProfileProperties Properties { get; set; } - /// The extended location. - public DeviceRegistryExtendedLocation ExtendedLocation { get; set; } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileResource.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileResource.Serialization.cs deleted file mode 100644 index b6d0bc5086b3..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileResource.Serialization.cs +++ /dev/null @@ -1,26 +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 DeviceRegistryDiscoveredAssetEndpointProfileResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - DeviceRegistryDiscoveredAssetEndpointProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - DeviceRegistryDiscoveredAssetEndpointProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileResource.cs deleted file mode 100644 index 6e7b61788f5a..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileResource.cs +++ /dev/null @@ -1,707 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.DeviceRegistry.Models; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.DeviceRegistry -{ - /// - /// A Class representing a DeviceRegistryDiscoveredAssetEndpointProfile 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 GetDeviceRegistryDiscoveredAssetEndpointProfileResource method. - /// Otherwise you can get one from its parent resource using the GetDeviceRegistryDiscoveredAssetEndpointProfile method. - /// - public partial class DeviceRegistryDiscoveredAssetEndpointProfileResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The discoveredAssetEndpointProfileName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics; - private readonly DiscoveredAssetEndpointProfilesRestOperations _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient; - private readonly DeviceRegistryDiscoveredAssetEndpointProfileData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles"; - - /// Initializes a new instance of the class for mocking. - protected DeviceRegistryDiscoveredAssetEndpointProfileResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal DeviceRegistryDiscoveredAssetEndpointProfileResource(ArmClient client, DeviceRegistryDiscoveredAssetEndpointProfileData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// 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 DeviceRegistryDiscoveredAssetEndpointProfileResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesApiVersion); - _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient = new DiscoveredAssetEndpointProfilesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual DeviceRegistryDiscoveredAssetEndpointProfileData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Get a DiscoveredAssetEndpointProfile - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileResource.Get"); - scope.Start(); - try - { - var response = await _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a DiscoveredAssetEndpointProfile - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileResource.Get"); - scope.Start(); - try - { - var response = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a DiscoveredAssetEndpointProfile - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_Delete - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileResource.Delete"); - scope.Start(); - try - { - var response = await _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new DeviceRegistryArmOperation(_deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics, Pipeline, _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a DiscoveredAssetEndpointProfile - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_Delete - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileResource.Delete"); - scope.Start(); - try - { - var response = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new DeviceRegistryArmOperation(_deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics, Pipeline, _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update a DiscoveredAssetEndpointProfile - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_Update - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The resource properties to be updated. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, DeviceRegistryDiscoveredAssetEndpointProfilePatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileResource.Update"); - scope.Start(); - try - { - var response = await _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryDiscoveredAssetEndpointProfileOperationSource(Client), _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics, Pipeline, _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update a DiscoveredAssetEndpointProfile - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_Update - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The resource properties to be updated. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, DeviceRegistryDiscoveredAssetEndpointProfilePatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileResource.Update"); - scope.Start(); - try - { - var response = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryDiscoveredAssetEndpointProfileOperationSource(Client), _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics, Pipeline, _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// 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) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileResource.AddTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - 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 _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new DeviceRegistryDiscoveredAssetEndpointProfilePatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileResource.AddTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues[key] = value; - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DeviceRegistryDiscoveredAssetEndpointProfilePatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// 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) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileResource.SetTags"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); - 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 _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new DeviceRegistryDiscoveredAssetEndpointProfilePatch(); - patch.Tags.ReplaceWith(tags); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// 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) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileResource.SetTags"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DeviceRegistryDiscoveredAssetEndpointProfilePatch(); - patch.Tags.ReplaceWith(tags); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileResource.RemoveTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - 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 _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new DeviceRegistryDiscoveredAssetEndpointProfilePatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileResource.RemoveTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.Remove(key); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DeviceRegistryDiscoveredAssetEndpointProfilePatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetResource.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetResource.Serialization.cs deleted file mode 100644 index 9904db2f0638..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetResource.Serialization.cs +++ /dev/null @@ -1,26 +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 DeviceRegistryDiscoveredAssetResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - DeviceRegistryDiscoveredAssetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - DeviceRegistryDiscoveredAssetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetResource.cs deleted file mode 100644 index 3ea76bdb734f..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetResource.cs +++ /dev/null @@ -1,707 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.DeviceRegistry.Models; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.DeviceRegistry -{ - /// - /// A Class representing a DeviceRegistryDiscoveredAsset 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 GetDeviceRegistryDiscoveredAssetResource method. - /// Otherwise you can get one from its parent resource using the GetDeviceRegistryDiscoveredAsset method. - /// - public partial class DeviceRegistryDiscoveredAssetResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The discoveredAssetName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string discoveredAssetName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics; - private readonly DiscoveredAssetsRestOperations _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient; - private readonly DeviceRegistryDiscoveredAssetData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DeviceRegistry/discoveredAssets"; - - /// Initializes a new instance of the class for mocking. - protected DeviceRegistryDiscoveredAssetResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal DeviceRegistryDiscoveredAssetResource(ArmClient client, DeviceRegistryDiscoveredAssetData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// 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 DeviceRegistryDiscoveredAssetResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string deviceRegistryDiscoveredAssetDiscoveredAssetsApiVersion); - _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient = new DiscoveredAssetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistryDiscoveredAssetDiscoveredAssetsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual DeviceRegistryDiscoveredAssetData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Get a DiscoveredAsset - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} - /// - /// - /// Operation Id - /// DiscoveredAsset_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetResource.Get"); - scope.Start(); - try - { - var response = await _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryDiscoveredAssetResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a DiscoveredAsset - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} - /// - /// - /// Operation Id - /// DiscoveredAsset_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetResource.Get"); - scope.Start(); - try - { - var response = _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistryDiscoveredAssetResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a DiscoveredAsset - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} - /// - /// - /// Operation Id - /// DiscoveredAsset_Delete - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetResource.Delete"); - scope.Start(); - try - { - var response = await _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new DeviceRegistryArmOperation(_deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics, Pipeline, _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a DiscoveredAsset - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} - /// - /// - /// Operation Id - /// DiscoveredAsset_Delete - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetResource.Delete"); - scope.Start(); - try - { - var response = _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new DeviceRegistryArmOperation(_deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics, Pipeline, _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update a DiscoveredAsset - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} - /// - /// - /// Operation Id - /// DiscoveredAsset_Update - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The resource properties to be updated. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, DeviceRegistryDiscoveredAssetPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetResource.Update"); - scope.Start(); - try - { - var response = await _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryDiscoveredAssetOperationSource(Client), _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics, Pipeline, _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update a DiscoveredAsset - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} - /// - /// - /// Operation Id - /// DiscoveredAsset_Update - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The resource properties to be updated. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, DeviceRegistryDiscoveredAssetPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetResource.Update"); - scope.Start(); - try - { - var response = _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - var operation = new DeviceRegistryArmOperation(new DeviceRegistryDiscoveredAssetOperationSource(Client), _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics, Pipeline, _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} - /// - /// - /// Operation Id - /// DiscoveredAsset_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// 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) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetResource.AddTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - 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 _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DeviceRegistryDiscoveredAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new DeviceRegistryDiscoveredAssetPatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} - /// - /// - /// Operation Id - /// DiscoveredAsset_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetResource.AddTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues[key] = value; - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new DeviceRegistryDiscoveredAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DeviceRegistryDiscoveredAssetPatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} - /// - /// - /// Operation Id - /// DiscoveredAsset_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// 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) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetResource.SetTags"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); - 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 _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DeviceRegistryDiscoveredAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new DeviceRegistryDiscoveredAssetPatch(); - patch.Tags.ReplaceWith(tags); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} - /// - /// - /// Operation Id - /// DiscoveredAsset_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// 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) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetResource.SetTags"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new DeviceRegistryDiscoveredAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DeviceRegistryDiscoveredAssetPatch(); - patch.Tags.ReplaceWith(tags); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} - /// - /// - /// Operation Id - /// DiscoveredAsset_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetResource.RemoveTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - 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 _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DeviceRegistryDiscoveredAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new DeviceRegistryDiscoveredAssetPatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} - /// - /// - /// Operation Id - /// DiscoveredAsset_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetResource.RemoveTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.Remove(key); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new DeviceRegistryDiscoveredAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DeviceRegistryDiscoveredAssetPatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaCollection.cs deleted file mode 100644 index d4f9187fa327..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaCollection.cs +++ /dev/null @@ -1,497 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; - -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 GetDeviceRegistrySchemas method from an instance of . - /// - public partial class DeviceRegistrySchemaCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _deviceRegistrySchemaSchemasClientDiagnostics; - private readonly SchemasRestOperations _deviceRegistrySchemaSchemasRestClient; - - /// Initializes a new instance of the class for mocking. - protected DeviceRegistrySchemaCollection() - { - } - - /// 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 DeviceRegistrySchemaCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _deviceRegistrySchemaSchemasClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistrySchemaResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(DeviceRegistrySchemaResource.ResourceType, out string deviceRegistrySchemaSchemasApiVersion); - _deviceRegistrySchemaSchemasRestClient = new SchemasRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistrySchemaSchemasApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != DeviceRegistrySchemaRegistryResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DeviceRegistrySchemaRegistryResource.ResourceType), nameof(id)); - } - - /// - /// Create a Schema - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} - /// - /// - /// Operation Id - /// Schema_CreateOrReplace - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Schema name parameter. - /// Resource create parameters. - /// 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 schemaName, DeviceRegistrySchemaData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _deviceRegistrySchemaSchemasRestClient.CreateOrReplaceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, schemaName, data, cancellationToken).ConfigureAwait(false); - var uri = _deviceRegistrySchemaSchemasRestClient.CreateCreateOrReplaceRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, schemaName, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new DeviceRegistryArmOperation(Response.FromValue(new DeviceRegistrySchemaResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create a Schema - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} - /// - /// - /// Operation Id - /// Schema_CreateOrReplace - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Schema name parameter. - /// Resource create parameters. - /// 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 schemaName, DeviceRegistrySchemaData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _deviceRegistrySchemaSchemasRestClient.CreateOrReplace(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, schemaName, data, cancellationToken); - var uri = _deviceRegistrySchemaSchemasRestClient.CreateCreateOrReplaceRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, schemaName, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new DeviceRegistryArmOperation(Response.FromValue(new DeviceRegistrySchemaResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a Schema - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} - /// - /// - /// Operation Id - /// Schema_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Schema name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string schemaName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); - - using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaCollection.Get"); - scope.Start(); - try - { - var response = await _deviceRegistrySchemaSchemasRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, schemaName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistrySchemaResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a Schema - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} - /// - /// - /// Operation Id - /// Schema_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Schema name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string schemaName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); - - using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaCollection.Get"); - scope.Start(); - try - { - var response = _deviceRegistrySchemaSchemasRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, schemaName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistrySchemaResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// List Schema resources by SchemaRegistry - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas - /// - /// - /// Operation Id - /// Schema_ListBySchemaRegistry - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// 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) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistrySchemaSchemasRestClient.CreateListBySchemaRegistryRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistrySchemaSchemasRestClient.CreateListBySchemaRegistryNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistrySchemaResource(Client, DeviceRegistrySchemaData.DeserializeDeviceRegistrySchemaData(e)), _deviceRegistrySchemaSchemasClientDiagnostics, Pipeline, "DeviceRegistrySchemaCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// List Schema resources by SchemaRegistry - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas - /// - /// - /// Operation Id - /// Schema_ListBySchemaRegistry - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// 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) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistrySchemaSchemasRestClient.CreateListBySchemaRegistryRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistrySchemaSchemasRestClient.CreateListBySchemaRegistryNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistrySchemaResource(Client, DeviceRegistrySchemaData.DeserializeDeviceRegistrySchemaData(e)), _deviceRegistrySchemaSchemasClientDiagnostics, Pipeline, "DeviceRegistrySchemaCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} - /// - /// - /// Operation Id - /// Schema_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Schema name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string schemaName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); - - using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaCollection.Exists"); - scope.Start(); - try - { - var response = await _deviceRegistrySchemaSchemasRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, schemaName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} - /// - /// - /// Operation Id - /// Schema_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Schema name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string schemaName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); - - using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaCollection.Exists"); - scope.Start(); - try - { - var response = _deviceRegistrySchemaSchemasRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, schemaName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} - /// - /// - /// Operation Id - /// Schema_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Schema name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string schemaName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); - - using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _deviceRegistrySchemaSchemasRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, schemaName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistrySchemaResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} - /// - /// - /// Operation Id - /// Schema_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Schema name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string schemaName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); - - using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaCollection.GetIfExists"); - scope.Start(); - try - { - var response = _deviceRegistrySchemaSchemasRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, schemaName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistrySchemaResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaData.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaData.Serialization.cs deleted file mode 100644 index 8dfe5b4955e5..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaData.Serialization.cs +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.DeviceRegistry.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.DeviceRegistry -{ - public partial class DeviceRegistrySchemaData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(DeviceRegistrySchemaData)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); - } - } - - DeviceRegistrySchemaData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DeviceRegistrySchemaData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistrySchemaData(document.RootElement, options); - } - - internal static DeviceRegistrySchemaData DeserializeDeviceRegistrySchemaData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DeviceRegistrySchemaProperties properties = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = DeviceRegistrySchemaProperties.DeserializeDeviceRegistrySchemaProperties(property.Value, options); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistrySchemaData( - id, - name, - type, - systemData, - properties, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DeviceRegistrySchemaData)} does not support writing '{options.Format}' format."); - } - } - - DeviceRegistrySchemaData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeviceRegistrySchemaData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DeviceRegistrySchemaData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaData.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaData.cs deleted file mode 100644 index d13f17f7b433..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaData.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.DeviceRegistry.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.DeviceRegistry -{ - /// - /// A class representing the DeviceRegistrySchema data model. - /// Schema definition. - /// - public partial class DeviceRegistrySchemaData : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public DeviceRegistrySchemaData() - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The resource-specific properties for this resource. - /// Keeps track of any properties unknown to the library. - internal DeviceRegistrySchemaData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DeviceRegistrySchemaProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The resource-specific properties for this resource. - public DeviceRegistrySchemaProperties Properties { get; set; } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryCollection.cs deleted file mode 100644 index d55dd875c8b1..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryCollection.cs +++ /dev/null @@ -1,494 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.Resources; - -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 GetDeviceRegistrySchemaRegistries method from an instance of . - /// - public partial class DeviceRegistrySchemaRegistryCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics; - private readonly SchemaRegistriesRestOperations _deviceRegistrySchemaRegistrySchemaRegistriesRestClient; - - /// Initializes a new instance of the class for mocking. - protected DeviceRegistrySchemaRegistryCollection() - { - } - - /// 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 DeviceRegistrySchemaRegistryCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistrySchemaRegistryResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(DeviceRegistrySchemaRegistryResource.ResourceType, out string deviceRegistrySchemaRegistrySchemaRegistriesApiVersion); - _deviceRegistrySchemaRegistrySchemaRegistriesRestClient = new SchemaRegistriesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistrySchemaRegistrySchemaRegistriesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); - } - - /// - /// Create a SchemaRegistry - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} - /// - /// - /// Operation Id - /// SchemaRegistry_CreateOrReplace - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Schema registry name parameter. - /// Resource create parameters. - /// 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 schemaRegistryName, DeviceRegistrySchemaRegistryData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateOrReplaceAsync(Id.SubscriptionId, Id.ResourceGroupName, schemaRegistryName, data, cancellationToken).ConfigureAwait(false); - var operation = new DeviceRegistryArmOperation(new DeviceRegistrySchemaRegistryOperationSource(Client), _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics, Pipeline, _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, schemaRegistryName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create a SchemaRegistry - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} - /// - /// - /// Operation Id - /// SchemaRegistry_CreateOrReplace - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Schema registry name parameter. - /// Resource create parameters. - /// 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 schemaRegistryName, DeviceRegistrySchemaRegistryData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateOrReplace(Id.SubscriptionId, Id.ResourceGroupName, schemaRegistryName, data, cancellationToken); - var operation = new DeviceRegistryArmOperation(new DeviceRegistrySchemaRegistryOperationSource(Client), _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics, Pipeline, _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, schemaRegistryName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a SchemaRegistry - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} - /// - /// - /// Operation Id - /// SchemaRegistry_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Schema registry name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string schemaRegistryName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - - using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryCollection.Get"); - scope.Start(); - try - { - var response = await _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, schemaRegistryName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistrySchemaRegistryResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a SchemaRegistry - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} - /// - /// - /// Operation Id - /// SchemaRegistry_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Schema registry name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string schemaRegistryName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - - using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryCollection.Get"); - scope.Start(); - try - { - var response = _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, schemaRegistryName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistrySchemaRegistryResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// List SchemaRegistry resources by resource group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries - /// - /// - /// Operation Id - /// SchemaRegistry_ListByResourceGroup - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// 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) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistrySchemaRegistryResource(Client, DeviceRegistrySchemaRegistryData.DeserializeDeviceRegistrySchemaRegistryData(e)), _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics, Pipeline, "DeviceRegistrySchemaRegistryCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// List SchemaRegistry resources by resource group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries - /// - /// - /// Operation Id - /// SchemaRegistry_ListByResourceGroup - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// 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) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistrySchemaRegistryResource(Client, DeviceRegistrySchemaRegistryData.DeserializeDeviceRegistrySchemaRegistryData(e)), _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics, Pipeline, "DeviceRegistrySchemaRegistryCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} - /// - /// - /// Operation Id - /// SchemaRegistry_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Schema registry name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string schemaRegistryName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - - using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryCollection.Exists"); - scope.Start(); - try - { - var response = await _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, schemaRegistryName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} - /// - /// - /// Operation Id - /// SchemaRegistry_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Schema registry name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string schemaRegistryName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - - using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryCollection.Exists"); - scope.Start(); - try - { - var response = _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, schemaRegistryName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} - /// - /// - /// Operation Id - /// SchemaRegistry_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Schema registry name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string schemaRegistryName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - - using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, schemaRegistryName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistrySchemaRegistryResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} - /// - /// - /// Operation Id - /// SchemaRegistry_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Schema registry name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string schemaRegistryName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - - using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryCollection.GetIfExists"); - scope.Start(); - try - { - var response = _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, schemaRegistryName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistrySchemaRegistryResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryData.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryData.Serialization.cs deleted file mode 100644 index 7354fa0f6b95..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryData.Serialization.cs +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.DeviceRegistry.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.DeviceRegistry -{ - public partial class DeviceRegistrySchemaRegistryData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(DeviceRegistrySchemaRegistryData)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); - } - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - JsonSerializer.Serialize(writer, Identity); - } - } - - DeviceRegistrySchemaRegistryData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DeviceRegistrySchemaRegistryData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistrySchemaRegistryData(document.RootElement, options); - } - - internal static DeviceRegistrySchemaRegistryData DeserializeDeviceRegistrySchemaRegistryData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DeviceRegistrySchemaRegistryProperties properties = default; - ManagedServiceIdentity identity = default; - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = DeviceRegistrySchemaRegistryProperties.DeserializeDeviceRegistrySchemaRegistryProperties(property.Value, options); - continue; - } - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - identity = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistrySchemaRegistryData( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - properties, - identity, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DeviceRegistrySchemaRegistryData)} does not support writing '{options.Format}' format."); - } - } - - DeviceRegistrySchemaRegistryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeviceRegistrySchemaRegistryData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DeviceRegistrySchemaRegistryData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryData.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryData.cs deleted file mode 100644 index eb1d2e0bea9b..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryData.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.DeviceRegistry.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.DeviceRegistry -{ - /// - /// A class representing the DeviceRegistrySchemaRegistry data model. - /// Schema registry definition. - /// - public partial class DeviceRegistrySchemaRegistryData : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - public DeviceRegistrySchemaRegistryData(AzureLocation location) : base(location) - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The 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 DeviceRegistrySchemaRegistryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, DeviceRegistrySchemaRegistryProperties 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 DeviceRegistrySchemaRegistryData() - { - } - - /// The resource-specific properties for this resource. - public DeviceRegistrySchemaRegistryProperties 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/DeviceRegistrySchemaRegistryResource.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryResource.Serialization.cs deleted file mode 100644 index 897d9aa090f7..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryResource.Serialization.cs +++ /dev/null @@ -1,26 +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 DeviceRegistrySchemaRegistryResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - DeviceRegistrySchemaRegistryData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - DeviceRegistrySchemaRegistryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryResource.cs deleted file mode 100644 index 505e7a6e7853..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryResource.cs +++ /dev/null @@ -1,776 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.DeviceRegistry.Models; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.DeviceRegistry -{ - /// - /// A Class representing a DeviceRegistrySchemaRegistry 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 GetDeviceRegistrySchemaRegistryResource method. - /// Otherwise you can get one from its parent resource using the GetDeviceRegistrySchemaRegistry method. - /// - public partial class DeviceRegistrySchemaRegistryResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The schemaRegistryName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string schemaRegistryName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics; - private readonly SchemaRegistriesRestOperations _deviceRegistrySchemaRegistrySchemaRegistriesRestClient; - private readonly DeviceRegistrySchemaRegistryData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DeviceRegistry/schemaRegistries"; - - /// Initializes a new instance of the class for mocking. - protected DeviceRegistrySchemaRegistryResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal DeviceRegistrySchemaRegistryResource(ArmClient client, DeviceRegistrySchemaRegistryData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// 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 DeviceRegistrySchemaRegistryResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string deviceRegistrySchemaRegistrySchemaRegistriesApiVersion); - _deviceRegistrySchemaRegistrySchemaRegistriesRestClient = new SchemaRegistriesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistrySchemaRegistrySchemaRegistriesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual DeviceRegistrySchemaRegistryData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// Gets a collection of DeviceRegistrySchemaResources in the DeviceRegistrySchemaRegistry. - /// An object representing collection of DeviceRegistrySchemaResources and their operations over a DeviceRegistrySchemaResource. - public virtual DeviceRegistrySchemaCollection GetDeviceRegistrySchemas() - { - return GetCachedClient(client => new DeviceRegistrySchemaCollection(client, Id)); - } - - /// - /// Get a Schema - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} - /// - /// - /// Operation Id - /// Schema_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Schema name parameter. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetDeviceRegistrySchemaAsync(string schemaName, CancellationToken cancellationToken = default) - { - return await GetDeviceRegistrySchemas().GetAsync(schemaName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get a Schema - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} - /// - /// - /// Operation Id - /// Schema_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Schema name parameter. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetDeviceRegistrySchema(string schemaName, CancellationToken cancellationToken = default) - { - return GetDeviceRegistrySchemas().Get(schemaName, cancellationToken); - } - - /// - /// Get a SchemaRegistry - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} - /// - /// - /// Operation Id - /// SchemaRegistry_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryResource.Get"); - scope.Start(); - try - { - var response = await _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistrySchemaRegistryResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a SchemaRegistry - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} - /// - /// - /// Operation Id - /// SchemaRegistry_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryResource.Get"); - scope.Start(); - try - { - var response = _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistrySchemaRegistryResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a SchemaRegistry - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} - /// - /// - /// Operation Id - /// SchemaRegistry_Delete - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryResource.Delete"); - scope.Start(); - try - { - var response = await _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new DeviceRegistryArmOperation(_deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics, Pipeline, _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a SchemaRegistry - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} - /// - /// - /// Operation Id - /// SchemaRegistry_Delete - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryResource.Delete"); - scope.Start(); - try - { - var response = _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new DeviceRegistryArmOperation(_deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics, Pipeline, _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update a SchemaRegistry - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} - /// - /// - /// Operation Id - /// SchemaRegistry_Update - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The resource properties to be updated. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, DeviceRegistrySchemaRegistryPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryResource.Update"); - scope.Start(); - try - { - var response = await _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new DeviceRegistryArmOperation(new DeviceRegistrySchemaRegistryOperationSource(Client), _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics, Pipeline, _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update a SchemaRegistry - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} - /// - /// - /// Operation Id - /// SchemaRegistry_Update - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The resource properties to be updated. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, DeviceRegistrySchemaRegistryPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryResource.Update"); - scope.Start(); - try - { - var response = _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - var operation = new DeviceRegistryArmOperation(new DeviceRegistrySchemaRegistryOperationSource(Client), _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics, Pipeline, _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} - /// - /// - /// Operation Id - /// SchemaRegistry_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// 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) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryResource.AddTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - 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 _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DeviceRegistrySchemaRegistryResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new DeviceRegistrySchemaRegistryPatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} - /// - /// - /// Operation Id - /// SchemaRegistry_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryResource.AddTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues[key] = value; - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new DeviceRegistrySchemaRegistryResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DeviceRegistrySchemaRegistryPatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} - /// - /// - /// Operation Id - /// SchemaRegistry_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// 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) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryResource.SetTags"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); - 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 _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DeviceRegistrySchemaRegistryResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new DeviceRegistrySchemaRegistryPatch(); - patch.Tags.ReplaceWith(tags); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} - /// - /// - /// Operation Id - /// SchemaRegistry_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// 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) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryResource.SetTags"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new DeviceRegistrySchemaRegistryResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DeviceRegistrySchemaRegistryPatch(); - patch.Tags.ReplaceWith(tags); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} - /// - /// - /// Operation Id - /// SchemaRegistry_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryResource.RemoveTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - 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 _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DeviceRegistrySchemaRegistryResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new DeviceRegistrySchemaRegistryPatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} - /// - /// - /// Operation Id - /// SchemaRegistry_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryResource.RemoveTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.Remove(key); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new DeviceRegistrySchemaRegistryResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DeviceRegistrySchemaRegistryPatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaResource.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaResource.Serialization.cs deleted file mode 100644 index c51484b85598..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaResource.Serialization.cs +++ /dev/null @@ -1,26 +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 DeviceRegistrySchemaResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - DeviceRegistrySchemaData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - DeviceRegistrySchemaData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaResource.cs deleted file mode 100644 index 1595594bf11e..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaResource.cs +++ /dev/null @@ -1,424 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.DeviceRegistry -{ - /// - /// A Class representing a DeviceRegistrySchema 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 GetDeviceRegistrySchemaResource method. - /// Otherwise you can get one from its parent resource using the GetDeviceRegistrySchema method. - /// - public partial class DeviceRegistrySchemaResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The schemaRegistryName. - /// The schemaName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _deviceRegistrySchemaSchemasClientDiagnostics; - private readonly SchemasRestOperations _deviceRegistrySchemaSchemasRestClient; - private readonly DeviceRegistrySchemaData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DeviceRegistry/schemaRegistries/schemas"; - - /// Initializes a new instance of the class for mocking. - protected DeviceRegistrySchemaResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal DeviceRegistrySchemaResource(ArmClient client, DeviceRegistrySchemaData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// 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 DeviceRegistrySchemaResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _deviceRegistrySchemaSchemasClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string deviceRegistrySchemaSchemasApiVersion); - _deviceRegistrySchemaSchemasRestClient = new SchemasRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistrySchemaSchemasApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual DeviceRegistrySchemaData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// Gets a collection of DeviceRegistrySchemaVersionResources in the DeviceRegistrySchema. - /// An object representing collection of DeviceRegistrySchemaVersionResources and their operations over a DeviceRegistrySchemaVersionResource. - public virtual DeviceRegistrySchemaVersionCollection GetDeviceRegistrySchemaVersions() - { - return GetCachedClient(client => new DeviceRegistrySchemaVersionCollection(client, Id)); - } - - /// - /// Get a SchemaVersion - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} - /// - /// - /// Operation Id - /// SchemaVersion_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Schema version name parameter. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetDeviceRegistrySchemaVersionAsync(string schemaVersionName, CancellationToken cancellationToken = default) - { - return await GetDeviceRegistrySchemaVersions().GetAsync(schemaVersionName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get a SchemaVersion - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} - /// - /// - /// Operation Id - /// SchemaVersion_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Schema version name parameter. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetDeviceRegistrySchemaVersion(string schemaVersionName, CancellationToken cancellationToken = default) - { - return GetDeviceRegistrySchemaVersions().Get(schemaVersionName, cancellationToken); - } - - /// - /// Get a Schema - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} - /// - /// - /// Operation Id - /// Schema_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaResource.Get"); - scope.Start(); - try - { - var response = await _deviceRegistrySchemaSchemasRestClient.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 DeviceRegistrySchemaResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a Schema - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} - /// - /// - /// Operation Id - /// Schema_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaResource.Get"); - scope.Start(); - try - { - var response = _deviceRegistrySchemaSchemasRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistrySchemaResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a Schema - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} - /// - /// - /// Operation Id - /// Schema_Delete - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaResource.Delete"); - scope.Start(); - try - { - var response = await _deviceRegistrySchemaSchemasRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var uri = _deviceRegistrySchemaSchemasRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new DeviceRegistryArmOperation(response, rehydrationToken); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a Schema - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} - /// - /// - /// Operation Id - /// Schema_Delete - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaResource.Delete"); - scope.Start(); - try - { - var response = _deviceRegistrySchemaSchemasRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var uri = _deviceRegistrySchemaSchemasRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new DeviceRegistryArmOperation(response, rehydrationToken); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create a Schema - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} - /// - /// - /// Operation Id - /// Schema_CreateOrReplace - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Resource create parameters. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, DeviceRegistrySchemaData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaResource.Update"); - scope.Start(); - try - { - var response = await _deviceRegistrySchemaSchemasRestClient.CreateOrReplaceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var uri = _deviceRegistrySchemaSchemasRestClient.CreateCreateOrReplaceRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new DeviceRegistryArmOperation(Response.FromValue(new DeviceRegistrySchemaResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create a Schema - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} - /// - /// - /// Operation Id - /// Schema_CreateOrReplace - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Resource create parameters. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, DeviceRegistrySchemaData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaResource.Update"); - scope.Start(); - try - { - var response = _deviceRegistrySchemaSchemasRestClient.CreateOrReplace(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var uri = _deviceRegistrySchemaSchemasRestClient.CreateCreateOrReplaceRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new DeviceRegistryArmOperation(Response.FromValue(new DeviceRegistrySchemaResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionCollection.cs deleted file mode 100644 index 407f152b4d61..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionCollection.cs +++ /dev/null @@ -1,497 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; - -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 GetDeviceRegistrySchemaVersions method from an instance of . - /// - public partial class DeviceRegistrySchemaVersionCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics; - private readonly SchemaVersionsRestOperations _deviceRegistrySchemaVersionSchemaVersionsRestClient; - - /// Initializes a new instance of the class for mocking. - protected DeviceRegistrySchemaVersionCollection() - { - } - - /// 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 DeviceRegistrySchemaVersionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistrySchemaVersionResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(DeviceRegistrySchemaVersionResource.ResourceType, out string deviceRegistrySchemaVersionSchemaVersionsApiVersion); - _deviceRegistrySchemaVersionSchemaVersionsRestClient = new SchemaVersionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistrySchemaVersionSchemaVersionsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != DeviceRegistrySchemaResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DeviceRegistrySchemaResource.ResourceType), nameof(id)); - } - - /// - /// Create a SchemaVersion - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} - /// - /// - /// Operation Id - /// SchemaVersion_CreateOrReplace - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Schema version name parameter. - /// Resource create parameters. - /// 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 schemaVersionName, DeviceRegistrySchemaVersionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateOrReplaceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, schemaVersionName, data, cancellationToken).ConfigureAwait(false); - var uri = _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateCreateOrReplaceRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, schemaVersionName, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new DeviceRegistryArmOperation(Response.FromValue(new DeviceRegistrySchemaVersionResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create a SchemaVersion - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} - /// - /// - /// Operation Id - /// SchemaVersion_CreateOrReplace - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Schema version name parameter. - /// Resource create parameters. - /// 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 schemaVersionName, DeviceRegistrySchemaVersionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateOrReplace(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, schemaVersionName, data, cancellationToken); - var uri = _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateCreateOrReplaceRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, schemaVersionName, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new DeviceRegistryArmOperation(Response.FromValue(new DeviceRegistrySchemaVersionResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a SchemaVersion - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} - /// - /// - /// Operation Id - /// SchemaVersion_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Schema version name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string schemaVersionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); - - using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionCollection.Get"); - scope.Start(); - try - { - var response = await _deviceRegistrySchemaVersionSchemaVersionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, schemaVersionName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistrySchemaVersionResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a SchemaVersion - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} - /// - /// - /// Operation Id - /// SchemaVersion_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Schema version name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string schemaVersionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); - - using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionCollection.Get"); - scope.Start(); - try - { - var response = _deviceRegistrySchemaVersionSchemaVersionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, schemaVersionName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistrySchemaVersionResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// List SchemaVersion resources by Schema - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions - /// - /// - /// Operation Id - /// SchemaVersion_ListBySchema - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// 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) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateListBySchemaRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateListBySchemaNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistrySchemaVersionResource(Client, DeviceRegistrySchemaVersionData.DeserializeDeviceRegistrySchemaVersionData(e)), _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics, Pipeline, "DeviceRegistrySchemaVersionCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// List SchemaVersion resources by Schema - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions - /// - /// - /// Operation Id - /// SchemaVersion_ListBySchema - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// 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) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateListBySchemaRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateListBySchemaNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistrySchemaVersionResource(Client, DeviceRegistrySchemaVersionData.DeserializeDeviceRegistrySchemaVersionData(e)), _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics, Pipeline, "DeviceRegistrySchemaVersionCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} - /// - /// - /// Operation Id - /// SchemaVersion_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Schema version name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string schemaVersionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); - - using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionCollection.Exists"); - scope.Start(); - try - { - var response = await _deviceRegistrySchemaVersionSchemaVersionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, schemaVersionName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} - /// - /// - /// Operation Id - /// SchemaVersion_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Schema version name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string schemaVersionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); - - using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionCollection.Exists"); - scope.Start(); - try - { - var response = _deviceRegistrySchemaVersionSchemaVersionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, schemaVersionName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} - /// - /// - /// Operation Id - /// SchemaVersion_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Schema version name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string schemaVersionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); - - using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _deviceRegistrySchemaVersionSchemaVersionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, schemaVersionName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistrySchemaVersionResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} - /// - /// - /// Operation Id - /// SchemaVersion_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Schema version name parameter. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string schemaVersionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); - - using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionCollection.GetIfExists"); - scope.Start(); - try - { - var response = _deviceRegistrySchemaVersionSchemaVersionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, schemaVersionName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistrySchemaVersionResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionData.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionData.Serialization.cs deleted file mode 100644 index d96a3df6d156..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionData.Serialization.cs +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.DeviceRegistry.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.DeviceRegistry -{ - public partial class DeviceRegistrySchemaVersionData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(DeviceRegistrySchemaVersionData)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); - } - } - - DeviceRegistrySchemaVersionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DeviceRegistrySchemaVersionData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistrySchemaVersionData(document.RootElement, options); - } - - internal static DeviceRegistrySchemaVersionData DeserializeDeviceRegistrySchemaVersionData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DeviceRegistrySchemaVersionProperties properties = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = DeviceRegistrySchemaVersionProperties.DeserializeDeviceRegistrySchemaVersionProperties(property.Value, options); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistrySchemaVersionData( - id, - name, - type, - systemData, - properties, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DeviceRegistrySchemaVersionData)} does not support writing '{options.Format}' format."); - } - } - - DeviceRegistrySchemaVersionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeviceRegistrySchemaVersionData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DeviceRegistrySchemaVersionData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionData.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionData.cs deleted file mode 100644 index f586a3ab5a4e..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionData.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.DeviceRegistry.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.DeviceRegistry -{ - /// - /// A class representing the DeviceRegistrySchemaVersion data model. - /// Schema version's definition. - /// - public partial class DeviceRegistrySchemaVersionData : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public DeviceRegistrySchemaVersionData() - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The resource-specific properties for this resource. - /// Keeps track of any properties unknown to the library. - internal DeviceRegistrySchemaVersionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DeviceRegistrySchemaVersionProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The resource-specific properties for this resource. - public DeviceRegistrySchemaVersionProperties Properties { get; set; } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionResource.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionResource.Serialization.cs deleted file mode 100644 index d763369b0fa7..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionResource.Serialization.cs +++ /dev/null @@ -1,26 +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 DeviceRegistrySchemaVersionResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - DeviceRegistrySchemaVersionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - DeviceRegistrySchemaVersionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionResource.cs deleted file mode 100644 index ab0953217832..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionResource.cs +++ /dev/null @@ -1,356 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.DeviceRegistry -{ - /// - /// A Class representing a DeviceRegistrySchemaVersion 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 GetDeviceRegistrySchemaVersionResource method. - /// Otherwise you can get one from its parent resource using the GetDeviceRegistrySchemaVersion method. - /// - public partial class DeviceRegistrySchemaVersionResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The schemaRegistryName. - /// The schemaName. - /// The schemaVersionName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics; - private readonly SchemaVersionsRestOperations _deviceRegistrySchemaVersionSchemaVersionsRestClient; - private readonly DeviceRegistrySchemaVersionData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DeviceRegistry/schemaRegistries/schemas/schemaVersions"; - - /// Initializes a new instance of the class for mocking. - protected DeviceRegistrySchemaVersionResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal DeviceRegistrySchemaVersionResource(ArmClient client, DeviceRegistrySchemaVersionData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// 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 DeviceRegistrySchemaVersionResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string deviceRegistrySchemaVersionSchemaVersionsApiVersion); - _deviceRegistrySchemaVersionSchemaVersionsRestClient = new SchemaVersionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistrySchemaVersionSchemaVersionsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual DeviceRegistrySchemaVersionData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Get a SchemaVersion - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} - /// - /// - /// Operation Id - /// SchemaVersion_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionResource.Get"); - scope.Start(); - try - { - var response = await _deviceRegistrySchemaVersionSchemaVersionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistrySchemaVersionResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a SchemaVersion - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} - /// - /// - /// Operation Id - /// SchemaVersion_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionResource.Get"); - scope.Start(); - try - { - var response = _deviceRegistrySchemaVersionSchemaVersionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceRegistrySchemaVersionResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a SchemaVersion - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} - /// - /// - /// Operation Id - /// SchemaVersion_Delete - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionResource.Delete"); - scope.Start(); - try - { - var response = await _deviceRegistrySchemaVersionSchemaVersionsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var uri = _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new DeviceRegistryArmOperation(response, rehydrationToken); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a SchemaVersion - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} - /// - /// - /// Operation Id - /// SchemaVersion_Delete - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionResource.Delete"); - scope.Start(); - try - { - var response = _deviceRegistrySchemaVersionSchemaVersionsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - var uri = _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new DeviceRegistryArmOperation(response, rehydrationToken); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create a SchemaVersion - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} - /// - /// - /// Operation Id - /// SchemaVersion_CreateOrReplace - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Resource create parameters. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, DeviceRegistrySchemaVersionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionResource.Update"); - scope.Start(); - try - { - var response = await _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateOrReplaceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var uri = _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateCreateOrReplaceRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new DeviceRegistryArmOperation(Response.FromValue(new DeviceRegistrySchemaVersionResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create a SchemaVersion - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} - /// - /// - /// Operation Id - /// SchemaVersion_CreateOrReplace - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Resource create parameters. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, DeviceRegistrySchemaVersionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionResource.Update"); - scope.Start(); - try - { - var response = _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateOrReplace(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); - var uri = _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateCreateOrReplaceRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new DeviceRegistryArmOperation(Response.FromValue(new DeviceRegistrySchemaVersionResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} 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 40c653c8fa45..07db454be032 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/DeviceRegistryExtensions.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/DeviceRegistryExtensions.cs @@ -89,101 +89,6 @@ public static DeviceRegistryBillingContainerResource GetDeviceRegistryBillingCon return GetMockableDeviceRegistryArmClient(client).GetDeviceRegistryBillingContainerResource(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. - /// - /// Mocking - /// 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 DeviceRegistryDiscoveredAssetResource GetDeviceRegistryDiscoveredAssetResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableDeviceRegistryArmClient(client).GetDeviceRegistryDiscoveredAssetResource(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. - /// - /// Mocking - /// 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 DeviceRegistryDiscoveredAssetEndpointProfileResource GetDeviceRegistryDiscoveredAssetEndpointProfileResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableDeviceRegistryArmClient(client).GetDeviceRegistryDiscoveredAssetEndpointProfileResource(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. - /// - /// Mocking - /// 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 DeviceRegistrySchemaRegistryResource GetDeviceRegistrySchemaRegistryResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableDeviceRegistryArmClient(client).GetDeviceRegistrySchemaRegistryResource(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. - /// - /// Mocking - /// 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 DeviceRegistrySchemaResource GetDeviceRegistrySchemaResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableDeviceRegistryArmClient(client).GetDeviceRegistrySchemaResource(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. - /// - /// Mocking - /// 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 DeviceRegistrySchemaVersionResource GetDeviceRegistrySchemaVersionResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableDeviceRegistryArmClient(client).GetDeviceRegistrySchemaVersionResource(id); - } - /// /// Gets a collection of DeviceRegistryAssetResources in the ResourceGroupResource. /// @@ -214,7 +119,7 @@ public static DeviceRegistryAssetCollection GetDeviceRegistryAssets(this Resourc /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -252,7 +157,7 @@ public static async Task> GetDeviceRegistr /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -307,7 +212,7 @@ public static DeviceRegistryAssetEndpointProfileCollection GetDeviceRegistryAsse /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -345,7 +250,7 @@ public static async Task> G /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -370,285 +275,6 @@ public static Response GetDeviceRegi return GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryAssetEndpointProfile(assetEndpointProfileName, cancellationToken); } - /// - /// Gets a collection of DeviceRegistryDiscoveredAssetResources in the ResourceGroupResource. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// is null. - /// An object representing collection of DeviceRegistryDiscoveredAssetResources and their operations over a DeviceRegistryDiscoveredAssetResource. - public static DeviceRegistryDiscoveredAssetCollection GetDeviceRegistryDiscoveredAssets(this ResourceGroupResource resourceGroupResource) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryDiscoveredAssets(); - } - - /// - /// Get a DiscoveredAsset - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} - /// - /// - /// Operation Id - /// DiscoveredAsset_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// Discovered Asset name parameter. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static async Task> GetDeviceRegistryDiscoveredAssetAsync(this ResourceGroupResource resourceGroupResource, string discoveredAssetName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return await GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryDiscoveredAssetAsync(discoveredAssetName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get a DiscoveredAsset - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} - /// - /// - /// Operation Id - /// DiscoveredAsset_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// Discovered Asset name parameter. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static Response GetDeviceRegistryDiscoveredAsset(this ResourceGroupResource resourceGroupResource, string discoveredAssetName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryDiscoveredAsset(discoveredAssetName, cancellationToken); - } - - /// - /// Gets a collection of DeviceRegistryDiscoveredAssetEndpointProfileResources in the ResourceGroupResource. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// is null. - /// An object representing collection of DeviceRegistryDiscoveredAssetEndpointProfileResources and their operations over a DeviceRegistryDiscoveredAssetEndpointProfileResource. - public static DeviceRegistryDiscoveredAssetEndpointProfileCollection GetDeviceRegistryDiscoveredAssetEndpointProfiles(this ResourceGroupResource resourceGroupResource) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryDiscoveredAssetEndpointProfiles(); - } - - /// - /// Get a DiscoveredAssetEndpointProfile - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// Discovered Asset Endpoint Profile name parameter. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static async Task> GetDeviceRegistryDiscoveredAssetEndpointProfileAsync(this ResourceGroupResource resourceGroupResource, string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return await GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryDiscoveredAssetEndpointProfileAsync(discoveredAssetEndpointProfileName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get a DiscoveredAssetEndpointProfile - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// Discovered Asset Endpoint Profile name parameter. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static Response GetDeviceRegistryDiscoveredAssetEndpointProfile(this ResourceGroupResource resourceGroupResource, string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryDiscoveredAssetEndpointProfile(discoveredAssetEndpointProfileName, cancellationToken); - } - - /// - /// Gets a collection of DeviceRegistrySchemaRegistryResources in the ResourceGroupResource. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// is null. - /// An object representing collection of DeviceRegistrySchemaRegistryResources and their operations over a DeviceRegistrySchemaRegistryResource. - public static DeviceRegistrySchemaRegistryCollection GetDeviceRegistrySchemaRegistries(this ResourceGroupResource resourceGroupResource) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistrySchemaRegistries(); - } - - /// - /// Get a SchemaRegistry - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} - /// - /// - /// Operation Id - /// SchemaRegistry_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// Schema registry name parameter. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static async Task> GetDeviceRegistrySchemaRegistryAsync(this ResourceGroupResource resourceGroupResource, string schemaRegistryName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return await GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistrySchemaRegistryAsync(schemaRegistryName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get a SchemaRegistry - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} - /// - /// - /// Operation Id - /// SchemaRegistry_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// Schema registry name parameter. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static Response GetDeviceRegistrySchemaRegistry(this ResourceGroupResource resourceGroupResource, string schemaRegistryName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistrySchemaRegistry(schemaRegistryName, cancellationToken); - } - /// /// Gets a collection of DeviceRegistryBillingContainerResources in the SubscriptionResource. /// @@ -679,7 +305,7 @@ public static DeviceRegistryBillingContainerCollection GetDeviceRegistryBillingC /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -717,7 +343,7 @@ public static async Task> GetDe /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -755,7 +381,7 @@ public static Response GetDeviceRegistry /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -791,7 +417,7 @@ public static AsyncPageable GetDeviceRegistryAssets /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -827,7 +453,7 @@ public static Pageable GetDeviceRegistryAssets(this /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -863,7 +489,7 @@ public static AsyncPageable GetDevic /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -885,221 +511,5 @@ public static Pageable GetDeviceRegi return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetDeviceRegistryAssetEndpointProfiles(cancellationToken); } - - /// - /// List DiscoveredAsset resources by subscription ID - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/discoveredAssets - /// - /// - /// Operation Id - /// DiscoveredAsset_ListBySubscription - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// 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 GetDeviceRegistryDiscoveredAssetsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetDeviceRegistryDiscoveredAssetsAsync(cancellationToken); - } - - /// - /// List DiscoveredAsset resources by subscription ID - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/discoveredAssets - /// - /// - /// Operation Id - /// DiscoveredAsset_ListBySubscription - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// 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 GetDeviceRegistryDiscoveredAssets(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetDeviceRegistryDiscoveredAssets(cancellationToken); - } - - /// - /// List DiscoveredAssetEndpointProfile resources by subscription ID - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_ListBySubscription - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// 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 GetDeviceRegistryDiscoveredAssetEndpointProfilesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetDeviceRegistryDiscoveredAssetEndpointProfilesAsync(cancellationToken); - } - - /// - /// List DiscoveredAssetEndpointProfile resources by subscription ID - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_ListBySubscription - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// 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 GetDeviceRegistryDiscoveredAssetEndpointProfiles(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetDeviceRegistryDiscoveredAssetEndpointProfiles(cancellationToken); - } - - /// - /// List SchemaRegistry resources by subscription ID - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/schemaRegistries - /// - /// - /// Operation Id - /// SchemaRegistry_ListBySubscription - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// 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 GetDeviceRegistrySchemaRegistriesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetDeviceRegistrySchemaRegistriesAsync(cancellationToken); - } - - /// - /// List SchemaRegistry resources by subscription ID - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/schemaRegistries - /// - /// - /// Operation Id - /// SchemaRegistry_ListBySubscription - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// 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 GetDeviceRegistrySchemaRegistries(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetDeviceRegistrySchemaRegistries(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 78af7c3296d6..9a806c1dd2ec 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistryArmClient.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistryArmClient.cs @@ -69,65 +69,5 @@ public virtual DeviceRegistryBillingContainerResource GetDeviceRegistryBillingCo DeviceRegistryBillingContainerResource.ValidateResourceId(id); return new DeviceRegistryBillingContainerResource(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. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual DeviceRegistryDiscoveredAssetResource GetDeviceRegistryDiscoveredAssetResource(ResourceIdentifier id) - { - DeviceRegistryDiscoveredAssetResource.ValidateResourceId(id); - return new DeviceRegistryDiscoveredAssetResource(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. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual DeviceRegistryDiscoveredAssetEndpointProfileResource GetDeviceRegistryDiscoveredAssetEndpointProfileResource(ResourceIdentifier id) - { - DeviceRegistryDiscoveredAssetEndpointProfileResource.ValidateResourceId(id); - return new DeviceRegistryDiscoveredAssetEndpointProfileResource(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. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual DeviceRegistrySchemaRegistryResource GetDeviceRegistrySchemaRegistryResource(ResourceIdentifier id) - { - DeviceRegistrySchemaRegistryResource.ValidateResourceId(id); - return new DeviceRegistrySchemaRegistryResource(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. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual DeviceRegistrySchemaResource GetDeviceRegistrySchemaResource(ResourceIdentifier id) - { - DeviceRegistrySchemaResource.ValidateResourceId(id); - return new DeviceRegistrySchemaResource(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. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual DeviceRegistrySchemaVersionResource GetDeviceRegistrySchemaVersionResource(ResourceIdentifier id) - { - DeviceRegistrySchemaVersionResource.ValidateResourceId(id); - return new DeviceRegistrySchemaVersionResource(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 fb8d8c7fc9b4..0fb3e0898aab 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistryResourceGroupResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistryResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual DeviceRegistryAssetCollection GetDeviceRegistryAssets() /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetDeviceRegist /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -122,7 +122,7 @@ public virtual DeviceRegistryAssetEndpointProfileCollection GetDeviceRegistryAss /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -153,7 +153,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -170,212 +170,5 @@ public virtual Response GetDeviceReg { return GetDeviceRegistryAssetEndpointProfiles().Get(assetEndpointProfileName, cancellationToken); } - - /// Gets a collection of DeviceRegistryDiscoveredAssetResources in the ResourceGroupResource. - /// An object representing collection of DeviceRegistryDiscoveredAssetResources and their operations over a DeviceRegistryDiscoveredAssetResource. - public virtual DeviceRegistryDiscoveredAssetCollection GetDeviceRegistryDiscoveredAssets() - { - return GetCachedClient(client => new DeviceRegistryDiscoveredAssetCollection(client, Id)); - } - - /// - /// Get a DiscoveredAsset - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} - /// - /// - /// Operation Id - /// DiscoveredAsset_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Discovered Asset name parameter. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetDeviceRegistryDiscoveredAssetAsync(string discoveredAssetName, CancellationToken cancellationToken = default) - { - return await GetDeviceRegistryDiscoveredAssets().GetAsync(discoveredAssetName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get a DiscoveredAsset - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} - /// - /// - /// Operation Id - /// DiscoveredAsset_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Discovered Asset name parameter. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetDeviceRegistryDiscoveredAsset(string discoveredAssetName, CancellationToken cancellationToken = default) - { - return GetDeviceRegistryDiscoveredAssets().Get(discoveredAssetName, cancellationToken); - } - - /// Gets a collection of DeviceRegistryDiscoveredAssetEndpointProfileResources in the ResourceGroupResource. - /// An object representing collection of DeviceRegistryDiscoveredAssetEndpointProfileResources and their operations over a DeviceRegistryDiscoveredAssetEndpointProfileResource. - public virtual DeviceRegistryDiscoveredAssetEndpointProfileCollection GetDeviceRegistryDiscoveredAssetEndpointProfiles() - { - return GetCachedClient(client => new DeviceRegistryDiscoveredAssetEndpointProfileCollection(client, Id)); - } - - /// - /// Get a DiscoveredAssetEndpointProfile - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Discovered Asset Endpoint Profile name parameter. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetDeviceRegistryDiscoveredAssetEndpointProfileAsync(string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) - { - return await GetDeviceRegistryDiscoveredAssetEndpointProfiles().GetAsync(discoveredAssetEndpointProfileName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get a DiscoveredAssetEndpointProfile - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Discovered Asset Endpoint Profile name parameter. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetDeviceRegistryDiscoveredAssetEndpointProfile(string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) - { - return GetDeviceRegistryDiscoveredAssetEndpointProfiles().Get(discoveredAssetEndpointProfileName, cancellationToken); - } - - /// Gets a collection of DeviceRegistrySchemaRegistryResources in the ResourceGroupResource. - /// An object representing collection of DeviceRegistrySchemaRegistryResources and their operations over a DeviceRegistrySchemaRegistryResource. - public virtual DeviceRegistrySchemaRegistryCollection GetDeviceRegistrySchemaRegistries() - { - return GetCachedClient(client => new DeviceRegistrySchemaRegistryCollection(client, Id)); - } - - /// - /// Get a SchemaRegistry - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} - /// - /// - /// Operation Id - /// SchemaRegistry_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Schema registry name parameter. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetDeviceRegistrySchemaRegistryAsync(string schemaRegistryName, CancellationToken cancellationToken = default) - { - return await GetDeviceRegistrySchemaRegistries().GetAsync(schemaRegistryName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get a SchemaRegistry - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} - /// - /// - /// Operation Id - /// SchemaRegistry_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Schema registry name parameter. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetDeviceRegistrySchemaRegistry(string schemaRegistryName, CancellationToken cancellationToken = default) - { - return GetDeviceRegistrySchemaRegistries().Get(schemaRegistryName, cancellationToken); - } } } 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 5f97882a97f9..a79ae955b1ae 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistrySubscriptionResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistrySubscriptionResource.cs @@ -21,12 +21,6 @@ public partial class MockableDeviceRegistrySubscriptionResource : ArmResource private AssetsRestOperations _deviceRegistryAssetAssetsRestClient; private ClientDiagnostics _deviceRegistryAssetEndpointProfileAssetEndpointProfilesClientDiagnostics; private AssetEndpointProfilesRestOperations _deviceRegistryAssetEndpointProfileAssetEndpointProfilesRestClient; - private ClientDiagnostics _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics; - private DiscoveredAssetsRestOperations _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient; - private ClientDiagnostics _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics; - private DiscoveredAssetEndpointProfilesRestOperations _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient; - private ClientDiagnostics _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics; - private SchemaRegistriesRestOperations _deviceRegistrySchemaRegistrySchemaRegistriesRestClient; /// Initializes a new instance of the class for mocking. protected MockableDeviceRegistrySubscriptionResource() @@ -44,12 +38,6 @@ 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 DeviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics => _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistryDiscoveredAssetResource.ResourceType.Namespace, Diagnostics); - private DiscoveredAssetsRestOperations DeviceRegistryDiscoveredAssetDiscoveredAssetsRestClient => _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient ??= new DiscoveredAssetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DeviceRegistryDiscoveredAssetResource.ResourceType)); - private ClientDiagnostics DeviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics => _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistryDiscoveredAssetEndpointProfileResource.ResourceType.Namespace, Diagnostics); - private DiscoveredAssetEndpointProfilesRestOperations DeviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient => _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient ??= new DiscoveredAssetEndpointProfilesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DeviceRegistryDiscoveredAssetEndpointProfileResource.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)); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -77,7 +65,7 @@ public virtual DeviceRegistryBillingContainerCollection GetDeviceRegistryBilling /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -108,7 +96,7 @@ public virtual async Task> GetD /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -139,7 +127,7 @@ public virtual Response GetDeviceRegistr /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -169,7 +157,7 @@ public virtual AsyncPageable GetDeviceRegistryAsset /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -199,7 +187,7 @@ public virtual Pageable GetDeviceRegistryAssets(Can /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -229,7 +217,7 @@ public virtual AsyncPageable GetDevi /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource @@ -245,185 +233,5 @@ public virtual Pageable GetDeviceReg HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceRegistryAssetEndpointProfileAssetEndpointProfilesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryAssetEndpointProfileResource(Client, DeviceRegistryAssetEndpointProfileData.DeserializeDeviceRegistryAssetEndpointProfileData(e)), DeviceRegistryAssetEndpointProfileAssetEndpointProfilesClientDiagnostics, Pipeline, "MockableDeviceRegistrySubscriptionResource.GetDeviceRegistryAssetEndpointProfiles", "value", "nextLink", cancellationToken); } - - /// - /// List DiscoveredAsset resources by subscription ID - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/discoveredAssets - /// - /// - /// Operation Id - /// DiscoveredAsset_ListBySubscription - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetDeviceRegistryDiscoveredAssetsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryDiscoveredAssetResource(Client, DeviceRegistryDiscoveredAssetData.DeserializeDeviceRegistryDiscoveredAssetData(e)), DeviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics, Pipeline, "MockableDeviceRegistrySubscriptionResource.GetDeviceRegistryDiscoveredAssets", "value", "nextLink", cancellationToken); - } - - /// - /// List DiscoveredAsset resources by subscription ID - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/discoveredAssets - /// - /// - /// Operation Id - /// DiscoveredAsset_ListBySubscription - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetDeviceRegistryDiscoveredAssets(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryDiscoveredAssetResource(Client, DeviceRegistryDiscoveredAssetData.DeserializeDeviceRegistryDiscoveredAssetData(e)), DeviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics, Pipeline, "MockableDeviceRegistrySubscriptionResource.GetDeviceRegistryDiscoveredAssets", "value", "nextLink", cancellationToken); - } - - /// - /// List DiscoveredAssetEndpointProfile resources by subscription ID - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_ListBySubscription - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetDeviceRegistryDiscoveredAssetEndpointProfilesAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, DeviceRegistryDiscoveredAssetEndpointProfileData.DeserializeDeviceRegistryDiscoveredAssetEndpointProfileData(e)), DeviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics, Pipeline, "MockableDeviceRegistrySubscriptionResource.GetDeviceRegistryDiscoveredAssetEndpointProfiles", "value", "nextLink", cancellationToken); - } - - /// - /// List DiscoveredAssetEndpointProfile resources by subscription ID - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles - /// - /// - /// Operation Id - /// DiscoveredAssetEndpointProfile_ListBySubscription - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetDeviceRegistryDiscoveredAssetEndpointProfiles(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, DeviceRegistryDiscoveredAssetEndpointProfileData.DeserializeDeviceRegistryDiscoveredAssetEndpointProfileData(e)), DeviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics, Pipeline, "MockableDeviceRegistrySubscriptionResource.GetDeviceRegistryDiscoveredAssetEndpointProfiles", "value", "nextLink", cancellationToken); - } - - /// - /// List SchemaRegistry resources by subscription ID - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/schemaRegistries - /// - /// - /// Operation Id - /// SchemaRegistry_ListBySubscription - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetDeviceRegistrySchemaRegistriesAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistrySchemaRegistryResource(Client, DeviceRegistrySchemaRegistryData.DeserializeDeviceRegistrySchemaRegistryData(e)), DeviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics, Pipeline, "MockableDeviceRegistrySubscriptionResource.GetDeviceRegistrySchemaRegistries", "value", "nextLink", cancellationToken); - } - - /// - /// List SchemaRegistry resources by subscription ID - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/schemaRegistries - /// - /// - /// Operation Id - /// SchemaRegistry_ListBySubscription - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetDeviceRegistrySchemaRegistries(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistrySchemaRegistryResource(Client, DeviceRegistrySchemaRegistryData.DeserializeDeviceRegistrySchemaRegistryData(e)), DeviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics, Pipeline, "MockableDeviceRegistrySubscriptionResource.GetDeviceRegistrySchemaRegistries", "value", "nextLink", cancellationToken); - } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryDiscoveredAssetEndpointProfileOperationSource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryDiscoveredAssetEndpointProfileOperationSource.cs deleted file mode 100644 index 54bb00650051..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryDiscoveredAssetEndpointProfileOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry -{ - internal class DeviceRegistryDiscoveredAssetEndpointProfileOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal DeviceRegistryDiscoveredAssetEndpointProfileOperationSource(ArmClient client) - { - _client = client; - } - - DeviceRegistryDiscoveredAssetEndpointProfileResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = DeviceRegistryDiscoveredAssetEndpointProfileData.DeserializeDeviceRegistryDiscoveredAssetEndpointProfileData(document.RootElement); - return new DeviceRegistryDiscoveredAssetEndpointProfileResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = DeviceRegistryDiscoveredAssetEndpointProfileData.DeserializeDeviceRegistryDiscoveredAssetEndpointProfileData(document.RootElement); - return new DeviceRegistryDiscoveredAssetEndpointProfileResource(_client, data); - } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryDiscoveredAssetOperationSource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryDiscoveredAssetOperationSource.cs deleted file mode 100644 index a739fa7c4dd1..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryDiscoveredAssetOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry -{ - internal class DeviceRegistryDiscoveredAssetOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal DeviceRegistryDiscoveredAssetOperationSource(ArmClient client) - { - _client = client; - } - - DeviceRegistryDiscoveredAssetResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = DeviceRegistryDiscoveredAssetData.DeserializeDeviceRegistryDiscoveredAssetData(document.RootElement); - return new DeviceRegistryDiscoveredAssetResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = DeviceRegistryDiscoveredAssetData.DeserializeDeviceRegistryDiscoveredAssetData(document.RootElement); - return new DeviceRegistryDiscoveredAssetResource(_client, data); - } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistrySchemaRegistryOperationSource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistrySchemaRegistryOperationSource.cs deleted file mode 100644 index 360604a614b0..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistrySchemaRegistryOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry -{ - internal class DeviceRegistrySchemaRegistryOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal DeviceRegistrySchemaRegistryOperationSource(ArmClient client) - { - _client = client; - } - - DeviceRegistrySchemaRegistryResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = DeviceRegistrySchemaRegistryData.DeserializeDeviceRegistrySchemaRegistryData(document.RootElement); - return new DeviceRegistrySchemaRegistryResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = DeviceRegistrySchemaRegistryData.DeserializeDeviceRegistrySchemaRegistryData(document.RootElement); - return new DeviceRegistrySchemaRegistryResource(_client, data); - } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetEndpointProfilePatch.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetEndpointProfilePatch.Serialization.cs deleted file mode 100644 index c88f921b4fab..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetEndpointProfilePatch.Serialization.cs +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - public partial class DeviceRegistryDiscoveredAssetEndpointProfilePatch : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetEndpointProfilePatch)} does not support writing '{format}' format."); - } - - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - DeviceRegistryDiscoveredAssetEndpointProfilePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetEndpointProfilePatch)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryDiscoveredAssetEndpointProfilePatch(document.RootElement, options); - } - - internal static DeviceRegistryDiscoveredAssetEndpointProfilePatch DeserializeDeviceRegistryDiscoveredAssetEndpointProfilePatch(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IDictionary tags = default; - DiscoveredAssetEndpointProfileUpdateProperties properties = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = DiscoveredAssetEndpointProfileUpdateProperties.DeserializeDiscoveredAssetEndpointProfileUpdateProperties(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryDiscoveredAssetEndpointProfilePatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetEndpointProfilePatch)} does not support writing '{options.Format}' format."); - } - } - - DeviceRegistryDiscoveredAssetEndpointProfilePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeviceRegistryDiscoveredAssetEndpointProfilePatch(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetEndpointProfilePatch)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetEndpointProfilePatch.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetEndpointProfilePatch.cs deleted file mode 100644 index 453a08d4ba5d..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetEndpointProfilePatch.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// The type used for update operations of the DiscoveredAssetEndpointProfile. - public partial class DeviceRegistryDiscoveredAssetEndpointProfilePatch - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public DeviceRegistryDiscoveredAssetEndpointProfilePatch() - { - Tags = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . - /// Resource tags. - /// The resource-specific properties for this resource. - /// Keeps track of any properties unknown to the library. - internal DeviceRegistryDiscoveredAssetEndpointProfilePatch(IDictionary tags, DiscoveredAssetEndpointProfileUpdateProperties properties, IDictionary serializedAdditionalRawData) - { - Tags = tags; - Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Resource tags. - public IDictionary Tags { get; } - /// The resource-specific properties for this resource. - public DiscoveredAssetEndpointProfileUpdateProperties Properties { get; set; } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetPatch.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetPatch.Serialization.cs deleted file mode 100644 index a1dd38d62e10..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetPatch.Serialization.cs +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - public partial class DeviceRegistryDiscoveredAssetPatch : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetPatch)} does not support writing '{format}' format."); - } - - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - DeviceRegistryDiscoveredAssetPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetPatch)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryDiscoveredAssetPatch(document.RootElement, options); - } - - internal static DeviceRegistryDiscoveredAssetPatch DeserializeDeviceRegistryDiscoveredAssetPatch(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IDictionary tags = default; - DiscoveredAssetUpdateProperties properties = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = DiscoveredAssetUpdateProperties.DeserializeDiscoveredAssetUpdateProperties(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryDiscoveredAssetPatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetPatch)} does not support writing '{options.Format}' format."); - } - } - - DeviceRegistryDiscoveredAssetPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeviceRegistryDiscoveredAssetPatch(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetPatch)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetPatch.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetPatch.cs deleted file mode 100644 index 08c89ec146f6..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetPatch.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// The type used for update operations of the DiscoveredAsset. - public partial class DeviceRegistryDiscoveredAssetPatch - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public DeviceRegistryDiscoveredAssetPatch() - { - Tags = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . - /// Resource tags. - /// The resource-specific properties for this resource. - /// Keeps track of any properties unknown to the library. - internal DeviceRegistryDiscoveredAssetPatch(IDictionary tags, DiscoveredAssetUpdateProperties properties, IDictionary serializedAdditionalRawData) - { - Tags = tags; - Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Resource tags. - public IDictionary Tags { get; } - /// The resource-specific properties for this resource. - public DiscoveredAssetUpdateProperties Properties { get; set; } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetProperties.Serialization.cs deleted file mode 100644 index d2fdb98730af..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetProperties.Serialization.cs +++ /dev/null @@ -1,358 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - public partial class DeviceRegistryDiscoveredAssetProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetProperties)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("assetEndpointProfileRef"u8); - writer.WriteStringValue(AssetEndpointProfileRef); - writer.WritePropertyName("discoveryId"u8); - writer.WriteStringValue(DiscoveryId); - writer.WritePropertyName("version"u8); - writer.WriteNumberValue(Version); - if (Optional.IsDefined(Manufacturer)) - { - writer.WritePropertyName("manufacturer"u8); - writer.WriteStringValue(Manufacturer); - } - if (Optional.IsDefined(ManufacturerUri)) - { - writer.WritePropertyName("manufacturerUri"u8); - writer.WriteStringValue(ManufacturerUri.AbsoluteUri); - } - if (Optional.IsDefined(Model)) - { - writer.WritePropertyName("model"u8); - writer.WriteStringValue(Model); - } - if (Optional.IsDefined(ProductCode)) - { - writer.WritePropertyName("productCode"u8); - writer.WriteStringValue(ProductCode); - } - if (Optional.IsDefined(HardwareRevision)) - { - writer.WritePropertyName("hardwareRevision"u8); - writer.WriteStringValue(HardwareRevision); - } - if (Optional.IsDefined(SoftwareRevision)) - { - writer.WritePropertyName("softwareRevision"u8); - writer.WriteStringValue(SoftwareRevision); - } - if (Optional.IsDefined(DocumentationUri)) - { - writer.WritePropertyName("documentationUri"u8); - writer.WriteStringValue(DocumentationUri.AbsoluteUri); - } - if (Optional.IsDefined(SerialNumber)) - { - writer.WritePropertyName("serialNumber"u8); - writer.WriteStringValue(SerialNumber); - } - if (Optional.IsDefined(DefaultDatasetsConfiguration)) - { - writer.WritePropertyName("defaultDatasetsConfiguration"u8); - writer.WriteStringValue(DefaultDatasetsConfiguration); - } - if (Optional.IsDefined(DefaultEventsConfiguration)) - { - writer.WritePropertyName("defaultEventsConfiguration"u8); - writer.WriteStringValue(DefaultEventsConfiguration); - } - if (Optional.IsDefined(DefaultTopic)) - { - writer.WritePropertyName("defaultTopic"u8); - writer.WriteObjectValue(DefaultTopic, options); - } - if (Optional.IsCollectionDefined(Datasets)) - { - writer.WritePropertyName("datasets"u8); - writer.WriteStartArray(); - foreach (var item in Datasets) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Events)) - { - writer.WritePropertyName("events"u8); - writer.WriteStartArray(); - foreach (var item in Events) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - DeviceRegistryDiscoveredAssetProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistryDiscoveredAssetProperties(document.RootElement, options); - } - - internal static DeviceRegistryDiscoveredAssetProperties DeserializeDeviceRegistryDiscoveredAssetProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string assetEndpointProfileRef = default; - string discoveryId = default; - long version = default; - string manufacturer = default; - Uri manufacturerUri = default; - string model = default; - string productCode = default; - string hardwareRevision = default; - string softwareRevision = default; - Uri documentationUri = default; - string serialNumber = default; - string defaultDatasetsConfiguration = default; - string defaultEventsConfiguration = default; - DeviceRegistryTopic defaultTopic = default; - IList datasets = default; - IList events = default; - DeviceRegistryProvisioningState? provisioningState = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("assetEndpointProfileRef"u8)) - { - assetEndpointProfileRef = property.Value.GetString(); - continue; - } - if (property.NameEquals("discoveryId"u8)) - { - discoveryId = property.Value.GetString(); - continue; - } - if (property.NameEquals("version"u8)) - { - version = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("manufacturer"u8)) - { - manufacturer = property.Value.GetString(); - continue; - } - if (property.NameEquals("manufacturerUri"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - manufacturerUri = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("model"u8)) - { - model = property.Value.GetString(); - continue; - } - if (property.NameEquals("productCode"u8)) - { - productCode = property.Value.GetString(); - continue; - } - if (property.NameEquals("hardwareRevision"u8)) - { - hardwareRevision = property.Value.GetString(); - continue; - } - if (property.NameEquals("softwareRevision"u8)) - { - softwareRevision = property.Value.GetString(); - continue; - } - if (property.NameEquals("documentationUri"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - documentationUri = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("serialNumber"u8)) - { - serialNumber = property.Value.GetString(); - continue; - } - if (property.NameEquals("defaultDatasetsConfiguration"u8)) - { - defaultDatasetsConfiguration = property.Value.GetString(); - continue; - } - if (property.NameEquals("defaultEventsConfiguration"u8)) - { - defaultEventsConfiguration = property.Value.GetString(); - continue; - } - if (property.NameEquals("defaultTopic"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - defaultTopic = DeviceRegistryTopic.DeserializeDeviceRegistryTopic(property.Value, options); - continue; - } - if (property.NameEquals("datasets"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DiscoveredDataset.DeserializeDiscoveredDataset(item, options)); - } - datasets = array; - continue; - } - if (property.NameEquals("events"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DiscoveredEvent.DeserializeDiscoveredEvent(item, options)); - } - events = array; - continue; - } - if (property.NameEquals("provisioningState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new DeviceRegistryProvisioningState(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryDiscoveredAssetProperties( - assetEndpointProfileRef, - discoveryId, - version, - manufacturer, - manufacturerUri, - model, - productCode, - hardwareRevision, - softwareRevision, - documentationUri, - serialNumber, - defaultDatasetsConfiguration, - defaultEventsConfiguration, - defaultTopic, - datasets ?? new ChangeTrackingList(), - events ?? new ChangeTrackingList(), - provisioningState, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetProperties)} does not support writing '{options.Format}' format."); - } - } - - DeviceRegistryDiscoveredAssetProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeviceRegistryDiscoveredAssetProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetProperties.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetProperties.cs deleted file mode 100644 index d09dc205a5b7..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetProperties.cs +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// Defines the discovered asset properties. - public partial class DeviceRegistryDiscoveredAssetProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// A reference to the asset endpoint profile (connection information) used by brokers to connect to an endpoint that provides data points for this asset. Must provide asset endpoint profile name. - /// Identifier used to detect changes in the asset. - /// An integer that is incremented each time the resource is modified. - /// or is null. - public DeviceRegistryDiscoveredAssetProperties(string assetEndpointProfileRef, string discoveryId, long version) - { - Argument.AssertNotNull(assetEndpointProfileRef, nameof(assetEndpointProfileRef)); - Argument.AssertNotNull(discoveryId, nameof(discoveryId)); - - AssetEndpointProfileRef = assetEndpointProfileRef; - DiscoveryId = discoveryId; - Version = version; - Datasets = new ChangeTrackingList(); - Events = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// A reference to the asset endpoint profile (connection information) used by brokers to connect to an endpoint that provides data points for this asset. Must provide asset endpoint profile name. - /// Identifier used to detect changes in the asset. - /// An integer that is incremented each time the resource is modified. - /// Asset manufacturer name. - /// Asset manufacturer URI. - /// Asset model name. - /// Asset product code. - /// Revision number of the hardware. - /// Revision number of the software. - /// Reference to the documentation. - /// Asset serial number. - /// Stringified JSON that contains connector-specific default configuration for all datasets. Each dataset can have its own configuration that overrides the default settings here. - /// Stringified JSON that contains connector-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here. - /// Object that describes the default topic information for the asset. - /// Array of datasets that are part of the asset. Each dataset spec describes the data points that make up the set. - /// Array of events that are part of the asset. Each event can have per-event configuration. - /// Provisioning state of the resource. - /// Keeps track of any properties unknown to the library. - internal DeviceRegistryDiscoveredAssetProperties(string assetEndpointProfileRef, string discoveryId, long version, string manufacturer, Uri manufacturerUri, string model, string productCode, string hardwareRevision, string softwareRevision, Uri documentationUri, string serialNumber, string defaultDatasetsConfiguration, string defaultEventsConfiguration, DeviceRegistryTopic defaultTopic, IList datasets, IList events, DeviceRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) - { - AssetEndpointProfileRef = assetEndpointProfileRef; - DiscoveryId = discoveryId; - Version = version; - Manufacturer = manufacturer; - ManufacturerUri = manufacturerUri; - Model = model; - ProductCode = productCode; - HardwareRevision = hardwareRevision; - SoftwareRevision = softwareRevision; - DocumentationUri = documentationUri; - SerialNumber = serialNumber; - DefaultDatasetsConfiguration = defaultDatasetsConfiguration; - DefaultEventsConfiguration = defaultEventsConfiguration; - DefaultTopic = defaultTopic; - Datasets = datasets; - Events = events; - ProvisioningState = provisioningState; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DeviceRegistryDiscoveredAssetProperties() - { - } - - /// A reference to the asset endpoint profile (connection information) used by brokers to connect to an endpoint that provides data points for this asset. Must provide asset endpoint profile name. - public string AssetEndpointProfileRef { get; set; } - /// Identifier used to detect changes in the asset. - public string DiscoveryId { get; set; } - /// An integer that is incremented each time the resource is modified. - public long Version { get; set; } - /// Asset manufacturer name. - public string Manufacturer { get; set; } - /// Asset manufacturer URI. - public Uri ManufacturerUri { get; set; } - /// Asset model name. - public string Model { get; set; } - /// Asset product code. - public string ProductCode { get; set; } - /// Revision number of the hardware. - public string HardwareRevision { get; set; } - /// Revision number of the software. - public string SoftwareRevision { get; set; } - /// Reference to the documentation. - public Uri DocumentationUri { get; set; } - /// Asset serial number. - public string SerialNumber { get; set; } - /// Stringified JSON that contains connector-specific default configuration for all datasets. Each dataset can have its own configuration that overrides the default settings here. - public string DefaultDatasetsConfiguration { get; set; } - /// Stringified JSON that contains connector-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here. - public string DefaultEventsConfiguration { get; set; } - /// Object that describes the default topic information for the asset. - public DeviceRegistryTopic DefaultTopic { get; set; } - /// Array of datasets that are part of the asset. Each dataset spec describes the data points that make up the set. - public IList Datasets { get; } - /// Array of events that are part of the asset. Each event can have per-event configuration. - public IList Events { get; } - /// Provisioning state of the resource. - public DeviceRegistryProvisioningState? ProvisioningState { get; } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaFormat.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaFormat.cs deleted file mode 100644 index 6a0aac44a946..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaFormat.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// Defines the schema format. - public readonly partial struct DeviceRegistrySchemaFormat : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DeviceRegistrySchemaFormat(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string JsonSchemaDraft7Value = "JsonSchema/draft-07"; - private const string Delta10Value = "Delta/1.0"; - - /// JSON Schema version draft 7 format. - public static DeviceRegistrySchemaFormat JsonSchemaDraft7 { get; } = new DeviceRegistrySchemaFormat(JsonSchemaDraft7Value); - /// Delta format. - public static DeviceRegistrySchemaFormat Delta10 { get; } = new DeviceRegistrySchemaFormat(Delta10Value); - /// Determines if two values are the same. - public static bool operator ==(DeviceRegistrySchemaFormat left, DeviceRegistrySchemaFormat right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DeviceRegistrySchemaFormat left, DeviceRegistrySchemaFormat right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator DeviceRegistrySchemaFormat(string value) => new DeviceRegistrySchemaFormat(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DeviceRegistrySchemaFormat other && Equals(other); - /// - public bool Equals(DeviceRegistrySchemaFormat other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaProperties.Serialization.cs deleted file mode 100644 index 8fbb6df82eb8..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaProperties.Serialization.cs +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - public partial class DeviceRegistrySchemaProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(DeviceRegistrySchemaProperties)} does not support writing '{format}' format."); - } - - if (options.Format != "W" && Optional.IsDefined(Uuid)) - { - writer.WritePropertyName("uuid"u8); - writer.WriteStringValue(Uuid); - } - if (Optional.IsDefined(DisplayName)) - { - writer.WritePropertyName("displayName"u8); - writer.WriteStringValue(DisplayName); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - writer.WritePropertyName("format"u8); - writer.WriteStringValue(Format.ToString()); - writer.WritePropertyName("schemaType"u8); - writer.WriteStringValue(SchemaType.ToString()); - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - DeviceRegistrySchemaProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DeviceRegistrySchemaProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistrySchemaProperties(document.RootElement, options); - } - - internal static DeviceRegistrySchemaProperties DeserializeDeviceRegistrySchemaProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string uuid = default; - string displayName = default; - string description = default; - DeviceRegistrySchemaFormat format = default; - DeviceRegistrySchemaType schemaType = default; - DeviceRegistryProvisioningState? provisioningState = default; - IDictionary tags = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("uuid"u8)) - { - uuid = property.Value.GetString(); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("format"u8)) - { - format = new DeviceRegistrySchemaFormat(property.Value.GetString()); - continue; - } - if (property.NameEquals("schemaType"u8)) - { - schemaType = new DeviceRegistrySchemaType(property.Value.GetString()); - continue; - } - if (property.NameEquals("provisioningState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new DeviceRegistryProvisioningState(property.Value.GetString()); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistrySchemaProperties( - uuid, - displayName, - description, - format, - schemaType, - provisioningState, - tags ?? new ChangeTrackingDictionary(), - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DeviceRegistrySchemaProperties)} does not support writing '{options.Format}' format."); - } - } - - DeviceRegistrySchemaProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeviceRegistrySchemaProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DeviceRegistrySchemaProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaProperties.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaProperties.cs deleted file mode 100644 index 7863d8ea1f2b..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaProperties.cs +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// Defines the schema properties. - public partial class DeviceRegistrySchemaProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Format of the schema. - /// Type of the schema. - public DeviceRegistrySchemaProperties(DeviceRegistrySchemaFormat format, DeviceRegistrySchemaType schemaType) - { - Format = format; - SchemaType = schemaType; - Tags = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . - /// Globally unique, immutable, non-reusable id. - /// Human-readable display name. - /// Human-readable description of the schema. - /// Format of the schema. - /// Type of the schema. - /// Provisioning state of the resource. - /// Schema tags. - /// Keeps track of any properties unknown to the library. - internal DeviceRegistrySchemaProperties(string uuid, string displayName, string description, DeviceRegistrySchemaFormat format, DeviceRegistrySchemaType schemaType, DeviceRegistryProvisioningState? provisioningState, IDictionary tags, IDictionary serializedAdditionalRawData) - { - Uuid = uuid; - DisplayName = displayName; - Description = description; - Format = format; - SchemaType = schemaType; - ProvisioningState = provisioningState; - Tags = tags; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DeviceRegistrySchemaProperties() - { - } - - /// Globally unique, immutable, non-reusable id. - public string Uuid { get; } - /// Human-readable display name. - public string DisplayName { get; set; } - /// Human-readable description of the schema. - public string Description { get; set; } - /// Format of the schema. - public DeviceRegistrySchemaFormat Format { get; set; } - /// Type of the schema. - public DeviceRegistrySchemaType SchemaType { get; set; } - /// Provisioning state of the resource. - public DeviceRegistryProvisioningState? ProvisioningState { get; } - /// Schema tags. - public IDictionary Tags { get; } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryPatch.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryPatch.Serialization.cs deleted file mode 100644 index 0ed57195ecb4..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryPatch.Serialization.cs +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - public partial class DeviceRegistrySchemaRegistryPatch : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(DeviceRegistrySchemaRegistryPatch)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - JsonSerializer.Serialize(writer, Identity); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - DeviceRegistrySchemaRegistryPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DeviceRegistrySchemaRegistryPatch)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistrySchemaRegistryPatch(document.RootElement, options); - } - - internal static DeviceRegistrySchemaRegistryPatch DeserializeDeviceRegistrySchemaRegistryPatch(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedServiceIdentity identity = default; - IDictionary tags = default; - SchemaRegistryUpdateProperties properties = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - identity = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = SchemaRegistryUpdateProperties.DeserializeSchemaRegistryUpdateProperties(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistrySchemaRegistryPatch(identity, tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DeviceRegistrySchemaRegistryPatch)} does not support writing '{options.Format}' format."); - } - } - - DeviceRegistrySchemaRegistryPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeviceRegistrySchemaRegistryPatch(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DeviceRegistrySchemaRegistryPatch)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryPatch.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryPatch.cs deleted file mode 100644 index 39dfa47de47f..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryPatch.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// The type used for update operations of the SchemaRegistry. - public partial class DeviceRegistrySchemaRegistryPatch - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public DeviceRegistrySchemaRegistryPatch() - { - Tags = new ChangeTrackingDictionary(); - } - - /// 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 DeviceRegistrySchemaRegistryPatch(ManagedServiceIdentity identity, IDictionary tags, SchemaRegistryUpdateProperties properties, IDictionary serializedAdditionalRawData) - { - Identity = identity; - Tags = tags; - Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The managed service identities assigned to this resource. Current supported identity types: None, SystemAssigned. - public ManagedServiceIdentity Identity { get; set; } - /// Resource tags. - public IDictionary Tags { get; } - /// The resource-specific properties for this resource. - public SchemaRegistryUpdateProperties Properties { get; set; } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryProperties.Serialization.cs deleted file mode 100644 index cf5bd474a3e4..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryProperties.Serialization.cs +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - public partial class DeviceRegistrySchemaRegistryProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(DeviceRegistrySchemaRegistryProperties)} does not support writing '{format}' format."); - } - - if (options.Format != "W" && Optional.IsDefined(Uuid)) - { - writer.WritePropertyName("uuid"u8); - writer.WriteStringValue(Uuid); - } - writer.WritePropertyName("namespace"u8); - writer.WriteStringValue(Namespace); - if (Optional.IsDefined(DisplayName)) - { - writer.WritePropertyName("displayName"u8); - writer.WriteStringValue(DisplayName); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - writer.WritePropertyName("storageAccountContainerUrl"u8); - writer.WriteStringValue(StorageAccountContainerUri.AbsoluteUri); - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - DeviceRegistrySchemaRegistryProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DeviceRegistrySchemaRegistryProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistrySchemaRegistryProperties(document.RootElement, options); - } - - internal static DeviceRegistrySchemaRegistryProperties DeserializeDeviceRegistrySchemaRegistryProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string uuid = default; - string @namespace = default; - string displayName = default; - string description = default; - Uri storageAccountContainerUrl = default; - DeviceRegistryProvisioningState? provisioningState = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("uuid"u8)) - { - uuid = property.Value.GetString(); - continue; - } - if (property.NameEquals("namespace"u8)) - { - @namespace = property.Value.GetString(); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("storageAccountContainerUrl"u8)) - { - storageAccountContainerUrl = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("provisioningState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new DeviceRegistryProvisioningState(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistrySchemaRegistryProperties( - uuid, - @namespace, - displayName, - description, - storageAccountContainerUrl, - provisioningState, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DeviceRegistrySchemaRegistryProperties)} does not support writing '{options.Format}' format."); - } - } - - DeviceRegistrySchemaRegistryProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeviceRegistrySchemaRegistryProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DeviceRegistrySchemaRegistryProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryProperties.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryProperties.cs deleted file mode 100644 index 402afa0db927..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryProperties.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// Defines the schema registry properties. - public partial class DeviceRegistrySchemaRegistryProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Schema registry namespace. Uniquely identifies a schema registry within a tenant. - /// The Storage Account's Container URL where schemas will be stored. - /// or is null. - public DeviceRegistrySchemaRegistryProperties(string @namespace, Uri storageAccountContainerUri) - { - Argument.AssertNotNull(@namespace, nameof(@namespace)); - Argument.AssertNotNull(storageAccountContainerUri, nameof(storageAccountContainerUri)); - - Namespace = @namespace; - StorageAccountContainerUri = storageAccountContainerUri; - } - - /// Initializes a new instance of . - /// Globally unique, immutable, non-reusable id. - /// Schema registry namespace. Uniquely identifies a schema registry within a tenant. - /// Human-readable display name. - /// Human-readable description of the schema registry. - /// The Storage Account's Container URL where schemas will be stored. - /// Provisioning state of the resource. - /// Keeps track of any properties unknown to the library. - internal DeviceRegistrySchemaRegistryProperties(string uuid, string @namespace, string displayName, string description, Uri storageAccountContainerUri, DeviceRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) - { - Uuid = uuid; - Namespace = @namespace; - DisplayName = displayName; - Description = description; - StorageAccountContainerUri = storageAccountContainerUri; - ProvisioningState = provisioningState; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DeviceRegistrySchemaRegistryProperties() - { - } - - /// Globally unique, immutable, non-reusable id. - public string Uuid { get; } - /// Schema registry namespace. Uniquely identifies a schema registry within a tenant. - public string Namespace { get; set; } - /// Human-readable display name. - public string DisplayName { get; set; } - /// Human-readable description of the schema registry. - public string Description { get; set; } - /// The Storage Account's Container URL where schemas will be stored. - public Uri StorageAccountContainerUri { get; set; } - /// Provisioning state of the resource. - public DeviceRegistryProvisioningState? ProvisioningState { get; } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaType.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaType.cs deleted file mode 100644 index a5a143bcbd26..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaType.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// Defines the schema type. - public readonly partial struct DeviceRegistrySchemaType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DeviceRegistrySchemaType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string MessageSchemaValue = "MessageSchema"; - - /// Message Schema schema type. - public static DeviceRegistrySchemaType MessageSchema { get; } = new DeviceRegistrySchemaType(MessageSchemaValue); - /// Determines if two values are the same. - public static bool operator ==(DeviceRegistrySchemaType left, DeviceRegistrySchemaType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DeviceRegistrySchemaType left, DeviceRegistrySchemaType right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator DeviceRegistrySchemaType(string value) => new DeviceRegistrySchemaType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DeviceRegistrySchemaType other && Equals(other); - /// - public bool Equals(DeviceRegistrySchemaType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaVersionProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaVersionProperties.Serialization.cs deleted file mode 100644 index a4468d02ca4d..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaVersionProperties.Serialization.cs +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - public partial class DeviceRegistrySchemaVersionProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(DeviceRegistrySchemaVersionProperties)} does not support writing '{format}' format."); - } - - if (options.Format != "W" && Optional.IsDefined(Uuid)) - { - writer.WritePropertyName("uuid"u8); - writer.WriteStringValue(Uuid); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - writer.WritePropertyName("schemaContent"u8); - writer.WriteStringValue(SchemaContent); - if (options.Format != "W" && Optional.IsDefined(Hash)) - { - writer.WritePropertyName("hash"u8); - writer.WriteStringValue(Hash); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - DeviceRegistrySchemaVersionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DeviceRegistrySchemaVersionProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeviceRegistrySchemaVersionProperties(document.RootElement, options); - } - - internal static DeviceRegistrySchemaVersionProperties DeserializeDeviceRegistrySchemaVersionProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string uuid = default; - string description = default; - string schemaContent = default; - string hash = default; - DeviceRegistryProvisioningState? provisioningState = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("uuid"u8)) - { - uuid = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("schemaContent"u8)) - { - schemaContent = property.Value.GetString(); - continue; - } - if (property.NameEquals("hash"u8)) - { - hash = property.Value.GetString(); - continue; - } - if (property.NameEquals("provisioningState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new DeviceRegistryProvisioningState(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistrySchemaVersionProperties( - uuid, - description, - schemaContent, - hash, - provisioningState, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DeviceRegistrySchemaVersionProperties)} does not support writing '{options.Format}' format."); - } - } - - DeviceRegistrySchemaVersionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeviceRegistrySchemaVersionProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DeviceRegistrySchemaVersionProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaVersionProperties.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaVersionProperties.cs deleted file mode 100644 index 12ec0a826707..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaVersionProperties.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// Defines the schema version properties. - public partial class DeviceRegistrySchemaVersionProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Schema content. - /// is null. - public DeviceRegistrySchemaVersionProperties(string schemaContent) - { - Argument.AssertNotNull(schemaContent, nameof(schemaContent)); - - SchemaContent = schemaContent; - } - - /// Initializes a new instance of . - /// Globally unique, immutable, non-reusable id. - /// Human-readable description of the schema. - /// Schema content. - /// Hash of the schema content. - /// Provisioning state of the resource. - /// Keeps track of any properties unknown to the library. - internal DeviceRegistrySchemaVersionProperties(string uuid, string description, string schemaContent, string hash, DeviceRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) - { - Uuid = uuid; - Description = description; - SchemaContent = schemaContent; - Hash = hash; - ProvisioningState = provisioningState; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DeviceRegistrySchemaVersionProperties() - { - } - - /// Globally unique, immutable, non-reusable id. - public string Uuid { get; } - /// Human-readable description of the schema. - public string Description { get; set; } - /// Schema content. - public string SchemaContent { get; set; } - /// Hash of the schema content. - public string Hash { get; } - /// Provisioning state of the resource. - public DeviceRegistryProvisioningState? ProvisioningState { get; } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileListResult.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileListResult.Serialization.cs deleted file mode 100644 index 0e4d21adf0c7..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileListResult.Serialization.cs +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - internal partial class DiscoveredAssetEndpointProfileListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(DiscoveredAssetEndpointProfileListResult)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - if (Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink.AbsoluteUri); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - DiscoveredAssetEndpointProfileListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DiscoveredAssetEndpointProfileListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDiscoveredAssetEndpointProfileListResult(document.RootElement, options); - } - - internal static DiscoveredAssetEndpointProfileListResult DeserializeDiscoveredAssetEndpointProfileListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - Uri nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DeviceRegistryDiscoveredAssetEndpointProfileData.DeserializeDeviceRegistryDiscoveredAssetEndpointProfileData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - nextLink = new Uri(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DiscoveredAssetEndpointProfileListResult(value, nextLink, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DiscoveredAssetEndpointProfileListResult)} does not support writing '{options.Format}' format."); - } - } - - DiscoveredAssetEndpointProfileListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDiscoveredAssetEndpointProfileListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DiscoveredAssetEndpointProfileListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileListResult.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileListResult.cs deleted file mode 100644 index e842dc9788bd..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileListResult.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// The response of a DiscoveredAssetEndpointProfile list operation. - internal partial class DiscoveredAssetEndpointProfileListResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The DiscoveredAssetEndpointProfile items on this page. - /// is null. - internal DiscoveredAssetEndpointProfileListResult(IEnumerable value) - { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); - } - - /// Initializes a new instance of . - /// The DiscoveredAssetEndpointProfile items on this page. - /// The link to the next page of items. - /// Keeps track of any properties unknown to the library. - internal DiscoveredAssetEndpointProfileListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DiscoveredAssetEndpointProfileListResult() - { - } - - /// The DiscoveredAssetEndpointProfile items on this page. - 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/DiscoveredAssetEndpointProfileProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileProperties.Serialization.cs deleted file mode 100644 index fe43ac62e719..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileProperties.Serialization.cs +++ /dev/null @@ -1,209 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - public partial class DiscoveredAssetEndpointProfileProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(DiscoveredAssetEndpointProfileProperties)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("targetAddress"u8); - writer.WriteStringValue(TargetAddress.AbsoluteUri); - if (Optional.IsDefined(AdditionalConfiguration)) - { - writer.WritePropertyName("additionalConfiguration"u8); - writer.WriteStringValue(AdditionalConfiguration); - } - if (Optional.IsCollectionDefined(SupportedAuthenticationMethods)) - { - writer.WritePropertyName("supportedAuthenticationMethods"u8); - writer.WriteStartArray(); - foreach (var item in SupportedAuthenticationMethods) - { - writer.WriteStringValue(item.ToString()); - } - writer.WriteEndArray(); - } - writer.WritePropertyName("endpointProfileType"u8); - writer.WriteStringValue(EndpointProfileType); - writer.WritePropertyName("discoveryId"u8); - writer.WriteStringValue(DiscoveryId); - writer.WritePropertyName("version"u8); - writer.WriteNumberValue(Version); - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - DiscoveredAssetEndpointProfileProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DiscoveredAssetEndpointProfileProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDiscoveredAssetEndpointProfileProperties(document.RootElement, options); - } - - internal static DiscoveredAssetEndpointProfileProperties DeserializeDiscoveredAssetEndpointProfileProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Uri targetAddress = default; - string additionalConfiguration = default; - IList supportedAuthenticationMethods = default; - string endpointProfileType = default; - string discoveryId = default; - long version = default; - DeviceRegistryProvisioningState? provisioningState = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("targetAddress"u8)) - { - targetAddress = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("additionalConfiguration"u8)) - { - additionalConfiguration = property.Value.GetString(); - continue; - } - if (property.NameEquals("supportedAuthenticationMethods"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(new AuthenticationMethod(item.GetString())); - } - supportedAuthenticationMethods = array; - continue; - } - if (property.NameEquals("endpointProfileType"u8)) - { - endpointProfileType = property.Value.GetString(); - continue; - } - if (property.NameEquals("discoveryId"u8)) - { - discoveryId = property.Value.GetString(); - continue; - } - if (property.NameEquals("version"u8)) - { - version = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("provisioningState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new DeviceRegistryProvisioningState(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DiscoveredAssetEndpointProfileProperties( - targetAddress, - additionalConfiguration, - supportedAuthenticationMethods ?? new ChangeTrackingList(), - endpointProfileType, - discoveryId, - version, - provisioningState, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DiscoveredAssetEndpointProfileProperties)} does not support writing '{options.Format}' format."); - } - } - - DiscoveredAssetEndpointProfileProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDiscoveredAssetEndpointProfileProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DiscoveredAssetEndpointProfileProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileProperties.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileProperties.cs deleted file mode 100644 index 44f41ea969ce..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileProperties.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// Defines the Discovered Asset Endpoint Profile properties. - public partial class DiscoveredAssetEndpointProfileProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. - /// Defines the configuration for the connector type that is being used with the endpoint profile. - /// Identifier used to detect changes in the asset endpoint profile. - /// An integer that is incremented each time the resource is modified. - /// , or is null. - public DiscoveredAssetEndpointProfileProperties(Uri targetAddress, string endpointProfileType, string discoveryId, long version) - { - Argument.AssertNotNull(targetAddress, nameof(targetAddress)); - Argument.AssertNotNull(endpointProfileType, nameof(endpointProfileType)); - Argument.AssertNotNull(discoveryId, nameof(discoveryId)); - - TargetAddress = targetAddress; - SupportedAuthenticationMethods = new ChangeTrackingList(); - EndpointProfileType = endpointProfileType; - DiscoveryId = discoveryId; - Version = version; - } - - /// Initializes a new instance of . - /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. - /// Stringified JSON that contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF). - /// List of supported authentication methods supported by the target server. - /// Defines the configuration for the connector type that is being used with the endpoint profile. - /// Identifier used to detect changes in the asset endpoint profile. - /// 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 DiscoveredAssetEndpointProfileProperties(Uri targetAddress, string additionalConfiguration, IList supportedAuthenticationMethods, string endpointProfileType, string discoveryId, long version, DeviceRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) - { - TargetAddress = targetAddress; - AdditionalConfiguration = additionalConfiguration; - SupportedAuthenticationMethods = supportedAuthenticationMethods; - EndpointProfileType = endpointProfileType; - DiscoveryId = discoveryId; - Version = version; - ProvisioningState = provisioningState; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DiscoveredAssetEndpointProfileProperties() - { - } - - /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. - public Uri TargetAddress { get; set; } - /// Stringified JSON that contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF). - public string AdditionalConfiguration { get; set; } - /// List of supported authentication methods supported by the target server. - public IList SupportedAuthenticationMethods { get; } - /// Defines the configuration for the connector type that is being used with the endpoint profile. - public string EndpointProfileType { get; set; } - /// Identifier used to detect changes in the asset endpoint profile. - public string DiscoveryId { get; set; } - /// An integer that is incremented each time the resource is modified. - public long Version { get; set; } - /// Provisioning state of the resource. - public DeviceRegistryProvisioningState? ProvisioningState { get; } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileUpdateProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileUpdateProperties.Serialization.cs deleted file mode 100644 index 73bdab54ce8d..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileUpdateProperties.Serialization.cs +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - public partial class DiscoveredAssetEndpointProfileUpdateProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(DiscoveredAssetEndpointProfileUpdateProperties)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(TargetAddress)) - { - writer.WritePropertyName("targetAddress"u8); - writer.WriteStringValue(TargetAddress.AbsoluteUri); - } - if (Optional.IsDefined(AdditionalConfiguration)) - { - writer.WritePropertyName("additionalConfiguration"u8); - writer.WriteStringValue(AdditionalConfiguration); - } - if (Optional.IsCollectionDefined(SupportedAuthenticationMethods)) - { - writer.WritePropertyName("supportedAuthenticationMethods"u8); - writer.WriteStartArray(); - foreach (var item in SupportedAuthenticationMethods) - { - writer.WriteStringValue(item.ToString()); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(EndpointProfileType)) - { - writer.WritePropertyName("endpointProfileType"u8); - writer.WriteStringValue(EndpointProfileType); - } - if (Optional.IsDefined(DiscoveryId)) - { - writer.WritePropertyName("discoveryId"u8); - writer.WriteStringValue(DiscoveryId); - } - if (Optional.IsDefined(Version)) - { - writer.WritePropertyName("version"u8); - writer.WriteNumberValue(Version.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - DiscoveredAssetEndpointProfileUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DiscoveredAssetEndpointProfileUpdateProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDiscoveredAssetEndpointProfileUpdateProperties(document.RootElement, options); - } - - internal static DiscoveredAssetEndpointProfileUpdateProperties DeserializeDiscoveredAssetEndpointProfileUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Uri targetAddress = default; - string additionalConfiguration = default; - IList supportedAuthenticationMethods = default; - string endpointProfileType = default; - string discoveryId = default; - long? version = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("targetAddress"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - targetAddress = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("additionalConfiguration"u8)) - { - additionalConfiguration = property.Value.GetString(); - continue; - } - if (property.NameEquals("supportedAuthenticationMethods"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(new AuthenticationMethod(item.GetString())); - } - supportedAuthenticationMethods = array; - continue; - } - if (property.NameEquals("endpointProfileType"u8)) - { - endpointProfileType = property.Value.GetString(); - continue; - } - if (property.NameEquals("discoveryId"u8)) - { - discoveryId = property.Value.GetString(); - continue; - } - if (property.NameEquals("version"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - version = property.Value.GetInt64(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DiscoveredAssetEndpointProfileUpdateProperties( - targetAddress, - additionalConfiguration, - supportedAuthenticationMethods ?? new ChangeTrackingList(), - endpointProfileType, - discoveryId, - version, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DiscoveredAssetEndpointProfileUpdateProperties)} does not support writing '{options.Format}' format."); - } - } - - DiscoveredAssetEndpointProfileUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDiscoveredAssetEndpointProfileUpdateProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DiscoveredAssetEndpointProfileUpdateProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileUpdateProperties.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileUpdateProperties.cs deleted file mode 100644 index 13d6727b30ab..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileUpdateProperties.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// The updatable properties of the DiscoveredAssetEndpointProfile. - public partial class DiscoveredAssetEndpointProfileUpdateProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public DiscoveredAssetEndpointProfileUpdateProperties() - { - SupportedAuthenticationMethods = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. - /// Stringified JSON that contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF). - /// List of supported authentication methods supported by the target server. - /// Defines the configuration for the connector type that is being used with the endpoint profile. - /// Identifier used to detect changes in the asset endpoint profile. - /// An integer that is incremented each time the resource is modified. - /// Keeps track of any properties unknown to the library. - internal DiscoveredAssetEndpointProfileUpdateProperties(Uri targetAddress, string additionalConfiguration, IList supportedAuthenticationMethods, string endpointProfileType, string discoveryId, long? version, IDictionary serializedAdditionalRawData) - { - TargetAddress = targetAddress; - AdditionalConfiguration = additionalConfiguration; - SupportedAuthenticationMethods = supportedAuthenticationMethods; - EndpointProfileType = endpointProfileType; - DiscoveryId = discoveryId; - Version = version; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. - public Uri TargetAddress { get; set; } - /// Stringified JSON that contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF). - public string AdditionalConfiguration { get; set; } - /// List of supported authentication methods supported by the target server. - public IList SupportedAuthenticationMethods { get; } - /// Defines the configuration for the connector type that is being used with the endpoint profile. - public string EndpointProfileType { get; set; } - /// Identifier used to detect changes in the asset endpoint profile. - public string DiscoveryId { get; set; } - /// An integer that is incremented each time the resource is modified. - public long? Version { get; set; } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetListResult.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetListResult.Serialization.cs deleted file mode 100644 index 1f09da57e4ec..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetListResult.Serialization.cs +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - internal partial class DiscoveredAssetListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(DiscoveredAssetListResult)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - if (Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink.AbsoluteUri); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - DiscoveredAssetListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DiscoveredAssetListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDiscoveredAssetListResult(document.RootElement, options); - } - - internal static DiscoveredAssetListResult DeserializeDiscoveredAssetListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - Uri nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DeviceRegistryDiscoveredAssetData.DeserializeDeviceRegistryDiscoveredAssetData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - nextLink = new Uri(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DiscoveredAssetListResult(value, nextLink, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DiscoveredAssetListResult)} does not support writing '{options.Format}' format."); - } - } - - DiscoveredAssetListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDiscoveredAssetListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DiscoveredAssetListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetListResult.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetListResult.cs deleted file mode 100644 index 1182e1bde8a7..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetListResult.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// The response of a DiscoveredAsset list operation. - internal partial class DiscoveredAssetListResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The DiscoveredAsset items on this page. - /// is null. - internal DiscoveredAssetListResult(IEnumerable value) - { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); - } - - /// Initializes a new instance of . - /// The DiscoveredAsset items on this page. - /// The link to the next page of items. - /// Keeps track of any properties unknown to the library. - internal DiscoveredAssetListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DiscoveredAssetListResult() - { - } - - /// The DiscoveredAsset items on this page. - 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/DiscoveredAssetUpdateProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetUpdateProperties.Serialization.cs deleted file mode 100644 index 555ed3a9fc16..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetUpdateProperties.Serialization.cs +++ /dev/null @@ -1,343 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - public partial class DiscoveredAssetUpdateProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(DiscoveredAssetUpdateProperties)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(DiscoveryId)) - { - writer.WritePropertyName("discoveryId"u8); - writer.WriteStringValue(DiscoveryId); - } - if (Optional.IsDefined(Version)) - { - writer.WritePropertyName("version"u8); - writer.WriteNumberValue(Version.Value); - } - if (Optional.IsDefined(Manufacturer)) - { - writer.WritePropertyName("manufacturer"u8); - writer.WriteStringValue(Manufacturer); - } - if (Optional.IsDefined(ManufacturerUri)) - { - writer.WritePropertyName("manufacturerUri"u8); - writer.WriteStringValue(ManufacturerUri.AbsoluteUri); - } - if (Optional.IsDefined(Model)) - { - writer.WritePropertyName("model"u8); - writer.WriteStringValue(Model); - } - if (Optional.IsDefined(ProductCode)) - { - writer.WritePropertyName("productCode"u8); - writer.WriteStringValue(ProductCode); - } - if (Optional.IsDefined(HardwareRevision)) - { - writer.WritePropertyName("hardwareRevision"u8); - writer.WriteStringValue(HardwareRevision); - } - if (Optional.IsDefined(SoftwareRevision)) - { - writer.WritePropertyName("softwareRevision"u8); - writer.WriteStringValue(SoftwareRevision); - } - if (Optional.IsDefined(DocumentationUri)) - { - writer.WritePropertyName("documentationUri"u8); - writer.WriteStringValue(DocumentationUri.AbsoluteUri); - } - if (Optional.IsDefined(SerialNumber)) - { - writer.WritePropertyName("serialNumber"u8); - writer.WriteStringValue(SerialNumber); - } - if (Optional.IsDefined(DefaultDatasetsConfiguration)) - { - writer.WritePropertyName("defaultDatasetsConfiguration"u8); - writer.WriteStringValue(DefaultDatasetsConfiguration); - } - if (Optional.IsDefined(DefaultEventsConfiguration)) - { - writer.WritePropertyName("defaultEventsConfiguration"u8); - writer.WriteStringValue(DefaultEventsConfiguration); - } - if (Optional.IsDefined(DefaultTopic)) - { - writer.WritePropertyName("defaultTopic"u8); - writer.WriteObjectValue(DefaultTopic, options); - } - if (Optional.IsCollectionDefined(Datasets)) - { - writer.WritePropertyName("datasets"u8); - writer.WriteStartArray(); - foreach (var item in Datasets) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Events)) - { - writer.WritePropertyName("events"u8); - writer.WriteStartArray(); - foreach (var item in Events) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - DiscoveredAssetUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DiscoveredAssetUpdateProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDiscoveredAssetUpdateProperties(document.RootElement, options); - } - - internal static DiscoveredAssetUpdateProperties DeserializeDiscoveredAssetUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string discoveryId = default; - long? version = default; - string manufacturer = default; - Uri manufacturerUri = default; - string model = default; - string productCode = default; - string hardwareRevision = default; - string softwareRevision = default; - Uri documentationUri = default; - string serialNumber = default; - string defaultDatasetsConfiguration = default; - string defaultEventsConfiguration = default; - DeviceRegistryTopic defaultTopic = default; - IList datasets = default; - IList events = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("discoveryId"u8)) - { - discoveryId = property.Value.GetString(); - continue; - } - if (property.NameEquals("version"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - version = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("manufacturer"u8)) - { - manufacturer = property.Value.GetString(); - continue; - } - if (property.NameEquals("manufacturerUri"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - manufacturerUri = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("model"u8)) - { - model = property.Value.GetString(); - continue; - } - if (property.NameEquals("productCode"u8)) - { - productCode = property.Value.GetString(); - continue; - } - if (property.NameEquals("hardwareRevision"u8)) - { - hardwareRevision = property.Value.GetString(); - continue; - } - if (property.NameEquals("softwareRevision"u8)) - { - softwareRevision = property.Value.GetString(); - continue; - } - if (property.NameEquals("documentationUri"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - documentationUri = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("serialNumber"u8)) - { - serialNumber = property.Value.GetString(); - continue; - } - if (property.NameEquals("defaultDatasetsConfiguration"u8)) - { - defaultDatasetsConfiguration = property.Value.GetString(); - continue; - } - if (property.NameEquals("defaultEventsConfiguration"u8)) - { - defaultEventsConfiguration = property.Value.GetString(); - continue; - } - if (property.NameEquals("defaultTopic"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - defaultTopic = DeviceRegistryTopic.DeserializeDeviceRegistryTopic(property.Value, options); - continue; - } - if (property.NameEquals("datasets"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DiscoveredDataset.DeserializeDiscoveredDataset(item, options)); - } - datasets = array; - continue; - } - if (property.NameEquals("events"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DiscoveredEvent.DeserializeDiscoveredEvent(item, options)); - } - events = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DiscoveredAssetUpdateProperties( - discoveryId, - version, - manufacturer, - manufacturerUri, - model, - productCode, - hardwareRevision, - softwareRevision, - documentationUri, - serialNumber, - defaultDatasetsConfiguration, - defaultEventsConfiguration, - defaultTopic, - datasets ?? new ChangeTrackingList(), - events ?? new ChangeTrackingList(), - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DiscoveredAssetUpdateProperties)} does not support writing '{options.Format}' format."); - } - } - - DiscoveredAssetUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDiscoveredAssetUpdateProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DiscoveredAssetUpdateProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetUpdateProperties.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetUpdateProperties.cs deleted file mode 100644 index a296876891ef..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetUpdateProperties.cs +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// The updatable properties of the DiscoveredAsset. - public partial class DiscoveredAssetUpdateProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public DiscoveredAssetUpdateProperties() - { - Datasets = new ChangeTrackingList(); - Events = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Identifier used to detect changes in the asset. - /// An integer that is incremented each time the resource is modified. - /// Asset manufacturer name. - /// Asset manufacturer URI. - /// Asset model name. - /// Asset product code. - /// Revision number of the hardware. - /// Revision number of the software. - /// Reference to the documentation. - /// Asset serial number. - /// Stringified JSON that contains connector-specific default configuration for all datasets. Each dataset can have its own configuration that overrides the default settings here. - /// Stringified JSON that contains connector-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here. - /// Object that describes the default topic information for the asset. - /// Array of datasets that are part of the asset. Each dataset spec describes the data points that make up the set. - /// Array of events that are part of the asset. Each event can have per-event configuration. - /// Keeps track of any properties unknown to the library. - internal DiscoveredAssetUpdateProperties(string discoveryId, long? version, string manufacturer, Uri manufacturerUri, string model, string productCode, string hardwareRevision, string softwareRevision, Uri documentationUri, string serialNumber, string defaultDatasetsConfiguration, string defaultEventsConfiguration, DeviceRegistryTopic defaultTopic, IList datasets, IList events, IDictionary serializedAdditionalRawData) - { - DiscoveryId = discoveryId; - Version = version; - Manufacturer = manufacturer; - ManufacturerUri = manufacturerUri; - Model = model; - ProductCode = productCode; - HardwareRevision = hardwareRevision; - SoftwareRevision = softwareRevision; - DocumentationUri = documentationUri; - SerialNumber = serialNumber; - DefaultDatasetsConfiguration = defaultDatasetsConfiguration; - DefaultEventsConfiguration = defaultEventsConfiguration; - DefaultTopic = defaultTopic; - Datasets = datasets; - Events = events; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Identifier used to detect changes in the asset. - public string DiscoveryId { get; set; } - /// An integer that is incremented each time the resource is modified. - public long? Version { get; set; } - /// Asset manufacturer name. - public string Manufacturer { get; set; } - /// Asset manufacturer URI. - public Uri ManufacturerUri { get; set; } - /// Asset model name. - public string Model { get; set; } - /// Asset product code. - public string ProductCode { get; set; } - /// Revision number of the hardware. - public string HardwareRevision { get; set; } - /// Revision number of the software. - public string SoftwareRevision { get; set; } - /// Reference to the documentation. - public Uri DocumentationUri { get; set; } - /// Asset serial number. - public string SerialNumber { get; set; } - /// Stringified JSON that contains connector-specific default configuration for all datasets. Each dataset can have its own configuration that overrides the default settings here. - public string DefaultDatasetsConfiguration { get; set; } - /// Stringified JSON that contains connector-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here. - public string DefaultEventsConfiguration { get; set; } - /// Object that describes the default topic information for the asset. - public DeviceRegistryTopic DefaultTopic { get; set; } - /// Array of datasets that are part of the asset. Each dataset spec describes the data points that make up the set. - public IList Datasets { get; } - /// Array of events that are part of the asset. Each event can have per-event configuration. - public IList Events { get; } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataPoint.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataPoint.Serialization.cs deleted file mode 100644 index 5249c8529804..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataPoint.Serialization.cs +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - public partial class DiscoveredDataPoint : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(DiscoveredDataPoint)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - writer.WritePropertyName("dataSource"u8); - writer.WriteStringValue(DataSource); - if (Optional.IsDefined(DataPointConfiguration)) - { - writer.WritePropertyName("dataPointConfiguration"u8); - writer.WriteStringValue(DataPointConfiguration); - } - if (Optional.IsDefined(LastUpdatedOn)) - { - writer.WritePropertyName("lastUpdatedOn"u8); - writer.WriteStringValue(LastUpdatedOn.Value, "O"); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - DiscoveredDataPoint IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DiscoveredDataPoint)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDiscoveredDataPoint(document.RootElement, options); - } - - internal static DiscoveredDataPoint DeserializeDiscoveredDataPoint(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string name = default; - string dataSource = default; - string dataPointConfiguration = default; - DateTimeOffset? lastUpdatedOn = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("dataSource"u8)) - { - dataSource = property.Value.GetString(); - continue; - } - if (property.NameEquals("dataPointConfiguration"u8)) - { - dataPointConfiguration = property.Value.GetString(); - continue; - } - if (property.NameEquals("lastUpdatedOn"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - lastUpdatedOn = property.Value.GetDateTimeOffset("O"); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DiscoveredDataPoint(name, dataSource, dataPointConfiguration, lastUpdatedOn, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DiscoveredDataPoint)} does not support writing '{options.Format}' format."); - } - } - - DiscoveredDataPoint IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDiscoveredDataPoint(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DiscoveredDataPoint)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataPoint.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataPoint.cs deleted file mode 100644 index 14ff31fca939..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataPoint.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// Defines the data point properties. - public partial class DiscoveredDataPoint - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The name of the data point. - /// The address of the source of the data in the asset (e.g. URL) so that a client can access the data source on the asset. - /// or is null. - public DiscoveredDataPoint(string name, string dataSource) - { - Argument.AssertNotNull(name, nameof(name)); - Argument.AssertNotNull(dataSource, nameof(dataSource)); - - Name = name; - DataSource = dataSource; - } - - /// Initializes a new instance of . - /// The name of the data point. - /// The address of the source of the data in the asset (e.g. URL) so that a client can access the data source on the asset. - /// Stringified JSON that contains connector-specific configuration for the data point. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. - /// UTC timestamp indicating when the data point was added or modified. - /// Keeps track of any properties unknown to the library. - internal DiscoveredDataPoint(string name, string dataSource, string dataPointConfiguration, DateTimeOffset? lastUpdatedOn, IDictionary serializedAdditionalRawData) - { - Name = name; - DataSource = dataSource; - DataPointConfiguration = dataPointConfiguration; - LastUpdatedOn = lastUpdatedOn; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DiscoveredDataPoint() - { - } - - /// The name of the data point. - public string Name { get; set; } - /// The address of the source of the data in the asset (e.g. URL) so that a client can access the data source on the asset. - public string DataSource { get; set; } - /// Stringified JSON that contains connector-specific configuration for the data point. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. - public string DataPointConfiguration { get; set; } - /// UTC timestamp indicating when the data point was added or modified. - public DateTimeOffset? LastUpdatedOn { get; set; } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataset.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataset.Serialization.cs deleted file mode 100644 index aa0436223f2a..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataset.Serialization.cs +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - public partial class DiscoveredDataset : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(DiscoveredDataset)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - if (Optional.IsDefined(DatasetConfiguration)) - { - writer.WritePropertyName("datasetConfiguration"u8); - writer.WriteStringValue(DatasetConfiguration); - } - if (Optional.IsDefined(Topic)) - { - writer.WritePropertyName("topic"u8); - writer.WriteObjectValue(Topic, options); - } - if (Optional.IsCollectionDefined(DataPoints)) - { - writer.WritePropertyName("dataPoints"u8); - writer.WriteStartArray(); - foreach (var item in DataPoints) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - DiscoveredDataset IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DiscoveredDataset)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDiscoveredDataset(document.RootElement, options); - } - - internal static DiscoveredDataset DeserializeDiscoveredDataset(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string name = default; - string datasetConfiguration = default; - DeviceRegistryTopic topic = default; - IList dataPoints = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("datasetConfiguration"u8)) - { - datasetConfiguration = property.Value.GetString(); - continue; - } - if (property.NameEquals("topic"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - topic = DeviceRegistryTopic.DeserializeDeviceRegistryTopic(property.Value, options); - continue; - } - if (property.NameEquals("dataPoints"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DiscoveredDataPoint.DeserializeDiscoveredDataPoint(item, options)); - } - dataPoints = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DiscoveredDataset(name, datasetConfiguration, topic, dataPoints ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DiscoveredDataset)} does not support writing '{options.Format}' format."); - } - } - - DiscoveredDataset IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDiscoveredDataset(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DiscoveredDataset)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataset.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataset.cs deleted file mode 100644 index 048e9382f363..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataset.cs +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// Defines the dataset properties. - public partial class DiscoveredDataset - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Name of the dataset. - /// is null. - public DiscoveredDataset(string name) - { - Argument.AssertNotNull(name, nameof(name)); - - Name = name; - DataPoints = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Name of the dataset. - /// Stringified JSON that contains connector-specific properties that describes configuration for the specific dataset. - /// Object that describes the topic information for the specific dataset. - /// Array of data points that are part of the dataset. Each data point can have per-data point configuration. - /// Keeps track of any properties unknown to the library. - internal DiscoveredDataset(string name, string datasetConfiguration, DeviceRegistryTopic topic, IList dataPoints, IDictionary serializedAdditionalRawData) - { - Name = name; - DatasetConfiguration = datasetConfiguration; - Topic = topic; - DataPoints = dataPoints; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DiscoveredDataset() - { - } - - /// Name of the dataset. - public string Name { get; set; } - /// Stringified JSON that contains connector-specific properties that describes configuration for the specific dataset. - public string DatasetConfiguration { get; set; } - /// Object that describes the topic information for the specific dataset. - public DeviceRegistryTopic Topic { get; set; } - /// Array of data points that are part of the dataset. Each data point can have per-data point configuration. - public IList DataPoints { get; } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredEvent.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredEvent.Serialization.cs deleted file mode 100644 index bfdaf1d4d06a..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredEvent.Serialization.cs +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - public partial class DiscoveredEvent : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(DiscoveredEvent)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - writer.WritePropertyName("eventNotifier"u8); - writer.WriteStringValue(EventNotifier); - if (Optional.IsDefined(EventConfiguration)) - { - writer.WritePropertyName("eventConfiguration"u8); - writer.WriteStringValue(EventConfiguration); - } - if (Optional.IsDefined(Topic)) - { - writer.WritePropertyName("topic"u8); - writer.WriteObjectValue(Topic, options); - } - if (Optional.IsDefined(LastUpdatedOn)) - { - writer.WritePropertyName("lastUpdatedOn"u8); - writer.WriteStringValue(LastUpdatedOn.Value, "O"); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - DiscoveredEvent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DiscoveredEvent)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDiscoveredEvent(document.RootElement, options); - } - - internal static DiscoveredEvent DeserializeDiscoveredEvent(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string name = default; - string eventNotifier = default; - string eventConfiguration = default; - DeviceRegistryTopic topic = default; - DateTimeOffset? lastUpdatedOn = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("eventNotifier"u8)) - { - eventNotifier = property.Value.GetString(); - continue; - } - if (property.NameEquals("eventConfiguration"u8)) - { - eventConfiguration = property.Value.GetString(); - continue; - } - if (property.NameEquals("topic"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - topic = DeviceRegistryTopic.DeserializeDeviceRegistryTopic(property.Value, options); - continue; - } - if (property.NameEquals("lastUpdatedOn"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - lastUpdatedOn = property.Value.GetDateTimeOffset("O"); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DiscoveredEvent( - name, - eventNotifier, - eventConfiguration, - topic, - lastUpdatedOn, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DiscoveredEvent)} does not support writing '{options.Format}' format."); - } - } - - DiscoveredEvent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDiscoveredEvent(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DiscoveredEvent)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredEvent.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredEvent.cs deleted file mode 100644 index 9fe81c213d45..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredEvent.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// Defines the event properties. - public partial class DiscoveredEvent - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The name of the event. - /// The address of the notifier of the event in the asset (e.g. URL) so that a client can access the event on the asset. - /// or is null. - public DiscoveredEvent(string name, string eventNotifier) - { - Argument.AssertNotNull(name, nameof(name)); - Argument.AssertNotNull(eventNotifier, nameof(eventNotifier)); - - Name = name; - EventNotifier = eventNotifier; - } - - /// Initializes a new instance of . - /// The name of the event. - /// The address of the notifier of the event in the asset (e.g. URL) so that a client can access the event on the asset. - /// Stringified JSON that contains connector-specific configuration for the event. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. - /// Object that describes the topic information for the specific event. - /// UTC timestamp indicating when the event was added or modified. - /// Keeps track of any properties unknown to the library. - internal DiscoveredEvent(string name, string eventNotifier, string eventConfiguration, DeviceRegistryTopic topic, DateTimeOffset? lastUpdatedOn, IDictionary serializedAdditionalRawData) - { - Name = name; - EventNotifier = eventNotifier; - EventConfiguration = eventConfiguration; - Topic = topic; - LastUpdatedOn = lastUpdatedOn; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DiscoveredEvent() - { - } - - /// The name of the event. - public string Name { get; set; } - /// The address of the notifier of the event in the asset (e.g. URL) so that a client can access the event on the asset. - public string EventNotifier { get; set; } - /// Stringified JSON that contains connector-specific configuration for the event. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. - public string EventConfiguration { get; set; } - /// Object that describes the topic information for the specific event. - public DeviceRegistryTopic Topic { get; set; } - /// UTC timestamp indicating when the event was added or modified. - public DateTimeOffset? LastUpdatedOn { get; set; } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaListResult.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaListResult.Serialization.cs deleted file mode 100644 index b7c7478fcfb5..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaListResult.Serialization.cs +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - internal partial class SchemaListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(SchemaListResult)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - if (Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink.AbsoluteUri); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - SchemaListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(SchemaListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeSchemaListResult(document.RootElement, options); - } - - internal static SchemaListResult DeserializeSchemaListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - Uri nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DeviceRegistrySchemaData.DeserializeDeviceRegistrySchemaData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - nextLink = new Uri(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new SchemaListResult(value, nextLink, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(SchemaListResult)} does not support writing '{options.Format}' format."); - } - } - - SchemaListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeSchemaListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(SchemaListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaListResult.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaListResult.cs deleted file mode 100644 index 3d8a3357a74a..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaListResult.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// The response of a Schema list operation. - internal partial class SchemaListResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The Schema items on this page. - /// is null. - internal SchemaListResult(IEnumerable value) - { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); - } - - /// Initializes a new instance of . - /// The Schema items on this page. - /// The link to the next page of items. - /// Keeps track of any properties unknown to the library. - internal SchemaListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal SchemaListResult() - { - } - - /// The Schema items on this page. - 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/SchemaRegistryListResult.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryListResult.Serialization.cs deleted file mode 100644 index 5e1d1d358577..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryListResult.Serialization.cs +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - internal partial class SchemaRegistryListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(SchemaRegistryListResult)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - if (Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink.AbsoluteUri); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - SchemaRegistryListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(SchemaRegistryListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeSchemaRegistryListResult(document.RootElement, options); - } - - internal static SchemaRegistryListResult DeserializeSchemaRegistryListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - Uri nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DeviceRegistrySchemaRegistryData.DeserializeDeviceRegistrySchemaRegistryData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - nextLink = new Uri(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new SchemaRegistryListResult(value, nextLink, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(SchemaRegistryListResult)} does not support writing '{options.Format}' format."); - } - } - - SchemaRegistryListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeSchemaRegistryListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(SchemaRegistryListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryListResult.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryListResult.cs deleted file mode 100644 index dc15f9d75cf1..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryListResult.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// The response of a SchemaRegistry list operation. - internal partial class SchemaRegistryListResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The SchemaRegistry items on this page. - /// is null. - internal SchemaRegistryListResult(IEnumerable value) - { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); - } - - /// Initializes a new instance of . - /// The SchemaRegistry items on this page. - /// The link to the next page of items. - /// Keeps track of any properties unknown to the library. - internal SchemaRegistryListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal SchemaRegistryListResult() - { - } - - /// The SchemaRegistry items on this page. - 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/SchemaRegistryUpdateProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryUpdateProperties.Serialization.cs deleted file mode 100644 index 4881a28a04bb..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryUpdateProperties.Serialization.cs +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - public partial class SchemaRegistryUpdateProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(SchemaRegistryUpdateProperties)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(DisplayName)) - { - writer.WritePropertyName("displayName"u8); - writer.WriteStringValue(DisplayName); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - SchemaRegistryUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(SchemaRegistryUpdateProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeSchemaRegistryUpdateProperties(document.RootElement, options); - } - - internal static SchemaRegistryUpdateProperties DeserializeSchemaRegistryUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string displayName = default; - string description = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new SchemaRegistryUpdateProperties(displayName, description, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(SchemaRegistryUpdateProperties)} does not support writing '{options.Format}' format."); - } - } - - SchemaRegistryUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeSchemaRegistryUpdateProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(SchemaRegistryUpdateProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryUpdateProperties.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryUpdateProperties.cs deleted file mode 100644 index 525f5d5fb6ef..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryUpdateProperties.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// The updatable properties of the SchemaRegistry. - public partial class SchemaRegistryUpdateProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public SchemaRegistryUpdateProperties() - { - } - - /// Initializes a new instance of . - /// Human-readable display name. - /// Human-readable description of the schema registry. - /// Keeps track of any properties unknown to the library. - internal SchemaRegistryUpdateProperties(string displayName, string description, IDictionary serializedAdditionalRawData) - { - DisplayName = displayName; - Description = description; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Human-readable display name. - public string DisplayName { get; set; } - /// Human-readable description of the schema registry. - public string Description { get; set; } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaVersionListResult.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaVersionListResult.Serialization.cs deleted file mode 100644 index c7b4a19d0eaf..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaVersionListResult.Serialization.cs +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - internal partial class SchemaVersionListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(SchemaVersionListResult)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - if (Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink.AbsoluteUri); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - SchemaVersionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(SchemaVersionListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeSchemaVersionListResult(document.RootElement, options); - } - - internal static SchemaVersionListResult DeserializeSchemaVersionListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - Uri nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DeviceRegistrySchemaVersionData.DeserializeDeviceRegistrySchemaVersionData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - nextLink = new Uri(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new SchemaVersionListResult(value, nextLink, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(SchemaVersionListResult)} does not support writing '{options.Format}' format."); - } - } - - SchemaVersionListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeSchemaVersionListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(SchemaVersionListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaVersionListResult.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaVersionListResult.cs deleted file mode 100644 index 66fd4612a901..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaVersionListResult.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// The response of a SchemaVersion list operation. - internal partial class SchemaVersionListResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The SchemaVersion items on this page. - /// is null. - internal SchemaVersionListResult(IEnumerable value) - { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); - } - - /// Initializes a new instance of . - /// The SchemaVersion items on this page. - /// The link to the next page of items. - /// Keeps track of any properties unknown to the library. - internal SchemaVersionListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal SchemaVersionListResult() - { - } - - /// The SchemaVersion items on this page. - 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/RestOperations/AssetEndpointProfilesRestOperations.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/AssetEndpointProfilesRestOperations.cs index dde0609678c6..17f64f2bece9 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/AssetEndpointProfilesRestOperations.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/AssetEndpointProfilesRestOperations.cs @@ -32,7 +32,7 @@ public AssetEndpointProfilesRestOperations(HttpPipeline pipeline, string applica { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/AssetsRestOperations.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/AssetsRestOperations.cs index de8b3c8894e3..7303c8cd8124 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/AssetsRestOperations.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/AssetsRestOperations.cs @@ -32,7 +32,7 @@ public AssetsRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/BillingContainersRestOperations.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/BillingContainersRestOperations.cs index c6239c813952..7e14b6fdf826 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/BillingContainersRestOperations.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/BillingContainersRestOperations.cs @@ -32,7 +32,7 @@ public BillingContainersRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/DiscoveredAssetEndpointProfilesRestOperations.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/DiscoveredAssetEndpointProfilesRestOperations.cs deleted file mode 100644 index 5859b759be61..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/DiscoveredAssetEndpointProfilesRestOperations.cs +++ /dev/null @@ -1,723 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.DeviceRegistry.Models; - -namespace Azure.ResourceManager.DeviceRegistry -{ - internal partial class DiscoveredAssetEndpointProfilesRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of DiscoveredAssetEndpointProfilesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// Service host. - /// The API version to use for this operation. - /// or is null. - public DiscoveredAssetEndpointProfilesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/", false); - uri.AppendPath(discoveredAssetEndpointProfileName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/", false); - uri.AppendPath(discoveredAssetEndpointProfileName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a DiscoveredAssetEndpointProfile. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Discovered Asset Endpoint Profile name parameter. - /// 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 discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, discoveredAssetEndpointProfileName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DeviceRegistryDiscoveredAssetEndpointProfileData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeviceRegistryDiscoveredAssetEndpointProfileData.DeserializeDeviceRegistryDiscoveredAssetEndpointProfileData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((DeviceRegistryDiscoveredAssetEndpointProfileData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a DiscoveredAssetEndpointProfile. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Discovered Asset Endpoint Profile name parameter. - /// 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 discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, discoveredAssetEndpointProfileName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DeviceRegistryDiscoveredAssetEndpointProfileData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeviceRegistryDiscoveredAssetEndpointProfileData.DeserializeDeviceRegistryDiscoveredAssetEndpointProfileData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((DeviceRegistryDiscoveredAssetEndpointProfileData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName, DeviceRegistryDiscoveredAssetEndpointProfileData data) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/", false); - uri.AppendPath(discoveredAssetEndpointProfileName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName, DeviceRegistryDiscoveredAssetEndpointProfileData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/", false); - uri.AppendPath(discoveredAssetEndpointProfileName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Create a DiscoveredAssetEndpointProfile. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Discovered Asset Endpoint Profile name parameter. - /// Resource create parameters. - /// 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 discoveredAssetEndpointProfileName, DeviceRegistryDiscoveredAssetEndpointProfileData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrReplaceRequest(subscriptionId, resourceGroupName, discoveredAssetEndpointProfileName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create a DiscoveredAssetEndpointProfile. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Discovered Asset Endpoint Profile name parameter. - /// Resource create parameters. - /// 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 discoveredAssetEndpointProfileName, DeviceRegistryDiscoveredAssetEndpointProfileData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrReplaceRequest(subscriptionId, resourceGroupName, discoveredAssetEndpointProfileName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName, DeviceRegistryDiscoveredAssetEndpointProfilePatch patch) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/", false); - uri.AppendPath(discoveredAssetEndpointProfileName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName, DeviceRegistryDiscoveredAssetEndpointProfilePatch patch) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/", false); - uri.AppendPath(discoveredAssetEndpointProfileName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Update a DiscoveredAssetEndpointProfile. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Discovered Asset Endpoint Profile name parameter. - /// The resource properties to be updated. - /// 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 discoveredAssetEndpointProfileName, DeviceRegistryDiscoveredAssetEndpointProfilePatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, discoveredAssetEndpointProfileName, patch); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Update a DiscoveredAssetEndpointProfile. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Discovered Asset Endpoint Profile name parameter. - /// The resource properties to be updated. - /// 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 discoveredAssetEndpointProfileName, DeviceRegistryDiscoveredAssetEndpointProfilePatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, discoveredAssetEndpointProfileName, patch); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/", false); - uri.AppendPath(discoveredAssetEndpointProfileName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/", false); - uri.AppendPath(discoveredAssetEndpointProfileName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Delete a DiscoveredAssetEndpointProfile. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Discovered Asset Endpoint Profile name parameter. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, discoveredAssetEndpointProfileName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Delete a DiscoveredAssetEndpointProfile. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Discovered Asset Endpoint Profile name parameter. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, discoveredAssetEndpointProfileName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List DiscoveredAssetEndpointProfile resources by resource group. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiscoveredAssetEndpointProfileListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiscoveredAssetEndpointProfileListResult.DeserializeDiscoveredAssetEndpointProfileListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List DiscoveredAssetEndpointProfile resources by resource group. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiscoveredAssetEndpointProfileListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiscoveredAssetEndpointProfileListResult.DeserializeDiscoveredAssetEndpointProfileListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List DiscoveredAssetEndpointProfile resources by subscription ID. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiscoveredAssetEndpointProfileListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiscoveredAssetEndpointProfileListResult.DeserializeDiscoveredAssetEndpointProfileListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List DiscoveredAssetEndpointProfile resources by subscription ID. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiscoveredAssetEndpointProfileListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiscoveredAssetEndpointProfileListResult.DeserializeDiscoveredAssetEndpointProfileListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List DiscoveredAssetEndpointProfile resources by resource group. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiscoveredAssetEndpointProfileListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiscoveredAssetEndpointProfileListResult.DeserializeDiscoveredAssetEndpointProfileListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List DiscoveredAssetEndpointProfile resources by resource group. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiscoveredAssetEndpointProfileListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiscoveredAssetEndpointProfileListResult.DeserializeDiscoveredAssetEndpointProfileListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List DiscoveredAssetEndpointProfile resources by subscription ID. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiscoveredAssetEndpointProfileListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiscoveredAssetEndpointProfileListResult.DeserializeDiscoveredAssetEndpointProfileListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List DiscoveredAssetEndpointProfile resources by subscription ID. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiscoveredAssetEndpointProfileListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiscoveredAssetEndpointProfileListResult.DeserializeDiscoveredAssetEndpointProfileListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/DiscoveredAssetsRestOperations.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/DiscoveredAssetsRestOperations.cs deleted file mode 100644 index 839b478826a1..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/DiscoveredAssetsRestOperations.cs +++ /dev/null @@ -1,723 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.DeviceRegistry.Models; - -namespace Azure.ResourceManager.DeviceRegistry -{ - internal partial class DiscoveredAssetsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of DiscoveredAssetsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// Service host. - /// The API version to use for this operation. - /// or is null. - public DiscoveredAssetsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string discoveredAssetName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssets/", false); - uri.AppendPath(discoveredAssetName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string discoveredAssetName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssets/", false); - uri.AppendPath(discoveredAssetName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a DiscoveredAsset. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Discovered Asset name parameter. - /// 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 discoveredAssetName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, discoveredAssetName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DeviceRegistryDiscoveredAssetData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeviceRegistryDiscoveredAssetData.DeserializeDeviceRegistryDiscoveredAssetData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((DeviceRegistryDiscoveredAssetData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a DiscoveredAsset. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Discovered Asset name parameter. - /// 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 discoveredAssetName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, discoveredAssetName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DeviceRegistryDiscoveredAssetData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeviceRegistryDiscoveredAssetData.DeserializeDeviceRegistryDiscoveredAssetData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((DeviceRegistryDiscoveredAssetData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId, string resourceGroupName, string discoveredAssetName, DeviceRegistryDiscoveredAssetData data) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssets/", false); - uri.AppendPath(discoveredAssetName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string resourceGroupName, string discoveredAssetName, DeviceRegistryDiscoveredAssetData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssets/", false); - uri.AppendPath(discoveredAssetName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Create a DiscoveredAsset. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Discovered Asset name parameter. - /// Resource create parameters. - /// 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 discoveredAssetName, DeviceRegistryDiscoveredAssetData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrReplaceRequest(subscriptionId, resourceGroupName, discoveredAssetName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create a DiscoveredAsset. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Discovered Asset name parameter. - /// Resource create parameters. - /// 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 discoveredAssetName, DeviceRegistryDiscoveredAssetData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrReplaceRequest(subscriptionId, resourceGroupName, discoveredAssetName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string discoveredAssetName, DeviceRegistryDiscoveredAssetPatch patch) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssets/", false); - uri.AppendPath(discoveredAssetName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string discoveredAssetName, DeviceRegistryDiscoveredAssetPatch patch) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssets/", false); - uri.AppendPath(discoveredAssetName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Update a DiscoveredAsset. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Discovered Asset name parameter. - /// The resource properties to be updated. - /// 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 discoveredAssetName, DeviceRegistryDiscoveredAssetPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, discoveredAssetName, patch); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Update a DiscoveredAsset. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Discovered Asset name parameter. - /// The resource properties to be updated. - /// 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 discoveredAssetName, DeviceRegistryDiscoveredAssetPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, discoveredAssetName, patch); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string discoveredAssetName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssets/", false); - uri.AppendPath(discoveredAssetName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string discoveredAssetName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssets/", false); - uri.AppendPath(discoveredAssetName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Delete a DiscoveredAsset. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Discovered Asset name parameter. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string discoveredAssetName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, discoveredAssetName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Delete a DiscoveredAsset. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Discovered Asset name parameter. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string discoveredAssetName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, discoveredAssetName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssets", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssets", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List DiscoveredAsset resources by resource group. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiscoveredAssetListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiscoveredAssetListResult.DeserializeDiscoveredAssetListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List DiscoveredAsset resources by resource group. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiscoveredAssetListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiscoveredAssetListResult.DeserializeDiscoveredAssetListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssets", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssets", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List DiscoveredAsset resources by subscription ID. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiscoveredAssetListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiscoveredAssetListResult.DeserializeDiscoveredAssetListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List DiscoveredAsset resources by subscription ID. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiscoveredAssetListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiscoveredAssetListResult.DeserializeDiscoveredAssetListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List DiscoveredAsset resources by resource group. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiscoveredAssetListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiscoveredAssetListResult.DeserializeDiscoveredAssetListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List DiscoveredAsset resources by resource group. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiscoveredAssetListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiscoveredAssetListResult.DeserializeDiscoveredAssetListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List DiscoveredAsset resources by subscription ID. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiscoveredAssetListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiscoveredAssetListResult.DeserializeDiscoveredAssetListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List DiscoveredAsset resources by subscription ID. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiscoveredAssetListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiscoveredAssetListResult.DeserializeDiscoveredAssetListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/SchemaRegistriesRestOperations.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/SchemaRegistriesRestOperations.cs deleted file mode 100644 index 93ef9b14a942..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/SchemaRegistriesRestOperations.cs +++ /dev/null @@ -1,723 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.DeviceRegistry.Models; - -namespace Azure.ResourceManager.DeviceRegistry -{ - internal partial class SchemaRegistriesRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of SchemaRegistriesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// Service host. - /// The API version to use for this operation. - /// or is null. - public SchemaRegistriesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string schemaRegistryName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); - uri.AppendPath(schemaRegistryName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string schemaRegistryName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); - uri.AppendPath(schemaRegistryName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a SchemaRegistry. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// 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 schemaRegistryName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, schemaRegistryName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DeviceRegistrySchemaRegistryData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeviceRegistrySchemaRegistryData.DeserializeDeviceRegistrySchemaRegistryData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((DeviceRegistrySchemaRegistryData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a SchemaRegistry. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// 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 schemaRegistryName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, schemaRegistryName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DeviceRegistrySchemaRegistryData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeviceRegistrySchemaRegistryData.DeserializeDeviceRegistrySchemaRegistryData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((DeviceRegistrySchemaRegistryData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId, string resourceGroupName, string schemaRegistryName, DeviceRegistrySchemaRegistryData data) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); - uri.AppendPath(schemaRegistryName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string resourceGroupName, string schemaRegistryName, DeviceRegistrySchemaRegistryData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); - uri.AppendPath(schemaRegistryName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Create a SchemaRegistry. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// Resource create parameters. - /// 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 schemaRegistryName, DeviceRegistrySchemaRegistryData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrReplaceRequest(subscriptionId, resourceGroupName, schemaRegistryName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create a SchemaRegistry. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// Resource create parameters. - /// 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 schemaRegistryName, DeviceRegistrySchemaRegistryData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrReplaceRequest(subscriptionId, resourceGroupName, schemaRegistryName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string schemaRegistryName, DeviceRegistrySchemaRegistryPatch patch) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); - uri.AppendPath(schemaRegistryName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string schemaRegistryName, DeviceRegistrySchemaRegistryPatch patch) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); - uri.AppendPath(schemaRegistryName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Update a SchemaRegistry. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// The resource properties to be updated. - /// 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 schemaRegistryName, DeviceRegistrySchemaRegistryPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, schemaRegistryName, patch); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Update a SchemaRegistry. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// The resource properties to be updated. - /// 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 schemaRegistryName, DeviceRegistrySchemaRegistryPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, schemaRegistryName, patch); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string schemaRegistryName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); - uri.AppendPath(schemaRegistryName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string schemaRegistryName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); - uri.AppendPath(schemaRegistryName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Delete a SchemaRegistry. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string schemaRegistryName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, schemaRegistryName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Delete a SchemaRegistry. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string schemaRegistryName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, schemaRegistryName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List SchemaRegistry resources by resource group. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SchemaRegistryListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SchemaRegistryListResult.DeserializeSchemaRegistryListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List SchemaRegistry resources by resource group. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SchemaRegistryListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SchemaRegistryListResult.DeserializeSchemaRegistryListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List SchemaRegistry resources by subscription ID. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SchemaRegistryListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SchemaRegistryListResult.DeserializeSchemaRegistryListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List SchemaRegistry resources by subscription ID. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SchemaRegistryListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SchemaRegistryListResult.DeserializeSchemaRegistryListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List SchemaRegistry resources by resource group. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SchemaRegistryListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SchemaRegistryListResult.DeserializeSchemaRegistryListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List SchemaRegistry resources by resource group. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SchemaRegistryListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SchemaRegistryListResult.DeserializeSchemaRegistryListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List SchemaRegistry resources by subscription ID. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SchemaRegistryListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SchemaRegistryListResult.DeserializeSchemaRegistryListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List SchemaRegistry resources by subscription ID. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SchemaRegistryListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SchemaRegistryListResult.DeserializeSchemaRegistryListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/SchemaVersionsRestOperations.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/SchemaVersionsRestOperations.cs deleted file mode 100644 index 30a08ad23e0b..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/SchemaVersionsRestOperations.cs +++ /dev/null @@ -1,559 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.DeviceRegistry.Models; - -namespace Azure.ResourceManager.DeviceRegistry -{ - internal partial class SchemaVersionsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of SchemaVersionsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// Service host. - /// The API version to use for this operation. - /// or is null. - public SchemaVersionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); - uri.AppendPath(schemaRegistryName, true); - uri.AppendPath("/schemas/", false); - uri.AppendPath(schemaName, true); - uri.AppendPath("/schemaVersions/", false); - uri.AppendPath(schemaVersionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); - uri.AppendPath(schemaRegistryName, true); - uri.AppendPath("/schemas/", false); - uri.AppendPath(schemaName, true); - uri.AppendPath("/schemaVersions/", false); - uri.AppendPath(schemaVersionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a SchemaVersion. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// Schema name parameter. - /// Schema version name parameter. - /// 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 schemaRegistryName, string schemaName, string schemaVersionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); - Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName, schemaVersionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DeviceRegistrySchemaVersionData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeviceRegistrySchemaVersionData.DeserializeDeviceRegistrySchemaVersionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((DeviceRegistrySchemaVersionData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a SchemaVersion. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// Schema name parameter. - /// Schema version name parameter. - /// 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 schemaRegistryName, string schemaName, string schemaVersionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); - Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName, schemaVersionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DeviceRegistrySchemaVersionData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeviceRegistrySchemaVersionData.DeserializeDeviceRegistrySchemaVersionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((DeviceRegistrySchemaVersionData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName, DeviceRegistrySchemaVersionData data) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); - uri.AppendPath(schemaRegistryName, true); - uri.AppendPath("/schemas/", false); - uri.AppendPath(schemaName, true); - uri.AppendPath("/schemaVersions/", false); - uri.AppendPath(schemaVersionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName, DeviceRegistrySchemaVersionData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); - uri.AppendPath(schemaRegistryName, true); - uri.AppendPath("/schemas/", false); - uri.AppendPath(schemaName, true); - uri.AppendPath("/schemaVersions/", false); - uri.AppendPath(schemaVersionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Create a SchemaVersion. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// Schema name parameter. - /// Schema version name parameter. - /// Resource create parameters. - /// 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 schemaRegistryName, string schemaName, string schemaVersionName, DeviceRegistrySchemaVersionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); - Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrReplaceRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - { - DeviceRegistrySchemaVersionData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeviceRegistrySchemaVersionData.DeserializeDeviceRegistrySchemaVersionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create a SchemaVersion. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// Schema name parameter. - /// Schema version name parameter. - /// Resource create parameters. - /// 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 schemaRegistryName, string schemaName, string schemaVersionName, DeviceRegistrySchemaVersionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); - Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrReplaceRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - { - DeviceRegistrySchemaVersionData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeviceRegistrySchemaVersionData.DeserializeDeviceRegistrySchemaVersionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); - uri.AppendPath(schemaRegistryName, true); - uri.AppendPath("/schemas/", false); - uri.AppendPath(schemaName, true); - uri.AppendPath("/schemaVersions/", false); - uri.AppendPath(schemaVersionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); - uri.AppendPath(schemaRegistryName, true); - uri.AppendPath("/schemas/", false); - uri.AppendPath(schemaName, true); - uri.AppendPath("/schemaVersions/", false); - uri.AppendPath(schemaVersionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Delete a SchemaVersion. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// Schema name parameter. - /// Schema version name parameter. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); - Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName, schemaVersionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Delete a SchemaVersion. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// Schema name parameter. - /// Schema version name parameter. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); - Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName, schemaVersionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySchemaRequestUri(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); - uri.AppendPath(schemaRegistryName, true); - uri.AppendPath("/schemas/", false); - uri.AppendPath(schemaName, true); - uri.AppendPath("/schemaVersions", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListBySchemaRequest(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); - uri.AppendPath(schemaRegistryName, true); - uri.AppendPath("/schemas/", false); - uri.AppendPath(schemaName, true); - uri.AppendPath("/schemaVersions", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List SchemaVersion resources by Schema. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// Schema name parameter. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListBySchemaAsync(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); - - using var message = CreateListBySchemaRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SchemaVersionListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SchemaVersionListResult.DeserializeSchemaVersionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List SchemaVersion resources by Schema. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// Schema name parameter. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response ListBySchema(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); - - using var message = CreateListBySchemaRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SchemaVersionListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SchemaVersionListResult.DeserializeSchemaVersionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySchemaNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListBySchemaNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List SchemaVersion resources by Schema. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// Schema name parameter. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListBySchemaNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); - - using var message = CreateListBySchemaNextPageRequest(nextLink, subscriptionId, resourceGroupName, schemaRegistryName, schemaName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SchemaVersionListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SchemaVersionListResult.DeserializeSchemaVersionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List SchemaVersion resources by Schema. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// Schema name parameter. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response ListBySchemaNextPage(string nextLink, string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); - - using var message = CreateListBySchemaNextPageRequest(nextLink, subscriptionId, resourceGroupName, schemaRegistryName, schemaName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SchemaVersionListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SchemaVersionListResult.DeserializeSchemaVersionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/SchemasRestOperations.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/SchemasRestOperations.cs deleted file mode 100644 index 572b8b04aaf1..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/SchemasRestOperations.cs +++ /dev/null @@ -1,523 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.DeviceRegistry.Models; - -namespace Azure.ResourceManager.DeviceRegistry -{ - internal partial class SchemasRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of SchemasRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// Service host. - /// The API version to use for this operation. - /// or is null. - public SchemasRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); - uri.AppendPath(schemaRegistryName, true); - uri.AppendPath("/schemas/", false); - uri.AppendPath(schemaName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); - uri.AppendPath(schemaRegistryName, true); - uri.AppendPath("/schemas/", false); - uri.AppendPath(schemaName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a Schema. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// Schema name parameter. - /// 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 schemaRegistryName, string schemaName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DeviceRegistrySchemaData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeviceRegistrySchemaData.DeserializeDeviceRegistrySchemaData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((DeviceRegistrySchemaData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a Schema. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// Schema name parameter. - /// 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 schemaRegistryName, string schemaName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DeviceRegistrySchemaData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeviceRegistrySchemaData.DeserializeDeviceRegistrySchemaData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((DeviceRegistrySchemaData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, DeviceRegistrySchemaData data) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); - uri.AppendPath(schemaRegistryName, true); - uri.AppendPath("/schemas/", false); - uri.AppendPath(schemaName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, DeviceRegistrySchemaData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); - uri.AppendPath(schemaRegistryName, true); - uri.AppendPath("/schemas/", false); - uri.AppendPath(schemaName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Create a Schema. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// Schema name parameter. - /// Resource create parameters. - /// 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 schemaRegistryName, string schemaName, DeviceRegistrySchemaData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrReplaceRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - { - DeviceRegistrySchemaData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeviceRegistrySchemaData.DeserializeDeviceRegistrySchemaData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create a Schema. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// Schema name parameter. - /// Resource create parameters. - /// 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 schemaRegistryName, string schemaName, DeviceRegistrySchemaData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrReplaceRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - { - DeviceRegistrySchemaData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeviceRegistrySchemaData.DeserializeDeviceRegistrySchemaData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); - uri.AppendPath(schemaRegistryName, true); - uri.AppendPath("/schemas/", false); - uri.AppendPath(schemaName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); - uri.AppendPath(schemaRegistryName, true); - uri.AppendPath("/schemas/", false); - uri.AppendPath(schemaName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Delete a Schema. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// Schema name parameter. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Delete a Schema. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// Schema name parameter. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySchemaRegistryRequestUri(string subscriptionId, string resourceGroupName, string schemaRegistryName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); - uri.AppendPath(schemaRegistryName, true); - uri.AppendPath("/schemas", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListBySchemaRegistryRequest(string subscriptionId, string resourceGroupName, string schemaRegistryName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); - uri.AppendPath(schemaRegistryName, true); - uri.AppendPath("/schemas", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List Schema resources by SchemaRegistry. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListBySchemaRegistryAsync(string subscriptionId, string resourceGroupName, string schemaRegistryName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - - using var message = CreateListBySchemaRegistryRequest(subscriptionId, resourceGroupName, schemaRegistryName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SchemaListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SchemaListResult.DeserializeSchemaListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List Schema resources by SchemaRegistry. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListBySchemaRegistry(string subscriptionId, string resourceGroupName, string schemaRegistryName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - - using var message = CreateListBySchemaRegistryRequest(subscriptionId, resourceGroupName, schemaRegistryName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SchemaListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SchemaListResult.DeserializeSchemaListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySchemaRegistryNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string schemaRegistryName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListBySchemaRegistryNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string schemaRegistryName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List Schema resources by SchemaRegistry. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListBySchemaRegistryNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string schemaRegistryName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - - using var message = CreateListBySchemaRegistryNextPageRequest(nextLink, subscriptionId, resourceGroupName, schemaRegistryName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SchemaListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SchemaListResult.DeserializeSchemaListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List Schema resources by SchemaRegistry. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Schema registry name parameter. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListBySchemaRegistryNextPage(string nextLink, string subscriptionId, string resourceGroupName, string schemaRegistryName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); - - using var message = CreateListBySchemaRegistryNextPageRequest(nextLink, subscriptionId, resourceGroupName, schemaRegistryName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SchemaListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SchemaListResult.DeserializeSchemaListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tsp-location.yaml b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tsp-location.yaml index eccde3b929d1..b6191d2d87dd 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tsp-location.yaml +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tsp-location.yaml @@ -1,3 +1,4 @@ -directory: specification\deviceregistry\DeviceRegistry.Management -commit: 6b24ef84f11c4f58c2d4a846ccee1eb04f0c877e -repo: Azure/azure-rest-api-specs \ No newline at end of file +directory: specification/deviceregistry/DeviceRegistry.Management +commit: eef885a274b10abcff394399d0eef85aa88086e4 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/resourcemanager/ci.mgmt.yml b/sdk/resourcemanager/ci.mgmt.yml index d8bf790b5988..f28c28a5d39c 100644 --- a/sdk/resourcemanager/ci.mgmt.yml +++ b/sdk/resourcemanager/ci.mgmt.yml @@ -79,7 +79,6 @@ trigger: - sdk/dnsresolver/Azure.ResourceManager.DnsResolver - sdk/dynatrace/Azure.ResourceManager.Dynatrace - sdk/edgeorder/Azure.ResourceManager.EdgeOrder - - sdk/iotoperations/Azure.ResourceManager.IotOperations - sdk/edgezones/Azure.ResourceManager.EdgeZones - sdk/elastic/Azure.ResourceManager.Elastic - sdk/elasticsan/Azure.ResourceManager.ElasticSan @@ -108,6 +107,7 @@ trigger: - sdk/iot/Azure.ResourceManager.IotFirmwareDefense - sdk/iotcentral/Azure.ResourceManager.IotCentral - sdk/iothub/Azure.ResourceManager.IotHub + - sdk/iotoperations/Azure.ResourceManager.IotOperations - sdk/keyvault/Azure.ResourceManager.KeyVault - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration - sdk/kusto/Azure.ResourceManager.Kusto @@ -285,7 +285,6 @@ pr: - sdk/dnsresolver/Azure.ResourceManager.DnsResolver - sdk/dynatrace/Azure.ResourceManager.Dynatrace - sdk/edgeorder/Azure.ResourceManager.EdgeOrder - - sdk/iotoperations/Azure.ResourceManager.IotOperations - sdk/edgezones/Azure.ResourceManager.EdgeZones - sdk/elastic/Azure.ResourceManager.Elastic - sdk/elasticsan/Azure.ResourceManager.ElasticSan @@ -314,6 +313,7 @@ pr: - sdk/iot/Azure.ResourceManager.IotFirmwareDefense - sdk/iotcentral/Azure.ResourceManager.IotCentral - sdk/iothub/Azure.ResourceManager.IotHub + - sdk/iotoperations/Azure.ResourceManager.IotOperations - sdk/keyvault/Azure.ResourceManager.KeyVault - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration - sdk/kusto/Azure.ResourceManager.Kusto