diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/Azure.ResourceManager.Dell.Storage.sln b/sdk/dell/Azure.ResourceManager.Dell.Storage/Azure.ResourceManager.Dell.Storage.sln new file mode 100644 index 000000000000..3bf74fb20c66 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/Azure.ResourceManager.Dell.Storage.sln @@ -0,0 +1,56 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ResourceManager.Dell.Storage.Samples", "samples\Azure.ResourceManager.Dell.Storage.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.Dell.Storage", "src\Azure.ResourceManager.Dell.Storage.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.Dell.Storage.Tests", "tests\Azure.ResourceManager.Dell.Storage.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/CHANGELOG.md b/sdk/dell/Azure.ResourceManager.Dell.Storage/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes \ No newline at end of file diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/Directory.Build.props b/sdk/dell/Azure.ResourceManager.Dell.Storage/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/README.md b/sdk/dell/Azure.ResourceManager.Dell.Storage/README.md new file mode 100644 index 000000000000..93ffdd516d9b --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure Storage management client library for .NET + +**[Describe the service briefly first.]** + +This library follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: + + - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET. + - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing. + - HTTP pipeline with custom policies. + - Better error-handling. + - Support uniform telemetry across all languages. + +## Getting started + +### Install the package + +Install the Microsoft Azure Storage management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.Dell.Storage --prerelease +``` + +### Prerequisites + +* You must have an [Microsoft Azure subscription](https://azure.microsoft.com/free/dotnet/). + +### Authenticate the Client + +To create an authenticated client and start interacting with Microsoft Azure resources, see the [quickstart guide here](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). + +## Key concepts + +Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html) + +## Documentation + +Documentation is available to help you learn how to use this package: + +- [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). +- [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). + +## Examples + +Code samples for using the management library for .NET can be found in the following locations +- [.NET Management Library Code Samples](https://aka.ms/azuresdk-net-mgmt-samples) + +## Troubleshooting + +- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues). +- Check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on Stack Overflow using Azure and .NET tags. + +## Next steps + +For more information about Microsoft Azure SDK, see [this website](https://azure.github.io/azure-sdk/). + +## Contributing + +For details on contributing to this repository, see the [contributing +guide][cg]. + +This project welcomes contributions and suggestions. Most contributions +require you to agree to a Contributor License Agreement (CLA) declaring +that you have the right to, and actually do, grant us the rights to use +your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine +whether you need to provide a CLA and decorate the PR appropriately +(for example, label, comment). Follow the instructions provided by the +bot. You'll only need to do this action once across all repositories +using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For +more information, see the [Code of Conduct FAQ][coc_faq] or contact + with any other questions or comments. + + +[cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/api/Azure.ResourceManager.Dell.Storage.net8.0.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/api/Azure.ResourceManager.Dell.Storage.net8.0.cs new file mode 100644 index 000000000000..a0c0a0c5e328 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/api/Azure.ResourceManager.Dell.Storage.net8.0.cs @@ -0,0 +1,356 @@ +namespace Azure.ResourceManager.Dell.Storage +{ + public partial class AzureResourceManagerDellStorageContext : System.ClientModel.Primitives.ModelReaderWriterContext + { + internal AzureResourceManagerDellStorageContext() { } + public static Azure.ResourceManager.Dell.Storage.AzureResourceManagerDellStorageContext Default { get { throw null; } } + protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; } + } + public partial class DellFileSystemCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DellFileSystemCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string filesystemName, Azure.ResourceManager.Dell.Storage.DellFileSystemData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string filesystemName, Azure.ResourceManager.Dell.Storage.DellFileSystemData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string filesystemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string filesystemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string filesystemName, 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 filesystemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string filesystemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string filesystemName, 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 DellFileSystemData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DellFileSystemData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Dell.Storage.DellFileSystemData 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.Dell.Storage.DellFileSystemData 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 DellFileSystemResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DellFileSystemResource() { } + public virtual Azure.ResourceManager.Dell.Storage.DellFileSystemData 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 filesystemName) { 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.Dell.Storage.DellFileSystemData 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.Dell.Storage.DellFileSystemData 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.Response Update(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class DellStorageExtensions + { + public static Azure.Response GetDellFileSystem(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string filesystemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetDellFileSystemAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string filesystemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Dell.Storage.DellFileSystemResource GetDellFileSystemResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Dell.Storage.DellFileSystemCollection GetDellFileSystems(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetDellFileSystems(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetDellFileSystemsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.Dell.Storage.Mocking +{ + public partial class MockableDellStorageArmClient : Azure.ResourceManager.ArmResource + { + protected MockableDellStorageArmClient() { } + public virtual Azure.ResourceManager.Dell.Storage.DellFileSystemResource GetDellFileSystemResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableDellStorageResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableDellStorageResourceGroupResource() { } + public virtual Azure.Response GetDellFileSystem(string filesystemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDellFileSystemAsync(string filesystemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Dell.Storage.DellFileSystemCollection GetDellFileSystems() { throw null; } + } + public partial class MockableDellStorageSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableDellStorageSubscriptionResource() { } + public virtual Azure.Pageable GetDellFileSystems(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDellFileSystemsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.Dell.Storage.Models +{ + public static partial class ArmDellStorageModelFactory + { + public static Azure.ResourceManager.Dell.Storage.DellFileSystemData DellFileSystemData(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.Dell.Storage.Models.DellFileSystemProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceDetails DellFileSystemMarketplaceDetails(string marketplaceSubscriptionId = null, string planId = null, string offerId = null, string publisherId = null, string privateOfferId = null, string planName = null, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus? marketplaceSubscriptionStatus = default(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus?), string endDate = null, string termUnit = null) { throw null; } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProperties DellFileSystemProperties(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemCapacity capacity = null, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceDetails marketplace = null, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState? provisioningState = default(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState?), string delegatedSubnetId = null, string delegatedSubnetCidr = null, string userEmail = null, string fileSystemId = null, string smartConnectFqdn = null, string oneFsUri = null, string dellReferenceNumber = null, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionProperties encryption = null) { throw null; } + } + public partial class DellFileSystemCapacity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DellFileSystemCapacity() { } + public string Current { get { throw null; } set { } } + public string Incremental { get { throw null; } set { } } + public string Max { get { throw null; } set { } } + public string Min { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Dell.Storage.Models.DellFileSystemCapacity 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.Dell.Storage.Models.DellFileSystemCapacity 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 DellFileSystemEncryptionIdentityPatchProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DellFileSystemEncryptionIdentityPatchProperties() { } + public Azure.Core.ResourceIdentifier IdentityResourceId { get { throw null; } set { } } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityType? IdentityType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityPatchProperties 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.Dell.Storage.Models.DellFileSystemEncryptionIdentityPatchProperties 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 DellFileSystemEncryptionIdentityProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DellFileSystemEncryptionIdentityProperties() { } + public Azure.Core.ResourceIdentifier IdentityResourceId { get { throw null; } set { } } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityType? IdentityType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityProperties 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.Dell.Storage.Models.DellFileSystemEncryptionIdentityProperties 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 DellFileSystemEncryptionIdentityType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DellFileSystemEncryptionIdentityType(string value) { throw null; } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityType SystemAssigned { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityType UserAssigned { get { throw null; } } + public bool Equals(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityType 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.Dell.Storage.Models.DellFileSystemEncryptionIdentityType left, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityType right) { throw null; } + public static implicit operator Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityType left, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DellFileSystemEncryptionPatchProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DellFileSystemEncryptionPatchProperties() { } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityPatchProperties EncryptionIdentityProperties { get { throw null; } set { } } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionType? EncryptionType { get { throw null; } set { } } + public string KeyUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionPatchProperties 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.Dell.Storage.Models.DellFileSystemEncryptionPatchProperties 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 DellFileSystemEncryptionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DellFileSystemEncryptionProperties(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionType encryptionType) { } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityProperties EncryptionIdentityProperties { get { throw null; } set { } } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionType EncryptionType { get { throw null; } set { } } + public string KeyUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionProperties 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.Dell.Storage.Models.DellFileSystemEncryptionProperties 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 DellFileSystemEncryptionType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DellFileSystemEncryptionType(string value) { throw null; } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionType CustomerManagedKeysCmk { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionType MicrosoftManagedKeysMmk { get { throw null; } } + public bool Equals(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionType 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.Dell.Storage.Models.DellFileSystemEncryptionType left, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionType right) { throw null; } + public static implicit operator Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionType left, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DellFileSystemMarketplaceDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DellFileSystemMarketplaceDetails(string planId, string offerId, string planName) { } + public string EndDate { get { throw null; } set { } } + public string MarketplaceSubscriptionId { get { throw null; } set { } } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus? MarketplaceSubscriptionStatus { get { throw null; } } + public string OfferId { get { throw null; } set { } } + public string PlanId { get { throw null; } set { } } + public string PlanName { get { throw null; } set { } } + public string PrivateOfferId { get { throw null; } set { } } + public string PublisherId { get { throw null; } set { } } + public string TermUnit { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceDetails 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.Dell.Storage.Models.DellFileSystemMarketplaceDetails 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 DellFileSystemMarketplaceSubscriptionStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DellFileSystemMarketplaceSubscriptionStatus(string value) { throw null; } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus PendingFulfillmentStart { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus Subscribed { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus Suspended { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus Unsubscribed { get { throw null; } } + public bool Equals(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus 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.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus left, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus left, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DellFileSystemPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DellFileSystemPatch() { } + public Azure.ResourceManager.Dell.Storage.Models.ManagedServiceIdentityUpdate Identity { get { throw null; } set { } } + public Azure.ResourceManager.Dell.Storage.Models.FileSystemResourceUpdateProperties 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.Dell.Storage.Models.DellFileSystemPatch 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.Dell.Storage.Models.DellFileSystemPatch 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 DellFileSystemProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DellFileSystemProperties(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceDetails marketplace, string delegatedSubnetId, string delegatedSubnetCidr, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemUserDetails user, string dellReferenceNumber, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionProperties encryption) { } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemCapacity Capacity { get { throw null; } set { } } + public string DelegatedSubnetCidr { get { throw null; } set { } } + public string DelegatedSubnetId { get { throw null; } set { } } + public string DellReferenceNumber { get { throw null; } set { } } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionProperties Encryption { get { throw null; } set { } } + public string FileSystemId { get { throw null; } set { } } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceDetails Marketplace { get { throw null; } set { } } + public string OneFsUri { get { throw null; } set { } } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState? ProvisioningState { get { throw null; } } + public string SmartConnectFqdn { get { throw null; } set { } } + public string UserEmail { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProperties 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.Dell.Storage.Models.DellFileSystemProperties 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 DellFileSystemProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DellFileSystemProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState Deleted { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState NotSpecified { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState 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.Dell.Storage.Models.DellFileSystemProvisioningState left, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState left, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DellFileSystemUserDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DellFileSystemUserDetails(string email) { } + public string Email { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Dell.Storage.Models.DellFileSystemUserDetails 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.Dell.Storage.Models.DellFileSystemUserDetails 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 FileSystemResourceUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FileSystemResourceUpdateProperties() { } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemCapacity Capacity { get { throw null; } set { } } + public string DelegatedSubnetId { get { throw null; } set { } } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionPatchProperties Encryption { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Dell.Storage.Models.FileSystemResourceUpdateProperties 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.Dell.Storage.Models.FileSystemResourceUpdateProperties 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 ManagedServiceIdentityType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ManagedServiceIdentityType(string value) { throw null; } + public static Azure.ResourceManager.Dell.Storage.Models.ManagedServiceIdentityType None { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.ManagedServiceIdentityType SystemAssigned { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.ManagedServiceIdentityType SystemAssignedUserAssigned { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.ManagedServiceIdentityType UserAssigned { get { throw null; } } + public bool Equals(Azure.ResourceManager.Dell.Storage.Models.ManagedServiceIdentityType 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.Dell.Storage.Models.ManagedServiceIdentityType left, Azure.ResourceManager.Dell.Storage.Models.ManagedServiceIdentityType right) { throw null; } + public static implicit operator Azure.ResourceManager.Dell.Storage.Models.ManagedServiceIdentityType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Dell.Storage.Models.ManagedServiceIdentityType left, Azure.ResourceManager.Dell.Storage.Models.ManagedServiceIdentityType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ManagedServiceIdentityUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ManagedServiceIdentityUpdate() { } + public Azure.ResourceManager.Dell.Storage.Models.ManagedServiceIdentityType? Type { get { throw null; } set { } } + public System.Collections.Generic.IDictionary UserAssignedIdentities { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Dell.Storage.Models.ManagedServiceIdentityUpdate 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.Dell.Storage.Models.ManagedServiceIdentityUpdate 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/dell/Azure.ResourceManager.Dell.Storage/api/Azure.ResourceManager.Dell.Storage.netstandard2.0.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/api/Azure.ResourceManager.Dell.Storage.netstandard2.0.cs new file mode 100644 index 000000000000..a0c0a0c5e328 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/api/Azure.ResourceManager.Dell.Storage.netstandard2.0.cs @@ -0,0 +1,356 @@ +namespace Azure.ResourceManager.Dell.Storage +{ + public partial class AzureResourceManagerDellStorageContext : System.ClientModel.Primitives.ModelReaderWriterContext + { + internal AzureResourceManagerDellStorageContext() { } + public static Azure.ResourceManager.Dell.Storage.AzureResourceManagerDellStorageContext Default { get { throw null; } } + protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; } + } + public partial class DellFileSystemCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DellFileSystemCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string filesystemName, Azure.ResourceManager.Dell.Storage.DellFileSystemData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string filesystemName, Azure.ResourceManager.Dell.Storage.DellFileSystemData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string filesystemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string filesystemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string filesystemName, 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 filesystemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string filesystemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string filesystemName, 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 DellFileSystemData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DellFileSystemData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Dell.Storage.DellFileSystemData 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.Dell.Storage.DellFileSystemData 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 DellFileSystemResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DellFileSystemResource() { } + public virtual Azure.ResourceManager.Dell.Storage.DellFileSystemData 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 filesystemName) { 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.Dell.Storage.DellFileSystemData 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.Dell.Storage.DellFileSystemData 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.Response Update(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class DellStorageExtensions + { + public static Azure.Response GetDellFileSystem(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string filesystemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetDellFileSystemAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string filesystemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Dell.Storage.DellFileSystemResource GetDellFileSystemResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Dell.Storage.DellFileSystemCollection GetDellFileSystems(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetDellFileSystems(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetDellFileSystemsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.Dell.Storage.Mocking +{ + public partial class MockableDellStorageArmClient : Azure.ResourceManager.ArmResource + { + protected MockableDellStorageArmClient() { } + public virtual Azure.ResourceManager.Dell.Storage.DellFileSystemResource GetDellFileSystemResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableDellStorageResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableDellStorageResourceGroupResource() { } + public virtual Azure.Response GetDellFileSystem(string filesystemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDellFileSystemAsync(string filesystemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Dell.Storage.DellFileSystemCollection GetDellFileSystems() { throw null; } + } + public partial class MockableDellStorageSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableDellStorageSubscriptionResource() { } + public virtual Azure.Pageable GetDellFileSystems(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDellFileSystemsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.Dell.Storage.Models +{ + public static partial class ArmDellStorageModelFactory + { + public static Azure.ResourceManager.Dell.Storage.DellFileSystemData DellFileSystemData(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.Dell.Storage.Models.DellFileSystemProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceDetails DellFileSystemMarketplaceDetails(string marketplaceSubscriptionId = null, string planId = null, string offerId = null, string publisherId = null, string privateOfferId = null, string planName = null, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus? marketplaceSubscriptionStatus = default(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus?), string endDate = null, string termUnit = null) { throw null; } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProperties DellFileSystemProperties(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemCapacity capacity = null, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceDetails marketplace = null, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState? provisioningState = default(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState?), string delegatedSubnetId = null, string delegatedSubnetCidr = null, string userEmail = null, string fileSystemId = null, string smartConnectFqdn = null, string oneFsUri = null, string dellReferenceNumber = null, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionProperties encryption = null) { throw null; } + } + public partial class DellFileSystemCapacity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DellFileSystemCapacity() { } + public string Current { get { throw null; } set { } } + public string Incremental { get { throw null; } set { } } + public string Max { get { throw null; } set { } } + public string Min { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Dell.Storage.Models.DellFileSystemCapacity 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.Dell.Storage.Models.DellFileSystemCapacity 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 DellFileSystemEncryptionIdentityPatchProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DellFileSystemEncryptionIdentityPatchProperties() { } + public Azure.Core.ResourceIdentifier IdentityResourceId { get { throw null; } set { } } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityType? IdentityType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityPatchProperties 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.Dell.Storage.Models.DellFileSystemEncryptionIdentityPatchProperties 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 DellFileSystemEncryptionIdentityProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DellFileSystemEncryptionIdentityProperties() { } + public Azure.Core.ResourceIdentifier IdentityResourceId { get { throw null; } set { } } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityType? IdentityType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityProperties 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.Dell.Storage.Models.DellFileSystemEncryptionIdentityProperties 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 DellFileSystemEncryptionIdentityType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DellFileSystemEncryptionIdentityType(string value) { throw null; } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityType SystemAssigned { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityType UserAssigned { get { throw null; } } + public bool Equals(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityType 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.Dell.Storage.Models.DellFileSystemEncryptionIdentityType left, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityType right) { throw null; } + public static implicit operator Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityType left, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DellFileSystemEncryptionPatchProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DellFileSystemEncryptionPatchProperties() { } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityPatchProperties EncryptionIdentityProperties { get { throw null; } set { } } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionType? EncryptionType { get { throw null; } set { } } + public string KeyUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionPatchProperties 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.Dell.Storage.Models.DellFileSystemEncryptionPatchProperties 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 DellFileSystemEncryptionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DellFileSystemEncryptionProperties(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionType encryptionType) { } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionIdentityProperties EncryptionIdentityProperties { get { throw null; } set { } } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionType EncryptionType { get { throw null; } set { } } + public string KeyUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionProperties 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.Dell.Storage.Models.DellFileSystemEncryptionProperties 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 DellFileSystemEncryptionType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DellFileSystemEncryptionType(string value) { throw null; } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionType CustomerManagedKeysCmk { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionType MicrosoftManagedKeysMmk { get { throw null; } } + public bool Equals(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionType 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.Dell.Storage.Models.DellFileSystemEncryptionType left, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionType right) { throw null; } + public static implicit operator Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionType left, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DellFileSystemMarketplaceDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DellFileSystemMarketplaceDetails(string planId, string offerId, string planName) { } + public string EndDate { get { throw null; } set { } } + public string MarketplaceSubscriptionId { get { throw null; } set { } } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus? MarketplaceSubscriptionStatus { get { throw null; } } + public string OfferId { get { throw null; } set { } } + public string PlanId { get { throw null; } set { } } + public string PlanName { get { throw null; } set { } } + public string PrivateOfferId { get { throw null; } set { } } + public string PublisherId { get { throw null; } set { } } + public string TermUnit { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceDetails 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.Dell.Storage.Models.DellFileSystemMarketplaceDetails 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 DellFileSystemMarketplaceSubscriptionStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DellFileSystemMarketplaceSubscriptionStatus(string value) { throw null; } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus PendingFulfillmentStart { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus Subscribed { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus Suspended { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus Unsubscribed { get { throw null; } } + public bool Equals(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus 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.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus left, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus left, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceSubscriptionStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DellFileSystemPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DellFileSystemPatch() { } + public Azure.ResourceManager.Dell.Storage.Models.ManagedServiceIdentityUpdate Identity { get { throw null; } set { } } + public Azure.ResourceManager.Dell.Storage.Models.FileSystemResourceUpdateProperties 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.Dell.Storage.Models.DellFileSystemPatch 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.Dell.Storage.Models.DellFileSystemPatch 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 DellFileSystemProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DellFileSystemProperties(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceDetails marketplace, string delegatedSubnetId, string delegatedSubnetCidr, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemUserDetails user, string dellReferenceNumber, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionProperties encryption) { } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemCapacity Capacity { get { throw null; } set { } } + public string DelegatedSubnetCidr { get { throw null; } set { } } + public string DelegatedSubnetId { get { throw null; } set { } } + public string DellReferenceNumber { get { throw null; } set { } } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionProperties Encryption { get { throw null; } set { } } + public string FileSystemId { get { throw null; } set { } } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemMarketplaceDetails Marketplace { get { throw null; } set { } } + public string OneFsUri { get { throw null; } set { } } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState? ProvisioningState { get { throw null; } } + public string SmartConnectFqdn { get { throw null; } set { } } + public string UserEmail { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProperties 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.Dell.Storage.Models.DellFileSystemProperties 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 DellFileSystemProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DellFileSystemProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState Deleted { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState NotSpecified { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState 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.Dell.Storage.Models.DellFileSystemProvisioningState left, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState left, Azure.ResourceManager.Dell.Storage.Models.DellFileSystemProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DellFileSystemUserDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DellFileSystemUserDetails(string email) { } + public string Email { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Dell.Storage.Models.DellFileSystemUserDetails 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.Dell.Storage.Models.DellFileSystemUserDetails 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 FileSystemResourceUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FileSystemResourceUpdateProperties() { } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemCapacity Capacity { get { throw null; } set { } } + public string DelegatedSubnetId { get { throw null; } set { } } + public Azure.ResourceManager.Dell.Storage.Models.DellFileSystemEncryptionPatchProperties Encryption { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Dell.Storage.Models.FileSystemResourceUpdateProperties 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.Dell.Storage.Models.FileSystemResourceUpdateProperties 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 ManagedServiceIdentityType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ManagedServiceIdentityType(string value) { throw null; } + public static Azure.ResourceManager.Dell.Storage.Models.ManagedServiceIdentityType None { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.ManagedServiceIdentityType SystemAssigned { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.ManagedServiceIdentityType SystemAssignedUserAssigned { get { throw null; } } + public static Azure.ResourceManager.Dell.Storage.Models.ManagedServiceIdentityType UserAssigned { get { throw null; } } + public bool Equals(Azure.ResourceManager.Dell.Storage.Models.ManagedServiceIdentityType 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.Dell.Storage.Models.ManagedServiceIdentityType left, Azure.ResourceManager.Dell.Storage.Models.ManagedServiceIdentityType right) { throw null; } + public static implicit operator Azure.ResourceManager.Dell.Storage.Models.ManagedServiceIdentityType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Dell.Storage.Models.ManagedServiceIdentityType left, Azure.ResourceManager.Dell.Storage.Models.ManagedServiceIdentityType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ManagedServiceIdentityUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ManagedServiceIdentityUpdate() { } + public Azure.ResourceManager.Dell.Storage.Models.ManagedServiceIdentityType? Type { get { throw null; } set { } } + public System.Collections.Generic.IDictionary UserAssignedIdentities { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Dell.Storage.Models.ManagedServiceIdentityUpdate 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.Dell.Storage.Models.ManagedServiceIdentityUpdate 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/dell/Azure.ResourceManager.Dell.Storage/assets.json b/sdk/dell/Azure.ResourceManager.Dell.Storage/assets.json new file mode 100644 index 000000000000..b62b8e226405 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/storage/Azure.ResourceManager.Dell.Storage", + "Tag": "" +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/samples/Azure.ResourceManager.Dell.Storage.Samples.csproj b/sdk/dell/Azure.ResourceManager.Dell.Storage/samples/Azure.ResourceManager.Dell.Storage.Samples.csproj new file mode 100644 index 000000000000..15bd14ce6364 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/samples/Azure.ResourceManager.Dell.Storage.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/samples/Generated/Samples/Sample_DellFileSystemCollection.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/samples/Generated/Samples/Sample_DellFileSystemCollection.cs new file mode 100644 index 000000000000..bb20f3a05771 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/samples/Generated/Samples/Sample_DellFileSystemCollection.cs @@ -0,0 +1,416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Dell.Storage.Models; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Dell.Storage.Samples +{ + public partial class Sample_DellFileSystemCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_FileSystemsCreateOrUpdateMaximumSetGen() + { + // Generated from example definition: 2025-03-21-preview/FileSystems_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "FileSystemResource_CreateOrUpdate" 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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4B6E265D-57CF-4A9D-8B35-3CC68ED9D208"; + string resourceGroupName = "rgDell"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DellFileSystemResource + DellFileSystemCollection collection = resourceGroupResource.GetDellFileSystems(); + + // invoke the operation + string filesystemName = "abcd"; + DellFileSystemData data = new DellFileSystemData(new AzureLocation("cvbmsqftppe")) + { + Properties = new DellFileSystemProperties( + new DellFileSystemMarketplaceDetails("eekvwfndjoxijeasksnt", "bcganbkmvznyqfnvhjuag", "planeName") + { + MarketplaceSubscriptionId = "mvjcxwndudbylynme", + PublisherId = "trdzykoeskmcwpo", + PrivateOfferId = "privateOfferId", + }, + "rqkpvczbtqcxiaivtbuixblb", + "10.0.0.1/24", + new DellFileSystemUserDetails("jwogfgznmjabdbcjcljjlkxdpc"), + "fhewkj", + new DellFileSystemEncryptionProperties(DellFileSystemEncryptionType.CustomerManagedKeysCmk) + { + KeyUri = "https://contoso.com/keyurl/keyVersion", + EncryptionIdentityProperties = new DellFileSystemEncryptionIdentityProperties + { + IdentityType = DellFileSystemEncryptionIdentityType.UserAssigned, + IdentityResourceId = new ResourceIdentifier("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}"), + }, + }) + { + SmartConnectFqdn = "fqdn", + OneFsUri = "oneFsUrl", + }, + Identity = new ManagedServiceIdentity("UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("key7644")] = new UserAssignedIdentity() +}, + }, + Tags = +{ +["key7594"] = "sfkwapubiurgedzveido" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, filesystemName, data); + DellFileSystemResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DellFileSystemData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_FileSystemsCreateOrUpdateMinimumSetGen() + { + // Generated from example definition: 2025-03-21-preview/FileSystems_CreateOrUpdate_MinimumSet_Gen.json + // this example is just showing the usage of "FileSystemResource_CreateOrUpdate" 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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "BF7E7352-2FE4-4163-9CF7-5FF8EC2E9B92"; + string resourceGroupName = "rgDell"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DellFileSystemResource + DellFileSystemCollection collection = resourceGroupResource.GetDellFileSystems(); + + // invoke the operation + string filesystemName = "abcd"; + DellFileSystemData data = new DellFileSystemData(new AzureLocation("tbcvhxzpgrijtdygkttnfswwtacs")) + { + Properties = new DellFileSystemProperties( + new DellFileSystemMarketplaceDetails("lgozf", "pzhjvibxqgeqkndqnjlduwnxqbr", "planeName") + { + PrivateOfferId = "privateOfferId", + }, + "yp", + "10.0.0.1/24", + new DellFileSystemUserDetails("hoznewwtzmyjzctzosfuh"), + "fhewkj", + new DellFileSystemEncryptionProperties(DellFileSystemEncryptionType.MicrosoftManagedKeysMmk)), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, filesystemName, data); + DellFileSystemResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DellFileSystemData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_FileSystemsGetMaximumSetGen() + { + // Generated from example definition: 2025-03-21-preview/FileSystems_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FileSystemResource_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 + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4B6E265D-57CF-4A9D-8B35-3CC68ED9D208"; + string resourceGroupName = "rgDell"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DellFileSystemResource + DellFileSystemCollection collection = resourceGroupResource.GetDellFileSystems(); + + // invoke the operation + string filesystemName = "abcd"; + DellFileSystemResource result = await collection.GetAsync(filesystemName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DellFileSystemData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_FileSystemsGetMinimumSetGen() + { + // Generated from example definition: 2025-03-21-preview/FileSystems_Get_MinimumSet_Gen.json + // this example is just showing the usage of "FileSystemResource_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 + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "BF7E7352-2FE4-4163-9CF7-5FF8EC2E9B92"; + string resourceGroupName = "rgDell"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DellFileSystemResource + DellFileSystemCollection collection = resourceGroupResource.GetDellFileSystems(); + + // invoke the operation + string filesystemName = "abcd"; + DellFileSystemResource result = await collection.GetAsync(filesystemName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DellFileSystemData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_FileSystemsListByResourceGroupMaximumSetGen() + { + // Generated from example definition: 2025-03-21-preview/FileSystems_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "FileSystemResource_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 + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4B6E265D-57CF-4A9D-8B35-3CC68ED9D208"; + string resourceGroupName = "rgDell"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DellFileSystemResource + DellFileSystemCollection collection = resourceGroupResource.GetDellFileSystems(); + + // invoke the operation and iterate over the result + await foreach (DellFileSystemResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DellFileSystemData 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 GetAll_FileSystemsListByResourceGroupMinimumSetGen() + { + // Generated from example definition: 2025-03-21-preview/FileSystems_ListByResourceGroup_MinimumSet_Gen.json + // this example is just showing the usage of "FileSystemResource_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 + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "BF7E7352-2FE4-4163-9CF7-5FF8EC2E9B92"; + string resourceGroupName = "rgDell"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DellFileSystemResource + DellFileSystemCollection collection = resourceGroupResource.GetDellFileSystems(); + + // invoke the operation and iterate over the result + await foreach (DellFileSystemResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DellFileSystemData 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 Exists_FileSystemsGetMaximumSetGen() + { + // Generated from example definition: 2025-03-21-preview/FileSystems_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FileSystemResource_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 + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4B6E265D-57CF-4A9D-8B35-3CC68ED9D208"; + string resourceGroupName = "rgDell"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DellFileSystemResource + DellFileSystemCollection collection = resourceGroupResource.GetDellFileSystems(); + + // invoke the operation + string filesystemName = "abcd"; + bool result = await collection.ExistsAsync(filesystemName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_FileSystemsGetMinimumSetGen() + { + // Generated from example definition: 2025-03-21-preview/FileSystems_Get_MinimumSet_Gen.json + // this example is just showing the usage of "FileSystemResource_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 + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "BF7E7352-2FE4-4163-9CF7-5FF8EC2E9B92"; + string resourceGroupName = "rgDell"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DellFileSystemResource + DellFileSystemCollection collection = resourceGroupResource.GetDellFileSystems(); + + // invoke the operation + string filesystemName = "abcd"; + bool result = await collection.ExistsAsync(filesystemName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_FileSystemsGetMaximumSetGen() + { + // Generated from example definition: 2025-03-21-preview/FileSystems_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FileSystemResource_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 + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4B6E265D-57CF-4A9D-8B35-3CC68ED9D208"; + string resourceGroupName = "rgDell"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DellFileSystemResource + DellFileSystemCollection collection = resourceGroupResource.GetDellFileSystems(); + + // invoke the operation + string filesystemName = "abcd"; + NullableResponse response = await collection.GetIfExistsAsync(filesystemName); + DellFileSystemResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DellFileSystemData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_FileSystemsGetMinimumSetGen() + { + // Generated from example definition: 2025-03-21-preview/FileSystems_Get_MinimumSet_Gen.json + // this example is just showing the usage of "FileSystemResource_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 + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "BF7E7352-2FE4-4163-9CF7-5FF8EC2E9B92"; + string resourceGroupName = "rgDell"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DellFileSystemResource + DellFileSystemCollection collection = resourceGroupResource.GetDellFileSystems(); + + // invoke the operation + string filesystemName = "abcd"; + NullableResponse response = await collection.GetIfExistsAsync(filesystemName); + DellFileSystemResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DellFileSystemData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/samples/Generated/Samples/Sample_DellFileSystemResource.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/samples/Generated/Samples/Sample_DellFileSystemResource.cs new file mode 100644 index 000000000000..9f130ead6b85 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/samples/Generated/Samples/Sample_DellFileSystemResource.cs @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Dell.Storage.Models; +using Azure.ResourceManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Dell.Storage.Samples +{ + public partial class Sample_DellFileSystemResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_FileSystemsGetMaximumSetGen() + { + // Generated from example definition: 2025-03-21-preview/FileSystems_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FileSystemResource_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 + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DellFileSystemResource created on azure + // for more information of creating DellFileSystemResource, please refer to the document of DellFileSystemResource + string subscriptionId = "4B6E265D-57CF-4A9D-8B35-3CC68ED9D208"; + string resourceGroupName = "rgDell"; + string filesystemName = "abcd"; + ResourceIdentifier dellFileSystemResourceId = DellFileSystemResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, filesystemName); + DellFileSystemResource dellFileSystem = client.GetDellFileSystemResource(dellFileSystemResourceId); + + // invoke the operation + DellFileSystemResource result = await dellFileSystem.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DellFileSystemData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_FileSystemsGetMinimumSetGen() + { + // Generated from example definition: 2025-03-21-preview/FileSystems_Get_MinimumSet_Gen.json + // this example is just showing the usage of "FileSystemResource_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 + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DellFileSystemResource created on azure + // for more information of creating DellFileSystemResource, please refer to the document of DellFileSystemResource + string subscriptionId = "BF7E7352-2FE4-4163-9CF7-5FF8EC2E9B92"; + string resourceGroupName = "rgDell"; + string filesystemName = "abcd"; + ResourceIdentifier dellFileSystemResourceId = DellFileSystemResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, filesystemName); + DellFileSystemResource dellFileSystem = client.GetDellFileSystemResource(dellFileSystemResourceId); + + // invoke the operation + DellFileSystemResource result = await dellFileSystem.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DellFileSystemData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_FileSystemsDeleteMaximumSetGen() + { + // Generated from example definition: 2025-03-21-preview/FileSystems_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "FileSystemResource_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 + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DellFileSystemResource created on azure + // for more information of creating DellFileSystemResource, please refer to the document of DellFileSystemResource + string subscriptionId = "4B6E265D-57CF-4A9D-8B35-3CC68ED9D208"; + string resourceGroupName = "rgDell"; + string filesystemName = "abcd"; + ResourceIdentifier dellFileSystemResourceId = DellFileSystemResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, filesystemName); + DellFileSystemResource dellFileSystem = client.GetDellFileSystemResource(dellFileSystemResourceId); + + // invoke the operation + await dellFileSystem.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_FileSystemsDeleteMinimumSetGen() + { + // Generated from example definition: 2025-03-21-preview/FileSystems_Delete_MinimumSet_Gen.json + // this example is just showing the usage of "FileSystemResource_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 + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DellFileSystemResource created on azure + // for more information of creating DellFileSystemResource, please refer to the document of DellFileSystemResource + string subscriptionId = "BF7E7352-2FE4-4163-9CF7-5FF8EC2E9B92"; + string resourceGroupName = "rgDell"; + string filesystemName = "abcd"; + ResourceIdentifier dellFileSystemResourceId = DellFileSystemResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, filesystemName); + DellFileSystemResource dellFileSystem = client.GetDellFileSystemResource(dellFileSystemResourceId); + + // invoke the operation + await dellFileSystem.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_FileSystemsUpdateMaximumSetGen() + { + // Generated from example definition: 2025-03-21-preview/FileSystems_Update_MaximumSet_Gen.json + // this example is just showing the usage of "FileSystemResource_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 + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DellFileSystemResource created on azure + // for more information of creating DellFileSystemResource, please refer to the document of DellFileSystemResource + string subscriptionId = "4B6E265D-57CF-4A9D-8B35-3CC68ED9D208"; + string resourceGroupName = "rgDell"; + string filesystemName = "abcd"; + ResourceIdentifier dellFileSystemResourceId = DellFileSystemResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, filesystemName); + DellFileSystemResource dellFileSystem = client.GetDellFileSystemResource(dellFileSystemResourceId); + + // invoke the operation + DellFileSystemPatch patch = new DellFileSystemPatch + { + Identity = new ManagedServiceIdentityUpdate + { + Type = Models.ManagedServiceIdentityType.SystemAssignedUserAssigned, + UserAssignedIdentities = +{ +["key7645"] = new UserAssignedIdentity() +}, + }, + Tags = +{ +["key6099"] = "ursbxlphfcguvntuevleacwq" +}, + Properties = new FileSystemResourceUpdateProperties + { + DelegatedSubnetId = "bfpuabdz", + Capacity = new DellFileSystemCapacity + { + Current = "5", + }, + Encryption = new DellFileSystemEncryptionPatchProperties + { + EncryptionType = DellFileSystemEncryptionType.CustomerManagedKeysCmk, + KeyUri = "https://contoso.com/keyurl/keyVersion", + EncryptionIdentityProperties = new DellFileSystemEncryptionIdentityPatchProperties + { + IdentityType = DellFileSystemEncryptionIdentityType.UserAssigned, + IdentityResourceId = new ResourceIdentifier("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}"), + }, + }, + }, + }; + DellFileSystemResource result = await dellFileSystem.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DellFileSystemData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_FileSystemsUpdateMinimumSetGen() + { + // Generated from example definition: 2025-03-21-preview/FileSystems_Update_MinimumSet_Gen.json + // this example is just showing the usage of "FileSystemResource_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 + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DellFileSystemResource created on azure + // for more information of creating DellFileSystemResource, please refer to the document of DellFileSystemResource + string subscriptionId = "BF7E7352-2FE4-4163-9CF7-5FF8EC2E9B92"; + string resourceGroupName = "rgDell"; + string filesystemName = "abcd"; + ResourceIdentifier dellFileSystemResourceId = DellFileSystemResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, filesystemName); + DellFileSystemResource dellFileSystem = client.GetDellFileSystemResource(dellFileSystemResourceId); + + // invoke the operation + DellFileSystemPatch patch = new DellFileSystemPatch + { + Properties = new FileSystemResourceUpdateProperties + { + DelegatedSubnetId = "uqfvajvyltgmqvdnxhbrfqbpuey", + Capacity = new DellFileSystemCapacity + { + Current = "5", + }, + }, + }; + DellFileSystemResource result = await dellFileSystem.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DellFileSystemData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..e51695a3c34a --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Dell.Storage.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetDellFileSystems_FileSystemsListBySubscriptionMaximumSetGen() + { + // Generated from example definition: 2025-03-21-preview/FileSystems_ListBySubscription_MaximumSet_Gen.json + // this example is just showing the usage of "FileSystemResource_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 = "4B6E265D-57CF-4A9D-8B35-3CC68ED9D208"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (DellFileSystemResource item in subscriptionResource.GetDellFileSystemsAsync()) + { + // 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 + DellFileSystemData 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 GetDellFileSystems_FileSystemsListBySubscriptionMinimumSetGen() + { + // Generated from example definition: 2025-03-21-preview/FileSystems_ListBySubscription_MinimumSet_Gen.json + // this example is just showing the usage of "FileSystemResource_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 = "BF7E7352-2FE4-4163-9CF7-5FF8EC2E9B92"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (DellFileSystemResource item in subscriptionResource.GetDellFileSystemsAsync()) + { + // 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 + DellFileSystemData 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/dell/Azure.ResourceManager.Dell.Storage/src/Azure.ResourceManager.Dell.Storage.csproj b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Azure.ResourceManager.Dell.Storage.csproj new file mode 100644 index 000000000000..9893d10193f6 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Azure.ResourceManager.Dell.Storage.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider Storage. + 1.0.0-beta.1 + azure;management;arm;resource manager;storage + Azure.ResourceManager.Dell.Storage + + diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/ArmDellStorageModelFactory.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/ArmDellStorageModelFactory.cs new file mode 100644 index 000000000000..a20e27ef86c7 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/ArmDellStorageModelFactory.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Dell.Storage.Models +{ + /// Model factory for models. + public static partial class ArmDellStorageModelFactory + { + /// 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. + /// A new instance for mocking. + public static DellFileSystemData DellFileSystemData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, DellFileSystemProperties properties = null, ManagedServiceIdentity identity = null) + { + tags ??= new Dictionary(); + + return new DellFileSystemData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + identity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Capacity for Dell Filesystem, Will be received as part of Job Status. + /// Marketplace details. + /// Provisioning State of the resource. + /// Delegated subnet id for Vnet injection. + /// Domain range for the delegated subnet. + /// User Details. + /// File system Id of the resource. + /// Smart Connect FQDN of the resource. + /// OneFS url. + /// DellReferenceNumber of the resource. + /// EncryptionProperties of the resource. + /// A new instance for mocking. + public static DellFileSystemProperties DellFileSystemProperties(DellFileSystemCapacity capacity = null, DellFileSystemMarketplaceDetails marketplace = null, DellFileSystemProvisioningState? provisioningState = null, string delegatedSubnetId = null, string delegatedSubnetCidr = null, string userEmail = null, string fileSystemId = null, string smartConnectFqdn = null, string oneFsUri = null, string dellReferenceNumber = null, DellFileSystemEncryptionProperties encryption = null) + { + return new DellFileSystemProperties( + capacity, + marketplace, + provisioningState, + delegatedSubnetId, + delegatedSubnetCidr, + userEmail != null ? new DellFileSystemUserDetails(userEmail, serializedAdditionalRawData: null) : null, + fileSystemId, + smartConnectFqdn, + oneFsUri, + dellReferenceNumber, + encryption, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Marketplace Subscription Id. + /// Plan Id. + /// Offer Id. + /// Publisher Id. + /// Private Offer Id. + /// Plan Name. + /// Marketplace subscription status. + /// End Date of the subscription. + /// Term Unit. + /// A new instance for mocking. + public static DellFileSystemMarketplaceDetails DellFileSystemMarketplaceDetails(string marketplaceSubscriptionId = null, string planId = null, string offerId = null, string publisherId = null, string privateOfferId = null, string planName = null, DellFileSystemMarketplaceSubscriptionStatus? marketplaceSubscriptionStatus = null, string endDate = null, string termUnit = null) + { + return new DellFileSystemMarketplaceDetails( + marketplaceSubscriptionId, + planId, + offerId, + publisherId, + privateOfferId, + planName, + marketplaceSubscriptionStatus, + endDate, + termUnit, + serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/DellFileSystemCollection.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/DellFileSystemCollection.cs new file mode 100644 index 000000000000..a42bb2cd7061 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/DellFileSystemCollection.cs @@ -0,0 +1,494 @@ +// 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.Dell.Storage +{ + /// + /// 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 GetDellFileSystems method from an instance of . + /// + public partial class DellFileSystemCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dellFileSystemFileSystemsClientDiagnostics; + private readonly FileSystemsRestOperations _dellFileSystemFileSystemsRestClient; + + /// Initializes a new instance of the class for mocking. + protected DellFileSystemCollection() + { + } + + /// 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 DellFileSystemCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dellFileSystemFileSystemsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Dell.Storage", DellFileSystemResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DellFileSystemResource.ResourceType, out string dellFileSystemFileSystemsApiVersion); + _dellFileSystemFileSystemsRestClient = new FileSystemsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dellFileSystemFileSystemsApiVersion); +#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 FileSystemResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName} + /// + /// + /// Operation Id + /// FileSystemResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-21-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. + /// Name of the filesystem resource. + /// 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 filesystemName, DellFileSystemData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(filesystemName, nameof(filesystemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dellFileSystemFileSystemsClientDiagnostics.CreateScope("DellFileSystemCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dellFileSystemFileSystemsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, filesystemName, data, cancellationToken).ConfigureAwait(false); + var operation = new StorageArmOperation(new DellFileSystemOperationSource(Client), _dellFileSystemFileSystemsClientDiagnostics, Pipeline, _dellFileSystemFileSystemsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, filesystemName, 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 FileSystemResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName} + /// + /// + /// Operation Id + /// FileSystemResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-21-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. + /// Name of the filesystem resource. + /// 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 filesystemName, DellFileSystemData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(filesystemName, nameof(filesystemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dellFileSystemFileSystemsClientDiagnostics.CreateScope("DellFileSystemCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dellFileSystemFileSystemsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, filesystemName, data, cancellationToken); + var operation = new StorageArmOperation(new DellFileSystemOperationSource(Client), _dellFileSystemFileSystemsClientDiagnostics, Pipeline, _dellFileSystemFileSystemsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, filesystemName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a FileSystemResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName} + /// + /// + /// Operation Id + /// FileSystemResource_Get + /// + /// + /// Default Api Version + /// 2025-03-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the filesystem resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string filesystemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(filesystemName, nameof(filesystemName)); + + using var scope = _dellFileSystemFileSystemsClientDiagnostics.CreateScope("DellFileSystemCollection.Get"); + scope.Start(); + try + { + var response = await _dellFileSystemFileSystemsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, filesystemName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DellFileSystemResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a FileSystemResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName} + /// + /// + /// Operation Id + /// FileSystemResource_Get + /// + /// + /// Default Api Version + /// 2025-03-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the filesystem resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string filesystemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(filesystemName, nameof(filesystemName)); + + using var scope = _dellFileSystemFileSystemsClientDiagnostics.CreateScope("DellFileSystemCollection.Get"); + scope.Start(); + try + { + var response = _dellFileSystemFileSystemsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, filesystemName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DellFileSystemResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List FileSystemResource resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems + /// + /// + /// Operation Id + /// FileSystemResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-03-21-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) => _dellFileSystemFileSystemsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dellFileSystemFileSystemsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DellFileSystemResource(Client, DellFileSystemData.DeserializeDellFileSystemData(e)), _dellFileSystemFileSystemsClientDiagnostics, Pipeline, "DellFileSystemCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List FileSystemResource resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems + /// + /// + /// Operation Id + /// FileSystemResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-03-21-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) => _dellFileSystemFileSystemsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dellFileSystemFileSystemsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DellFileSystemResource(Client, DellFileSystemData.DeserializeDellFileSystemData(e)), _dellFileSystemFileSystemsClientDiagnostics, Pipeline, "DellFileSystemCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName} + /// + /// + /// Operation Id + /// FileSystemResource_Get + /// + /// + /// Default Api Version + /// 2025-03-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the filesystem resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string filesystemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(filesystemName, nameof(filesystemName)); + + using var scope = _dellFileSystemFileSystemsClientDiagnostics.CreateScope("DellFileSystemCollection.Exists"); + scope.Start(); + try + { + var response = await _dellFileSystemFileSystemsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, filesystemName, 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/Dell.Storage/filesystems/{filesystemName} + /// + /// + /// Operation Id + /// FileSystemResource_Get + /// + /// + /// Default Api Version + /// 2025-03-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the filesystem resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string filesystemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(filesystemName, nameof(filesystemName)); + + using var scope = _dellFileSystemFileSystemsClientDiagnostics.CreateScope("DellFileSystemCollection.Exists"); + scope.Start(); + try + { + var response = _dellFileSystemFileSystemsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, filesystemName, 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/Dell.Storage/filesystems/{filesystemName} + /// + /// + /// Operation Id + /// FileSystemResource_Get + /// + /// + /// Default Api Version + /// 2025-03-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the filesystem resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string filesystemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(filesystemName, nameof(filesystemName)); + + using var scope = _dellFileSystemFileSystemsClientDiagnostics.CreateScope("DellFileSystemCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dellFileSystemFileSystemsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, filesystemName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DellFileSystemResource(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/Dell.Storage/filesystems/{filesystemName} + /// + /// + /// Operation Id + /// FileSystemResource_Get + /// + /// + /// Default Api Version + /// 2025-03-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the filesystem resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string filesystemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(filesystemName, nameof(filesystemName)); + + using var scope = _dellFileSystemFileSystemsClientDiagnostics.CreateScope("DellFileSystemCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dellFileSystemFileSystemsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, filesystemName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DellFileSystemResource(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/dell/Azure.ResourceManager.Dell.Storage/src/Generated/DellFileSystemData.Serialization.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/DellFileSystemData.Serialization.cs new file mode 100644 index 000000000000..5147bcdf3c40 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/DellFileSystemData.Serialization.cs @@ -0,0 +1,196 @@ +// 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.Dell.Storage.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Dell.Storage +{ + public partial class DellFileSystemData : 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(DellFileSystemData)} 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); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); + } + } + + DellFileSystemData 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(DellFileSystemData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDellFileSystemData(document.RootElement, options); + } + + internal static DellFileSystemData DeserializeDellFileSystemData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DellFileSystemProperties 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 = DellFileSystemProperties.DeserializeDellFileSystemProperties(property.Value, options); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); + 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 DellFileSystemData( + 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, AzureResourceManagerDellStorageContext.Default); + default: + throw new FormatException($"The model {nameof(DellFileSystemData)} does not support writing '{options.Format}' format."); + } + } + + DellFileSystemData 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDellFileSystemData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DellFileSystemData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/DellFileSystemData.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/DellFileSystemData.cs new file mode 100644 index 000000000000..4d7bbe65a8ed --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/DellFileSystemData.cs @@ -0,0 +1,87 @@ +// 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.Dell.Storage.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Dell.Storage +{ + /// + /// A class representing the DellFileSystem data model. + /// Concrete tracked resource types can be created by aliasing this type using a specific property type. + /// + public partial class DellFileSystemData : 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 DellFileSystemData(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. + /// Keeps track of any properties unknown to the library. + internal DellFileSystemData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, DellFileSystemProperties 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 DellFileSystemData() + { + } + + /// The resource-specific properties for this resource. + public DellFileSystemProperties Properties { get; set; } + /// The managed service identities assigned to this resource. + public ManagedServiceIdentity Identity { get; set; } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/DellFileSystemResource.Serialization.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/DellFileSystemResource.Serialization.cs new file mode 100644 index 000000000000..9c69055584a0 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/DellFileSystemResource.Serialization.cs @@ -0,0 +1,26 @@ +// 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.Dell.Storage +{ + public partial class DellFileSystemResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DellFileSystemData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerDellStorageContext.Default); + + DellFileSystemData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerDellStorageContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/DellFileSystemResource.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/DellFileSystemResource.cs new file mode 100644 index 000000000000..57cfd4c3f82a --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/DellFileSystemResource.cs @@ -0,0 +1,699 @@ +// 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.Dell.Storage.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Dell.Storage +{ + /// + /// A Class representing a DellFileSystem 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 GetDellFileSystemResource method. + /// Otherwise you can get one from its parent resource using the GetDellFileSystem method. + /// + public partial class DellFileSystemResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The filesystemName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string filesystemName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dellFileSystemFileSystemsClientDiagnostics; + private readonly FileSystemsRestOperations _dellFileSystemFileSystemsRestClient; + private readonly DellFileSystemData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Dell.Storage/filesystems"; + + /// Initializes a new instance of the class for mocking. + protected DellFileSystemResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DellFileSystemResource(ArmClient client, DellFileSystemData 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 DellFileSystemResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dellFileSystemFileSystemsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Dell.Storage", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dellFileSystemFileSystemsApiVersion); + _dellFileSystemFileSystemsRestClient = new FileSystemsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dellFileSystemFileSystemsApiVersion); +#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 DellFileSystemData 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 FileSystemResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName} + /// + /// + /// Operation Id + /// FileSystemResource_Get + /// + /// + /// Default Api Version + /// 2025-03-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dellFileSystemFileSystemsClientDiagnostics.CreateScope("DellFileSystemResource.Get"); + scope.Start(); + try + { + var response = await _dellFileSystemFileSystemsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DellFileSystemResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a FileSystemResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName} + /// + /// + /// Operation Id + /// FileSystemResource_Get + /// + /// + /// Default Api Version + /// 2025-03-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dellFileSystemFileSystemsClientDiagnostics.CreateScope("DellFileSystemResource.Get"); + scope.Start(); + try + { + var response = _dellFileSystemFileSystemsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DellFileSystemResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a FileSystemResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName} + /// + /// + /// Operation Id + /// FileSystemResource_Delete + /// + /// + /// Default Api Version + /// 2025-03-21-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 = _dellFileSystemFileSystemsClientDiagnostics.CreateScope("DellFileSystemResource.Delete"); + scope.Start(); + try + { + var response = await _dellFileSystemFileSystemsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new StorageArmOperation(_dellFileSystemFileSystemsClientDiagnostics, Pipeline, _dellFileSystemFileSystemsRestClient.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 FileSystemResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName} + /// + /// + /// Operation Id + /// FileSystemResource_Delete + /// + /// + /// Default Api Version + /// 2025-03-21-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 = _dellFileSystemFileSystemsClientDiagnostics.CreateScope("DellFileSystemResource.Delete"); + scope.Start(); + try + { + var response = _dellFileSystemFileSystemsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new StorageArmOperation(_dellFileSystemFileSystemsClientDiagnostics, Pipeline, _dellFileSystemFileSystemsRestClient.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 FileSystemResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName} + /// + /// + /// Operation Id + /// FileSystemResource_Update + /// + /// + /// Default Api Version + /// 2025-03-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(DellFileSystemPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _dellFileSystemFileSystemsClientDiagnostics.CreateScope("DellFileSystemResource.Update"); + scope.Start(); + try + { + var response = await _dellFileSystemFileSystemsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DellFileSystemResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a FileSystemResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName} + /// + /// + /// Operation Id + /// FileSystemResource_Update + /// + /// + /// Default Api Version + /// 2025-03-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual Response Update(DellFileSystemPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _dellFileSystemFileSystemsClientDiagnostics.CreateScope("DellFileSystemResource.Update"); + scope.Start(); + try + { + var response = _dellFileSystemFileSystemsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + return Response.FromValue(new DellFileSystemResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName} + /// + /// + /// Operation Id + /// FileSystemResource_Get + /// + /// + /// Default Api Version + /// 2025-03-21-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 = _dellFileSystemFileSystemsClientDiagnostics.CreateScope("DellFileSystemResource.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 _dellFileSystemFileSystemsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DellFileSystemResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DellFileSystemPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName} + /// + /// + /// Operation Id + /// FileSystemResource_Get + /// + /// + /// Default Api Version + /// 2025-03-21-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 = _dellFileSystemFileSystemsClientDiagnostics.CreateScope("DellFileSystemResource.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 = _dellFileSystemFileSystemsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DellFileSystemResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DellFileSystemPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName} + /// + /// + /// Operation Id + /// FileSystemResource_Get + /// + /// + /// Default Api Version + /// 2025-03-21-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 = _dellFileSystemFileSystemsClientDiagnostics.CreateScope("DellFileSystemResource.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 _dellFileSystemFileSystemsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DellFileSystemResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DellFileSystemPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName} + /// + /// + /// Operation Id + /// FileSystemResource_Get + /// + /// + /// Default Api Version + /// 2025-03-21-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 = _dellFileSystemFileSystemsClientDiagnostics.CreateScope("DellFileSystemResource.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 = _dellFileSystemFileSystemsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DellFileSystemResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DellFileSystemPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName} + /// + /// + /// Operation Id + /// FileSystemResource_Get + /// + /// + /// Default Api Version + /// 2025-03-21-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 = _dellFileSystemFileSystemsClientDiagnostics.CreateScope("DellFileSystemResource.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 _dellFileSystemFileSystemsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DellFileSystemResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DellFileSystemPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName} + /// + /// + /// Operation Id + /// FileSystemResource_Get + /// + /// + /// Default Api Version + /// 2025-03-21-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 = _dellFileSystemFileSystemsClientDiagnostics.CreateScope("DellFileSystemResource.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 = _dellFileSystemFileSystemsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DellFileSystemResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DellFileSystemPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Extensions/DellStorageExtensions.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Extensions/DellStorageExtensions.cs new file mode 100644 index 000000000000..cffa3a7fea6e --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Extensions/DellStorageExtensions.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.Dell.Storage.Mocking; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Dell.Storage +{ + /// A class to add extension methods to Azure.ResourceManager.Dell.Storage. + public static partial class DellStorageExtensions + { + private static MockableDellStorageArmClient GetMockableDellStorageArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableDellStorageArmClient(client0)); + } + + private static MockableDellStorageResourceGroupResource GetMockableDellStorageResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableDellStorageResourceGroupResource(client, resource.Id)); + } + + private static MockableDellStorageSubscriptionResource GetMockableDellStorageSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableDellStorageSubscriptionResource(client, resource.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 DellFileSystemResource GetDellFileSystemResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDellStorageArmClient(client).GetDellFileSystemResource(id); + } + + /// + /// Gets a collection of DellFileSystemResources 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 DellFileSystemResources and their operations over a DellFileSystemResource. + public static DellFileSystemCollection GetDellFileSystems(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableDellStorageResourceGroupResource(resourceGroupResource).GetDellFileSystems(); + } + + /// + /// Get a FileSystemResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName} + /// + /// + /// Operation Id + /// FileSystemResource_Get + /// + /// + /// Default Api Version + /// 2025-03-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the filesystem resource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetDellFileSystemAsync(this ResourceGroupResource resourceGroupResource, string filesystemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableDellStorageResourceGroupResource(resourceGroupResource).GetDellFileSystemAsync(filesystemName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a FileSystemResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName} + /// + /// + /// Operation Id + /// FileSystemResource_Get + /// + /// + /// Default Api Version + /// 2025-03-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the filesystem resource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetDellFileSystem(this ResourceGroupResource resourceGroupResource, string filesystemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableDellStorageResourceGroupResource(resourceGroupResource).GetDellFileSystem(filesystemName, cancellationToken); + } + + /// + /// List FileSystemResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Dell.Storage/filesystems + /// + /// + /// Operation Id + /// FileSystemResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-21-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 GetDellFileSystemsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDellStorageSubscriptionResource(subscriptionResource).GetDellFileSystemsAsync(cancellationToken); + } + + /// + /// List FileSystemResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Dell.Storage/filesystems + /// + /// + /// Operation Id + /// FileSystemResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-21-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 GetDellFileSystems(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDellStorageSubscriptionResource(subscriptionResource).GetDellFileSystems(cancellationToken); + } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Extensions/MockableDellStorageArmClient.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Extensions/MockableDellStorageArmClient.cs new file mode 100644 index 000000000000..0ffdd8cccd80 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Extensions/MockableDellStorageArmClient.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.Dell.Storage.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableDellStorageArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableDellStorageArmClient() + { + } + + /// 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 MockableDellStorageArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableDellStorageArmClient(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// 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 DellFileSystemResource GetDellFileSystemResource(ResourceIdentifier id) + { + DellFileSystemResource.ValidateResourceId(id); + return new DellFileSystemResource(Client, id); + } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Extensions/MockableDellStorageResourceGroupResource.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Extensions/MockableDellStorageResourceGroupResource.cs new file mode 100644 index 000000000000..f6c9bd9d4d4b --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Extensions/MockableDellStorageResourceGroupResource.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Dell.Storage.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableDellStorageResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableDellStorageResourceGroupResource() + { + } + + /// 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 MockableDellStorageResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of DellFileSystemResources in the ResourceGroupResource. + /// An object representing collection of DellFileSystemResources and their operations over a DellFileSystemResource. + public virtual DellFileSystemCollection GetDellFileSystems() + { + return GetCachedClient(client => new DellFileSystemCollection(client, Id)); + } + + /// + /// Get a FileSystemResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName} + /// + /// + /// Operation Id + /// FileSystemResource_Get + /// + /// + /// Default Api Version + /// 2025-03-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the filesystem resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDellFileSystemAsync(string filesystemName, CancellationToken cancellationToken = default) + { + return await GetDellFileSystems().GetAsync(filesystemName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a FileSystemResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName} + /// + /// + /// Operation Id + /// FileSystemResource_Get + /// + /// + /// Default Api Version + /// 2025-03-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the filesystem resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDellFileSystem(string filesystemName, CancellationToken cancellationToken = default) + { + return GetDellFileSystems().Get(filesystemName, cancellationToken); + } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Extensions/MockableDellStorageSubscriptionResource.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Extensions/MockableDellStorageSubscriptionResource.cs new file mode 100644 index 000000000000..8494dacfc214 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Extensions/MockableDellStorageSubscriptionResource.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Dell.Storage.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableDellStorageSubscriptionResource : ArmResource + { + private ClientDiagnostics _dellFileSystemFileSystemsClientDiagnostics; + private FileSystemsRestOperations _dellFileSystemFileSystemsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableDellStorageSubscriptionResource() + { + } + + /// 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 MockableDellStorageSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics DellFileSystemFileSystemsClientDiagnostics => _dellFileSystemFileSystemsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Dell.Storage", DellFileSystemResource.ResourceType.Namespace, Diagnostics); + private FileSystemsRestOperations DellFileSystemFileSystemsRestClient => _dellFileSystemFileSystemsRestClient ??= new FileSystemsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DellFileSystemResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// List FileSystemResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Dell.Storage/filesystems + /// + /// + /// Operation Id + /// FileSystemResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetDellFileSystemsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DellFileSystemFileSystemsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DellFileSystemFileSystemsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DellFileSystemResource(Client, DellFileSystemData.DeserializeDellFileSystemData(e)), DellFileSystemFileSystemsClientDiagnostics, Pipeline, "MockableDellStorageSubscriptionResource.GetDellFileSystems", "value", "nextLink", cancellationToken); + } + + /// + /// List FileSystemResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Dell.Storage/filesystems + /// + /// + /// Operation Id + /// FileSystemResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-21-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetDellFileSystems(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DellFileSystemFileSystemsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DellFileSystemFileSystemsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DellFileSystemResource(Client, DellFileSystemData.DeserializeDellFileSystemData(e)), DellFileSystemFileSystemsClientDiagnostics, Pipeline, "MockableDellStorageSubscriptionResource.GetDellFileSystems", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Internal/Argument.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..59e8febb4b2e --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Dell.Storage +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..d327c595e48d --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Dell.Storage +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Internal/ChangeTrackingList.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..e3a7e2258afa --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// 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.Linq; + +namespace Azure.ResourceManager.Dell.Storage +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..fedce231bc15 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,407 @@ +// 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.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.ResourceManager.Dell.Storage +{ + internal static class ModelSerializationExtensions + { + internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions { MaxDepth = 256 }; + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + internal static readonly BinaryData SentinelValue = BinaryData.FromBytes("\"__EMPTY__\""u8.ToArray()); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static bool IsSentinelValue(BinaryData value) + { + ReadOnlySpan sentinelSpan = SentinelValue.ToMemory().Span; + ReadOnlySpan valueSpan = value.ToMemory().Span; + return sentinelSpan.SequenceEqual(valueSpan); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Internal/Optional.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..6932519d4289 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.ResourceManager.Dell.Storage +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..6e86acee5300 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Dell.Storage +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/LongRunningOperation/DellFileSystemOperationSource.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/LongRunningOperation/DellFileSystemOperationSource.cs new file mode 100644 index 000000000000..fad798bda1fc --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/LongRunningOperation/DellFileSystemOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Dell.Storage +{ + internal class DellFileSystemOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DellFileSystemOperationSource(ArmClient client) + { + _client = client; + } + + DellFileSystemResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerDellStorageContext.Default); + return new DellFileSystemResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerDellStorageContext.Default); + return await Task.FromResult(new DellFileSystemResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/LongRunningOperation/StorageArmOperation.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/LongRunningOperation/StorageArmOperation.cs new file mode 100644 index 000000000000..08f317e2224b --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/LongRunningOperation/StorageArmOperation.cs @@ -0,0 +1,94 @@ +// 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.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Dell.Storage +{ +#pragma warning disable SA1649 // File name should match first type name + internal class StorageArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of StorageArmOperation for mocking. + protected StorageArmOperation() + { + } + + internal StorageArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal StorageArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "StorageArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json, AzureResourceManagerDellStorageContext.Default).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); + + /// + public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/LongRunningOperation/StorageArmOperationOfT.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/LongRunningOperation/StorageArmOperationOfT.cs new file mode 100644 index 000000000000..eb83f1dc6d5a --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/LongRunningOperation/StorageArmOperationOfT.cs @@ -0,0 +1,100 @@ +// 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.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Dell.Storage +{ +#pragma warning disable SA1649 // File name should match first type name + internal class StorageArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of StorageArmOperation for mocking. + protected StorageArmOperation() + { + } + + internal StorageArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal StorageArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(NextLinkOperationImplementation.Create(source, nextLinkOperation), clientDiagnostics, response, "StorageArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json, AzureResourceManagerDellStorageContext.Default).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override T Value => _operation.Value; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); + + /// + public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/AzureResourceManagerDellStorageContext.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/AzureResourceManagerDellStorageContext.cs new file mode 100644 index 000000000000..12443771c23b --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/AzureResourceManagerDellStorageContext.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Azure.ResourceManager.Dell.Storage +{ + /// + /// Context class which will be filled in by the System.ClientModel.SourceGeneration. + /// For more information see 'https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/System.ClientModel/src/docs/ModelReaderWriterContext.md' + /// + public partial class AzureResourceManagerDellStorageContext : ModelReaderWriterContext + { + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemCapacity.Serialization.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemCapacity.Serialization.cs new file mode 100644 index 000000000000..ee8b01f063d2 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemCapacity.Serialization.cs @@ -0,0 +1,162 @@ +// 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.Dell.Storage.Models +{ + public partial class DellFileSystemCapacity : 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(DellFileSystemCapacity)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Min)) + { + writer.WritePropertyName("min"u8); + writer.WriteStringValue(Min); + } + if (Optional.IsDefined(Max)) + { + writer.WritePropertyName("max"u8); + writer.WriteStringValue(Max); + } + if (Optional.IsDefined(Incremental)) + { + writer.WritePropertyName("incremental"u8); + writer.WriteStringValue(Incremental); + } + if (Optional.IsDefined(Current)) + { + writer.WritePropertyName("current"u8); + writer.WriteStringValue(Current); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DellFileSystemCapacity 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(DellFileSystemCapacity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDellFileSystemCapacity(document.RootElement, options); + } + + internal static DellFileSystemCapacity DeserializeDellFileSystemCapacity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string min = default; + string max = default; + string incremental = default; + string current = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("min"u8)) + { + min = property.Value.GetString(); + continue; + } + if (property.NameEquals("max"u8)) + { + max = property.Value.GetString(); + continue; + } + if (property.NameEquals("incremental"u8)) + { + incremental = property.Value.GetString(); + continue; + } + if (property.NameEquals("current"u8)) + { + current = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DellFileSystemCapacity(min, max, incremental, current, 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, AzureResourceManagerDellStorageContext.Default); + default: + throw new FormatException($"The model {nameof(DellFileSystemCapacity)} does not support writing '{options.Format}' format."); + } + } + + DellFileSystemCapacity 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDellFileSystemCapacity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DellFileSystemCapacity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemCapacity.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemCapacity.cs new file mode 100644 index 000000000000..17a3602321e5 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemCapacity.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Dell.Storage.Models +{ + /// Capacity for a Resource. + public partial class DellFileSystemCapacity + { + /// + /// 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 DellFileSystemCapacity() + { + } + + /// Initializes a new instance of . + /// Minimum Capacity. + /// Maximum Capacity. + /// Units to be increased. + /// Current Capacity of the resource. + /// Keeps track of any properties unknown to the library. + internal DellFileSystemCapacity(string min, string max, string incremental, string current, IDictionary serializedAdditionalRawData) + { + Min = min; + Max = max; + Incremental = incremental; + Current = current; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Minimum Capacity. + public string Min { get; set; } + /// Maximum Capacity. + public string Max { get; set; } + /// Units to be increased. + public string Incremental { get; set; } + /// Current Capacity of the resource. + public string Current { get; set; } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionIdentityPatchProperties.Serialization.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionIdentityPatchProperties.Serialization.cs new file mode 100644 index 000000000000..bb27a5a3b466 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionIdentityPatchProperties.Serialization.cs @@ -0,0 +1,148 @@ +// 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.Dell.Storage.Models +{ + public partial class DellFileSystemEncryptionIdentityPatchProperties : 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(DellFileSystemEncryptionIdentityPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IdentityType)) + { + writer.WritePropertyName("identityType"u8); + writer.WriteStringValue(IdentityType.Value.ToString()); + } + if (Optional.IsDefined(IdentityResourceId)) + { + writer.WritePropertyName("identityResourceId"u8); + writer.WriteStringValue(IdentityResourceId); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DellFileSystemEncryptionIdentityPatchProperties 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(DellFileSystemEncryptionIdentityPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDellFileSystemEncryptionIdentityPatchProperties(document.RootElement, options); + } + + internal static DellFileSystemEncryptionIdentityPatchProperties DeserializeDellFileSystemEncryptionIdentityPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DellFileSystemEncryptionIdentityType? identityType = default; + ResourceIdentifier identityResourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identityType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identityType = new DellFileSystemEncryptionIdentityType(property.Value.GetString()); + continue; + } + if (property.NameEquals("identityResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identityResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DellFileSystemEncryptionIdentityPatchProperties(identityType, identityResourceId, 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, AzureResourceManagerDellStorageContext.Default); + default: + throw new FormatException($"The model {nameof(DellFileSystemEncryptionIdentityPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + DellFileSystemEncryptionIdentityPatchProperties 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDellFileSystemEncryptionIdentityPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DellFileSystemEncryptionIdentityPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionIdentityPatchProperties.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionIdentityPatchProperties.cs new file mode 100644 index 000000000000..dd1e139e74a2 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionIdentityPatchProperties.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Dell.Storage.Models +{ + /// EncryptionIdentityUpdateProperties of Dell FileSystem resource. + public partial class DellFileSystemEncryptionIdentityPatchProperties + { + /// + /// 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 DellFileSystemEncryptionIdentityPatchProperties() + { + } + + /// Initializes a new instance of . + /// Identity type - SystemAssigned/UserAssigned - Only UserAssigned is supported now. + /// User-assigned identity resource id - Only when user opts for UserAssigned identity and hence optional. + /// Keeps track of any properties unknown to the library. + internal DellFileSystemEncryptionIdentityPatchProperties(DellFileSystemEncryptionIdentityType? identityType, ResourceIdentifier identityResourceId, IDictionary serializedAdditionalRawData) + { + IdentityType = identityType; + IdentityResourceId = identityResourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Identity type - SystemAssigned/UserAssigned - Only UserAssigned is supported now. + public DellFileSystemEncryptionIdentityType? IdentityType { get; set; } + /// User-assigned identity resource id - Only when user opts for UserAssigned identity and hence optional. + public ResourceIdentifier IdentityResourceId { get; set; } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionIdentityProperties.Serialization.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionIdentityProperties.Serialization.cs new file mode 100644 index 000000000000..7daf9b6f4d9f --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionIdentityProperties.Serialization.cs @@ -0,0 +1,148 @@ +// 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.Dell.Storage.Models +{ + public partial class DellFileSystemEncryptionIdentityProperties : 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(DellFileSystemEncryptionIdentityProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IdentityType)) + { + writer.WritePropertyName("identityType"u8); + writer.WriteStringValue(IdentityType.Value.ToString()); + } + if (Optional.IsDefined(IdentityResourceId)) + { + writer.WritePropertyName("identityResourceId"u8); + writer.WriteStringValue(IdentityResourceId); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DellFileSystemEncryptionIdentityProperties 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(DellFileSystemEncryptionIdentityProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDellFileSystemEncryptionIdentityProperties(document.RootElement, options); + } + + internal static DellFileSystemEncryptionIdentityProperties DeserializeDellFileSystemEncryptionIdentityProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DellFileSystemEncryptionIdentityType? identityType = default; + ResourceIdentifier identityResourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identityType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identityType = new DellFileSystemEncryptionIdentityType(property.Value.GetString()); + continue; + } + if (property.NameEquals("identityResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identityResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DellFileSystemEncryptionIdentityProperties(identityType, identityResourceId, 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, AzureResourceManagerDellStorageContext.Default); + default: + throw new FormatException($"The model {nameof(DellFileSystemEncryptionIdentityProperties)} does not support writing '{options.Format}' format."); + } + } + + DellFileSystemEncryptionIdentityProperties 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDellFileSystemEncryptionIdentityProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DellFileSystemEncryptionIdentityProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionIdentityProperties.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionIdentityProperties.cs new file mode 100644 index 000000000000..4cc9465f7319 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionIdentityProperties.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Dell.Storage.Models +{ + /// EncryptionIdentityProperties of Dell FileSystem resource. + public partial class DellFileSystemEncryptionIdentityProperties + { + /// + /// 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 DellFileSystemEncryptionIdentityProperties() + { + } + + /// Initializes a new instance of . + /// Identity type - SystemAssigned/UserAssigned - Only UserAssigned is supported now. + /// User-assigned identity resource id - Only when user opts for UserAssigned identity and hence optional. + /// Keeps track of any properties unknown to the library. + internal DellFileSystemEncryptionIdentityProperties(DellFileSystemEncryptionIdentityType? identityType, ResourceIdentifier identityResourceId, IDictionary serializedAdditionalRawData) + { + IdentityType = identityType; + IdentityResourceId = identityResourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Identity type - SystemAssigned/UserAssigned - Only UserAssigned is supported now. + public DellFileSystemEncryptionIdentityType? IdentityType { get; set; } + /// User-assigned identity resource id - Only when user opts for UserAssigned identity and hence optional. + public ResourceIdentifier IdentityResourceId { get; set; } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionIdentityType.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionIdentityType.cs new file mode 100644 index 000000000000..b593b48af40f --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionIdentityType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Dell.Storage.Models +{ + /// Identity type of ManagedIdentity Associated with Dell FileSystem resource. + public readonly partial struct DellFileSystemEncryptionIdentityType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DellFileSystemEncryptionIdentityType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SystemAssignedValue = "SystemAssigned"; + private const string UserAssignedValue = "UserAssigned"; + + /// System Assigned Managed identity. + public static DellFileSystemEncryptionIdentityType SystemAssigned { get; } = new DellFileSystemEncryptionIdentityType(SystemAssignedValue); + /// User Assigned managed identity. + public static DellFileSystemEncryptionIdentityType UserAssigned { get; } = new DellFileSystemEncryptionIdentityType(UserAssignedValue); + /// Determines if two values are the same. + public static bool operator ==(DellFileSystemEncryptionIdentityType left, DellFileSystemEncryptionIdentityType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DellFileSystemEncryptionIdentityType left, DellFileSystemEncryptionIdentityType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DellFileSystemEncryptionIdentityType(string value) => new DellFileSystemEncryptionIdentityType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DellFileSystemEncryptionIdentityType other && Equals(other); + /// + public bool Equals(DellFileSystemEncryptionIdentityType 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/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionPatchProperties.Serialization.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionPatchProperties.Serialization.cs new file mode 100644 index 000000000000..a543784f5037 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionPatchProperties.Serialization.cs @@ -0,0 +1,159 @@ +// 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.Dell.Storage.Models +{ + public partial class DellFileSystemEncryptionPatchProperties : 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(DellFileSystemEncryptionPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(EncryptionType)) + { + writer.WritePropertyName("encryptionType"u8); + writer.WriteStringValue(EncryptionType.Value.ToString()); + } + if (Optional.IsDefined(KeyUri)) + { + writer.WritePropertyName("keyUrl"u8); + writer.WriteStringValue(KeyUri); + } + if (Optional.IsDefined(EncryptionIdentityProperties)) + { + writer.WritePropertyName("encryptionIdentityProperties"u8); + writer.WriteObjectValue(EncryptionIdentityProperties, 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DellFileSystemEncryptionPatchProperties 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(DellFileSystemEncryptionPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDellFileSystemEncryptionPatchProperties(document.RootElement, options); + } + + internal static DellFileSystemEncryptionPatchProperties DeserializeDellFileSystemEncryptionPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DellFileSystemEncryptionType? encryptionType = default; + string keyUrl = default; + DellFileSystemEncryptionIdentityPatchProperties encryptionIdentityProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("encryptionType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encryptionType = new DellFileSystemEncryptionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("keyUrl"u8)) + { + keyUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("encryptionIdentityProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encryptionIdentityProperties = DellFileSystemEncryptionIdentityPatchProperties.DeserializeDellFileSystemEncryptionIdentityPatchProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DellFileSystemEncryptionPatchProperties(encryptionType, keyUrl, encryptionIdentityProperties, 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, AzureResourceManagerDellStorageContext.Default); + default: + throw new FormatException($"The model {nameof(DellFileSystemEncryptionPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + DellFileSystemEncryptionPatchProperties 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDellFileSystemEncryptionPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DellFileSystemEncryptionPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionPatchProperties.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionPatchProperties.cs new file mode 100644 index 000000000000..4d5618893793 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionPatchProperties.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Dell.Storage.Models +{ + /// EncryptionUpdateProperties of Dell FileSystem resource. + public partial class DellFileSystemEncryptionPatchProperties + { + /// + /// 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 DellFileSystemEncryptionPatchProperties() + { + } + + /// Initializes a new instance of . + /// Encryption Type - MMK/CMK. + /// Versioned Encryption Key Url - Only when user opts for CMK and hence optional. + /// Identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault - Only when user opts for CMK and hence optional. + /// Keeps track of any properties unknown to the library. + internal DellFileSystemEncryptionPatchProperties(DellFileSystemEncryptionType? encryptionType, string keyUri, DellFileSystemEncryptionIdentityPatchProperties encryptionIdentityProperties, IDictionary serializedAdditionalRawData) + { + EncryptionType = encryptionType; + KeyUri = keyUri; + EncryptionIdentityProperties = encryptionIdentityProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Encryption Type - MMK/CMK. + public DellFileSystemEncryptionType? EncryptionType { get; set; } + /// Versioned Encryption Key Url - Only when user opts for CMK and hence optional. + public string KeyUri { get; set; } + /// Identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault - Only when user opts for CMK and hence optional. + public DellFileSystemEncryptionIdentityPatchProperties EncryptionIdentityProperties { get; set; } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionProperties.Serialization.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionProperties.Serialization.cs new file mode 100644 index 000000000000..2e78cea3d01f --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionProperties.Serialization.cs @@ -0,0 +1,152 @@ +// 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.Dell.Storage.Models +{ + public partial class DellFileSystemEncryptionProperties : 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(DellFileSystemEncryptionProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("encryptionType"u8); + writer.WriteStringValue(EncryptionType.ToString()); + if (Optional.IsDefined(KeyUri)) + { + writer.WritePropertyName("keyUrl"u8); + writer.WriteStringValue(KeyUri); + } + if (Optional.IsDefined(EncryptionIdentityProperties)) + { + writer.WritePropertyName("encryptionIdentityProperties"u8); + writer.WriteObjectValue(EncryptionIdentityProperties, 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DellFileSystemEncryptionProperties 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(DellFileSystemEncryptionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDellFileSystemEncryptionProperties(document.RootElement, options); + } + + internal static DellFileSystemEncryptionProperties DeserializeDellFileSystemEncryptionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DellFileSystemEncryptionType encryptionType = default; + string keyUrl = default; + DellFileSystemEncryptionIdentityProperties encryptionIdentityProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("encryptionType"u8)) + { + encryptionType = new DellFileSystemEncryptionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("keyUrl"u8)) + { + keyUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("encryptionIdentityProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encryptionIdentityProperties = DellFileSystemEncryptionIdentityProperties.DeserializeDellFileSystemEncryptionIdentityProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DellFileSystemEncryptionProperties(encryptionType, keyUrl, encryptionIdentityProperties, 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, AzureResourceManagerDellStorageContext.Default); + default: + throw new FormatException($"The model {nameof(DellFileSystemEncryptionProperties)} does not support writing '{options.Format}' format."); + } + } + + DellFileSystemEncryptionProperties 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDellFileSystemEncryptionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DellFileSystemEncryptionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionProperties.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionProperties.cs new file mode 100644 index 000000000000..a15dade209a4 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionProperties.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Dell.Storage.Models +{ + /// EncryptionProperties of Dell FileSystem resource. + public partial class DellFileSystemEncryptionProperties + { + /// + /// 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 . + /// Encryption Type - MMK/CMK. + public DellFileSystemEncryptionProperties(DellFileSystemEncryptionType encryptionType) + { + EncryptionType = encryptionType; + } + + /// Initializes a new instance of . + /// Encryption Type - MMK/CMK. + /// Versioned Encryption Key Url - Only when user opts for CMK and hence optional. + /// Identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault - Only when user opts for CMK and hence optional. + /// Keeps track of any properties unknown to the library. + internal DellFileSystemEncryptionProperties(DellFileSystemEncryptionType encryptionType, string keyUri, DellFileSystemEncryptionIdentityProperties encryptionIdentityProperties, IDictionary serializedAdditionalRawData) + { + EncryptionType = encryptionType; + KeyUri = keyUri; + EncryptionIdentityProperties = encryptionIdentityProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DellFileSystemEncryptionProperties() + { + } + + /// Encryption Type - MMK/CMK. + public DellFileSystemEncryptionType EncryptionType { get; set; } + /// Versioned Encryption Key Url - Only when user opts for CMK and hence optional. + public string KeyUri { get; set; } + /// Identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault - Only when user opts for CMK and hence optional. + public DellFileSystemEncryptionIdentityProperties EncryptionIdentityProperties { get; set; } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionType.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionType.cs new file mode 100644 index 000000000000..b7f2e3491e52 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemEncryptionType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Dell.Storage.Models +{ + /// Identity type of ManagedIdentity Associated with Dell FileSystem resource. + public readonly partial struct DellFileSystemEncryptionType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DellFileSystemEncryptionType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MicrosoftManagedKeysMmkValue = "Microsoft-managed keys (MMK)"; + private const string CustomerManagedKeysCmkValue = "Customer-managed keys (CMK)"; + + /// Microsoft managed keys (Default). + public static DellFileSystemEncryptionType MicrosoftManagedKeysMmk { get; } = new DellFileSystemEncryptionType(MicrosoftManagedKeysMmkValue); + /// + /// Customer managed keys + /// (CMK) - Only UserAssigned identity is supported + /// + public static DellFileSystemEncryptionType CustomerManagedKeysCmk { get; } = new DellFileSystemEncryptionType(CustomerManagedKeysCmkValue); + /// Determines if two values are the same. + public static bool operator ==(DellFileSystemEncryptionType left, DellFileSystemEncryptionType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DellFileSystemEncryptionType left, DellFileSystemEncryptionType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DellFileSystemEncryptionType(string value) => new DellFileSystemEncryptionType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DellFileSystemEncryptionType other && Equals(other); + /// + public bool Equals(DellFileSystemEncryptionType 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/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemMarketplaceDetails.Serialization.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemMarketplaceDetails.Serialization.cs new file mode 100644 index 000000000000..382ed372984a --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemMarketplaceDetails.Serialization.cs @@ -0,0 +1,222 @@ +// 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.Dell.Storage.Models +{ + public partial class DellFileSystemMarketplaceDetails : 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(DellFileSystemMarketplaceDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(MarketplaceSubscriptionId)) + { + writer.WritePropertyName("marketplaceSubscriptionId"u8); + writer.WriteStringValue(MarketplaceSubscriptionId); + } + writer.WritePropertyName("planId"u8); + writer.WriteStringValue(PlanId); + writer.WritePropertyName("offerId"u8); + writer.WriteStringValue(OfferId); + if (Optional.IsDefined(PublisherId)) + { + writer.WritePropertyName("publisherId"u8); + writer.WriteStringValue(PublisherId); + } + if (Optional.IsDefined(PrivateOfferId)) + { + writer.WritePropertyName("privateOfferId"u8); + writer.WriteStringValue(PrivateOfferId); + } + writer.WritePropertyName("planName"u8); + writer.WriteStringValue(PlanName); + if (options.Format != "W" && Optional.IsDefined(MarketplaceSubscriptionStatus)) + { + writer.WritePropertyName("marketplaceSubscriptionStatus"u8); + writer.WriteStringValue(MarketplaceSubscriptionStatus.Value.ToString()); + } + if (Optional.IsDefined(EndDate)) + { + writer.WritePropertyName("endDate"u8); + writer.WriteStringValue(EndDate); + } + if (Optional.IsDefined(TermUnit)) + { + writer.WritePropertyName("termUnit"u8); + writer.WriteStringValue(TermUnit); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DellFileSystemMarketplaceDetails 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(DellFileSystemMarketplaceDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDellFileSystemMarketplaceDetails(document.RootElement, options); + } + + internal static DellFileSystemMarketplaceDetails DeserializeDellFileSystemMarketplaceDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string marketplaceSubscriptionId = default; + string planId = default; + string offerId = default; + string publisherId = default; + string privateOfferId = default; + string planName = default; + DellFileSystemMarketplaceSubscriptionStatus? marketplaceSubscriptionStatus = default; + string endDate = default; + string termUnit = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("marketplaceSubscriptionId"u8)) + { + marketplaceSubscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("planId"u8)) + { + planId = property.Value.GetString(); + continue; + } + if (property.NameEquals("offerId"u8)) + { + offerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("publisherId"u8)) + { + publisherId = property.Value.GetString(); + continue; + } + if (property.NameEquals("privateOfferId"u8)) + { + privateOfferId = property.Value.GetString(); + continue; + } + if (property.NameEquals("planName"u8)) + { + planName = property.Value.GetString(); + continue; + } + if (property.NameEquals("marketplaceSubscriptionStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + marketplaceSubscriptionStatus = new DellFileSystemMarketplaceSubscriptionStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("endDate"u8)) + { + endDate = property.Value.GetString(); + continue; + } + if (property.NameEquals("termUnit"u8)) + { + termUnit = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DellFileSystemMarketplaceDetails( + marketplaceSubscriptionId, + planId, + offerId, + publisherId, + privateOfferId, + planName, + marketplaceSubscriptionStatus, + endDate, + termUnit, + 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, AzureResourceManagerDellStorageContext.Default); + default: + throw new FormatException($"The model {nameof(DellFileSystemMarketplaceDetails)} does not support writing '{options.Format}' format."); + } + } + + DellFileSystemMarketplaceDetails 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDellFileSystemMarketplaceDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DellFileSystemMarketplaceDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemMarketplaceDetails.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemMarketplaceDetails.cs new file mode 100644 index 000000000000..e185355ac20b --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemMarketplaceDetails.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Dell.Storage.Models +{ + /// MarketplaceDetails of Dell FileSystem resource. + public partial class DellFileSystemMarketplaceDetails + { + /// + /// 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 . + /// Plan Id. + /// Offer Id. + /// Plan Name. + /// , or is null. + public DellFileSystemMarketplaceDetails(string planId, string offerId, string planName) + { + Argument.AssertNotNull(planId, nameof(planId)); + Argument.AssertNotNull(offerId, nameof(offerId)); + Argument.AssertNotNull(planName, nameof(planName)); + + PlanId = planId; + OfferId = offerId; + PlanName = planName; + } + + /// Initializes a new instance of . + /// Marketplace Subscription Id. + /// Plan Id. + /// Offer Id. + /// Publisher Id. + /// Private Offer Id. + /// Plan Name. + /// Marketplace subscription status. + /// End Date of the subscription. + /// Term Unit. + /// Keeps track of any properties unknown to the library. + internal DellFileSystemMarketplaceDetails(string marketplaceSubscriptionId, string planId, string offerId, string publisherId, string privateOfferId, string planName, DellFileSystemMarketplaceSubscriptionStatus? marketplaceSubscriptionStatus, string endDate, string termUnit, IDictionary serializedAdditionalRawData) + { + MarketplaceSubscriptionId = marketplaceSubscriptionId; + PlanId = planId; + OfferId = offerId; + PublisherId = publisherId; + PrivateOfferId = privateOfferId; + PlanName = planName; + MarketplaceSubscriptionStatus = marketplaceSubscriptionStatus; + EndDate = endDate; + TermUnit = termUnit; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DellFileSystemMarketplaceDetails() + { + } + + /// Marketplace Subscription Id. + public string MarketplaceSubscriptionId { get; set; } + /// Plan Id. + public string PlanId { get; set; } + /// Offer Id. + public string OfferId { get; set; } + /// Publisher Id. + public string PublisherId { get; set; } + /// Private Offer Id. + public string PrivateOfferId { get; set; } + /// Plan Name. + public string PlanName { get; set; } + /// Marketplace subscription status. + public DellFileSystemMarketplaceSubscriptionStatus? MarketplaceSubscriptionStatus { get; } + /// End Date of the subscription. + public string EndDate { get; set; } + /// Term Unit. + public string TermUnit { get; set; } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemMarketplaceSubscriptionStatus.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemMarketplaceSubscriptionStatus.cs new file mode 100644 index 000000000000..c1a4b09deadf --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemMarketplaceSubscriptionStatus.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Dell.Storage.Models +{ + /// Marketplace subscription status of the file system resource. + public readonly partial struct DellFileSystemMarketplaceSubscriptionStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DellFileSystemMarketplaceSubscriptionStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PendingFulfillmentStartValue = "PendingFulfillmentStart"; + private const string SubscribedValue = "Subscribed"; + private const string SuspendedValue = "Suspended"; + private const string UnsubscribedValue = "Unsubscribed"; + + /// Fulfillment has not started. + public static DellFileSystemMarketplaceSubscriptionStatus PendingFulfillmentStart { get; } = new DellFileSystemMarketplaceSubscriptionStatus(PendingFulfillmentStartValue); + /// Marketplace offer is subscribed. + public static DellFileSystemMarketplaceSubscriptionStatus Subscribed { get; } = new DellFileSystemMarketplaceSubscriptionStatus(SubscribedValue); + /// Marketplace offer is suspended because of non payment. + public static DellFileSystemMarketplaceSubscriptionStatus Suspended { get; } = new DellFileSystemMarketplaceSubscriptionStatus(SuspendedValue); + /// Marketplace offer is unsubscribed. + public static DellFileSystemMarketplaceSubscriptionStatus Unsubscribed { get; } = new DellFileSystemMarketplaceSubscriptionStatus(UnsubscribedValue); + /// Determines if two values are the same. + public static bool operator ==(DellFileSystemMarketplaceSubscriptionStatus left, DellFileSystemMarketplaceSubscriptionStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DellFileSystemMarketplaceSubscriptionStatus left, DellFileSystemMarketplaceSubscriptionStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DellFileSystemMarketplaceSubscriptionStatus(string value) => new DellFileSystemMarketplaceSubscriptionStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DellFileSystemMarketplaceSubscriptionStatus other && Equals(other); + /// + public bool Equals(DellFileSystemMarketplaceSubscriptionStatus 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/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemPatch.Serialization.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemPatch.Serialization.cs new file mode 100644 index 000000000000..125cb61c447f --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemPatch.Serialization.cs @@ -0,0 +1,174 @@ +// 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.Dell.Storage.Models +{ + public partial class DellFileSystemPatch : 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(DellFileSystemPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, options); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DellFileSystemPatch 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(DellFileSystemPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDellFileSystemPatch(document.RootElement, options); + } + + internal static DellFileSystemPatch DeserializeDellFileSystemPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedServiceIdentityUpdate identity = default; + IDictionary tags = default; + FileSystemResourceUpdateProperties 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 = ManagedServiceIdentityUpdate.DeserializeManagedServiceIdentityUpdate(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("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = FileSystemResourceUpdateProperties.DeserializeFileSystemResourceUpdateProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DellFileSystemPatch(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, AzureResourceManagerDellStorageContext.Default); + default: + throw new FormatException($"The model {nameof(DellFileSystemPatch)} does not support writing '{options.Format}' format."); + } + } + + DellFileSystemPatch 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDellFileSystemPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DellFileSystemPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemPatch.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemPatch.cs new file mode 100644 index 000000000000..03251b316634 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemPatch.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Dell.Storage.Models +{ + /// The type used for update operations of the FileSystemResource. + public partial class DellFileSystemPatch + { + /// + /// 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 DellFileSystemPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The managed service identities assigned to this resource. + /// Resource tags. + /// The updatable properties of the FileSystemResource. + /// Keeps track of any properties unknown to the library. + internal DellFileSystemPatch(ManagedServiceIdentityUpdate identity, IDictionary tags, FileSystemResourceUpdateProperties properties, IDictionary serializedAdditionalRawData) + { + Identity = identity; + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The managed service identities assigned to this resource. + public ManagedServiceIdentityUpdate Identity { get; set; } + /// Resource tags. + public IDictionary Tags { get; } + /// The updatable properties of the FileSystemResource. + public FileSystemResourceUpdateProperties Properties { get; set; } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemProperties.Serialization.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemProperties.Serialization.cs new file mode 100644 index 000000000000..4888ff2809b6 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemProperties.Serialization.cs @@ -0,0 +1,241 @@ +// 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.Dell.Storage.Models +{ + public partial class DellFileSystemProperties : 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(DellFileSystemProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Capacity)) + { + writer.WritePropertyName("capacity"u8); + writer.WriteObjectValue(Capacity, options); + } + writer.WritePropertyName("marketplace"u8); + writer.WriteObjectValue(Marketplace, options); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("delegatedSubnetId"u8); + writer.WriteStringValue(DelegatedSubnetId); + writer.WritePropertyName("delegatedSubnetCidr"u8); + writer.WriteStringValue(DelegatedSubnetCidr); + writer.WritePropertyName("user"u8); + writer.WriteObjectValue(User, options); + if (Optional.IsDefined(FileSystemId)) + { + writer.WritePropertyName("fileSystemId"u8); + writer.WriteStringValue(FileSystemId); + } + if (Optional.IsDefined(SmartConnectFqdn)) + { + writer.WritePropertyName("smartConnectFqdn"u8); + writer.WriteStringValue(SmartConnectFqdn); + } + if (Optional.IsDefined(OneFsUri)) + { + writer.WritePropertyName("oneFsUrl"u8); + writer.WriteStringValue(OneFsUri); + } + writer.WritePropertyName("dellReferenceNumber"u8); + writer.WriteStringValue(DellReferenceNumber); + writer.WritePropertyName("encryption"u8); + writer.WriteObjectValue(Encryption, 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DellFileSystemProperties 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(DellFileSystemProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDellFileSystemProperties(document.RootElement, options); + } + + internal static DellFileSystemProperties DeserializeDellFileSystemProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DellFileSystemCapacity capacity = default; + DellFileSystemMarketplaceDetails marketplace = default; + DellFileSystemProvisioningState? provisioningState = default; + string delegatedSubnetId = default; + string delegatedSubnetCidr = default; + DellFileSystemUserDetails user = default; + string fileSystemId = default; + string smartConnectFqdn = default; + string oneFsUrl = default; + string dellReferenceNumber = default; + DellFileSystemEncryptionProperties encryption = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("capacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacity = DellFileSystemCapacity.DeserializeDellFileSystemCapacity(property.Value, options); + continue; + } + if (property.NameEquals("marketplace"u8)) + { + marketplace = DellFileSystemMarketplaceDetails.DeserializeDellFileSystemMarketplaceDetails(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DellFileSystemProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("delegatedSubnetId"u8)) + { + delegatedSubnetId = property.Value.GetString(); + continue; + } + if (property.NameEquals("delegatedSubnetCidr"u8)) + { + delegatedSubnetCidr = property.Value.GetString(); + continue; + } + if (property.NameEquals("user"u8)) + { + user = DellFileSystemUserDetails.DeserializeDellFileSystemUserDetails(property.Value, options); + continue; + } + if (property.NameEquals("fileSystemId"u8)) + { + fileSystemId = property.Value.GetString(); + continue; + } + if (property.NameEquals("smartConnectFqdn"u8)) + { + smartConnectFqdn = property.Value.GetString(); + continue; + } + if (property.NameEquals("oneFsUrl"u8)) + { + oneFsUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("dellReferenceNumber"u8)) + { + dellReferenceNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("encryption"u8)) + { + encryption = DellFileSystemEncryptionProperties.DeserializeDellFileSystemEncryptionProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DellFileSystemProperties( + capacity, + marketplace, + provisioningState, + delegatedSubnetId, + delegatedSubnetCidr, + user, + fileSystemId, + smartConnectFqdn, + oneFsUrl, + dellReferenceNumber, + encryption, + 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, AzureResourceManagerDellStorageContext.Default); + default: + throw new FormatException($"The model {nameof(DellFileSystemProperties)} does not support writing '{options.Format}' format."); + } + } + + DellFileSystemProperties 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDellFileSystemProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DellFileSystemProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemProperties.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemProperties.cs new file mode 100644 index 000000000000..ff808d1c5253 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemProperties.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Dell.Storage.Models +{ + /// Properties specific to the Dell File System resource. + public partial class DellFileSystemProperties + { + /// + /// 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 . + /// Marketplace details. + /// Delegated subnet id for Vnet injection. + /// Domain range for the delegated subnet. + /// User Details. + /// DellReferenceNumber of the resource. + /// EncryptionProperties of the resource. + /// , , , , or is null. + public DellFileSystemProperties(DellFileSystemMarketplaceDetails marketplace, string delegatedSubnetId, string delegatedSubnetCidr, DellFileSystemUserDetails user, string dellReferenceNumber, DellFileSystemEncryptionProperties encryption) + { + Argument.AssertNotNull(marketplace, nameof(marketplace)); + Argument.AssertNotNull(delegatedSubnetId, nameof(delegatedSubnetId)); + Argument.AssertNotNull(delegatedSubnetCidr, nameof(delegatedSubnetCidr)); + Argument.AssertNotNull(user, nameof(user)); + Argument.AssertNotNull(dellReferenceNumber, nameof(dellReferenceNumber)); + Argument.AssertNotNull(encryption, nameof(encryption)); + + Marketplace = marketplace; + DelegatedSubnetId = delegatedSubnetId; + DelegatedSubnetCidr = delegatedSubnetCidr; + User = user; + DellReferenceNumber = dellReferenceNumber; + Encryption = encryption; + } + + /// Initializes a new instance of . + /// Capacity for Dell Filesystem, Will be received as part of Job Status. + /// Marketplace details. + /// Provisioning State of the resource. + /// Delegated subnet id for Vnet injection. + /// Domain range for the delegated subnet. + /// User Details. + /// File system Id of the resource. + /// Smart Connect FQDN of the resource. + /// OneFS url. + /// DellReferenceNumber of the resource. + /// EncryptionProperties of the resource. + /// Keeps track of any properties unknown to the library. + internal DellFileSystemProperties(DellFileSystemCapacity capacity, DellFileSystemMarketplaceDetails marketplace, DellFileSystemProvisioningState? provisioningState, string delegatedSubnetId, string delegatedSubnetCidr, DellFileSystemUserDetails user, string fileSystemId, string smartConnectFqdn, string oneFsUri, string dellReferenceNumber, DellFileSystemEncryptionProperties encryption, IDictionary serializedAdditionalRawData) + { + Capacity = capacity; + Marketplace = marketplace; + ProvisioningState = provisioningState; + DelegatedSubnetId = delegatedSubnetId; + DelegatedSubnetCidr = delegatedSubnetCidr; + User = user; + FileSystemId = fileSystemId; + SmartConnectFqdn = smartConnectFqdn; + OneFsUri = oneFsUri; + DellReferenceNumber = dellReferenceNumber; + Encryption = encryption; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DellFileSystemProperties() + { + } + + /// Capacity for Dell Filesystem, Will be received as part of Job Status. + public DellFileSystemCapacity Capacity { get; set; } + /// Marketplace details. + public DellFileSystemMarketplaceDetails Marketplace { get; set; } + /// Provisioning State of the resource. + public DellFileSystemProvisioningState? ProvisioningState { get; } + /// Delegated subnet id for Vnet injection. + public string DelegatedSubnetId { get; set; } + /// Domain range for the delegated subnet. + public string DelegatedSubnetCidr { get; set; } + /// User Details. + internal DellFileSystemUserDetails User { get; set; } + /// User Email. + public string UserEmail + { + get => User is null ? default : User.Email; + set => User = new DellFileSystemUserDetails(value); + } + + /// File system Id of the resource. + public string FileSystemId { get; set; } + /// Smart Connect FQDN of the resource. + public string SmartConnectFqdn { get; set; } + /// OneFS url. + public string OneFsUri { get; set; } + /// DellReferenceNumber of the resource. + public string DellReferenceNumber { get; set; } + /// EncryptionProperties of the resource. + public DellFileSystemEncryptionProperties Encryption { get; set; } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemProvisioningState.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemProvisioningState.cs new file mode 100644 index 000000000000..13314d1db2f0 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemProvisioningState.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Dell.Storage.Models +{ + /// Provisioning State of the File system resource. + public readonly partial struct DellFileSystemProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DellFileSystemProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AcceptedValue = "Accepted"; + private const string CreatingValue = "Creating"; + private const string UpdatingValue = "Updating"; + private const string DeletingValue = "Deleting"; + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string DeletedValue = "Deleted"; + private const string NotSpecifiedValue = "NotSpecified"; + + /// File system resource creation request accepted. + public static DellFileSystemProvisioningState Accepted { get; } = new DellFileSystemProvisioningState(AcceptedValue); + /// File system resource creation started. + public static DellFileSystemProvisioningState Creating { get; } = new DellFileSystemProvisioningState(CreatingValue); + /// File system resource is being updated. + public static DellFileSystemProvisioningState Updating { get; } = new DellFileSystemProvisioningState(UpdatingValue); + /// File system resource deletion started. + public static DellFileSystemProvisioningState Deleting { get; } = new DellFileSystemProvisioningState(DeletingValue); + /// File system resource creation successful. + public static DellFileSystemProvisioningState Succeeded { get; } = new DellFileSystemProvisioningState(SucceededValue); + /// File system resource creation failed. + public static DellFileSystemProvisioningState Failed { get; } = new DellFileSystemProvisioningState(FailedValue); + /// File system resource creation canceled. + public static DellFileSystemProvisioningState Canceled { get; } = new DellFileSystemProvisioningState(CanceledValue); + /// File system resource is deleted. + public static DellFileSystemProvisioningState Deleted { get; } = new DellFileSystemProvisioningState(DeletedValue); + /// File system resource state is unknown. + public static DellFileSystemProvisioningState NotSpecified { get; } = new DellFileSystemProvisioningState(NotSpecifiedValue); + /// Determines if two values are the same. + public static bool operator ==(DellFileSystemProvisioningState left, DellFileSystemProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DellFileSystemProvisioningState left, DellFileSystemProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DellFileSystemProvisioningState(string value) => new DellFileSystemProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DellFileSystemProvisioningState other && Equals(other); + /// + public bool Equals(DellFileSystemProvisioningState 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/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemUserDetails.Serialization.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemUserDetails.Serialization.cs new file mode 100644 index 000000000000..1af7c9d0f0b6 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemUserDetails.Serialization.cs @@ -0,0 +1,126 @@ +// 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.Dell.Storage.Models +{ + public partial class DellFileSystemUserDetails : 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(DellFileSystemUserDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("email"u8); + writer.WriteStringValue(Email); + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DellFileSystemUserDetails 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(DellFileSystemUserDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDellFileSystemUserDetails(document.RootElement, options); + } + + internal static DellFileSystemUserDetails DeserializeDellFileSystemUserDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string email = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("email"u8)) + { + email = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DellFileSystemUserDetails(email, 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, AzureResourceManagerDellStorageContext.Default); + default: + throw new FormatException($"The model {nameof(DellFileSystemUserDetails)} does not support writing '{options.Format}' format."); + } + } + + DellFileSystemUserDetails 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDellFileSystemUserDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DellFileSystemUserDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemUserDetails.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemUserDetails.cs new file mode 100644 index 000000000000..2c4d5eab7563 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/DellFileSystemUserDetails.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Dell.Storage.Models +{ + /// User Details of Dell FileSystem resource. + public partial class DellFileSystemUserDetails + { + /// + /// 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 . + /// User Email. + /// is null. + public DellFileSystemUserDetails(string email) + { + Argument.AssertNotNull(email, nameof(email)); + + Email = email; + } + + /// Initializes a new instance of . + /// User Email. + /// Keeps track of any properties unknown to the library. + internal DellFileSystemUserDetails(string email, IDictionary serializedAdditionalRawData) + { + Email = email; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DellFileSystemUserDetails() + { + } + + /// User Email. + public string Email { get; set; } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/FileSystemResourceListResult.Serialization.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/FileSystemResourceListResult.Serialization.cs new file mode 100644 index 000000000000..89d43d9bf40d --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/FileSystemResourceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// 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.Dell.Storage.Models +{ + internal partial class FileSystemResourceListResult : 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(FileSystemResourceListResult)} 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FileSystemResourceListResult 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(FileSystemResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFileSystemResourceListResult(document.RootElement, options); + } + + internal static FileSystemResourceListResult DeserializeFileSystemResourceListResult(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(DellFileSystemData.DeserializeDellFileSystemData(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 FileSystemResourceListResult(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, AzureResourceManagerDellStorageContext.Default); + default: + throw new FormatException($"The model {nameof(FileSystemResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + FileSystemResourceListResult 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFileSystemResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FileSystemResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/FileSystemResourceListResult.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/FileSystemResourceListResult.cs new file mode 100644 index 000000000000..0b493e249a79 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/FileSystemResourceListResult.cs @@ -0,0 +1,80 @@ +// 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.Dell.Storage.Models +{ + /// The response of a FileSystemResource list operation. + internal partial class FileSystemResourceListResult + { + /// + /// 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 FileSystemResource items on this page. + /// is null. + internal FileSystemResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The FileSystemResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FileSystemResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FileSystemResourceListResult() + { + } + + /// The FileSystemResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/FileSystemResourceUpdateProperties.Serialization.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/FileSystemResourceUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..34b78c21dce8 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/FileSystemResourceUpdateProperties.Serialization.cs @@ -0,0 +1,159 @@ +// 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.Dell.Storage.Models +{ + public partial class FileSystemResourceUpdateProperties : 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(FileSystemResourceUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DelegatedSubnetId)) + { + writer.WritePropertyName("delegatedSubnetId"u8); + writer.WriteStringValue(DelegatedSubnetId); + } + if (Optional.IsDefined(Capacity)) + { + writer.WritePropertyName("capacity"u8); + writer.WriteObjectValue(Capacity, options); + } + if (Optional.IsDefined(Encryption)) + { + writer.WritePropertyName("encryption"u8); + writer.WriteObjectValue(Encryption, 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FileSystemResourceUpdateProperties 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(FileSystemResourceUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFileSystemResourceUpdateProperties(document.RootElement, options); + } + + internal static FileSystemResourceUpdateProperties DeserializeFileSystemResourceUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string delegatedSubnetId = default; + DellFileSystemCapacity capacity = default; + DellFileSystemEncryptionPatchProperties encryption = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("delegatedSubnetId"u8)) + { + delegatedSubnetId = property.Value.GetString(); + continue; + } + if (property.NameEquals("capacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacity = DellFileSystemCapacity.DeserializeDellFileSystemCapacity(property.Value, options); + continue; + } + if (property.NameEquals("encryption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encryption = DellFileSystemEncryptionPatchProperties.DeserializeDellFileSystemEncryptionPatchProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FileSystemResourceUpdateProperties(delegatedSubnetId, capacity, encryption, 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, AzureResourceManagerDellStorageContext.Default); + default: + throw new FormatException($"The model {nameof(FileSystemResourceUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + FileSystemResourceUpdateProperties 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFileSystemResourceUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FileSystemResourceUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/FileSystemResourceUpdateProperties.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/FileSystemResourceUpdateProperties.cs new file mode 100644 index 000000000000..2757e6be5ea3 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/FileSystemResourceUpdateProperties.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Dell.Storage.Models +{ + /// The updatable properties of the FileSystemResource. + public partial class FileSystemResourceUpdateProperties + { + /// + /// 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 FileSystemResourceUpdateProperties() + { + } + + /// Initializes a new instance of . + /// Delegated subnet id for Vnet injection. + /// Capacity for Dell Filesystem. + /// Encryption Details of the resource. + /// Keeps track of any properties unknown to the library. + internal FileSystemResourceUpdateProperties(string delegatedSubnetId, DellFileSystemCapacity capacity, DellFileSystemEncryptionPatchProperties encryption, IDictionary serializedAdditionalRawData) + { + DelegatedSubnetId = delegatedSubnetId; + Capacity = capacity; + Encryption = encryption; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Delegated subnet id for Vnet injection. + public string DelegatedSubnetId { get; set; } + /// Capacity for Dell Filesystem. + public DellFileSystemCapacity Capacity { get; set; } + /// Encryption Details of the resource. + public DellFileSystemEncryptionPatchProperties Encryption { get; set; } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/ManagedServiceIdentityType.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/ManagedServiceIdentityType.cs new file mode 100644 index 000000000000..516b05e78896 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/ManagedServiceIdentityType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Dell.Storage.Models +{ + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + public readonly partial struct ManagedServiceIdentityType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ManagedServiceIdentityType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string SystemAssignedValue = "SystemAssigned"; + private const string UserAssignedValue = "UserAssigned"; + private const string SystemAssignedUserAssignedValue = "SystemAssigned,UserAssigned"; + + /// No managed identity. + public static ManagedServiceIdentityType None { get; } = new ManagedServiceIdentityType(NoneValue); + /// System assigned managed identity. + public static ManagedServiceIdentityType SystemAssigned { get; } = new ManagedServiceIdentityType(SystemAssignedValue); + /// User assigned managed identity. + public static ManagedServiceIdentityType UserAssigned { get; } = new ManagedServiceIdentityType(UserAssignedValue); + /// System and user assigned managed identity. + public static ManagedServiceIdentityType SystemAssignedUserAssigned { get; } = new ManagedServiceIdentityType(SystemAssignedUserAssignedValue); + /// Determines if two values are the same. + public static bool operator ==(ManagedServiceIdentityType left, ManagedServiceIdentityType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ManagedServiceIdentityType left, ManagedServiceIdentityType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ManagedServiceIdentityType(string value) => new ManagedServiceIdentityType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ManagedServiceIdentityType other && Equals(other); + /// + public bool Equals(ManagedServiceIdentityType 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/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/ManagedServiceIdentityUpdate.Serialization.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/ManagedServiceIdentityUpdate.Serialization.cs new file mode 100644 index 000000000000..9926438f9e10 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/ManagedServiceIdentityUpdate.Serialization.cs @@ -0,0 +1,160 @@ +// 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.Dell.Storage.Models +{ + public partial class ManagedServiceIdentityUpdate : 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(ManagedServiceIdentityUpdate)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.Value.ToString()); + } + if (Optional.IsCollectionDefined(UserAssignedIdentities)) + { + writer.WritePropertyName("userAssignedIdentities"u8); + writer.WriteStartObject(); + foreach (var item in UserAssignedIdentities) + { + writer.WritePropertyName(item.Key); + JsonSerializer.Serialize(writer, 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ManagedServiceIdentityUpdate 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(ManagedServiceIdentityUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedServiceIdentityUpdate(document.RootElement, options); + } + + internal static ManagedServiceIdentityUpdate DeserializeManagedServiceIdentityUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedServiceIdentityType? type = default; + IDictionary userAssignedIdentities = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new ManagedServiceIdentityType(property.Value.GetString()); + continue; + } + if (property.NameEquals("userAssignedIdentities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, JsonSerializer.Deserialize(property0.Value.GetRawText())); + } + userAssignedIdentities = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedServiceIdentityUpdate(type, userAssignedIdentities ?? 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, AzureResourceManagerDellStorageContext.Default); + default: + throw new FormatException($"The model {nameof(ManagedServiceIdentityUpdate)} does not support writing '{options.Format}' format."); + } + } + + ManagedServiceIdentityUpdate 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeManagedServiceIdentityUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedServiceIdentityUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/ManagedServiceIdentityUpdate.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/ManagedServiceIdentityUpdate.cs new file mode 100644 index 000000000000..3f87ad12009e --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/Models/ManagedServiceIdentityUpdate.cs @@ -0,0 +1,71 @@ +// 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.Dell.Storage.Models +{ + /// Managed service identity (system assigned and/or user assigned identities). + public partial class ManagedServiceIdentityUpdate + { + /// + /// 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 ManagedServiceIdentityUpdate() + { + UserAssignedIdentities = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The type of managed identity assigned to this resource. + /// The identities assigned to this resource by the user. + /// Keeps track of any properties unknown to the library. + internal ManagedServiceIdentityUpdate(ManagedServiceIdentityType? type, IDictionary userAssignedIdentities, IDictionary serializedAdditionalRawData) + { + Type = type; + UserAssignedIdentities = userAssignedIdentities; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of managed identity assigned to this resource. + public ManagedServiceIdentityType? Type { get; set; } + /// The identities assigned to this resource by the user. + public IDictionary UserAssignedIdentities { get; } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/ProviderConstants.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..54f3b02a428e --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/ProviderConstants.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Dell.Storage +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/RestOperations/FileSystemsRestOperations.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/RestOperations/FileSystemsRestOperations.cs new file mode 100644 index 000000000000..c36d568936f1 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Generated/RestOperations/FileSystemsRestOperations.cs @@ -0,0 +1,731 @@ +// 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.Dell.Storage.Models; + +namespace Azure.ResourceManager.Dell.Storage +{ + internal partial class FileSystemsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FileSystemsRestOperations. + /// 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 FileSystemsRestOperations(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 ?? "2025-03-21-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string filesystemName) + { + 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/Dell.Storage/filesystems/", false); + uri.AppendPath(filesystemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string filesystemName) + { + 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/Dell.Storage/filesystems/", false); + uri.AppendPath(filesystemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a FileSystemResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the filesystem resource. + /// 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 filesystemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(filesystemName, nameof(filesystemName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, filesystemName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DellFileSystemData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DellFileSystemData.DeserializeDellFileSystemData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DellFileSystemData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a FileSystemResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the filesystem resource. + /// 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 filesystemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(filesystemName, nameof(filesystemName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, filesystemName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DellFileSystemData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DellFileSystemData.DeserializeDellFileSystemData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DellFileSystemData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string filesystemName, DellFileSystemData 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/Dell.Storage/filesystems/", false); + uri.AppendPath(filesystemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string filesystemName, DellFileSystemData 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/Dell.Storage/filesystems/", false); + uri.AppendPath(filesystemName, 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 FileSystemResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the filesystem resource. + /// 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 CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string filesystemName, DellFileSystemData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(filesystemName, nameof(filesystemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, filesystemName, 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 FileSystemResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the filesystem resource. + /// 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 CreateOrUpdate(string subscriptionId, string resourceGroupName, string filesystemName, DellFileSystemData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(filesystemName, nameof(filesystemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, filesystemName, 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 filesystemName, DellFileSystemPatch 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/Dell.Storage/filesystems/", false); + uri.AppendPath(filesystemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string filesystemName, DellFileSystemPatch 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/Dell.Storage/filesystems/", false); + uri.AppendPath(filesystemName, 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 FileSystemResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the filesystem resource. + /// 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 filesystemName, DellFileSystemPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(filesystemName, nameof(filesystemName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, filesystemName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DellFileSystemData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DellFileSystemData.DeserializeDellFileSystemData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a FileSystemResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the filesystem resource. + /// 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 filesystemName, DellFileSystemPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(filesystemName, nameof(filesystemName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, filesystemName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DellFileSystemData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DellFileSystemData.DeserializeDellFileSystemData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string filesystemName) + { + 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/Dell.Storage/filesystems/", false); + uri.AppendPath(filesystemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string filesystemName) + { + 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/Dell.Storage/filesystems/", false); + uri.AppendPath(filesystemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a FileSystemResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the filesystem resource. + /// 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 filesystemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(filesystemName, nameof(filesystemName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, filesystemName); + 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 FileSystemResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the filesystem resource. + /// 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 filesystemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(filesystemName, nameof(filesystemName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, filesystemName); + _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/Dell.Storage/filesystems", 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/Dell.Storage/filesystems", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List FileSystemResource 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: + { + FileSystemResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FileSystemResourceListResult.DeserializeFileSystemResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List FileSystemResource 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: + { + FileSystemResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FileSystemResourceListResult.DeserializeFileSystemResourceListResult(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/Dell.Storage/filesystems", 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/Dell.Storage/filesystems", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List FileSystemResource 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: + { + FileSystemResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FileSystemResourceListResult.DeserializeFileSystemResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List FileSystemResource 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: + { + FileSystemResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FileSystemResourceListResult.DeserializeFileSystemResourceListResult(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 FileSystemResource 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: + { + FileSystemResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FileSystemResourceListResult.DeserializeFileSystemResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List FileSystemResource 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: + { + FileSystemResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FileSystemResourceListResult.DeserializeFileSystemResourceListResult(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 FileSystemResource 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: + { + FileSystemResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FileSystemResourceListResult.DeserializeFileSystemResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List FileSystemResource 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: + { + FileSystemResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FileSystemResourceListResult.DeserializeFileSystemResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Properties/AssemblyInfo.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..e7aa85879210 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.ResourceManager.Dell.Storage.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("Storage")] diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/tests/Azure.ResourceManager.Dell.Storage.Tests.csproj b/sdk/dell/Azure.ResourceManager.Dell.Storage/tests/Azure.ResourceManager.Dell.Storage.Tests.csproj new file mode 100644 index 000000000000..dddda8294641 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/tests/Azure.ResourceManager.Dell.Storage.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/tests/StorageManagementTestBase.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/tests/StorageManagementTestBase.cs new file mode 100644 index 000000000000..469e8a178502 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/tests/StorageManagementTestBase.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.TestFramework; +using NUnit.Framework; +using System.Threading.Tasks; + +namespace Azure.ResourceManager.Dell.Storage.Tests +{ + public class StorageManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected StorageManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected StorageManagementTestBase(bool isAsync) + : base(isAsync) + { + } + + [SetUp] + public async Task CreateCommonClient() + { + Client = GetArmClient(); + DefaultSubscription = await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false); + } + + protected async Task CreateResourceGroup(SubscriptionResource subscription, string rgNamePrefix, AzureLocation location) + { + string rgName = Recording.GenerateAssetName(rgNamePrefix); + ResourceGroupData input = new ResourceGroupData(location); + var lro = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, input); + return lro.Value; + } + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/tests/StorageManagementTestEnvironment.cs b/sdk/dell/Azure.ResourceManager.Dell.Storage/tests/StorageManagementTestEnvironment.cs new file mode 100644 index 000000000000..7b29453a8ac0 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/tests/StorageManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.Dell.Storage.Tests +{ + public class StorageManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/dell/Azure.ResourceManager.Dell.Storage/tsp-location.yaml b/sdk/dell/Azure.ResourceManager.Dell.Storage/tsp-location.yaml new file mode 100644 index 000000000000..c34aa37b7321 --- /dev/null +++ b/sdk/dell/Azure.ResourceManager.Dell.Storage/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/dell/Dell.Storage.Management +commit: ddd7495a7fd97d2c68ff494b86d20df4d9f60038 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/dell/ci.mgmt.yml b/sdk/dell/ci.mgmt.yml new file mode 100644 index 000000000000..0bdca234bac8 --- /dev/null +++ b/sdk/dell/ci.mgmt.yml @@ -0,0 +1,26 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: none + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dell /ci.mgmt.yml + - sdk/dell /Azure.ResourceManager.Dell.Storage / + + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: dell + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.Dell.Storage + safeName: AzureResourceManagerDellStorage diff --git a/sdk/resourcemanager/ci.mgmt.yml b/sdk/resourcemanager/ci.mgmt.yml index 9ae0a7e75290..a7ff2bceb28d 100644 --- a/sdk/resourcemanager/ci.mgmt.yml +++ b/sdk/resourcemanager/ci.mgmt.yml @@ -69,6 +69,7 @@ trigger: - sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup - sdk/datashare/Azure.ResourceManager.DataShare - sdk/defendereasm/Azure.ResourceManager.DefenderEasm + - sdk/dell/Azure.ResourceManager.Dell.Storage - sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization - sdk/devcenter/Azure.ResourceManager.DevCenter - sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices @@ -285,6 +286,7 @@ pr: - sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup - sdk/datashare/Azure.ResourceManager.DataShare - sdk/defendereasm/Azure.ResourceManager.DefenderEasm + - sdk/dell/Azure.ResourceManager.Dell.Storage - sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization - sdk/devcenter/Azure.ResourceManager.DevCenter - sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 2ca0501b60bd..4e749e6b85b1 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -12,6 +12,8 @@ trigger: - sdk/storage/Azure.Storage.DataMovement/ - sdk/storage/Azure.Storage.DataMovement.Blobs/ - sdk/storage/Azure.Storage.DataMovement.Files/ + exclude: + - sdk/storage/Azure.ResourceManager.Storage/ - sdk/storage/Azure.Storage.DataMovement.Blobs.Files.Shares/ exclude: - sdk/storage/Azure.ResourceManager.Storage/