diff --git a/sdk/durabletask/ci.mgmt.yml b/sdk/durabletask/ci.mgmt.yml
index 5f63204cd804..32b11e75b082 100644
--- a/sdk/durabletask/ci.mgmt.yml
+++ b/sdk/durabletask/ci.mgmt.yml
@@ -1,7 +1,6 @@
# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
trigger: none
-
pr:
branches:
include:
diff --git a/sdk/fileshares/Azure.ResourceManager.Fileshares/Azure.ResourceManager.Fileshares.sln b/sdk/fileshares/Azure.ResourceManager.Fileshares/Azure.ResourceManager.Fileshares.sln
new file mode 100644
index 000000000000..8c11de1fe878
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/Azure.ResourceManager.Fileshares.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.Fileshares.Samples", "samples\Azure.ResourceManager.Fileshares.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.Fileshares", "src\Azure.ResourceManager.Fileshares.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.Fileshares.Tests", "tests\Azure.ResourceManager.Fileshares.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/fileshares/Azure.ResourceManager.Fileshares/CHANGELOG.md b/sdk/fileshares/Azure.ResourceManager.Fileshares/CHANGELOG.md
new file mode 100644
index 000000000000..8b33f0fedccc
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/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/fileshares/Azure.ResourceManager.Fileshares/Directory.Build.props b/sdk/fileshares/Azure.ResourceManager.Fileshares/Directory.Build.props
new file mode 100644
index 000000000000..63bd836ad44b
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/Directory.Build.props
@@ -0,0 +1,6 @@
+
+
+
+
diff --git a/sdk/fileshares/Azure.ResourceManager.Fileshares/README.md b/sdk/fileshares/Azure.ResourceManager.Fileshares/README.md
new file mode 100644
index 000000000000..172be5595afc
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/README.md
@@ -0,0 +1,80 @@
+# Microsoft Azure Fileshares 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 Fileshares management library for .NET with [NuGet](https://www.nuget.org/):
+
+```dotnetcli
+dotnet add package Azure.ResourceManager.Fileshares --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/fileshares/Azure.ResourceManager.Fileshares/assets.json b/sdk/fileshares/Azure.ResourceManager.Fileshares/assets.json
new file mode 100644
index 000000000000..2087ff434c9d
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/assets.json
@@ -0,0 +1,7 @@
+
+{
+ "AssetsRepo": "Azure/azure-sdk-assets",
+ "AssetsRepoPrefixPath": "net",
+ "TagPrefix": "net/fileshares/Azure.ResourceManager.Fileshares",
+ "Tag": ""
+}
diff --git a/sdk/fileshares/Azure.ResourceManager.Fileshares/samples/Azure.ResourceManager.Fileshares.Samples.csproj b/sdk/fileshares/Azure.ResourceManager.Fileshares/samples/Azure.ResourceManager.Fileshares.Samples.csproj
new file mode 100644
index 000000000000..3477e05494ef
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/samples/Azure.ResourceManager.Fileshares.Samples.csproj
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Azure.ResourceManager.Fileshares.csproj b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Azure.ResourceManager.Fileshares.csproj
new file mode 100644
index 000000000000..b089ae6c2c69
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Azure.ResourceManager.Fileshares.csproj
@@ -0,0 +1,8 @@
+
+
+ Azure Resource Manager client SDK for Azure resource provider Fileshares.
+ 1.0.0-beta.1
+ azure;management;arm;resource manager;fileshares
+ Azure.ResourceManager.Fileshares
+
+
diff --git a/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/ArmFilesharesModelFactory.cs b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/ArmFilesharesModelFactory.cs
new file mode 100644
index 000000000000..a985bbb0fe1c
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/ArmFilesharesModelFactory.cs
@@ -0,0 +1,201 @@
+// 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.Fileshares.Models
+{
+ /// Model factory for models.
+ public static partial class ArmFilesharesModelFactory
+ {
+ /// Initializes a new instance of .
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The tags.
+ /// The location.
+ /// The resource-specific properties for this resource.
+ /// A new instance for mocking.
+ public static FileShareData FileShareData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, FileShareProperties properties = null)
+ {
+ tags ??= new Dictionary();
+
+ return new FileShareData(
+ id,
+ name,
+ resourceType,
+ systemData,
+ tags,
+ location,
+ properties,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The name of the file share as seen by the end user when mounting the share, such as in a URI or UNC format in their operating system.
+ /// The host name of the file share.
+ /// The storage media tier of the file share.
+ /// The chosen redundancy level of the file share.
+ /// The file sharing protocol for this file share.
+ /// The provisioned storage size of the share in GiB (1 GiB is 1024^3 bytes or 1073741824 bytes). A component of the file share's bill is the provisioned storage, regardless of the amount of used storage.
+ /// A date/time value that specifies when the provisioned storage for the file share is permitted to be reduced.
+ /// The provisioned IO / sec of the share.
+ /// A date/time value that specifies when the provisioned IOPS for the file share is permitted to be reduced.
+ /// The provisioned throughput / sec of the share.
+ /// A date/time value that specifies when the provisioned throughput for the file share is permitted to be reduced.
+ /// Burst IOPS are extra buffer IOPS enabling you to consume more than your provisioned IOPS for a short period of time, depending on the burst credits available for your share.
+ /// Max burst IOPS credits shows the maximum number of burst credits the share can have at the current IOPS provisioning level.
+ /// Protocol settings specific NFS.
+ /// The set of properties for control public access.
+ /// The status of the last operation.
+ /// Gets or sets allow or disallow public network access to azure managed file share.
+ /// The list of associated private endpoint connections.
+ /// A new instance for mocking.
+ public static FileShareProperties FileShareProperties(string mountName = null, string hostName = null, MediaTier? mediaTier = null, Redundancy? redundancy = null, Protocol? protocol = null, int? provisionedStorageGiB = null, DateTimeOffset? provisionedStorageNextAllowedDowngrade = null, int? provisionedIOPerSec = null, DateTimeOffset? provisionedIOPerSecNextAllowedDowngrade = null, int? provisionedThroughputMiBPerSec = null, DateTimeOffset? provisionedThroughputNextAllowedDowngrade = null, int? includedBurstIOPerSec = null, long? maxBurstIOPerSecCredits = null, ShareRootSquash? nfsProtocolRootSquash = null, IEnumerable publicAccessAllowedSubnets = null, FileShareProvisioningState? provisioningState = null, PublicNetworkAccess? publicNetworkAccess = null, IEnumerable privateEndpointConnections = null)
+ {
+ publicAccessAllowedSubnets ??= new List();
+ privateEndpointConnections ??= new List();
+
+ return new FileShareProperties(
+ mountName,
+ hostName,
+ mediaTier,
+ redundancy,
+ protocol,
+ provisionedStorageGiB,
+ provisionedStorageNextAllowedDowngrade,
+ provisionedIOPerSec,
+ provisionedIOPerSecNextAllowedDowngrade,
+ provisionedThroughputMiBPerSec,
+ provisionedThroughputNextAllowedDowngrade,
+ includedBurstIOPerSec,
+ maxBurstIOPerSecCredits,
+ nfsProtocolRootSquash.HasValue ? new NfsProtocolProperties(nfsProtocolRootSquash.Value, serializedAdditionalRawData: null) : null,
+ publicAccessAllowedSubnets != null ? new PublicAccessProperties(publicAccessAllowedSubnets?.ToList(), serializedAdditionalRawData: null) : null,
+ provisioningState,
+ publicNetworkAccess,
+ privateEndpointConnections?.ToList(),
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The private endpoint connection properties.
+ /// A new instance for mocking.
+ public static FilesharesPrivateEndpointConnection FilesharesPrivateEndpointConnection(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, PrivateEndpointConnectionProperties properties = null)
+ {
+ return new FilesharesPrivateEndpointConnection(
+ id,
+ name,
+ resourceType,
+ systemData,
+ properties,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The group ids for the private endpoint resource.
+ /// The private endpoint resource.
+ /// A collection of information about the state of the connection between service consumer and provider.
+ /// The provisioning state of the private endpoint connection resource.
+ /// A new instance for mocking.
+ public static PrivateEndpointConnectionProperties PrivateEndpointConnectionProperties(IEnumerable groupIds = null, ResourceIdentifier privateEndpointId = null, FilesharesPrivateLinkServiceConnectionState privateLinkServiceConnectionState = null, FilesharesPrivateEndpointConnectionProvisioningState? provisioningState = null)
+ {
+ groupIds ??= new List();
+
+ return new PrivateEndpointConnectionProperties(groupIds?.ToList(), privateEndpointId != null ? ResourceManagerModelFactory.SubResource(privateEndpointId) : null, privateLinkServiceConnectionState, provisioningState, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.
+ /// The reason for approval/rejection of the connection.
+ /// A message indicating if changes on the service provider require any updates on the consumer.
+ /// A new instance for mocking.
+ public static FilesharesPrivateLinkServiceConnectionState FilesharesPrivateLinkServiceConnectionState(FilesharesPrivateEndpointServiceConnectionStatus? status = null, string description = null, string actionsRequired = null)
+ {
+ return new FilesharesPrivateLinkServiceConnectionState(status, description, actionsRequired, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Indicates if the resource name is available.
+ /// The reason why the given name is not available.
+ /// Detailed reason why the given name is not available.
+ /// A new instance for mocking.
+ public static CheckNameAvailabilityResponse CheckNameAvailabilityResponse(bool? nameAvailable = null, CheckNameAvailabilityReason? reason = null, string message = null)
+ {
+ return new CheckNameAvailabilityResponse(nameAvailable, reason, message, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The resource-specific properties for this resource.
+ /// A new instance for mocking.
+ public static FileShareSnapshotData FileShareSnapshotData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, FileShareSnapshotProperties properties = null)
+ {
+ return new FileShareSnapshotData(
+ id,
+ name,
+ resourceType,
+ systemData,
+ properties,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The FileShareSnapshot time in UTC in string representation.
+ /// The initiator of the FileShareSnapshot.
+ /// The metadata.
+ /// The status of the last operation.
+ /// A new instance for mocking.
+ public static FileShareSnapshotProperties FileShareSnapshotProperties(string snapshotTime = null, string initiatorId = null, IEnumerable metadata = null, FileShareProvisioningState? provisioningState = null)
+ {
+ metadata ??= new List();
+
+ return new FileShareSnapshotProperties(snapshotTime, initiatorId, metadata?.ToList(), provisioningState, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action".
+ /// Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure Resource Manager/control-plane operations.
+ /// Localized display information for this particular operation.
+ /// The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system".
+ /// Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ /// A new instance for mocking.
+ public static Operation Operation(string name = null, bool? isDataAction = null, OperationDisplay display = null, Origin? origin = null, ActionType? actionType = null)
+ {
+ return new Operation(
+ name,
+ isDataAction,
+ display,
+ origin,
+ actionType,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute".
+ /// The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections".
+ /// The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine".
+ /// The short, localized friendly description of the operation; suitable for tool tips and detailed views.
+ /// A new instance for mocking.
+ public static OperationDisplay OperationDisplay(string provider = null, string resource = null, string operation = null, string description = null)
+ {
+ return new OperationDisplay(provider, resource, operation, description, serializedAdditionalRawData: null);
+ }
+ }
+}
diff --git a/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/Extensions/FilesharesExtensions.cs b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/Extensions/FilesharesExtensions.cs
new file mode 100644
index 000000000000..d8a5726ab429
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/Extensions/FilesharesExtensions.cs
@@ -0,0 +1,374 @@
+// 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.Fileshares.Mocking;
+using Azure.ResourceManager.Fileshares.Models;
+using Azure.ResourceManager.Resources;
+
+namespace Azure.ResourceManager.Fileshares
+{
+ /// A class to add extension methods to Azure.ResourceManager.Fileshares.
+ public static partial class FilesharesExtensions
+ {
+ private static MockableFilesharesArmClient GetMockableFilesharesArmClient(ArmClient client)
+ {
+ return client.GetCachedClient(client0 => new MockableFilesharesArmClient(client0));
+ }
+
+ private static MockableFilesharesResourceGroupResource GetMockableFilesharesResourceGroupResource(ArmResource resource)
+ {
+ return resource.GetCachedClient(client => new MockableFilesharesResourceGroupResource(client, resource.Id));
+ }
+
+ private static MockableFilesharesSubscriptionResource GetMockableFilesharesSubscriptionResource(ArmResource resource)
+ {
+ return resource.GetCachedClient(client => new MockableFilesharesSubscriptionResource(client, resource.Id));
+ }
+
+ private static MockableFilesharesTenantResource GetMockableFilesharesTenantResource(ArmResource resource)
+ {
+ return resource.GetCachedClient(client => new MockableFilesharesTenantResource(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 FileShareResource GetFileShareResource(this ArmClient client, ResourceIdentifier id)
+ {
+ Argument.AssertNotNull(client, nameof(client));
+
+ return GetMockableFilesharesArmClient(client).GetFileShareResource(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 FileShareSnapshotResource GetFileShareSnapshotResource(this ArmClient client, ResourceIdentifier id)
+ {
+ Argument.AssertNotNull(client, nameof(client));
+
+ return GetMockableFilesharesArmClient(client).GetFileShareSnapshotResource(id);
+ }
+
+ ///
+ /// Gets a collection of FileShareResources 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 FileShareResources and their operations over a FileShareResource.
+ public static FileShareCollection GetFileShares(this ResourceGroupResource resourceGroupResource)
+ {
+ Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
+
+ return GetMockableFilesharesResourceGroupResource(resourceGroupResource).GetFileShares();
+ }
+
+ ///
+ /// Get a FileShare
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ /// -
+ /// Mocking
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The instance the method will execute against.
+ /// The resource name of the file share, as seen by the administrator through Azure Resource Manager.
+ /// The cancellation token to use.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ [ForwardsClientCalls]
+ public static async Task> GetFileShareAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
+
+ return await GetMockableFilesharesResourceGroupResource(resourceGroupResource).GetFileShareAsync(resourceName, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Get a FileShare
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ /// -
+ /// Mocking
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The instance the method will execute against.
+ /// The resource name of the file share, as seen by the administrator through Azure Resource Manager.
+ /// The cancellation token to use.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ [ForwardsClientCalls]
+ public static Response GetFileShare(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
+
+ return GetMockableFilesharesResourceGroupResource(resourceGroupResource).GetFileShare(resourceName, cancellationToken);
+ }
+
+ ///
+ /// List FileShare resources by subscription ID
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.FileShares/fileShares
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_ListBySubscription
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ /// -
+ /// Mocking
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The instance the method will execute against.
+ /// The cancellation token to use.
+ /// is null.
+ /// An async collection of that may take multiple service requests to iterate over.
+ public static AsyncPageable GetFileSharesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource));
+
+ return GetMockableFilesharesSubscriptionResource(subscriptionResource).GetFileSharesAsync(cancellationToken);
+ }
+
+ ///
+ /// List FileShare resources by subscription ID
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.FileShares/fileShares
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_ListBySubscription
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ /// -
+ /// Mocking
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The instance the method will execute against.
+ /// The cancellation token to use.
+ /// is null.
+ /// A collection of that may take multiple service requests to iterate over.
+ public static Pageable GetFileShares(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource));
+
+ return GetMockableFilesharesSubscriptionResource(subscriptionResource).GetFileShares(cancellationToken);
+ }
+
+ ///
+ /// Implements local CheckNameAvailability operations
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.FileShares/locations/{location}/checkNameAvailability
+ ///
+ /// -
+ /// Operation Id
+ /// FileShares_CheckNameAvailability
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ ///
+ /// -
+ /// Mocking
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The instance the method will execute against.
+ /// The name of the Azure region.
+ /// The CheckAvailability request.
+ /// The cancellation token to use.
+ /// or is null.
+ public static async Task> CheckNameAvailabilityFileShareAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CheckNameAvailabilityContent content, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource));
+
+ return await GetMockableFilesharesSubscriptionResource(subscriptionResource).CheckNameAvailabilityFileShareAsync(location, content, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Implements local CheckNameAvailability operations
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.FileShares/locations/{location}/checkNameAvailability
+ ///
+ /// -
+ /// Operation Id
+ /// FileShares_CheckNameAvailability
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ ///
+ /// -
+ /// Mocking
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The instance the method will execute against.
+ /// The name of the Azure region.
+ /// The CheckAvailability request.
+ /// The cancellation token to use.
+ /// or is null.
+ public static Response CheckNameAvailabilityFileShare(this SubscriptionResource subscriptionResource, AzureLocation location, CheckNameAvailabilityContent content, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource));
+
+ return GetMockableFilesharesSubscriptionResource(subscriptionResource).CheckNameAvailabilityFileShare(location, content, cancellationToken);
+ }
+
+ ///
+ /// List the operations for the provider
+ ///
+ /// -
+ /// Request Path
+ /// /providers/Microsoft.FileShares/operations
+ ///
+ /// -
+ /// Operation Id
+ /// Operations_List
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ ///
+ /// -
+ /// 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 GetOperationsAsync(this TenantResource tenantResource, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(tenantResource, nameof(tenantResource));
+
+ return GetMockableFilesharesTenantResource(tenantResource).GetOperationsAsync(cancellationToken);
+ }
+
+ ///
+ /// List the operations for the provider
+ ///
+ /// -
+ /// Request Path
+ /// /providers/Microsoft.FileShares/operations
+ ///
+ /// -
+ /// Operation Id
+ /// Operations_List
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ ///
+ /// -
+ /// 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 GetOperations(this TenantResource tenantResource, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(tenantResource, nameof(tenantResource));
+
+ return GetMockableFilesharesTenantResource(tenantResource).GetOperations(cancellationToken);
+ }
+ }
+}
diff --git a/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/Extensions/MockableFilesharesArmClient.cs b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/Extensions/MockableFilesharesArmClient.cs
new file mode 100644
index 000000000000..4993e1e720b2
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/Extensions/MockableFilesharesArmClient.cs
@@ -0,0 +1,61 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using Azure.Core;
+
+namespace Azure.ResourceManager.Fileshares.Mocking
+{
+ /// A class to add extension methods to ArmClient.
+ public partial class MockableFilesharesArmClient : ArmResource
+ {
+ /// Initializes a new instance of the class for mocking.
+ protected MockableFilesharesArmClient()
+ {
+ }
+
+ /// 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 MockableFilesharesArmClient(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ }
+
+ internal MockableFilesharesArmClient(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 FileShareResource GetFileShareResource(ResourceIdentifier id)
+ {
+ FileShareResource.ValidateResourceId(id);
+ return new FileShareResource(Client, id);
+ }
+
+ ///
+ /// Gets an object representing a along with the instance operations that can be performed on it but with no data.
+ /// You can use to create a from its components.
+ ///
+ /// The resource ID of the resource to get.
+ /// Returns a object.
+ public virtual FileShareSnapshotResource GetFileShareSnapshotResource(ResourceIdentifier id)
+ {
+ FileShareSnapshotResource.ValidateResourceId(id);
+ return new FileShareSnapshotResource(Client, id);
+ }
+ }
+}
diff --git a/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/Extensions/MockableFilesharesResourceGroupResource.cs b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/Extensions/MockableFilesharesResourceGroupResource.cs
new file mode 100644
index 000000000000..c226543d2a9f
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/Extensions/MockableFilesharesResourceGroupResource.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.Fileshares.Mocking
+{
+ /// A class to add extension methods to ResourceGroupResource.
+ public partial class MockableFilesharesResourceGroupResource : ArmResource
+ {
+ /// Initializes a new instance of the class for mocking.
+ protected MockableFilesharesResourceGroupResource()
+ {
+ }
+
+ /// 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 MockableFilesharesResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ }
+
+ private string GetApiVersionOrNull(ResourceType resourceType)
+ {
+ TryGetApiVersion(resourceType, out string apiVersion);
+ return apiVersion;
+ }
+
+ /// Gets a collection of FileShareResources in the ResourceGroupResource.
+ /// An object representing collection of FileShareResources and their operations over a FileShareResource.
+ public virtual FileShareCollection GetFileShares()
+ {
+ return GetCachedClient(client => new FileShareCollection(client, Id));
+ }
+
+ ///
+ /// Get a FileShare
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The resource name of the file share, as seen by the administrator through Azure Resource Manager.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ [ForwardsClientCalls]
+ public virtual async Task> GetFileShareAsync(string resourceName, CancellationToken cancellationToken = default)
+ {
+ return await GetFileShares().GetAsync(resourceName, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Get a FileShare
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The resource name of the file share, as seen by the administrator through Azure Resource Manager.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ [ForwardsClientCalls]
+ public virtual Response GetFileShare(string resourceName, CancellationToken cancellationToken = default)
+ {
+ return GetFileShares().Get(resourceName, cancellationToken);
+ }
+ }
+}
diff --git a/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/Extensions/MockableFilesharesSubscriptionResource.cs b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/Extensions/MockableFilesharesSubscriptionResource.cs
new file mode 100644
index 000000000000..4bcf0c3b1a58
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/Extensions/MockableFilesharesSubscriptionResource.cs
@@ -0,0 +1,187 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Autorest.CSharp.Core;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.Fileshares.Models;
+
+namespace Azure.ResourceManager.Fileshares.Mocking
+{
+ /// A class to add extension methods to SubscriptionResource.
+ public partial class MockableFilesharesSubscriptionResource : ArmResource
+ {
+ private ClientDiagnostics _fileShareClientDiagnostics;
+ private FileSharesRestOperations _fileShareRestClient;
+ private ClientDiagnostics _fileSharesClientDiagnostics;
+ private FileSharesRestOperations _fileSharesRestClient;
+
+ /// Initializes a new instance of the class for mocking.
+ protected MockableFilesharesSubscriptionResource()
+ {
+ }
+
+ /// 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 MockableFilesharesSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ }
+
+ private ClientDiagnostics FileShareClientDiagnostics => _fileShareClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Fileshares", FileShareResource.ResourceType.Namespace, Diagnostics);
+ private FileSharesRestOperations FileShareRestClient => _fileShareRestClient ??= new FileSharesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(FileShareResource.ResourceType));
+ private ClientDiagnostics FileSharesClientDiagnostics => _fileSharesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Fileshares", ProviderConstants.DefaultProviderNamespace, Diagnostics);
+ private FileSharesRestOperations FileSharesRestClient => _fileSharesRestClient ??= new FileSharesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint);
+
+ private string GetApiVersionOrNull(ResourceType resourceType)
+ {
+ TryGetApiVersion(resourceType, out string apiVersion);
+ return apiVersion;
+ }
+
+ ///
+ /// List FileShare resources by subscription ID
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.FileShares/fileShares
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_ListBySubscription
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetFileSharesAsync(CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => FileShareRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FileShareRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId);
+ return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FileShareResource(Client, FileShareData.DeserializeFileShareData(e)), FileShareClientDiagnostics, Pipeline, "MockableFilesharesSubscriptionResource.GetFileShares", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// List FileShare resources by subscription ID
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.FileShares/fileShares
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_ListBySubscription
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetFileShares(CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => FileShareRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FileShareRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId);
+ return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FileShareResource(Client, FileShareData.DeserializeFileShareData(e)), FileShareClientDiagnostics, Pipeline, "MockableFilesharesSubscriptionResource.GetFileShares", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// Implements local CheckNameAvailability operations
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.FileShares/locations/{location}/checkNameAvailability
+ ///
+ /// -
+ /// Operation Id
+ /// FileShares_CheckNameAvailability
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ ///
+ ///
+ /// The name of the Azure region.
+ /// The CheckAvailability request.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task> CheckNameAvailabilityFileShareAsync(AzureLocation location, CheckNameAvailabilityContent content, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = FileSharesClientDiagnostics.CreateScope("MockableFilesharesSubscriptionResource.CheckNameAvailabilityFileShare");
+ scope.Start();
+ try
+ {
+ var response = await FileSharesRestClient.CheckNameAvailabilityAsync(Id.SubscriptionId, location, content, cancellationToken).ConfigureAwait(false);
+ return response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Implements local CheckNameAvailability operations
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.FileShares/locations/{location}/checkNameAvailability
+ ///
+ /// -
+ /// Operation Id
+ /// FileShares_CheckNameAvailability
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ ///
+ ///
+ /// The name of the Azure region.
+ /// The CheckAvailability request.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual Response CheckNameAvailabilityFileShare(AzureLocation location, CheckNameAvailabilityContent content, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = FileSharesClientDiagnostics.CreateScope("MockableFilesharesSubscriptionResource.CheckNameAvailabilityFileShare");
+ scope.Start();
+ try
+ {
+ var response = FileSharesRestClient.CheckNameAvailability(Id.SubscriptionId, location, content, cancellationToken);
+ return response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/Extensions/MockableFilesharesTenantResource.cs b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/Extensions/MockableFilesharesTenantResource.cs
new file mode 100644
index 000000000000..f9d63a4324d0
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/Extensions/MockableFilesharesTenantResource.cs
@@ -0,0 +1,95 @@
+// 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;
+using Azure.ResourceManager.Fileshares.Models;
+
+namespace Azure.ResourceManager.Fileshares.Mocking
+{
+ /// A class to add extension methods to TenantResource.
+ public partial class MockableFilesharesTenantResource : ArmResource
+ {
+ private ClientDiagnostics _operationsClientDiagnostics;
+ private OperationsRestOperations _operationsRestClient;
+
+ /// Initializes a new instance of the class for mocking.
+ protected MockableFilesharesTenantResource()
+ {
+ }
+
+ /// 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 MockableFilesharesTenantResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ }
+
+ private ClientDiagnostics OperationsClientDiagnostics => _operationsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Fileshares", ProviderConstants.DefaultProviderNamespace, Diagnostics);
+ private OperationsRestOperations OperationsRestClient => _operationsRestClient ??= new OperationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint);
+
+ private string GetApiVersionOrNull(ResourceType resourceType)
+ {
+ TryGetApiVersion(resourceType, out string apiVersion);
+ return apiVersion;
+ }
+
+ ///
+ /// List the operations for the provider
+ ///
+ /// -
+ /// Request Path
+ /// /providers/Microsoft.FileShares/operations
+ ///
+ /// -
+ /// Operation Id
+ /// Operations_List
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetOperationsAsync(CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => OperationsRestClient.CreateListRequest();
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OperationsRestClient.CreateListNextPageRequest(nextLink);
+ return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => Models.Operation.DeserializeOperation(e), OperationsClientDiagnostics, Pipeline, "MockableFilesharesTenantResource.GetOperations", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// List the operations for the provider
+ ///
+ /// -
+ /// Request Path
+ /// /providers/Microsoft.FileShares/operations
+ ///
+ /// -
+ /// Operation Id
+ /// Operations_List
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetOperations(CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => OperationsRestClient.CreateListRequest();
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OperationsRestClient.CreateListNextPageRequest(nextLink);
+ return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => Models.Operation.DeserializeOperation(e), OperationsClientDiagnostics, Pipeline, "MockableFilesharesTenantResource.GetOperations", "value", "nextLink", cancellationToken);
+ }
+ }
+}
diff --git a/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareCollection.cs b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareCollection.cs
new file mode 100644
index 000000000000..1945b527268b
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareCollection.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.Fileshares
+{
+ ///
+ /// 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 GetFileShares method from an instance of .
+ ///
+ public partial class FileShareCollection : ArmCollection, IEnumerable, IAsyncEnumerable
+ {
+ private readonly ClientDiagnostics _fileShareClientDiagnostics;
+ private readonly FileSharesRestOperations _fileShareRestClient;
+
+ /// Initializes a new instance of the class for mocking.
+ protected FileShareCollection()
+ {
+ }
+
+ /// 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 FileShareCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _fileShareClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Fileshares", FileShareResource.ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(FileShareResource.ResourceType, out string fileShareApiVersion);
+ _fileShareRestClient = new FileSharesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fileShareApiVersion);
+#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 or update a file share.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The resource name of the file share, as seen by the administrator through Azure Resource Manager.
+ /// 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 resourceName, FileShareData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _fileShareClientDiagnostics.CreateScope("FileShareCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = await _fileShareRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, cancellationToken).ConfigureAwait(false);
+ var operation = new FilesharesArmOperation(new FileShareOperationSource(Client), _fileShareClientDiagnostics, Pipeline, _fileShareRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, 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 or update a file share.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The resource name of the file share, as seen by the administrator through Azure Resource Manager.
+ /// 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 resourceName, FileShareData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _fileShareClientDiagnostics.CreateScope("FileShareCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = _fileShareRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, cancellationToken);
+ var operation = new FilesharesArmOperation(new FileShareOperationSource(Client), _fileShareClientDiagnostics, Pipeline, _fileShareRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a FileShare
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The resource name of the file share, as seen by the administrator through Azure Resource Manager.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetAsync(string resourceName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName));
+
+ using var scope = _fileShareClientDiagnostics.CreateScope("FileShareCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = await _fileShareRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new FileShareResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a FileShare
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The resource name of the file share, as seen by the administrator through Azure Resource Manager.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Get(string resourceName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName));
+
+ using var scope = _fileShareClientDiagnostics.CreateScope("FileShareCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = _fileShareRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new FileShareResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// List FileShare resources by resource group
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_ListByParent
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => _fileShareRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fileShareRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName);
+ return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FileShareResource(Client, FileShareData.DeserializeFileShareData(e)), _fileShareClientDiagnostics, Pipeline, "FileShareCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// List FileShare resources by resource group
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_ListByParent
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetAll(CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => _fileShareRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fileShareRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName);
+ return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FileShareResource(Client, FileShareData.DeserializeFileShareData(e)), _fileShareClientDiagnostics, Pipeline, "FileShareCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// Checks to see if the resource exists in azure.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The resource name of the file share, as seen by the administrator through Azure Resource Manager.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> ExistsAsync(string resourceName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName));
+
+ using var scope = _fileShareClientDiagnostics.CreateScope("FileShareCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = await _fileShareRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Response.FromValue(response.Value != null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Checks to see if the resource exists in azure.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The resource name of the file share, as seen by the administrator through Azure Resource Manager.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Exists(string resourceName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName));
+
+ using var scope = _fileShareClientDiagnostics.CreateScope("FileShareCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = _fileShareRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken: cancellationToken);
+ return Response.FromValue(response.Value != null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Tries to get details for this resource from the service.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The resource name of the file share, as seen by the administrator through Azure Resource Manager.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetIfExistsAsync(string resourceName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName));
+
+ using var scope = _fileShareClientDiagnostics.CreateScope("FileShareCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = await _fileShareRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken: cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ return new NoValueResponse(response.GetRawResponse());
+ return Response.FromValue(new FileShareResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Tries to get details for this resource from the service.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The resource name of the file share, as seen by the administrator through Azure Resource Manager.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual NullableResponse GetIfExists(string resourceName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName));
+
+ using var scope = _fileShareClientDiagnostics.CreateScope("FileShareCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = _fileShareRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken: cancellationToken);
+ if (response.Value == null)
+ return new NoValueResponse(response.GetRawResponse());
+ return Response.FromValue(new FileShareResource(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/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareData.Serialization.cs b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareData.Serialization.cs
new file mode 100644
index 000000000000..9856a91127e9
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareData.Serialization.cs
@@ -0,0 +1,178 @@
+// 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.Fileshares.Models;
+using Azure.ResourceManager.Models;
+
+namespace Azure.ResourceManager.Fileshares
+{
+ public partial class FileShareData : 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(FileShareData)} does not support writing '{format}' format.");
+ }
+
+ base.JsonModelWriteCore(writer, options);
+ if (Optional.IsDefined(Properties))
+ {
+ writer.WritePropertyName("properties"u8);
+ writer.WriteObjectValue(Properties, options);
+ }
+ }
+
+ FileShareData 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(FileShareData)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeFileShareData(document.RootElement, options);
+ }
+
+ internal static FileShareData DeserializeFileShareData(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ FileShareProperties properties = 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 = FileShareProperties.DeserializeFileShareProperties(property.Value, options);
+ continue;
+ }
+ if (property.NameEquals("tags"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ Dictionary dictionary = new Dictionary();
+ foreach (var property0 in property.Value.EnumerateObject())
+ {
+ dictionary.Add(property0.Name, property0.Value.GetString());
+ }
+ tags = dictionary;
+ continue;
+ }
+ if (property.NameEquals("location"u8))
+ {
+ location = new AzureLocation(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("id"u8))
+ {
+ id = new ResourceIdentifier(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("name"u8))
+ {
+ name = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("type"u8))
+ {
+ type = new ResourceType(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("systemData"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ systemData = JsonSerializer.Deserialize(property.Value.GetRawText());
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new FileShareData(
+ id,
+ name,
+ type,
+ systemData,
+ tags ?? new ChangeTrackingDictionary(),
+ location,
+ properties,
+ serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(FileShareData)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ FileShareData 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 DeserializeFileShareData(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(FileShareData)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+ }
+}
diff --git a/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareData.cs b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareData.cs
new file mode 100644
index 000000000000..abc4427d573f
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareData.cs
@@ -0,0 +1,83 @@
+// 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.Fileshares.Models;
+using Azure.ResourceManager.Models;
+
+namespace Azure.ResourceManager.Fileshares
+{
+ ///
+ /// A class representing the FileShare data model.
+ /// File share resource
+ ///
+ public partial class FileShareData : 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 FileShareData(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.
+ /// Keeps track of any properties unknown to the library.
+ internal FileShareData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, FileShareProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location)
+ {
+ Properties = properties;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal FileShareData()
+ {
+ }
+
+ /// The resource-specific properties for this resource.
+ public FileShareProperties Properties { get; set; }
+ }
+}
diff --git a/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareResource.Serialization.cs b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareResource.Serialization.cs
new file mode 100644
index 000000000000..de7778146742
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareResource.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.Fileshares
+{
+ public partial class FileShareResource : IJsonModel
+ {
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options);
+
+ FileShareData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options);
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options);
+
+ FileShareData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options);
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options);
+ }
+}
diff --git a/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareResource.cs b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareResource.cs
new file mode 100644
index 000000000000..edce7bf4aabc
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareResource.cs
@@ -0,0 +1,776 @@
+// 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.Fileshares.Models;
+using Azure.ResourceManager.Resources;
+
+namespace Azure.ResourceManager.Fileshares
+{
+ ///
+ /// A Class representing a FileShare 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 GetFileShareResource method.
+ /// Otherwise you can get one from its parent resource using the GetFileShare method.
+ ///
+ public partial class FileShareResource : ArmResource
+ {
+ /// Generate the resource identifier of a instance.
+ /// The subscriptionId.
+ /// The resourceGroupName.
+ /// The resourceName.
+ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName)
+ {
+ var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}";
+ return new ResourceIdentifier(resourceId);
+ }
+
+ private readonly ClientDiagnostics _fileShareClientDiagnostics;
+ private readonly FileSharesRestOperations _fileShareRestClient;
+ private readonly FileShareData _data;
+
+ /// Gets the resource type for the operations.
+ public static readonly ResourceType ResourceType = "Microsoft.FileShares/fileShares";
+
+ /// Initializes a new instance of the class for mocking.
+ protected FileShareResource()
+ {
+ }
+
+ /// Initializes a new instance of the class.
+ /// The client parameters to use in these operations.
+ /// The resource that is the target of operations.
+ internal FileShareResource(ArmClient client, FileShareData 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 FileShareResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _fileShareClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Fileshares", ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(ResourceType, out string fileShareApiVersion);
+ _fileShareRestClient = new FileSharesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fileShareApiVersion);
+#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 FileShareData Data
+ {
+ get
+ {
+ if (!HasData)
+ throw new InvalidOperationException("The current instance does not have data, you must call Get first.");
+ return _data;
+ }
+ }
+
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != ResourceType)
+ throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id));
+ }
+
+ /// Gets a collection of FileShareSnapshotResources in the FileShare.
+ /// An object representing collection of FileShareSnapshotResources and their operations over a FileShareSnapshotResource.
+ public virtual FileShareSnapshotCollection GetFileShareSnapshots()
+ {
+ return GetCachedClient(client => new FileShareSnapshotCollection(client, Id));
+ }
+
+ ///
+ /// Get a FileShareSnapshot
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots/{name}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShareSnapshot_GetFileShareSnapshot
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The name of the FileShareSnapshot.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ [ForwardsClientCalls]
+ public virtual async Task> GetFileShareSnapshotAsync(string name, CancellationToken cancellationToken = default)
+ {
+ return await GetFileShareSnapshots().GetAsync(name, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Get a FileShareSnapshot
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots/{name}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShareSnapshot_GetFileShareSnapshot
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The name of the FileShareSnapshot.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ [ForwardsClientCalls]
+ public virtual Response GetFileShareSnapshot(string name, CancellationToken cancellationToken = default)
+ {
+ return GetFileShareSnapshots().Get(name, cancellationToken);
+ }
+
+ ///
+ /// Get a FileShare
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
+ {
+ using var scope = _fileShareClientDiagnostics.CreateScope("FileShareResource.Get");
+ scope.Start();
+ try
+ {
+ var response = await _fileShareRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new FileShareResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a FileShare
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual Response Get(CancellationToken cancellationToken = default)
+ {
+ using var scope = _fileShareClientDiagnostics.CreateScope("FileShareResource.Get");
+ scope.Start();
+ try
+ {
+ var response = _fileShareRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new FileShareResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a FileShare
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_Delete
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The cancellation token to use.
+ public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default)
+ {
+ using var scope = _fileShareClientDiagnostics.CreateScope("FileShareResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = await _fileShareRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false);
+ var operation = new FilesharesArmOperation(_fileShareClientDiagnostics, Pipeline, _fileShareRestClient.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 FileShare
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_Delete
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The cancellation token to use.
+ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default)
+ {
+ using var scope = _fileShareClientDiagnostics.CreateScope("FileShareResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = _fileShareRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
+ var operation = new FilesharesArmOperation(_fileShareClientDiagnostics, Pipeline, _fileShareRestClient.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 FileShare
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_Update
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The resource properties to be updated.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task> UpdateAsync(WaitUntil waitUntil, FileSharePatch patch, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(patch, nameof(patch));
+
+ using var scope = _fileShareClientDiagnostics.CreateScope("FileShareResource.Update");
+ scope.Start();
+ try
+ {
+ var response = await _fileShareRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false);
+ var operation = new FilesharesArmOperation(new FileShareOperationSource(Client), _fileShareClientDiagnostics, Pipeline, _fileShareRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Update a FileShare
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_Update
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The resource properties to be updated.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual ArmOperation Update(WaitUntil waitUntil, FileSharePatch patch, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(patch, nameof(patch));
+
+ using var scope = _fileShareClientDiagnostics.CreateScope("FileShareResource.Update");
+ scope.Start();
+ try
+ {
+ var response = _fileShareRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken);
+ var operation = new FilesharesArmOperation(new FileShareOperationSource(Client), _fileShareClientDiagnostics, Pipeline, _fileShareRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Add a tag to the current resource.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The key for the tag.
+ /// The value for the tag.
+ /// The cancellation token to use.
+ /// or is null.
+ public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(key, nameof(key));
+ Argument.AssertNotNull(value, nameof(value));
+
+ using var scope = _fileShareClientDiagnostics.CreateScope("FileShareResource.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 _fileShareRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false);
+ return Response.FromValue(new FileShareResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
+ }
+ else
+ {
+ var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data;
+ var patch = new FileSharePatch();
+ foreach (var tag in current.Tags)
+ {
+ patch.Tags.Add(tag);
+ }
+ patch.Tags[key] = value;
+ var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Response.FromValue(result.Value, result.GetRawResponse());
+ }
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Add a tag to the current resource.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The key for the tag.
+ /// The value for the tag.
+ /// The cancellation token to use.
+ /// or is null.
+ public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(key, nameof(key));
+ Argument.AssertNotNull(value, nameof(value));
+
+ using var scope = _fileShareClientDiagnostics.CreateScope("FileShareResource.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 = _fileShareRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
+ return Response.FromValue(new FileShareResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
+ }
+ else
+ {
+ var current = Get(cancellationToken: cancellationToken).Value.Data;
+ var patch = new FileSharePatch();
+ foreach (var tag in current.Tags)
+ {
+ patch.Tags.Add(tag);
+ }
+ patch.Tags[key] = value;
+ var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken);
+ return Response.FromValue(result.Value, result.GetRawResponse());
+ }
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Replace the tags on the resource with the given set.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The set of tags to use as replacement.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(tags, nameof(tags));
+
+ using var scope = _fileShareClientDiagnostics.CreateScope("FileShareResource.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 _fileShareRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false);
+ return Response.FromValue(new FileShareResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
+ }
+ else
+ {
+ var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data;
+ var patch = new FileSharePatch();
+ patch.Tags.ReplaceWith(tags);
+ var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Response.FromValue(result.Value, result.GetRawResponse());
+ }
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Replace the tags on the resource with the given set.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The set of tags to use as replacement.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(tags, nameof(tags));
+
+ using var scope = _fileShareClientDiagnostics.CreateScope("FileShareResource.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 = _fileShareRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
+ return Response.FromValue(new FileShareResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
+ }
+ else
+ {
+ var current = Get(cancellationToken: cancellationToken).Value.Data;
+ var patch = new FileSharePatch();
+ patch.Tags.ReplaceWith(tags);
+ var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken);
+ return Response.FromValue(result.Value, result.GetRawResponse());
+ }
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Removes a tag by key from the resource.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The key for the tag.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(key, nameof(key));
+
+ using var scope = _fileShareClientDiagnostics.CreateScope("FileShareResource.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 _fileShareRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false);
+ return Response.FromValue(new FileShareResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
+ }
+ else
+ {
+ var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data;
+ var patch = new FileSharePatch();
+ foreach (var tag in current.Tags)
+ {
+ patch.Tags.Add(tag);
+ }
+ patch.Tags.Remove(key);
+ var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Response.FromValue(result.Value, result.GetRawResponse());
+ }
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Removes a tag by key from the resource.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShare_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The key for the tag.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(key, nameof(key));
+
+ using var scope = _fileShareClientDiagnostics.CreateScope("FileShareResource.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 = _fileShareRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
+ return Response.FromValue(new FileShareResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
+ }
+ else
+ {
+ var current = Get(cancellationToken: cancellationToken).Value.Data;
+ var patch = new FileSharePatch();
+ foreach (var tag in current.Tags)
+ {
+ patch.Tags.Add(tag);
+ }
+ patch.Tags.Remove(key);
+ var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken);
+ return Response.FromValue(result.Value, result.GetRawResponse());
+ }
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareSnapshotCollection.cs b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareSnapshotCollection.cs
new file mode 100644
index 000000000000..6661de1cbc3e
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareSnapshotCollection.cs
@@ -0,0 +1,497 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Threading;
+using System.Threading.Tasks;
+using Autorest.CSharp.Core;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.Fileshares
+{
+ ///
+ /// 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 GetFileShareSnapshots method from an instance of .
+ ///
+ public partial class FileShareSnapshotCollection : ArmCollection, IEnumerable, IAsyncEnumerable
+ {
+ private readonly ClientDiagnostics _fileShareSnapshotFileSharesClientDiagnostics;
+ private readonly FileSharesRestOperations _fileShareSnapshotFileSharesRestClient;
+
+ /// Initializes a new instance of the class for mocking.
+ protected FileShareSnapshotCollection()
+ {
+ }
+
+ /// 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 FileShareSnapshotCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _fileShareSnapshotFileSharesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Fileshares", FileShareSnapshotResource.ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(FileShareSnapshotResource.ResourceType, out string fileShareSnapshotFileSharesApiVersion);
+ _fileShareSnapshotFileSharesRestClient = new FileSharesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fileShareSnapshotFileSharesApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != FileShareResource.ResourceType)
+ throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FileShareResource.ResourceType), nameof(id));
+ }
+
+ ///
+ /// Create a FileShareSnapshot.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots/{name}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShareSnapshot_CreateOrUpdateFileShareSnapshot
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The name of the FileShareSnapshot.
+ /// 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 name, FileShareSnapshotData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _fileShareSnapshotFileSharesClientDiagnostics.CreateScope("FileShareSnapshotCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = await _fileShareSnapshotFileSharesRestClient.CreateOrUpdateFileShareSnapshotAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data, cancellationToken).ConfigureAwait(false);
+ var uri = _fileShareSnapshotFileSharesRestClient.CreateCreateOrUpdateFileShareSnapshotRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data);
+ var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ var operation = new FilesharesArmOperation(Response.FromValue(new FileShareSnapshotResource(Client, response), response.GetRawResponse()), rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a FileShareSnapshot.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots/{name}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShareSnapshot_CreateOrUpdateFileShareSnapshot
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The name of the FileShareSnapshot.
+ /// 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 name, FileShareSnapshotData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _fileShareSnapshotFileSharesClientDiagnostics.CreateScope("FileShareSnapshotCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = _fileShareSnapshotFileSharesRestClient.CreateOrUpdateFileShareSnapshot(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data, cancellationToken);
+ var uri = _fileShareSnapshotFileSharesRestClient.CreateCreateOrUpdateFileShareSnapshotRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data);
+ var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ var operation = new FilesharesArmOperation(Response.FromValue(new FileShareSnapshotResource(Client, response), response.GetRawResponse()), rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a FileShareSnapshot
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots/{name}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShareSnapshot_GetFileShareSnapshot
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The name of the FileShareSnapshot.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetAsync(string name, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+
+ using var scope = _fileShareSnapshotFileSharesClientDiagnostics.CreateScope("FileShareSnapshotCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = await _fileShareSnapshotFileSharesRestClient.GetFileShareSnapshotAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new FileShareSnapshotResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a FileShareSnapshot
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots/{name}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShareSnapshot_GetFileShareSnapshot
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The name of the FileShareSnapshot.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Get(string name, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+
+ using var scope = _fileShareSnapshotFileSharesClientDiagnostics.CreateScope("FileShareSnapshotCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = _fileShareSnapshotFileSharesRestClient.GetFileShareSnapshot(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new FileShareSnapshotResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// List FileShareSnapshot by FileShare.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots
+ ///
+ /// -
+ /// Operation Id
+ /// FileShareSnapshot_ListByFileShare
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => _fileShareSnapshotFileSharesRestClient.CreateListByFileShareRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fileShareSnapshotFileSharesRestClient.CreateListByFileShareNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
+ return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FileShareSnapshotResource(Client, FileShareSnapshotData.DeserializeFileShareSnapshotData(e)), _fileShareSnapshotFileSharesClientDiagnostics, Pipeline, "FileShareSnapshotCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// List FileShareSnapshot by FileShare.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots
+ ///
+ /// -
+ /// Operation Id
+ /// FileShareSnapshot_ListByFileShare
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetAll(CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => _fileShareSnapshotFileSharesRestClient.CreateListByFileShareRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fileShareSnapshotFileSharesRestClient.CreateListByFileShareNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
+ return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FileShareSnapshotResource(Client, FileShareSnapshotData.DeserializeFileShareSnapshotData(e)), _fileShareSnapshotFileSharesClientDiagnostics, Pipeline, "FileShareSnapshotCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// Checks to see if the resource exists in azure.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots/{name}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShareSnapshot_GetFileShareSnapshot
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The name of the FileShareSnapshot.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> ExistsAsync(string name, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+
+ using var scope = _fileShareSnapshotFileSharesClientDiagnostics.CreateScope("FileShareSnapshotCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = await _fileShareSnapshotFileSharesRestClient.GetFileShareSnapshotAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Response.FromValue(response.Value != null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Checks to see if the resource exists in azure.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots/{name}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShareSnapshot_GetFileShareSnapshot
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The name of the FileShareSnapshot.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Exists(string name, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+
+ using var scope = _fileShareSnapshotFileSharesClientDiagnostics.CreateScope("FileShareSnapshotCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = _fileShareSnapshotFileSharesRestClient.GetFileShareSnapshot(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken);
+ return Response.FromValue(response.Value != null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Tries to get details for this resource from the service.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots/{name}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShareSnapshot_GetFileShareSnapshot
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The name of the FileShareSnapshot.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetIfExistsAsync(string name, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+
+ using var scope = _fileShareSnapshotFileSharesClientDiagnostics.CreateScope("FileShareSnapshotCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = await _fileShareSnapshotFileSharesRestClient.GetFileShareSnapshotAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ return new NoValueResponse(response.GetRawResponse());
+ return Response.FromValue(new FileShareSnapshotResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Tries to get details for this resource from the service.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots/{name}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShareSnapshot_GetFileShareSnapshot
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The name of the FileShareSnapshot.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual NullableResponse GetIfExists(string name, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+
+ using var scope = _fileShareSnapshotFileSharesClientDiagnostics.CreateScope("FileShareSnapshotCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = _fileShareSnapshotFileSharesRestClient.GetFileShareSnapshot(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken);
+ if (response.Value == null)
+ return new NoValueResponse(response.GetRawResponse());
+ return Response.FromValue(new FileShareSnapshotResource(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/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareSnapshotData.Serialization.cs b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareSnapshotData.Serialization.cs
new file mode 100644
index 000000000000..6062c978d2a2
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareSnapshotData.Serialization.cs
@@ -0,0 +1,155 @@
+// 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.Fileshares.Models;
+using Azure.ResourceManager.Models;
+
+namespace Azure.ResourceManager.Fileshares
+{
+ public partial class FileShareSnapshotData : 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(FileShareSnapshotData)} does not support writing '{format}' format.");
+ }
+
+ base.JsonModelWriteCore(writer, options);
+ if (Optional.IsDefined(Properties))
+ {
+ writer.WritePropertyName("properties"u8);
+ writer.WriteObjectValue(Properties, options);
+ }
+ }
+
+ FileShareSnapshotData 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(FileShareSnapshotData)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeFileShareSnapshotData(document.RootElement, options);
+ }
+
+ internal static FileShareSnapshotData DeserializeFileShareSnapshotData(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ FileShareSnapshotProperties properties = default;
+ ResourceIdentifier id = default;
+ string name = default;
+ ResourceType type = default;
+ SystemData systemData = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("properties"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ properties = FileShareSnapshotProperties.DeserializeFileShareSnapshotProperties(property.Value, options);
+ continue;
+ }
+ if (property.NameEquals("id"u8))
+ {
+ id = new ResourceIdentifier(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("name"u8))
+ {
+ name = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("type"u8))
+ {
+ type = new ResourceType(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("systemData"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ systemData = JsonSerializer.Deserialize(property.Value.GetRawText());
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new FileShareSnapshotData(
+ id,
+ name,
+ type,
+ systemData,
+ properties,
+ serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(FileShareSnapshotData)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ FileShareSnapshotData 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 DeserializeFileShareSnapshotData(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(FileShareSnapshotData)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+ }
+}
diff --git a/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareSnapshotData.cs b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareSnapshotData.cs
new file mode 100644
index 000000000000..21129f8560df
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareSnapshotData.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;
+using Azure.Core;
+using Azure.ResourceManager.Fileshares.Models;
+using Azure.ResourceManager.Models;
+
+namespace Azure.ResourceManager.Fileshares
+{
+ ///
+ /// A class representing the FileShareSnapshot data model.
+ /// FileShareSnapshot resource
+ ///
+ public partial class FileShareSnapshotData : ResourceData
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ public FileShareSnapshotData()
+ {
+ }
+
+ /// Initializes a new instance of .
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The resource-specific properties for this resource.
+ /// Keeps track of any properties unknown to the library.
+ internal FileShareSnapshotData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, FileShareSnapshotProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData)
+ {
+ Properties = properties;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// The resource-specific properties for this resource.
+ public FileShareSnapshotProperties Properties { get; set; }
+ }
+}
diff --git a/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareSnapshotResource.Serialization.cs b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareSnapshotResource.Serialization.cs
new file mode 100644
index 000000000000..165a0d72adeb
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareSnapshotResource.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.Fileshares
+{
+ public partial class FileShareSnapshotResource : IJsonModel
+ {
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options);
+
+ FileShareSnapshotData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options);
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options);
+
+ FileShareSnapshotData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options);
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options);
+ }
+}
diff --git a/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareSnapshotResource.cs b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareSnapshotResource.cs
new file mode 100644
index 000000000000..a963b7fc4102
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/FileShareSnapshotResource.cs
@@ -0,0 +1,348 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Globalization;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.Fileshares.Models;
+
+namespace Azure.ResourceManager.Fileshares
+{
+ ///
+ /// A Class representing a FileShareSnapshot 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 GetFileShareSnapshotResource method.
+ /// Otherwise you can get one from its parent resource using the GetFileShareSnapshot method.
+ ///
+ public partial class FileShareSnapshotResource : ArmResource
+ {
+ /// Generate the resource identifier of a instance.
+ /// The subscriptionId.
+ /// The resourceGroupName.
+ /// The resourceName.
+ /// The name.
+ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string name)
+ {
+ var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots/{name}";
+ return new ResourceIdentifier(resourceId);
+ }
+
+ private readonly ClientDiagnostics _fileShareSnapshotFileSharesClientDiagnostics;
+ private readonly FileSharesRestOperations _fileShareSnapshotFileSharesRestClient;
+ private readonly FileShareSnapshotData _data;
+
+ /// Gets the resource type for the operations.
+ public static readonly ResourceType ResourceType = "Microsoft.FileShares/fileShares/fileShareSnapshots";
+
+ /// Initializes a new instance of the class for mocking.
+ protected FileShareSnapshotResource()
+ {
+ }
+
+ /// Initializes a new instance of the class.
+ /// The client parameters to use in these operations.
+ /// The resource that is the target of operations.
+ internal FileShareSnapshotResource(ArmClient client, FileShareSnapshotData 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 FileShareSnapshotResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _fileShareSnapshotFileSharesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Fileshares", ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(ResourceType, out string fileShareSnapshotFileSharesApiVersion);
+ _fileShareSnapshotFileSharesRestClient = new FileSharesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fileShareSnapshotFileSharesApiVersion);
+#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 FileShareSnapshotData 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 FileShareSnapshot
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots/{name}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShareSnapshot_GetFileShareSnapshot
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
+ {
+ using var scope = _fileShareSnapshotFileSharesClientDiagnostics.CreateScope("FileShareSnapshotResource.Get");
+ scope.Start();
+ try
+ {
+ var response = await _fileShareSnapshotFileSharesRestClient.GetFileShareSnapshotAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new FileShareSnapshotResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a FileShareSnapshot
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots/{name}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShareSnapshot_GetFileShareSnapshot
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual Response Get(CancellationToken cancellationToken = default)
+ {
+ using var scope = _fileShareSnapshotFileSharesClientDiagnostics.CreateScope("FileShareSnapshotResource.Get");
+ scope.Start();
+ try
+ {
+ var response = _fileShareSnapshotFileSharesRestClient.GetFileShareSnapshot(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new FileShareSnapshotResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a FileShareSnapshot.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots/{name}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShareSnapshot_DeleteFileShareSnapshot
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The cancellation token to use.
+ public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default)
+ {
+ using var scope = _fileShareSnapshotFileSharesClientDiagnostics.CreateScope("FileShareSnapshotResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = await _fileShareSnapshotFileSharesRestClient.DeleteFileShareSnapshotAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ var operation = new FilesharesArmOperation(_fileShareSnapshotFileSharesClientDiagnostics, Pipeline, _fileShareSnapshotFileSharesRestClient.CreateDeleteFileShareSnapshotRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a FileShareSnapshot.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots/{name}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShareSnapshot_DeleteFileShareSnapshot
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The cancellation token to use.
+ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default)
+ {
+ using var scope = _fileShareSnapshotFileSharesClientDiagnostics.CreateScope("FileShareSnapshotResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = _fileShareSnapshotFileSharesRestClient.DeleteFileShareSnapshot(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
+ var operation = new FilesharesArmOperation(_fileShareSnapshotFileSharesClientDiagnostics, Pipeline, _fileShareSnapshotFileSharesRestClient.CreateDeleteFileShareSnapshotRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletionResponse(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Update a FileShareSnapshot.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots/{name}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShareSnapshot_UpdateFileShareSnapshot
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The resource properties to be updated.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task> UpdateAsync(WaitUntil waitUntil, FileShareSnapshotPatch patch, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(patch, nameof(patch));
+
+ using var scope = _fileShareSnapshotFileSharesClientDiagnostics.CreateScope("FileShareSnapshotResource.Update");
+ scope.Start();
+ try
+ {
+ var response = await _fileShareSnapshotFileSharesRestClient.UpdateFileShareSnapshotAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false);
+ var operation = new FilesharesArmOperation(new FileShareSnapshotOperationSource(Client), _fileShareSnapshotFileSharesClientDiagnostics, Pipeline, _fileShareSnapshotFileSharesRestClient.CreateUpdateFileShareSnapshotRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Update a FileShareSnapshot.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots/{name}
+ ///
+ /// -
+ /// Operation Id
+ /// FileShareSnapshot_UpdateFileShareSnapshot
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-01-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The resource properties to be updated.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual ArmOperation Update(WaitUntil waitUntil, FileShareSnapshotPatch patch, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(patch, nameof(patch));
+
+ using var scope = _fileShareSnapshotFileSharesClientDiagnostics.CreateScope("FileShareSnapshotResource.Update");
+ scope.Start();
+ try
+ {
+ var response = _fileShareSnapshotFileSharesRestClient.UpdateFileShareSnapshot(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken);
+ var operation = new FilesharesArmOperation(new FileShareSnapshotOperationSource(Client), _fileShareSnapshotFileSharesClientDiagnostics, Pipeline, _fileShareSnapshotFileSharesRestClient.CreateUpdateFileShareSnapshotRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/Internal/Argument.cs b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/Internal/Argument.cs
new file mode 100644
index 000000000000..3522fc327abc
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/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.Fileshares
+{
+ 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/fileshares/Azure.ResourceManager.Fileshares/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/Internal/ChangeTrackingDictionary.cs
new file mode 100644
index 000000000000..3ee27bcce9e6
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/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.Fileshares
+{
+ 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/fileshares/Azure.ResourceManager.Fileshares/src/Generated/Internal/ChangeTrackingList.cs b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/Internal/ChangeTrackingList.cs
new file mode 100644
index 000000000000..a85545516fb0
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/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.Fileshares
+{
+ 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/fileshares/Azure.ResourceManager.Fileshares/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/Internal/ModelSerializationExtensions.cs
new file mode 100644
index 000000000000..aa636e1d09b0
--- /dev/null
+++ b/sdk/fileshares/Azure.ResourceManager.Fileshares/src/Generated/Internal/ModelSerializationExtensions.cs
@@ -0,0 +1,399 @@
+// 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.Fileshares
+{
+ internal static class ModelSerializationExtensions
+ {
+ internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions { MaxDepth = 256 };
+ internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W");
+
+ 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