diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/Azure.ResourceManager.Sphere.sln b/sdk/sphere/Azure.ResourceManager.Sphere/Azure.ResourceManager.Sphere.sln
new file mode 100644
index 000000000000..4a1a445799dd
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/Azure.ResourceManager.Sphere.sln
@@ -0,0 +1,65 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30309.148
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{D14D2012-A352-40D1-AD05-DC1D6D7BA159}") = "Azure.ResourceManager.Sphere", "src\Azure.ResourceManager.Sphere.csproj", "{D3CD5A6A-BC2A-46A5-9DB9-71EF39D5BC77}"
+EndProject
+Project("{D14D2012-A352-40D1-AD05-DC1D6D7BA159}") = "Azure.ResourceManager.Sphere.Tests", "tests\Azure.ResourceManager.Sphere.Tests.csproj", "{154BD045-87E8-467E-8397-4956676DD245}"
+EndProject
+Project("{D14D2012-A352-40D1-AD05-DC1D6D7BA159}") = "Azure.ResourceManager.Sphere.Samples", "samples\Azure.ResourceManager.Sphere.Samples.csproj", "{09D6D688-2548-411A-AE88-FF31448FC088}"
+EndProject
+Global
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {AC78AA6A-1E82-463A-B8A5-0F88781701C9}
+ EndGlobalSection
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {D3CD5A6A-BC2A-46A5-9DB9-71EF39D5BC77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D3CD5A6A-BC2A-46A5-9DB9-71EF39D5BC77}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D3CD5A6A-BC2A-46A5-9DB9-71EF39D5BC77}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {D3CD5A6A-BC2A-46A5-9DB9-71EF39D5BC77}.Debug|x64.Build.0 = Debug|Any CPU
+ {D3CD5A6A-BC2A-46A5-9DB9-71EF39D5BC77}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {D3CD5A6A-BC2A-46A5-9DB9-71EF39D5BC77}.Debug|x86.Build.0 = Debug|Any CPU
+ {D3CD5A6A-BC2A-46A5-9DB9-71EF39D5BC77}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D3CD5A6A-BC2A-46A5-9DB9-71EF39D5BC77}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D3CD5A6A-BC2A-46A5-9DB9-71EF39D5BC77}.Release|x64.ActiveCfg = Release|Any CPU
+ {D3CD5A6A-BC2A-46A5-9DB9-71EF39D5BC77}.Release|x64.Build.0 = Release|Any CPU
+ {D3CD5A6A-BC2A-46A5-9DB9-71EF39D5BC77}.Release|x86.ActiveCfg = Release|Any CPU
+ {D3CD5A6A-BC2A-46A5-9DB9-71EF39D5BC77}.Release|x86.Build.0 = Release|Any CPU
+ {154BD045-87E8-467E-8397-4956676DD245}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {154BD045-87E8-467E-8397-4956676DD245}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {154BD045-87E8-467E-8397-4956676DD245}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {154BD045-87E8-467E-8397-4956676DD245}.Debug|x64.Build.0 = Debug|Any CPU
+ {154BD045-87E8-467E-8397-4956676DD245}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {154BD045-87E8-467E-8397-4956676DD245}.Debug|x86.Build.0 = Debug|Any CPU
+ {154BD045-87E8-467E-8397-4956676DD245}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {154BD045-87E8-467E-8397-4956676DD245}.Release|Any CPU.Build.0 = Release|Any CPU
+ {154BD045-87E8-467E-8397-4956676DD245}.Release|x64.ActiveCfg = Release|Any CPU
+ {154BD045-87E8-467E-8397-4956676DD245}.Release|x64.Build.0 = Release|Any CPU
+ {154BD045-87E8-467E-8397-4956676DD245}.Release|x86.ActiveCfg = Release|Any CPU
+ {154BD045-87E8-467E-8397-4956676DD245}.Release|x86.Build.0 = Release|Any CPU
+ {09D6D688-2548-411A-AE88-FF31448FC088}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {09D6D688-2548-411A-AE88-FF31448FC088}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {09D6D688-2548-411A-AE88-FF31448FC088}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {09D6D688-2548-411A-AE88-FF31448FC088}.Debug|x64.Build.0 = Debug|Any CPU
+ {09D6D688-2548-411A-AE88-FF31448FC088}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {09D6D688-2548-411A-AE88-FF31448FC088}.Debug|x86.Build.0 = Debug|Any CPU
+ {09D6D688-2548-411A-AE88-FF31448FC088}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {09D6D688-2548-411A-AE88-FF31448FC088}.Release|Any CPU.Build.0 = Release|Any CPU
+ {09D6D688-2548-411A-AE88-FF31448FC088}.Release|x64.ActiveCfg = Release|Any CPU
+ {09D6D688-2548-411A-AE88-FF31448FC088}.Release|x64.Build.0 = Release|Any CPU
+ {09D6D688-2548-411A-AE88-FF31448FC088}.Release|x86.ActiveCfg = Release|Any CPU
+ {09D6D688-2548-411A-AE88-FF31448FC088}.Release|x86.Build.0 = Release|Any CPU
+ EndGlobalSection
+EndGlobal
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/CHANGELOG.md b/sdk/sphere/Azure.ResourceManager.Sphere/CHANGELOG.md
new file mode 100644
index 000000000000..23f86d1e896e
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/CHANGELOG.md
@@ -0,0 +1,17 @@
+# Release History
+
+## 1.0.0-beta.1 (Unreleased)
+
+### General New Features
+
+This package 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.
+
+This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues).
+
+> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet).
\ No newline at end of file
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/Directory.Build.props b/sdk/sphere/Azure.ResourceManager.Sphere/Directory.Build.props
new file mode 100644
index 000000000000..1a9611bd4924
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/Directory.Build.props
@@ -0,0 +1,6 @@
+
+
+
+
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/README.md b/sdk/sphere/Azure.ResourceManager.Sphere/README.md
new file mode 100644
index 000000000000..c65ce5755c6b
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/README.md
@@ -0,0 +1,80 @@
+# Microsoft Azure sphere 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 sphere management library for .NET with [NuGet](https://www.nuget.org/):
+
+```dotnetcli
+dotnet add package Azure.ResourceManager.Sphere --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://docs.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/sphere/Azure.ResourceManager.Sphere/samples/Azure.ResourceManager.Sphere.Samples.csproj b/sdk/sphere/Azure.ResourceManager.Sphere/samples/Azure.ResourceManager.Sphere.Samples.csproj
new file mode 100644
index 000000000000..096809cffa53
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/samples/Azure.ResourceManager.Sphere.Samples.csproj
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/samples/autorest.tests.md b/sdk/sphere/Azure.ResourceManager.Sphere/samples/autorest.tests.md
new file mode 100644
index 000000000000..509dda31a7b6
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/samples/autorest.tests.md
@@ -0,0 +1,13 @@
+# Generated code configuration
+
+Run `dotnet build /t:GenerateTests` to generate code.
+
+# Azure.ResourceManager.sphere.Tests
+
+> see https://aka.ms/autorest
+``` yaml
+require: ../src/autorest.md
+include-x-ms-examples-original-file: true
+testgen:
+ sample: true
+```
\ No newline at end of file
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Azure.ResourceManager.Sphere.csproj b/sdk/sphere/Azure.ResourceManager.Sphere/src/Azure.ResourceManager.Sphere.csproj
new file mode 100644
index 000000000000..7c0b1c94e6ee
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Azure.ResourceManager.Sphere.csproj
@@ -0,0 +1,8 @@
+
+
+ 1.0.0-beta.1
+ Azure.ResourceManager.Sphere
+ Azure Resource Manager client SDK for Azure resource provider sphere.
+ azure;management;arm;resource manager;sphere
+
+
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/ArmSphereModelFactory.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/ArmSphereModelFactory.cs
new file mode 100644
index 000000000000..6c57d72968d5
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/ArmSphereModelFactory.cs
@@ -0,0 +1,237 @@
+// 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;
+using Azure.ResourceManager.Sphere;
+
+namespace Azure.ResourceManager.Sphere.Models
+{
+ /// Model factory for models.
+ public static partial class ArmSphereModelFactory
+ {
+ /// Initializes a new instance of CatalogData.
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The tags.
+ /// The location.
+ /// The status of the last operation.
+ /// A new instance for mocking.
+ public static CatalogData CatalogData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ProvisioningState? provisioningState = null)
+ {
+ tags ??= new Dictionary();
+
+ return new CatalogData(id, name, resourceType, systemData, tags, location, provisioningState);
+ }
+
+ /// Initializes a new instance of CertificateData.
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The certificate as a UTF-8 encoded base 64 string.
+ /// The certificate status.
+ /// The certificate subject.
+ /// The certificate thumbprint.
+ /// The certificate expiry date.
+ /// The certificate not before date.
+ /// The status of the last operation.
+ /// A new instance for mocking.
+ public static CertificateData CertificateData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string certificate = null, CertificateStatus? status = null, string subject = null, string thumbprint = null, DateTimeOffset? expiryUtc = null, DateTimeOffset? notBeforeUtc = null, ProvisioningState? provisioningState = null)
+ {
+ return new CertificateData(id, name, resourceType, systemData, certificate, status, subject, thumbprint, expiryUtc, notBeforeUtc, provisioningState);
+ }
+
+ /// Initializes a new instance of CertificateProperties.
+ /// The certificate as a UTF-8 encoded base 64 string.
+ /// The certificate status.
+ /// The certificate subject.
+ /// The certificate thumbprint.
+ /// The certificate expiry date.
+ /// The certificate not before date.
+ /// The status of the last operation.
+ /// A new instance for mocking.
+ public static CertificateProperties CertificateProperties(string certificate = null, CertificateStatus? status = null, string subject = null, string thumbprint = null, DateTimeOffset? expiryUtc = null, DateTimeOffset? notBeforeUtc = null, ProvisioningState? provisioningState = null)
+ {
+ return new CertificateProperties(certificate, status, subject, thumbprint, expiryUtc, notBeforeUtc, provisioningState);
+ }
+
+ /// Initializes a new instance of CertificateChainResponse.
+ /// The certificate chain.
+ /// A new instance for mocking.
+ public static CertificateChainResponse CertificateChainResponse(string certificateChain = null)
+ {
+ return new CertificateChainResponse(certificateChain);
+ }
+
+ /// Initializes a new instance of ProofOfPossessionNonceResponse.
+ /// The certificate as a UTF-8 encoded base 64 string.
+ /// The certificate status.
+ /// The certificate subject.
+ /// The certificate thumbprint.
+ /// The certificate expiry date.
+ /// The certificate not before date.
+ /// The status of the last operation.
+ /// A new instance for mocking.
+ public static ProofOfPossessionNonceResponse ProofOfPossessionNonceResponse(string certificate = null, CertificateStatus? status = null, string subject = null, string thumbprint = null, DateTimeOffset? expiryUtc = null, DateTimeOffset? notBeforeUtc = null, ProvisioningState? provisioningState = null)
+ {
+ return new ProofOfPossessionNonceResponse(certificate, status, subject, thumbprint, expiryUtc, notBeforeUtc, provisioningState);
+ }
+
+ /// Initializes a new instance of CountDeviceResponse.
+ /// Number of children resources in parent resource.
+ /// A new instance for mocking.
+ public static CountDeviceResponse CountDeviceResponse(int value = default)
+ {
+ return new CountDeviceResponse(value);
+ }
+
+ /// Initializes a new instance of CountElementsResponse.
+ /// Number of children resources in parent resource.
+ /// A new instance for mocking.
+ public static CountElementsResponse CountElementsResponse(int value = default)
+ {
+ return new CountElementsResponse(value);
+ }
+
+ /// Initializes a new instance of ImageData.
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// Image as a UTF-8 encoded base 64 string on image create. This field contains the image URI on image reads.
+ /// Image ID.
+ /// Image name.
+ /// Regional data boundary for an image.
+ /// Location the image.
+ /// The image description.
+ /// The image component id.
+ /// The image type.
+ /// The status of the last operation.
+ /// A new instance for mocking.
+ public static ImageData ImageData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string image = null, string imageId = null, string imageName = null, RegionalDataBoundary? regionalDataBoundary = null, Uri uri = null, string description = null, string componentId = null, ImageType? imageType = null, ProvisioningState? provisioningState = null)
+ {
+ return new ImageData(id, name, resourceType, systemData, image, imageId, imageName, regionalDataBoundary, uri, description, componentId, imageType, provisioningState);
+ }
+
+ /// Initializes a new instance of DeploymentData.
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// Deployment ID.
+ /// Images deployed.
+ /// Deployment date UTC.
+ /// The status of the last operation.
+ /// A new instance for mocking.
+ public static DeploymentData DeploymentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string deploymentId = null, IEnumerable deployedImages = null, DateTimeOffset? deploymentDateUtc = null, ProvisioningState? provisioningState = null)
+ {
+ deployedImages ??= new List();
+
+ return new DeploymentData(id, name, resourceType, systemData, deploymentId, deployedImages?.ToList(), deploymentDateUtc, provisioningState);
+ }
+
+ /// Initializes a new instance of DeviceGroupData.
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// Description of the device group.
+ /// Operating system feed type of the device group.
+ /// Update policy of the device group.
+ /// Flag to define if the user allows for crash dump collection.
+ /// Regional data boundary for the device group.
+ /// Deployment status for the device group.
+ /// The status of the last operation.
+ /// A new instance for mocking.
+ public static DeviceGroupData DeviceGroupData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string description = null, OSFeedType? osFeedType = null, UpdatePolicy? updatePolicy = null, AllowCrashDumpCollection? allowCrashDumpsCollection = null, RegionalDataBoundary? regionalDataBoundary = null, bool? hasDeployment = null, ProvisioningState? provisioningState = null)
+ {
+ return new DeviceGroupData(id, name, resourceType, systemData, description, osFeedType, updatePolicy, allowCrashDumpsCollection, regionalDataBoundary, hasDeployment, provisioningState);
+ }
+
+ /// Initializes a new instance of DeviceInsight.
+ /// Device ID.
+ /// Event description.
+ /// Event start timestamp.
+ /// Event end timestamp.
+ /// Event category.
+ /// Event class.
+ /// Event type.
+ /// Event count.
+ /// , , , or is null.
+ /// A new instance for mocking.
+ public static DeviceInsight DeviceInsight(string deviceId = null, string description = null, DateTimeOffset startTimestampUtc = default, DateTimeOffset endTimestampUtc = default, string eventCategory = null, string eventClass = null, string eventType = null, int eventCount = default)
+ {
+ if (deviceId == null)
+ {
+ throw new ArgumentNullException(nameof(deviceId));
+ }
+ if (description == null)
+ {
+ throw new ArgumentNullException(nameof(description));
+ }
+ if (eventCategory == null)
+ {
+ throw new ArgumentNullException(nameof(eventCategory));
+ }
+ if (eventClass == null)
+ {
+ throw new ArgumentNullException(nameof(eventClass));
+ }
+ if (eventType == null)
+ {
+ throw new ArgumentNullException(nameof(eventType));
+ }
+
+ return new DeviceInsight(deviceId, description, startTimestampUtc, endTimestampUtc, eventCategory, eventClass, eventType, eventCount);
+ }
+
+ /// Initializes a new instance of DeviceData.
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// Device ID.
+ /// SKU of the chip.
+ /// OS version available for installation when update requested.
+ /// OS version running on device when update requested.
+ /// Time when update requested and new OS version available.
+ /// Time when update was last requested.
+ /// The status of the last operation.
+ /// A new instance for mocking.
+ public static DeviceData DeviceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string deviceId = null, string chipSku = null, string lastAvailableOSVersion = null, string lastInstalledOSVersion = null, DateTimeOffset? lastOSUpdateUtc = null, DateTimeOffset? lastUpdateRequestUtc = null, ProvisioningState? provisioningState = null)
+ {
+ return new DeviceData(id, name, resourceType, systemData, deviceId, chipSku, lastAvailableOSVersion, lastInstalledOSVersion, lastOSUpdateUtc, lastUpdateRequestUtc, provisioningState);
+ }
+
+ /// Initializes a new instance of ProductData.
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// Description of the product.
+ /// The status of the last operation.
+ /// A new instance for mocking.
+ public static ProductData ProductData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string description = null, ProvisioningState? provisioningState = null)
+ {
+ return new ProductData(id, name, resourceType, systemData, description, provisioningState);
+ }
+
+ /// Initializes a new instance of SignedCapabilityImageResponse.
+ /// The signed device capability image as a UTF-8 encoded base 64 string.
+ /// A new instance for mocking.
+ public static SignedCapabilityImageResponse SignedCapabilityImageResponse(string image = null)
+ {
+ return new SignedCapabilityImageResponse(image);
+ }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/CatalogCollection.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/CatalogCollection.cs
new file mode 100644
index 000000000000..91924c8350e4
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/CatalogCollection.cs
@@ -0,0 +1,341 @@
+// 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 Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager;
+using Azure.ResourceManager.Resources;
+
+namespace Azure.ResourceManager.Sphere
+{
+ ///
+ /// 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 GetCatalogs method from an instance of .
+ ///
+ public partial class CatalogCollection : ArmCollection, IEnumerable, IAsyncEnumerable
+ {
+ private readonly ClientDiagnostics _catalogClientDiagnostics;
+ private readonly CatalogsRestOperations _catalogRestClient;
+
+ /// Initializes a new instance of the class for mocking.
+ protected CatalogCollection()
+ {
+ }
+
+ /// 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 CatalogCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _catalogClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sphere", CatalogResource.ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(CatalogResource.ResourceType, out string catalogApiVersion);
+ _catalogRestClient = new CatalogsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, catalogApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != ResourceGroupResource.ResourceType)
+ throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id));
+ }
+
+ ///
+ /// Create a Catalog
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_CreateOrUpdate
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// Name of catalog.
+ /// 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 catalogName, CatalogData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _catalogClientDiagnostics.CreateScope("CatalogCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = await _catalogRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, catalogName, data, cancellationToken).ConfigureAwait(false);
+ var operation = new SphereArmOperation(new CatalogOperationSource(Client), _catalogClientDiagnostics, Pipeline, _catalogRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, catalogName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a Catalog
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_CreateOrUpdate
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// Name of catalog.
+ /// 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 catalogName, CatalogData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _catalogClientDiagnostics.CreateScope("CatalogCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = _catalogRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, catalogName, data, cancellationToken);
+ var operation = new SphereArmOperation(new CatalogOperationSource(Client), _catalogClientDiagnostics, Pipeline, _catalogRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, catalogName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a Catalog
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_Get
+ ///
+ ///
+ ///
+ /// Name of catalog.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetAsync(string catalogName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName));
+
+ using var scope = _catalogClientDiagnostics.CreateScope("CatalogCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = await _catalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new CatalogResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a Catalog
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_Get
+ ///
+ ///
+ ///
+ /// Name of catalog.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Get(string catalogName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName));
+
+ using var scope = _catalogClientDiagnostics.CreateScope("CatalogCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = _catalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new CatalogResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// List Catalog resources by resource group
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_ListByResourceGroup
+ ///
+ ///
+ ///
+ /// 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) => _catalogRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _catalogRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName);
+ return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CatalogResource(Client, CatalogData.DeserializeCatalogData(e)), _catalogClientDiagnostics, Pipeline, "CatalogCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// List Catalog resources by resource group
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_ListByResourceGroup
+ ///
+ ///
+ ///
+ /// 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) => _catalogRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _catalogRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName);
+ return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CatalogResource(Client, CatalogData.DeserializeCatalogData(e)), _catalogClientDiagnostics, Pipeline, "CatalogCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// Checks to see if the resource exists in azure.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_Get
+ ///
+ ///
+ ///
+ /// Name of catalog.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> ExistsAsync(string catalogName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName));
+
+ using var scope = _catalogClientDiagnostics.CreateScope("CatalogCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = await _catalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, catalogName, 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.AzureSphere/catalogs/{catalogName}
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_Get
+ ///
+ ///
+ ///
+ /// Name of catalog.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Exists(string catalogName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName));
+
+ using var scope = _catalogClientDiagnostics.CreateScope("CatalogCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = _catalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken: cancellationToken);
+ return Response.FromValue(response.Value != null, 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/sphere/Azure.ResourceManager.Sphere/src/Generated/CatalogData.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/CatalogData.cs
new file mode 100644
index 000000000000..0bb955b3edbe
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/CatalogData.cs
@@ -0,0 +1,43 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+using Azure.Core;
+using Azure.ResourceManager.Models;
+using Azure.ResourceManager.Sphere.Models;
+
+namespace Azure.ResourceManager.Sphere
+{
+ ///
+ /// A class representing the Catalog data model.
+ /// An Azure Sphere catalog
+ ///
+ public partial class CatalogData : TrackedResourceData
+ {
+ /// Initializes a new instance of CatalogData.
+ /// The location.
+ public CatalogData(AzureLocation location) : base(location)
+ {
+ }
+
+ /// Initializes a new instance of CatalogData.
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The tags.
+ /// The location.
+ /// The status of the last operation.
+ internal CatalogData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ProvisioningState? provisioningState) : base(id, name, resourceType, systemData, tags, location)
+ {
+ ProvisioningState = provisioningState;
+ }
+
+ /// The status of the last operation.
+ public ProvisioningState? ProvisioningState { get; }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/CatalogResource.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/CatalogResource.cs
new file mode 100644
index 000000000000..ee69d613cb85
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/CatalogResource.cs
@@ -0,0 +1,1037 @@
+// 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;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager;
+using Azure.ResourceManager.Resources;
+using Azure.ResourceManager.Sphere.Models;
+
+namespace Azure.ResourceManager.Sphere
+{
+ ///
+ /// A Class representing a Catalog 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 GetCatalogResource method.
+ /// Otherwise you can get one from its parent resource using the GetCatalog method.
+ ///
+ public partial class CatalogResource : ArmResource
+ {
+ /// Generate the resource identifier of a instance.
+ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string catalogName)
+ {
+ var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}";
+ return new ResourceIdentifier(resourceId);
+ }
+
+ private readonly ClientDiagnostics _catalogClientDiagnostics;
+ private readonly CatalogsRestOperations _catalogRestClient;
+ private readonly CatalogData _data;
+
+ /// Initializes a new instance of the class for mocking.
+ protected CatalogResource()
+ {
+ }
+
+ /// Initializes a new instance of the class.
+ /// The client parameters to use in these operations.
+ /// The resource that is the target of operations.
+ internal CatalogResource(ArmClient client, CatalogData 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 CatalogResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _catalogClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sphere", ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(ResourceType, out string catalogApiVersion);
+ _catalogRestClient = new CatalogsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, catalogApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ /// Gets the resource type for the operations.
+ public static readonly ResourceType ResourceType = "Microsoft.AzureSphere/catalogs";
+
+ /// 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 CatalogData 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 CertificateResources in the Catalog.
+ /// An object representing collection of CertificateResources and their operations over a CertificateResource.
+ public virtual CertificateCollection GetCertificates()
+ {
+ return GetCachedClient(Client => new CertificateCollection(Client, Id));
+ }
+
+ ///
+ /// Get a Certificate
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}
+ ///
+ /// -
+ /// Operation Id
+ /// Certificates_Get
+ ///
+ ///
+ ///
+ /// Serial number of the certificate. Use '.default' to get current active certificate.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ [ForwardsClientCalls]
+ public virtual async Task> GetCertificateAsync(string serialNumber, CancellationToken cancellationToken = default)
+ {
+ return await GetCertificates().GetAsync(serialNumber, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Get a Certificate
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}
+ ///
+ /// -
+ /// Operation Id
+ /// Certificates_Get
+ ///
+ ///
+ ///
+ /// Serial number of the certificate. Use '.default' to get current active certificate.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ [ForwardsClientCalls]
+ public virtual Response GetCertificate(string serialNumber, CancellationToken cancellationToken = default)
+ {
+ return GetCertificates().Get(serialNumber, cancellationToken);
+ }
+
+ /// Gets a collection of ImageResources in the Catalog.
+ /// An object representing collection of ImageResources and their operations over a ImageResource.
+ public virtual ImageCollection GetImages()
+ {
+ return GetCachedClient(Client => new ImageCollection(Client, Id));
+ }
+
+ ///
+ /// Get a Image
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}
+ ///
+ /// -
+ /// Operation Id
+ /// Images_Get
+ ///
+ ///
+ ///
+ /// Image name. Use .default for image creation.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ [ForwardsClientCalls]
+ public virtual async Task> GetImageAsync(string imageName, CancellationToken cancellationToken = default)
+ {
+ return await GetImages().GetAsync(imageName, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Get a Image
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}
+ ///
+ /// -
+ /// Operation Id
+ /// Images_Get
+ ///
+ ///
+ ///
+ /// Image name. Use .default for image creation.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ [ForwardsClientCalls]
+ public virtual Response GetImage(string imageName, CancellationToken cancellationToken = default)
+ {
+ return GetImages().Get(imageName, cancellationToken);
+ }
+
+ /// Gets a collection of ProductResources in the Catalog.
+ /// An object representing collection of ProductResources and their operations over a ProductResource.
+ public virtual ProductCollection GetProducts()
+ {
+ return GetCachedClient(Client => new ProductCollection(Client, Id));
+ }
+
+ ///
+ /// Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}
+ ///
+ /// -
+ /// Operation Id
+ /// Products_Get
+ ///
+ ///
+ ///
+ /// Name of product.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ [ForwardsClientCalls]
+ public virtual async Task> GetProductAsync(string productName, CancellationToken cancellationToken = default)
+ {
+ return await GetProducts().GetAsync(productName, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}
+ ///
+ /// -
+ /// Operation Id
+ /// Products_Get
+ ///
+ ///
+ ///
+ /// Name of product.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ [ForwardsClientCalls]
+ public virtual Response GetProduct(string productName, CancellationToken cancellationToken = default)
+ {
+ return GetProducts().Get(productName, cancellationToken);
+ }
+
+ ///
+ /// Get a Catalog
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_Get
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
+ {
+ using var scope = _catalogClientDiagnostics.CreateScope("CatalogResource.Get");
+ scope.Start();
+ try
+ {
+ var response = await _catalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new CatalogResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a Catalog
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_Get
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual Response Get(CancellationToken cancellationToken = default)
+ {
+ using var scope = _catalogClientDiagnostics.CreateScope("CatalogResource.Get");
+ scope.Start();
+ try
+ {
+ var response = _catalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new CatalogResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a Catalog
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_Delete
+ ///
+ ///
+ ///
+ /// 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 = _catalogClientDiagnostics.CreateScope("CatalogResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = await _catalogRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false);
+ var operation = new SphereArmOperation(_catalogClientDiagnostics, Pipeline, _catalogRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a Catalog
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_Delete
+ ///
+ ///
+ ///
+ /// 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 = _catalogClientDiagnostics.CreateScope("CatalogResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = _catalogRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
+ var operation = new SphereArmOperation(_catalogClientDiagnostics, Pipeline, _catalogRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletionResponse(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Update a Catalog
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_Update
+ ///
+ ///
+ ///
+ /// The resource properties to be updated.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task> UpdateAsync(CatalogPatch patch, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(patch, nameof(patch));
+
+ using var scope = _catalogClientDiagnostics.CreateScope("CatalogResource.Update");
+ scope.Start();
+ try
+ {
+ var response = await _catalogRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false);
+ return Response.FromValue(new CatalogResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Update a Catalog
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_Update
+ ///
+ ///
+ ///
+ /// The resource properties to be updated.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual Response Update(CatalogPatch patch, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(patch, nameof(patch));
+
+ using var scope = _catalogClientDiagnostics.CreateScope("CatalogResource.Update");
+ scope.Start();
+ try
+ {
+ var response = _catalogRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken);
+ return Response.FromValue(new CatalogResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Counts devices in catalog.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/countDevices
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_CountDevices
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual async Task> CountDevicesAsync(CancellationToken cancellationToken = default)
+ {
+ using var scope = _catalogClientDiagnostics.CreateScope("CatalogResource.CountDevices");
+ scope.Start();
+ try
+ {
+ var response = await _catalogRestClient.CountDevicesAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false);
+ return response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Counts devices in catalog.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/countDevices
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_CountDevices
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual Response CountDevices(CancellationToken cancellationToken = default)
+ {
+ using var scope = _catalogClientDiagnostics.CreateScope("CatalogResource.CountDevices");
+ scope.Start();
+ try
+ {
+ var response = _catalogRestClient.CountDevices(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
+ return response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Lists deployments for catalog.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/listDeployments
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_ListDeployments
+ ///
+ ///
+ ///
+ /// Filter the result list using the given expression.
+ /// The number of result items to return.
+ /// The number of result items to skip.
+ /// The maximum number of result items per page.
+ /// The cancellation token to use.
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetDeploymentsAsync(string filter = null, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => _catalogRestClient.CreateListDeploymentsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top, skip, pageSizeHint);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _catalogRestClient.CreateListDeploymentsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top, skip, pageSizeHint);
+ return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeploymentResource(Client, DeploymentData.DeserializeDeploymentData(e)), _catalogClientDiagnostics, Pipeline, "CatalogResource.GetDeployments", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// Lists deployments for catalog.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/listDeployments
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_ListDeployments
+ ///
+ ///
+ ///
+ /// Filter the result list using the given expression.
+ /// The number of result items to return.
+ /// The number of result items to skip.
+ /// The maximum number of result items per page.
+ /// The cancellation token to use.
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetDeployments(string filter = null, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => _catalogRestClient.CreateListDeploymentsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top, skip, pageSizeHint);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _catalogRestClient.CreateListDeploymentsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top, skip, pageSizeHint);
+ return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeploymentResource(Client, DeploymentData.DeserializeDeploymentData(e)), _catalogClientDiagnostics, Pipeline, "CatalogResource.GetDeployments", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// List the device groups for the catalog.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/listDeviceGroups
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_ListDeviceGroups
+ ///
+ ///
+ ///
+ /// List device groups for catalog.
+ /// Filter the result list using the given expression.
+ /// The number of result items to return.
+ /// The number of result items to skip.
+ /// The maximum number of result items per page.
+ /// The cancellation token to use.
+ /// is null.
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetDeviceGroupsAsync(ListDeviceGroupsContent content, string filter = null, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(content, nameof(content));
+
+ HttpMessage FirstPageRequest(int? pageSizeHint) => _catalogRestClient.CreateListDeviceGroupsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, filter, top, skip, pageSizeHint);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _catalogRestClient.CreateListDeviceGroupsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, filter, top, skip, pageSizeHint);
+ return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceGroupResource(Client, DeviceGroupData.DeserializeDeviceGroupData(e)), _catalogClientDiagnostics, Pipeline, "CatalogResource.GetDeviceGroups", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// List the device groups for the catalog.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/listDeviceGroups
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_ListDeviceGroups
+ ///
+ ///
+ ///
+ /// List device groups for catalog.
+ /// Filter the result list using the given expression.
+ /// The number of result items to return.
+ /// The number of result items to skip.
+ /// The maximum number of result items per page.
+ /// The cancellation token to use.
+ /// is null.
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetDeviceGroups(ListDeviceGroupsContent content, string filter = null, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(content, nameof(content));
+
+ HttpMessage FirstPageRequest(int? pageSizeHint) => _catalogRestClient.CreateListDeviceGroupsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, filter, top, skip, pageSizeHint);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _catalogRestClient.CreateListDeviceGroupsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, filter, top, skip, pageSizeHint);
+ return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceGroupResource(Client, DeviceGroupData.DeserializeDeviceGroupData(e)), _catalogClientDiagnostics, Pipeline, "CatalogResource.GetDeviceGroups", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// Lists device insights for catalog.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/listDeviceInsights
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_ListDeviceInsights
+ ///
+ ///
+ ///
+ /// Filter the result list using the given expression.
+ /// The number of result items to return.
+ /// The number of result items to skip.
+ /// The maximum number of result items per page.
+ /// The cancellation token to use.
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetDeviceInsightsAsync(string filter = null, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => _catalogRestClient.CreateListDeviceInsightsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top, skip, pageSizeHint);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _catalogRestClient.CreateListDeviceInsightsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top, skip, pageSizeHint);
+ return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DeviceInsight.DeserializeDeviceInsight, _catalogClientDiagnostics, Pipeline, "CatalogResource.GetDeviceInsights", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// Lists device insights for catalog.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/listDeviceInsights
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_ListDeviceInsights
+ ///
+ ///
+ ///
+ /// Filter the result list using the given expression.
+ /// The number of result items to return.
+ /// The number of result items to skip.
+ /// The maximum number of result items per page.
+ /// The cancellation token to use.
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetDeviceInsights(string filter = null, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => _catalogRestClient.CreateListDeviceInsightsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top, skip, pageSizeHint);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _catalogRestClient.CreateListDeviceInsightsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top, skip, pageSizeHint);
+ return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DeviceInsight.DeserializeDeviceInsight, _catalogClientDiagnostics, Pipeline, "CatalogResource.GetDeviceInsights", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// Lists devices for catalog.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/listDevices
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_ListDevices
+ ///
+ ///
+ ///
+ /// Filter the result list using the given expression.
+ /// The number of result items to return.
+ /// The number of result items to skip.
+ /// The maximum number of result items per page.
+ /// The cancellation token to use.
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetDevicesAsync(string filter = null, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => _catalogRestClient.CreateListDevicesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top, skip, pageSizeHint);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _catalogRestClient.CreateListDevicesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top, skip, pageSizeHint);
+ return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceResource(Client, DeviceData.DeserializeDeviceData(e)), _catalogClientDiagnostics, Pipeline, "CatalogResource.GetDevices", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// Lists devices for catalog.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/listDevices
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_ListDevices
+ ///
+ ///
+ ///
+ /// Filter the result list using the given expression.
+ /// The number of result items to return.
+ /// The number of result items to skip.
+ /// The maximum number of result items per page.
+ /// The cancellation token to use.
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetDevices(string filter = null, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => _catalogRestClient.CreateListDevicesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top, skip, pageSizeHint);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _catalogRestClient.CreateListDevicesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top, skip, pageSizeHint);
+ return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceResource(Client, DeviceData.DeserializeDeviceData(e)), _catalogClientDiagnostics, Pipeline, "CatalogResource.GetDevices", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// Add a tag to the current resource.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_Get
+ ///
+ ///
+ ///
+ /// 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 = _catalogClientDiagnostics.CreateScope("CatalogResource.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 _catalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false);
+ return Response.FromValue(new CatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
+ }
+ else
+ {
+ var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data;
+ var patch = new CatalogPatch();
+ foreach (var tag in current.Tags)
+ {
+ patch.Tags.Add(tag);
+ }
+ patch.Tags[key] = value;
+ var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return result;
+ }
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Add a tag to the current resource.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_Get
+ ///
+ ///
+ ///
+ /// 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 = _catalogClientDiagnostics.CreateScope("CatalogResource.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 = _catalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
+ return Response.FromValue(new CatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
+ }
+ else
+ {
+ var current = Get(cancellationToken: cancellationToken).Value.Data;
+ var patch = new CatalogPatch();
+ foreach (var tag in current.Tags)
+ {
+ patch.Tags.Add(tag);
+ }
+ patch.Tags[key] = value;
+ var result = Update(patch, cancellationToken: cancellationToken);
+ return result;
+ }
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Replace the tags on the resource with the given set.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_Get
+ ///
+ ///
+ ///
+ /// 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 = _catalogClientDiagnostics.CreateScope("CatalogResource.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 _catalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false);
+ return Response.FromValue(new CatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
+ }
+ else
+ {
+ var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data;
+ var patch = new CatalogPatch();
+ patch.Tags.ReplaceWith(tags);
+ var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return result;
+ }
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Replace the tags on the resource with the given set.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_Get
+ ///
+ ///
+ ///
+ /// 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 = _catalogClientDiagnostics.CreateScope("CatalogResource.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 = _catalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
+ return Response.FromValue(new CatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
+ }
+ else
+ {
+ var current = Get(cancellationToken: cancellationToken).Value.Data;
+ var patch = new CatalogPatch();
+ patch.Tags.ReplaceWith(tags);
+ var result = Update(patch, cancellationToken: cancellationToken);
+ return result;
+ }
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Removes a tag by key from the resource.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_Get
+ ///
+ ///
+ ///
+ /// 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 = _catalogClientDiagnostics.CreateScope("CatalogResource.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 _catalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false);
+ return Response.FromValue(new CatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
+ }
+ else
+ {
+ var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data;
+ var patch = new CatalogPatch();
+ foreach (var tag in current.Tags)
+ {
+ patch.Tags.Add(tag);
+ }
+ patch.Tags.Remove(key);
+ var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return result;
+ }
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Removes a tag by key from the resource.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_Get
+ ///
+ ///
+ ///
+ /// 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 = _catalogClientDiagnostics.CreateScope("CatalogResource.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 = _catalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
+ return Response.FromValue(new CatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
+ }
+ else
+ {
+ var current = Get(cancellationToken: cancellationToken).Value.Data;
+ var patch = new CatalogPatch();
+ foreach (var tag in current.Tags)
+ {
+ patch.Tags.Add(tag);
+ }
+ patch.Tags.Remove(key);
+ var result = Update(patch, cancellationToken: cancellationToken);
+ return result;
+ }
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/CertificateCollection.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/CertificateCollection.cs
new file mode 100644
index 000000000000..001df66c9fce
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/CertificateCollection.cs
@@ -0,0 +1,266 @@
+// 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 Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager;
+
+namespace Azure.ResourceManager.Sphere
+{
+ ///
+ /// 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 GetCertificates method from an instance of .
+ ///
+ public partial class CertificateCollection : ArmCollection, IEnumerable, IAsyncEnumerable
+ {
+ private readonly ClientDiagnostics _certificateClientDiagnostics;
+ private readonly CertificatesRestOperations _certificateRestClient;
+
+ /// Initializes a new instance of the class for mocking.
+ protected CertificateCollection()
+ {
+ }
+
+ /// 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 CertificateCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _certificateClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sphere", CertificateResource.ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(CertificateResource.ResourceType, out string certificateApiVersion);
+ _certificateRestClient = new CertificatesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, certificateApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != CatalogResource.ResourceType)
+ throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CatalogResource.ResourceType), nameof(id));
+ }
+
+ ///
+ /// Get a Certificate
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}
+ ///
+ /// -
+ /// Operation Id
+ /// Certificates_Get
+ ///
+ ///
+ ///
+ /// Serial number of the certificate. Use '.default' to get current active certificate.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetAsync(string serialNumber, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(serialNumber, nameof(serialNumber));
+
+ using var scope = _certificateClientDiagnostics.CreateScope("CertificateCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = await _certificateRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serialNumber, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new CertificateResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a Certificate
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}
+ ///
+ /// -
+ /// Operation Id
+ /// Certificates_Get
+ ///
+ ///
+ ///
+ /// Serial number of the certificate. Use '.default' to get current active certificate.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Get(string serialNumber, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(serialNumber, nameof(serialNumber));
+
+ using var scope = _certificateClientDiagnostics.CreateScope("CertificateCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = _certificateRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serialNumber, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new CertificateResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// List Certificate resources by Catalog
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates
+ ///
+ /// -
+ /// Operation Id
+ /// Certificates_ListByCatalog
+ ///
+ ///
+ ///
+ /// Filter the result list using the given expression.
+ /// The number of result items to return.
+ /// The number of result items to skip.
+ /// The maximum number of result items per page.
+ /// The cancellation token to use.
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetAllAsync(string filter = null, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => _certificateRestClient.CreateListByCatalogRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top, skip, pageSizeHint);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _certificateRestClient.CreateListByCatalogNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top, skip, pageSizeHint);
+ return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CertificateResource(Client, CertificateData.DeserializeCertificateData(e)), _certificateClientDiagnostics, Pipeline, "CertificateCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// List Certificate resources by Catalog
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates
+ ///
+ /// -
+ /// Operation Id
+ /// Certificates_ListByCatalog
+ ///
+ ///
+ ///
+ /// Filter the result list using the given expression.
+ /// The number of result items to return.
+ /// The number of result items to skip.
+ /// The maximum number of result items per page.
+ /// The cancellation token to use.
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetAll(string filter = null, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => _certificateRestClient.CreateListByCatalogRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top, skip, pageSizeHint);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _certificateRestClient.CreateListByCatalogNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top, skip, pageSizeHint);
+ return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CertificateResource(Client, CertificateData.DeserializeCertificateData(e)), _certificateClientDiagnostics, Pipeline, "CertificateCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// Checks to see if the resource exists in azure.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}
+ ///
+ /// -
+ /// Operation Id
+ /// Certificates_Get
+ ///
+ ///
+ ///
+ /// Serial number of the certificate. Use '.default' to get current active certificate.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> ExistsAsync(string serialNumber, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(serialNumber, nameof(serialNumber));
+
+ using var scope = _certificateClientDiagnostics.CreateScope("CertificateCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = await _certificateRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serialNumber, 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.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}
+ ///
+ /// -
+ /// Operation Id
+ /// Certificates_Get
+ ///
+ ///
+ ///
+ /// Serial number of the certificate. Use '.default' to get current active certificate.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Exists(string serialNumber, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(serialNumber, nameof(serialNumber));
+
+ using var scope = _certificateClientDiagnostics.CreateScope("CertificateCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = _certificateRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serialNumber, cancellationToken: cancellationToken);
+ return Response.FromValue(response.Value != null, 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/sphere/Azure.ResourceManager.Sphere/src/Generated/CertificateData.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/CertificateData.cs
new file mode 100644
index 000000000000..c9a87e7f3952
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/CertificateData.cs
@@ -0,0 +1,64 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using Azure.Core;
+using Azure.ResourceManager.Models;
+using Azure.ResourceManager.Sphere.Models;
+
+namespace Azure.ResourceManager.Sphere
+{
+ ///
+ /// A class representing the Certificate data model.
+ /// An certificate resource belonging to a catalog resource.
+ ///
+ public partial class CertificateData : ResourceData
+ {
+ /// Initializes a new instance of CertificateData.
+ public CertificateData()
+ {
+ }
+
+ /// Initializes a new instance of CertificateData.
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The certificate as a UTF-8 encoded base 64 string.
+ /// The certificate status.
+ /// The certificate subject.
+ /// The certificate thumbprint.
+ /// The certificate expiry date.
+ /// The certificate not before date.
+ /// The status of the last operation.
+ internal CertificateData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string certificate, CertificateStatus? status, string subject, string thumbprint, DateTimeOffset? expiryUtc, DateTimeOffset? notBeforeUtc, ProvisioningState? provisioningState) : base(id, name, resourceType, systemData)
+ {
+ Certificate = certificate;
+ Status = status;
+ Subject = subject;
+ Thumbprint = thumbprint;
+ ExpiryUtc = expiryUtc;
+ NotBeforeUtc = notBeforeUtc;
+ ProvisioningState = provisioningState;
+ }
+
+ /// The certificate as a UTF-8 encoded base 64 string.
+ public string Certificate { get; }
+ /// The certificate status.
+ public CertificateStatus? Status { get; }
+ /// The certificate subject.
+ public string Subject { get; }
+ /// The certificate thumbprint.
+ public string Thumbprint { get; }
+ /// The certificate expiry date.
+ public DateTimeOffset? ExpiryUtc { get; }
+ /// The certificate not before date.
+ public DateTimeOffset? NotBeforeUtc { get; }
+ /// The status of the last operation.
+ public ProvisioningState? ProvisioningState { get; }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/CertificateResource.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/CertificateResource.cs
new file mode 100644
index 000000000000..85a87801bdb7
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/CertificateResource.cs
@@ -0,0 +1,282 @@
+// 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;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager;
+using Azure.ResourceManager.Sphere.Models;
+
+namespace Azure.ResourceManager.Sphere
+{
+ ///
+ /// A Class representing a Certificate 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 GetCertificateResource method.
+ /// Otherwise you can get one from its parent resource using the GetCertificate method.
+ ///
+ public partial class CertificateResource : ArmResource
+ {
+ /// Generate the resource identifier of a instance.
+ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string catalogName, string serialNumber)
+ {
+ var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}";
+ return new ResourceIdentifier(resourceId);
+ }
+
+ private readonly ClientDiagnostics _certificateClientDiagnostics;
+ private readonly CertificatesRestOperations _certificateRestClient;
+ private readonly CertificateData _data;
+
+ /// Initializes a new instance of the class for mocking.
+ protected CertificateResource()
+ {
+ }
+
+ /// Initializes a new instance of the class.
+ /// The client parameters to use in these operations.
+ /// The resource that is the target of operations.
+ internal CertificateResource(ArmClient client, CertificateData 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 CertificateResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _certificateClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sphere", ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(ResourceType, out string certificateApiVersion);
+ _certificateRestClient = new CertificatesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, certificateApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ /// Gets the resource type for the operations.
+ public static readonly ResourceType ResourceType = "Microsoft.AzureSphere/catalogs/certificates";
+
+ /// 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 CertificateData 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 Certificate
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}
+ ///
+ /// -
+ /// Operation Id
+ /// Certificates_Get
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
+ {
+ using var scope = _certificateClientDiagnostics.CreateScope("CertificateResource.Get");
+ scope.Start();
+ try
+ {
+ var response = await _certificateRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new CertificateResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a Certificate
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}
+ ///
+ /// -
+ /// Operation Id
+ /// Certificates_Get
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual Response Get(CancellationToken cancellationToken = default)
+ {
+ using var scope = _certificateClientDiagnostics.CreateScope("CertificateResource.Get");
+ scope.Start();
+ try
+ {
+ var response = _certificateRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new CertificateResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Retrieves cert chain.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}/retrieveCertChain
+ ///
+ /// -
+ /// Operation Id
+ /// Certificates_RetrieveCertChain
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual async Task> RetrieveCertChainAsync(CancellationToken cancellationToken = default)
+ {
+ using var scope = _certificateClientDiagnostics.CreateScope("CertificateResource.RetrieveCertChain");
+ scope.Start();
+ try
+ {
+ var response = await _certificateRestClient.RetrieveCertChainAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ return response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Retrieves cert chain.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}/retrieveCertChain
+ ///
+ /// -
+ /// Operation Id
+ /// Certificates_RetrieveCertChain
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual Response RetrieveCertChain(CancellationToken cancellationToken = default)
+ {
+ using var scope = _certificateClientDiagnostics.CreateScope("CertificateResource.RetrieveCertChain");
+ scope.Start();
+ try
+ {
+ var response = _certificateRestClient.RetrieveCertChain(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
+ return response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Gets the proof of possession nonce.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}/retrieveProofOfPossessionNonce
+ ///
+ /// -
+ /// Operation Id
+ /// Certificates_RetrieveProofOfPossessionNonce
+ ///
+ ///
+ ///
+ /// Proof of possession nonce request body.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task> RetrieveProofOfPossessionNonceAsync(ProofOfPossessionNonceContent content, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = _certificateClientDiagnostics.CreateScope("CertificateResource.RetrieveProofOfPossessionNonce");
+ scope.Start();
+ try
+ {
+ var response = await _certificateRestClient.RetrieveProofOfPossessionNonceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false);
+ return response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Gets the proof of possession nonce.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}/retrieveProofOfPossessionNonce
+ ///
+ /// -
+ /// Operation Id
+ /// Certificates_RetrieveProofOfPossessionNonce
+ ///
+ ///
+ ///
+ /// Proof of possession nonce request body.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual Response RetrieveProofOfPossessionNonce(ProofOfPossessionNonceContent content, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = _certificateClientDiagnostics.CreateScope("CertificateResource.RetrieveProofOfPossessionNonce");
+ scope.Start();
+ try
+ {
+ var response = _certificateRestClient.RetrieveProofOfPossessionNonce(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken);
+ return response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/DeploymentCollection.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/DeploymentCollection.cs
new file mode 100644
index 000000000000..5990df4020af
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/DeploymentCollection.cs
@@ -0,0 +1,348 @@
+// 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 Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager;
+
+namespace Azure.ResourceManager.Sphere
+{
+ ///
+ /// 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 GetDeployments method from an instance of .
+ ///
+ public partial class DeploymentCollection : ArmCollection, IEnumerable, IAsyncEnumerable
+ {
+ private readonly ClientDiagnostics _deploymentClientDiagnostics;
+ private readonly DeploymentsRestOperations _deploymentRestClient;
+
+ /// Initializes a new instance of the class for mocking.
+ protected DeploymentCollection()
+ {
+ }
+
+ /// 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 DeploymentCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _deploymentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sphere", DeploymentResource.ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(DeploymentResource.ResourceType, out string deploymentApiVersion);
+ _deploymentRestClient = new DeploymentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deploymentApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != DeviceGroupResource.ResourceType)
+ throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DeviceGroupResource.ResourceType), nameof(id));
+ }
+
+ ///
+ /// Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}
+ ///
+ /// -
+ /// Operation Id
+ /// Deployments_CreateOrUpdate
+ ///
+ ///
+ ///
+ /// 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.
+ /// Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ /// 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 deploymentName, DeploymentData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _deploymentClientDiagnostics.CreateScope("DeploymentCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = await _deploymentRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, deploymentName, data, cancellationToken).ConfigureAwait(false);
+ var operation = new SphereArmOperation(new DeploymentOperationSource(Client), _deploymentClientDiagnostics, Pipeline, _deploymentRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, deploymentName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}
+ ///
+ /// -
+ /// Operation Id
+ /// Deployments_CreateOrUpdate
+ ///
+ ///
+ ///
+ /// 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.
+ /// Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ /// 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 deploymentName, DeploymentData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _deploymentClientDiagnostics.CreateScope("DeploymentCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = _deploymentRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, deploymentName, data, cancellationToken);
+ var operation = new SphereArmOperation(new DeploymentOperationSource(Client), _deploymentClientDiagnostics, Pipeline, _deploymentRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, deploymentName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}
+ ///
+ /// -
+ /// Operation Id
+ /// Deployments_Get
+ ///
+ ///
+ ///
+ /// Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetAsync(string deploymentName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName));
+
+ using var scope = _deploymentClientDiagnostics.CreateScope("DeploymentCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = await _deploymentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, deploymentName, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new DeploymentResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}
+ ///
+ /// -
+ /// Operation Id
+ /// Deployments_Get
+ ///
+ ///
+ ///
+ /// Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Get(string deploymentName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName));
+
+ using var scope = _deploymentClientDiagnostics.CreateScope("DeploymentCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = _deploymentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, deploymentName, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new DeploymentResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments
+ ///
+ /// -
+ /// Operation Id
+ /// Deployments_ListByDeviceGroup
+ ///
+ ///
+ ///
+ /// Filter the result list using the given expression.
+ /// The number of result items to return.
+ /// The number of result items to skip.
+ /// The maximum number of result items per page.
+ /// The cancellation token to use.
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetAllAsync(string filter = null, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => _deploymentRestClient.CreateListByDeviceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, top, skip, pageSizeHint);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deploymentRestClient.CreateListByDeviceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, top, skip, pageSizeHint);
+ return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeploymentResource(Client, DeploymentData.DeserializeDeploymentData(e)), _deploymentClientDiagnostics, Pipeline, "DeploymentCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments
+ ///
+ /// -
+ /// Operation Id
+ /// Deployments_ListByDeviceGroup
+ ///
+ ///
+ ///
+ /// Filter the result list using the given expression.
+ /// The number of result items to return.
+ /// The number of result items to skip.
+ /// The maximum number of result items per page.
+ /// The cancellation token to use.
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetAll(string filter = null, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => _deploymentRestClient.CreateListByDeviceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, top, skip, pageSizeHint);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deploymentRestClient.CreateListByDeviceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, top, skip, pageSizeHint);
+ return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeploymentResource(Client, DeploymentData.DeserializeDeploymentData(e)), _deploymentClientDiagnostics, Pipeline, "DeploymentCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// Checks to see if the resource exists in azure.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}
+ ///
+ /// -
+ /// Operation Id
+ /// Deployments_Get
+ ///
+ ///
+ ///
+ /// Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> ExistsAsync(string deploymentName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName));
+
+ using var scope = _deploymentClientDiagnostics.CreateScope("DeploymentCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = await _deploymentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, deploymentName, 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.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}
+ ///
+ /// -
+ /// Operation Id
+ /// Deployments_Get
+ ///
+ ///
+ ///
+ /// Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Exists(string deploymentName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName));
+
+ using var scope = _deploymentClientDiagnostics.CreateScope("DeploymentCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = _deploymentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, deploymentName, cancellationToken: cancellationToken);
+ return Response.FromValue(response.Value != null, 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/sphere/Azure.ResourceManager.Sphere/src/Generated/DeploymentData.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/DeploymentData.cs
new file mode 100644
index 000000000000..4baba9da5167
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/DeploymentData.cs
@@ -0,0 +1,54 @@
+// 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.Models;
+using Azure.ResourceManager.Sphere.Models;
+
+namespace Azure.ResourceManager.Sphere
+{
+ ///
+ /// A class representing the Deployment data model.
+ /// An deployment resource belonging to a device group resource.
+ ///
+ public partial class DeploymentData : ResourceData
+ {
+ /// Initializes a new instance of DeploymentData.
+ public DeploymentData()
+ {
+ DeployedImages = new ChangeTrackingList();
+ }
+
+ /// Initializes a new instance of DeploymentData.
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// Deployment ID.
+ /// Images deployed.
+ /// Deployment date UTC.
+ /// The status of the last operation.
+ internal DeploymentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string deploymentId, IList deployedImages, DateTimeOffset? deploymentDateUtc, ProvisioningState? provisioningState) : base(id, name, resourceType, systemData)
+ {
+ DeploymentId = deploymentId;
+ DeployedImages = deployedImages;
+ DeploymentDateUtc = deploymentDateUtc;
+ ProvisioningState = provisioningState;
+ }
+
+ /// Deployment ID.
+ public string DeploymentId { get; set; }
+ /// Images deployed.
+ public IList DeployedImages { get; }
+ /// Deployment date UTC.
+ public DateTimeOffset? DeploymentDateUtc { get; }
+ /// The status of the last operation.
+ public ProvisioningState? ProvisioningState { get; }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/DeploymentResource.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/DeploymentResource.cs
new file mode 100644
index 000000000000..23ef35e7d50a
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/DeploymentResource.cs
@@ -0,0 +1,297 @@
+// 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;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager;
+
+namespace Azure.ResourceManager.Sphere
+{
+ ///
+ /// A Class representing a Deployment 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 GetDeploymentResource method.
+ /// Otherwise you can get one from its parent resource using the GetDeployment method.
+ ///
+ public partial class DeploymentResource : ArmResource
+ {
+ /// Generate the resource identifier of a instance.
+ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string catalogName, string productName, string deviceGroupName, string deploymentName)
+ {
+ var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}";
+ return new ResourceIdentifier(resourceId);
+ }
+
+ private readonly ClientDiagnostics _deploymentClientDiagnostics;
+ private readonly DeploymentsRestOperations _deploymentRestClient;
+ private readonly DeploymentData _data;
+
+ /// Initializes a new instance of the class for mocking.
+ protected DeploymentResource()
+ {
+ }
+
+ /// Initializes a new instance of the class.
+ /// The client parameters to use in these operations.
+ /// The resource that is the target of operations.
+ internal DeploymentResource(ArmClient client, DeploymentData 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 DeploymentResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _deploymentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sphere", ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(ResourceType, out string deploymentApiVersion);
+ _deploymentRestClient = new DeploymentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deploymentApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ /// Gets the resource type for the operations.
+ public static readonly ResourceType ResourceType = "Microsoft.AzureSphere/catalogs/products/deviceGroups/deployments";
+
+ /// 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 DeploymentData 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 Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}
+ ///
+ /// -
+ /// Operation Id
+ /// Deployments_Get
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
+ {
+ using var scope = _deploymentClientDiagnostics.CreateScope("DeploymentResource.Get");
+ scope.Start();
+ try
+ {
+ var response = await _deploymentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new DeploymentResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}
+ ///
+ /// -
+ /// Operation Id
+ /// Deployments_Get
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual Response Get(CancellationToken cancellationToken = default)
+ {
+ using var scope = _deploymentClientDiagnostics.CreateScope("DeploymentResource.Get");
+ scope.Start();
+ try
+ {
+ var response = _deploymentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new DeploymentResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}
+ ///
+ /// -
+ /// Operation Id
+ /// Deployments_Delete
+ ///
+ ///
+ ///
+ /// 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 = _deploymentClientDiagnostics.CreateScope("DeploymentResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = await _deploymentRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ var operation = new SphereArmOperation(_deploymentClientDiagnostics, Pipeline, _deploymentRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}
+ ///
+ /// -
+ /// Operation Id
+ /// Deployments_Delete
+ ///
+ ///
+ ///
+ /// 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 = _deploymentClientDiagnostics.CreateScope("DeploymentResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = _deploymentRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken);
+ var operation = new SphereArmOperation(_deploymentClientDiagnostics, Pipeline, _deploymentRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletionResponse(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}
+ ///
+ /// -
+ /// Operation Id
+ /// Deployments_CreateOrUpdate
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task> UpdateAsync(WaitUntil waitUntil, DeploymentData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _deploymentClientDiagnostics.CreateScope("DeploymentResource.Update");
+ scope.Start();
+ try
+ {
+ var response = await _deploymentRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false);
+ var operation = new SphereArmOperation(new DeploymentOperationSource(Client), _deploymentClientDiagnostics, Pipeline, _deploymentRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}
+ ///
+ /// -
+ /// Operation Id
+ /// Deployments_CreateOrUpdate
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual ArmOperation Update(WaitUntil waitUntil, DeploymentData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _deploymentClientDiagnostics.CreateScope("DeploymentResource.Update");
+ scope.Start();
+ try
+ {
+ var response = _deploymentRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken);
+ var operation = new SphereArmOperation(new DeploymentOperationSource(Client), _deploymentClientDiagnostics, Pipeline, _deploymentRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/DeviceCollection.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/DeviceCollection.cs
new file mode 100644
index 000000000000..f1de477a3f74
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/DeviceCollection.cs
@@ -0,0 +1,340 @@
+// 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 Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager;
+
+namespace Azure.ResourceManager.Sphere
+{
+ ///
+ /// 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 GetDevices method from an instance of .
+ ///
+ public partial class DeviceCollection : ArmCollection, IEnumerable, IAsyncEnumerable
+ {
+ private readonly ClientDiagnostics _deviceClientDiagnostics;
+ private readonly DevicesRestOperations _deviceRestClient;
+
+ /// Initializes a new instance of the class for mocking.
+ protected DeviceCollection()
+ {
+ }
+
+ /// 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 DeviceCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _deviceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sphere", DeviceResource.ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(DeviceResource.ResourceType, out string deviceApiVersion);
+ _deviceRestClient = new DevicesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != DeviceGroupResource.ResourceType)
+ throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DeviceGroupResource.ResourceType), nameof(id));
+ }
+
+ ///
+ /// Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the catalog only.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}
+ ///
+ /// -
+ /// Operation Id
+ /// Devices_CreateOrUpdate
+ ///
+ ///
+ ///
+ /// 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.
+ /// Device name.
+ /// 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 deviceName, DeviceData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(deviceName, nameof(deviceName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _deviceClientDiagnostics.CreateScope("DeviceCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = await _deviceRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, deviceName, data, cancellationToken).ConfigureAwait(false);
+ var operation = new SphereArmOperation(new DeviceOperationSource(Client), _deviceClientDiagnostics, Pipeline, _deviceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, deviceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the catalog only.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}
+ ///
+ /// -
+ /// Operation Id
+ /// Devices_CreateOrUpdate
+ ///
+ ///
+ ///
+ /// 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.
+ /// Device name.
+ /// 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 deviceName, DeviceData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(deviceName, nameof(deviceName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _deviceClientDiagnostics.CreateScope("DeviceCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = _deviceRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, deviceName, data, cancellationToken);
+ var operation = new SphereArmOperation(new DeviceOperationSource(Client), _deviceClientDiagnostics, Pipeline, _deviceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, deviceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not belong to a device group and product.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}
+ ///
+ /// -
+ /// Operation Id
+ /// Devices_Get
+ ///
+ ///
+ ///
+ /// Device name.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetAsync(string deviceName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(deviceName, nameof(deviceName));
+
+ using var scope = _deviceClientDiagnostics.CreateScope("DeviceCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = await _deviceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, deviceName, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new DeviceResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not belong to a device group and product.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}
+ ///
+ /// -
+ /// Operation Id
+ /// Devices_Get
+ ///
+ ///
+ ///
+ /// Device name.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Get(string deviceName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(deviceName, nameof(deviceName));
+
+ using var scope = _deviceClientDiagnostics.CreateScope("DeviceCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = _deviceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, deviceName, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new DeviceResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices
+ ///
+ /// -
+ /// Operation Id
+ /// Devices_ListByDeviceGroup
+ ///
+ ///
+ ///
+ /// 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) => _deviceRestClient.CreateListByDeviceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRestClient.CreateListByDeviceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name);
+ return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceResource(Client, DeviceData.DeserializeDeviceData(e)), _deviceClientDiagnostics, Pipeline, "DeviceCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices
+ ///
+ /// -
+ /// Operation Id
+ /// Devices_ListByDeviceGroup
+ ///
+ ///
+ ///
+ /// 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) => _deviceRestClient.CreateListByDeviceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRestClient.CreateListByDeviceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name);
+ return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceResource(Client, DeviceData.DeserializeDeviceData(e)), _deviceClientDiagnostics, Pipeline, "DeviceCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// Checks to see if the resource exists in azure.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}
+ ///
+ /// -
+ /// Operation Id
+ /// Devices_Get
+ ///
+ ///
+ ///
+ /// Device name.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> ExistsAsync(string deviceName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(deviceName, nameof(deviceName));
+
+ using var scope = _deviceClientDiagnostics.CreateScope("DeviceCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = await _deviceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, deviceName, 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.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}
+ ///
+ /// -
+ /// Operation Id
+ /// Devices_Get
+ ///
+ ///
+ ///
+ /// Device name.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Exists(string deviceName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(deviceName, nameof(deviceName));
+
+ using var scope = _deviceClientDiagnostics.CreateScope("DeviceCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = _deviceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, deviceName, cancellationToken: cancellationToken);
+ return Response.FromValue(response.Value != null, 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/sphere/Azure.ResourceManager.Sphere/src/Generated/DeviceData.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/DeviceData.cs
new file mode 100644
index 000000000000..3002e5268f4d
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/DeviceData.cs
@@ -0,0 +1,64 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using Azure.Core;
+using Azure.ResourceManager.Models;
+using Azure.ResourceManager.Sphere.Models;
+
+namespace Azure.ResourceManager.Sphere
+{
+ ///
+ /// A class representing the Device data model.
+ /// An device resource belonging to a device group resource.
+ ///
+ public partial class DeviceData : ResourceData
+ {
+ /// Initializes a new instance of DeviceData.
+ public DeviceData()
+ {
+ }
+
+ /// Initializes a new instance of DeviceData.
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// Device ID.
+ /// SKU of the chip.
+ /// OS version available for installation when update requested.
+ /// OS version running on device when update requested.
+ /// Time when update requested and new OS version available.
+ /// Time when update was last requested.
+ /// The status of the last operation.
+ internal DeviceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string deviceId, string chipSku, string lastAvailableOSVersion, string lastInstalledOSVersion, DateTimeOffset? lastOSUpdateUtc, DateTimeOffset? lastUpdateRequestUtc, ProvisioningState? provisioningState) : base(id, name, resourceType, systemData)
+ {
+ DeviceId = deviceId;
+ ChipSku = chipSku;
+ LastAvailableOSVersion = lastAvailableOSVersion;
+ LastInstalledOSVersion = lastInstalledOSVersion;
+ LastOSUpdateUtc = lastOSUpdateUtc;
+ LastUpdateRequestUtc = lastUpdateRequestUtc;
+ ProvisioningState = provisioningState;
+ }
+
+ /// Device ID.
+ public string DeviceId { get; set; }
+ /// SKU of the chip.
+ public string ChipSku { get; }
+ /// OS version available for installation when update requested.
+ public string LastAvailableOSVersion { get; }
+ /// OS version running on device when update requested.
+ public string LastInstalledOSVersion { get; }
+ /// Time when update requested and new OS version available.
+ public DateTimeOffset? LastOSUpdateUtc { get; }
+ /// Time when update was last requested.
+ public DateTimeOffset? LastUpdateRequestUtc { get; }
+ /// The status of the last operation.
+ public ProvisioningState? ProvisioningState { get; }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/DeviceGroupCollection.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/DeviceGroupCollection.cs
new file mode 100644
index 000000000000..3f75c5264d5d
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/DeviceGroupCollection.cs
@@ -0,0 +1,348 @@
+// 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 Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager;
+
+namespace Azure.ResourceManager.Sphere
+{
+ ///
+ /// 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 GetDeviceGroups method from an instance of .
+ ///
+ public partial class DeviceGroupCollection : ArmCollection, IEnumerable, IAsyncEnumerable
+ {
+ private readonly ClientDiagnostics _deviceGroupClientDiagnostics;
+ private readonly DeviceGroupsRestOperations _deviceGroupRestClient;
+
+ /// Initializes a new instance of the class for mocking.
+ protected DeviceGroupCollection()
+ {
+ }
+
+ /// 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 DeviceGroupCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _deviceGroupClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sphere", DeviceGroupResource.ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(DeviceGroupResource.ResourceType, out string deviceGroupApiVersion);
+ _deviceGroupRestClient = new DeviceGroupsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceGroupApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != ProductResource.ResourceType)
+ throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ProductResource.ResourceType), nameof(id));
+ }
+
+ ///
+ /// Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}
+ ///
+ /// -
+ /// Operation Id
+ /// DeviceGroups_CreateOrUpdate
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// Name of device group.
+ /// 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 deviceGroupName, DeviceGroupData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(deviceGroupName, nameof(deviceGroupName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _deviceGroupClientDiagnostics.CreateScope("DeviceGroupCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = await _deviceGroupRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deviceGroupName, data, cancellationToken).ConfigureAwait(false);
+ var operation = new SphereArmOperation(new DeviceGroupOperationSource(Client), _deviceGroupClientDiagnostics, Pipeline, _deviceGroupRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deviceGroupName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}
+ ///
+ /// -
+ /// Operation Id
+ /// DeviceGroups_CreateOrUpdate
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// Name of device group.
+ /// 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 deviceGroupName, DeviceGroupData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(deviceGroupName, nameof(deviceGroupName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _deviceGroupClientDiagnostics.CreateScope("DeviceGroupCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = _deviceGroupRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deviceGroupName, data, cancellationToken);
+ var operation = new SphereArmOperation(new DeviceGroupOperationSource(Client), _deviceGroupClientDiagnostics, Pipeline, _deviceGroupRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deviceGroupName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}
+ ///
+ /// -
+ /// Operation Id
+ /// DeviceGroups_Get
+ ///
+ ///
+ ///
+ /// Name of device group.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetAsync(string deviceGroupName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(deviceGroupName, nameof(deviceGroupName));
+
+ using var scope = _deviceGroupClientDiagnostics.CreateScope("DeviceGroupCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = await _deviceGroupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deviceGroupName, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new DeviceGroupResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}
+ ///
+ /// -
+ /// Operation Id
+ /// DeviceGroups_Get
+ ///
+ ///
+ ///
+ /// Name of device group.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Get(string deviceGroupName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(deviceGroupName, nameof(deviceGroupName));
+
+ using var scope = _deviceGroupClientDiagnostics.CreateScope("DeviceGroupCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = _deviceGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deviceGroupName, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new DeviceGroupResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used for product name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups
+ ///
+ /// -
+ /// Operation Id
+ /// DeviceGroups_ListByProduct
+ ///
+ ///
+ ///
+ /// Filter the result list using the given expression.
+ /// The number of result items to return.
+ /// The number of result items to skip.
+ /// The maximum number of result items per page.
+ /// The cancellation token to use.
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetAllAsync(string filter = null, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceGroupRestClient.CreateListByProductRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, filter, top, skip, pageSizeHint);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceGroupRestClient.CreateListByProductNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, filter, top, skip, pageSizeHint);
+ return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceGroupResource(Client, DeviceGroupData.DeserializeDeviceGroupData(e)), _deviceGroupClientDiagnostics, Pipeline, "DeviceGroupCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used for product name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups
+ ///
+ /// -
+ /// Operation Id
+ /// DeviceGroups_ListByProduct
+ ///
+ ///
+ ///
+ /// Filter the result list using the given expression.
+ /// The number of result items to return.
+ /// The number of result items to skip.
+ /// The maximum number of result items per page.
+ /// The cancellation token to use.
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetAll(string filter = null, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceGroupRestClient.CreateListByProductRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, filter, top, skip, pageSizeHint);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceGroupRestClient.CreateListByProductNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, filter, top, skip, pageSizeHint);
+ return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceGroupResource(Client, DeviceGroupData.DeserializeDeviceGroupData(e)), _deviceGroupClientDiagnostics, Pipeline, "DeviceGroupCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// Checks to see if the resource exists in azure.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}
+ ///
+ /// -
+ /// Operation Id
+ /// DeviceGroups_Get
+ ///
+ ///
+ ///
+ /// Name of device group.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> ExistsAsync(string deviceGroupName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(deviceGroupName, nameof(deviceGroupName));
+
+ using var scope = _deviceGroupClientDiagnostics.CreateScope("DeviceGroupCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = await _deviceGroupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deviceGroupName, 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.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}
+ ///
+ /// -
+ /// Operation Id
+ /// DeviceGroups_Get
+ ///
+ ///
+ ///
+ /// Name of device group.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Exists(string deviceGroupName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(deviceGroupName, nameof(deviceGroupName));
+
+ using var scope = _deviceGroupClientDiagnostics.CreateScope("DeviceGroupCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = _deviceGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deviceGroupName, cancellationToken: cancellationToken);
+ return Response.FromValue(response.Value != null, 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/sphere/Azure.ResourceManager.Sphere/src/Generated/DeviceGroupData.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/DeviceGroupData.cs
new file mode 100644
index 000000000000..9a1c93801160
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/DeviceGroupData.cs
@@ -0,0 +1,63 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using Azure.Core;
+using Azure.ResourceManager.Models;
+using Azure.ResourceManager.Sphere.Models;
+
+namespace Azure.ResourceManager.Sphere
+{
+ ///
+ /// A class representing the DeviceGroup data model.
+ /// An device group resource belonging to a product resource.
+ ///
+ public partial class DeviceGroupData : ResourceData
+ {
+ /// Initializes a new instance of DeviceGroupData.
+ public DeviceGroupData()
+ {
+ }
+
+ /// Initializes a new instance of DeviceGroupData.
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// Description of the device group.
+ /// Operating system feed type of the device group.
+ /// Update policy of the device group.
+ /// Flag to define if the user allows for crash dump collection.
+ /// Regional data boundary for the device group.
+ /// Deployment status for the device group.
+ /// The status of the last operation.
+ internal DeviceGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string description, OSFeedType? osFeedType, UpdatePolicy? updatePolicy, AllowCrashDumpCollection? allowCrashDumpsCollection, RegionalDataBoundary? regionalDataBoundary, bool? hasDeployment, ProvisioningState? provisioningState) : base(id, name, resourceType, systemData)
+ {
+ Description = description;
+ OSFeedType = osFeedType;
+ UpdatePolicy = updatePolicy;
+ AllowCrashDumpsCollection = allowCrashDumpsCollection;
+ RegionalDataBoundary = regionalDataBoundary;
+ HasDeployment = hasDeployment;
+ ProvisioningState = provisioningState;
+ }
+
+ /// Description of the device group.
+ public string Description { get; set; }
+ /// Operating system feed type of the device group.
+ public OSFeedType? OSFeedType { get; set; }
+ /// Update policy of the device group.
+ public UpdatePolicy? UpdatePolicy { get; set; }
+ /// Flag to define if the user allows for crash dump collection.
+ public AllowCrashDumpCollection? AllowCrashDumpsCollection { get; set; }
+ /// Regional data boundary for the device group.
+ public RegionalDataBoundary? RegionalDataBoundary { get; set; }
+ /// Deployment status for the device group.
+ public bool? HasDeployment { get; }
+ /// The status of the last operation.
+ public ProvisioningState? ProvisioningState { get; }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/DeviceGroupResource.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/DeviceGroupResource.cs
new file mode 100644
index 000000000000..8a52e3fa161c
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/DeviceGroupResource.cs
@@ -0,0 +1,540 @@
+// 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;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager;
+using Azure.ResourceManager.Sphere.Models;
+
+namespace Azure.ResourceManager.Sphere
+{
+ ///
+ /// A Class representing a DeviceGroup 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 GetDeviceGroupResource method.
+ /// Otherwise you can get one from its parent resource using the GetDeviceGroup method.
+ ///
+ public partial class DeviceGroupResource : ArmResource
+ {
+ /// Generate the resource identifier of a instance.
+ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string catalogName, string productName, string deviceGroupName)
+ {
+ var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}";
+ return new ResourceIdentifier(resourceId);
+ }
+
+ private readonly ClientDiagnostics _deviceGroupClientDiagnostics;
+ private readonly DeviceGroupsRestOperations _deviceGroupRestClient;
+ private readonly DeviceGroupData _data;
+
+ /// Initializes a new instance of the class for mocking.
+ protected DeviceGroupResource()
+ {
+ }
+
+ /// Initializes a new instance of the class.
+ /// The client parameters to use in these operations.
+ /// The resource that is the target of operations.
+ internal DeviceGroupResource(ArmClient client, DeviceGroupData 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 DeviceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _deviceGroupClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sphere", ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(ResourceType, out string deviceGroupApiVersion);
+ _deviceGroupRestClient = new DeviceGroupsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceGroupApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ /// Gets the resource type for the operations.
+ public static readonly ResourceType ResourceType = "Microsoft.AzureSphere/catalogs/products/deviceGroups";
+
+ /// 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 DeviceGroupData 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 DeploymentResources in the DeviceGroup.
+ /// An object representing collection of DeploymentResources and their operations over a DeploymentResource.
+ public virtual DeploymentCollection GetDeployments()
+ {
+ return GetCachedClient(Client => new DeploymentCollection(Client, Id));
+ }
+
+ ///
+ /// Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}
+ ///
+ /// -
+ /// Operation Id
+ /// Deployments_Get
+ ///
+ ///
+ ///
+ /// Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ [ForwardsClientCalls]
+ public virtual async Task> GetDeploymentAsync(string deploymentName, CancellationToken cancellationToken = default)
+ {
+ return await GetDeployments().GetAsync(deploymentName, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}
+ ///
+ /// -
+ /// Operation Id
+ /// Deployments_Get
+ ///
+ ///
+ ///
+ /// Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ [ForwardsClientCalls]
+ public virtual Response GetDeployment(string deploymentName, CancellationToken cancellationToken = default)
+ {
+ return GetDeployments().Get(deploymentName, cancellationToken);
+ }
+
+ /// Gets a collection of DeviceResources in the DeviceGroup.
+ /// An object representing collection of DeviceResources and their operations over a DeviceResource.
+ public virtual DeviceCollection GetDevices()
+ {
+ return GetCachedClient(Client => new DeviceCollection(Client, Id));
+ }
+
+ ///
+ /// Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not belong to a device group and product.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}
+ ///
+ /// -
+ /// Operation Id
+ /// Devices_Get
+ ///
+ ///
+ ///
+ /// Device name.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ [ForwardsClientCalls]
+ public virtual async Task> GetDeviceAsync(string deviceName, CancellationToken cancellationToken = default)
+ {
+ return await GetDevices().GetAsync(deviceName, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not belong to a device group and product.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}
+ ///
+ /// -
+ /// Operation Id
+ /// Devices_Get
+ ///
+ ///
+ ///
+ /// Device name.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ [ForwardsClientCalls]
+ public virtual Response GetDevice(string deviceName, CancellationToken cancellationToken = default)
+ {
+ return GetDevices().Get(deviceName, cancellationToken);
+ }
+
+ ///
+ /// Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}
+ ///
+ /// -
+ /// Operation Id
+ /// DeviceGroups_Get
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
+ {
+ using var scope = _deviceGroupClientDiagnostics.CreateScope("DeviceGroupResource.Get");
+ scope.Start();
+ try
+ {
+ var response = await _deviceGroupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new DeviceGroupResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}
+ ///
+ /// -
+ /// Operation Id
+ /// DeviceGroups_Get
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual Response Get(CancellationToken cancellationToken = default)
+ {
+ using var scope = _deviceGroupClientDiagnostics.CreateScope("DeviceGroupResource.Get");
+ scope.Start();
+ try
+ {
+ var response = _deviceGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new DeviceGroupResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}
+ ///
+ /// -
+ /// Operation Id
+ /// DeviceGroups_Delete
+ ///
+ ///
+ ///
+ /// 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 = _deviceGroupClientDiagnostics.CreateScope("DeviceGroupResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = await _deviceGroupRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ var operation = new SphereArmOperation(_deviceGroupClientDiagnostics, Pipeline, _deviceGroupRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}
+ ///
+ /// -
+ /// Operation Id
+ /// DeviceGroups_Delete
+ ///
+ ///
+ ///
+ /// 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 = _deviceGroupClientDiagnostics.CreateScope("DeviceGroupResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = _deviceGroupRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken);
+ var operation = new SphereArmOperation(_deviceGroupClientDiagnostics, Pipeline, _deviceGroupRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletionResponse(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}
+ ///
+ /// -
+ /// Operation Id
+ /// DeviceGroups_Update
+ ///
+ ///
+ ///
+ /// 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, DeviceGroupPatch patch, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(patch, nameof(patch));
+
+ using var scope = _deviceGroupClientDiagnostics.CreateScope("DeviceGroupResource.Update");
+ scope.Start();
+ try
+ {
+ var response = await _deviceGroupRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false);
+ var operation = new SphereArmOperation(new DeviceGroupOperationSource(Client), _deviceGroupClientDiagnostics, Pipeline, _deviceGroupRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}
+ ///
+ /// -
+ /// Operation Id
+ /// DeviceGroups_Update
+ ///
+ ///
+ ///
+ /// 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, DeviceGroupPatch patch, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(patch, nameof(patch));
+
+ using var scope = _deviceGroupClientDiagnostics.CreateScope("DeviceGroupResource.Update");
+ scope.Start();
+ try
+ {
+ var response = _deviceGroupRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken);
+ var operation = new SphereArmOperation(new DeviceGroupOperationSource(Client), _deviceGroupClientDiagnostics, Pipeline, _deviceGroupRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk claiming devices to a catalog only.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/claimDevices
+ ///
+ /// -
+ /// Operation Id
+ /// DeviceGroups_ClaimDevices
+ ///
+ ///
+ ///
+ /// 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.
+ /// Bulk claim devices request body.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task ClaimDevicesAsync(WaitUntil waitUntil, ClaimDevicesContent content, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = _deviceGroupClientDiagnostics.CreateScope("DeviceGroupResource.ClaimDevices");
+ scope.Start();
+ try
+ {
+ var response = await _deviceGroupRestClient.ClaimDevicesAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false);
+ var operation = new SphereArmOperation(_deviceGroupClientDiagnostics, Pipeline, _deviceGroupRestClient.CreateClaimDevicesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk claiming devices to a catalog only.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/claimDevices
+ ///
+ /// -
+ /// Operation Id
+ /// DeviceGroups_ClaimDevices
+ ///
+ ///
+ ///
+ /// 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.
+ /// Bulk claim devices request body.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual ArmOperation ClaimDevices(WaitUntil waitUntil, ClaimDevicesContent content, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = _deviceGroupClientDiagnostics.CreateScope("DeviceGroupResource.ClaimDevices");
+ scope.Start();
+ try
+ {
+ var response = _deviceGroupRestClient.ClaimDevices(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken);
+ var operation = new SphereArmOperation(_deviceGroupClientDiagnostics, Pipeline, _deviceGroupRestClient.CreateClaimDevicesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletionResponse(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/countDevices
+ ///
+ /// -
+ /// Operation Id
+ /// DeviceGroups_CountDevices
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual async Task> CountDevicesAsync(CancellationToken cancellationToken = default)
+ {
+ using var scope = _deviceGroupClientDiagnostics.CreateScope("DeviceGroupResource.CountDevices");
+ scope.Start();
+ try
+ {
+ var response = await _deviceGroupRestClient.CountDevicesAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ return response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/countDevices
+ ///
+ /// -
+ /// Operation Id
+ /// DeviceGroups_CountDevices
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual Response CountDevices(CancellationToken cancellationToken = default)
+ {
+ using var scope = _deviceGroupClientDiagnostics.CreateScope("DeviceGroupResource.CountDevices");
+ scope.Start();
+ try
+ {
+ var response = _deviceGroupRestClient.CountDevices(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken);
+ return response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/DeviceResource.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/DeviceResource.cs
new file mode 100644
index 000000000000..fb18f0ac4630
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/DeviceResource.cs
@@ -0,0 +1,374 @@
+// 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;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager;
+using Azure.ResourceManager.Sphere.Models;
+
+namespace Azure.ResourceManager.Sphere
+{
+ ///
+ /// A Class representing a Device 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 GetDeviceResource method.
+ /// Otherwise you can get one from its parent resource using the GetDevice method.
+ ///
+ public partial class DeviceResource : ArmResource
+ {
+ /// Generate the resource identifier of a instance.
+ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string catalogName, string productName, string deviceGroupName, string deviceName)
+ {
+ var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}";
+ return new ResourceIdentifier(resourceId);
+ }
+
+ private readonly ClientDiagnostics _deviceClientDiagnostics;
+ private readonly DevicesRestOperations _deviceRestClient;
+ private readonly DeviceData _data;
+
+ /// Initializes a new instance of the class for mocking.
+ protected DeviceResource()
+ {
+ }
+
+ /// Initializes a new instance of the class.
+ /// The client parameters to use in these operations.
+ /// The resource that is the target of operations.
+ internal DeviceResource(ArmClient client, DeviceData 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 DeviceResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _deviceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sphere", ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(ResourceType, out string deviceApiVersion);
+ _deviceRestClient = new DevicesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ /// Gets the resource type for the operations.
+ public static readonly ResourceType ResourceType = "Microsoft.AzureSphere/catalogs/products/deviceGroups/devices";
+
+ /// 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 DeviceData 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 Device. Use '.unassigned' or '.default' for the device group and product names when a device does not belong to a device group and product.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}
+ ///
+ /// -
+ /// Operation Id
+ /// Devices_Get
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
+ {
+ using var scope = _deviceClientDiagnostics.CreateScope("DeviceResource.Get");
+ scope.Start();
+ try
+ {
+ var response = await _deviceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new DeviceResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not belong to a device group and product.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}
+ ///
+ /// -
+ /// Operation Id
+ /// Devices_Get
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual Response Get(CancellationToken cancellationToken = default)
+ {
+ using var scope = _deviceClientDiagnostics.CreateScope("DeviceResource.Get");
+ scope.Start();
+ try
+ {
+ var response = _deviceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new DeviceResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a Device
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}
+ ///
+ /// -
+ /// Operation Id
+ /// Devices_Delete
+ ///
+ ///
+ ///
+ /// 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 = _deviceClientDiagnostics.CreateScope("DeviceResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = await _deviceRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ var operation = new SphereArmOperation(_deviceClientDiagnostics, Pipeline, _deviceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a Device
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}
+ ///
+ /// -
+ /// Operation Id
+ /// Devices_Delete
+ ///
+ ///
+ ///
+ /// 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 = _deviceClientDiagnostics.CreateScope("DeviceResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = _deviceRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken);
+ var operation = new SphereArmOperation(_deviceClientDiagnostics, Pipeline, _deviceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletionResponse(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the catalog level.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}
+ ///
+ /// -
+ /// Operation Id
+ /// Devices_Update
+ ///
+ ///
+ ///
+ /// 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, DevicePatch patch, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(patch, nameof(patch));
+
+ using var scope = _deviceClientDiagnostics.CreateScope("DeviceResource.Update");
+ scope.Start();
+ try
+ {
+ var response = await _deviceRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false);
+ var operation = new SphereArmOperation(new DeviceOperationSource(Client), _deviceClientDiagnostics, Pipeline, _deviceRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, 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 Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the catalog level.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}
+ ///
+ /// -
+ /// Operation Id
+ /// Devices_Update
+ ///
+ ///
+ ///
+ /// 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, DevicePatch patch, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(patch, nameof(patch));
+
+ using var scope = _deviceClientDiagnostics.CreateScope("DeviceResource.Update");
+ scope.Start();
+ try
+ {
+ var response = _deviceRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken);
+ var operation = new SphereArmOperation(new DeviceOperationSource(Client), _deviceClientDiagnostics, Pipeline, _deviceRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, 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;
+ }
+ }
+
+ ///
+ /// Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product names to generate the image for a device that does not belong to a specific device group and product.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}/generateCapabilityImage
+ ///
+ /// -
+ /// Operation Id
+ /// Devices_GenerateCapabilityImage
+ ///
+ ///
+ ///
+ /// 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.
+ /// Generate capability image request body.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task> GenerateCapabilityImageAsync(WaitUntil waitUntil, GenerateCapabilityImageContent content, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = _deviceClientDiagnostics.CreateScope("DeviceResource.GenerateCapabilityImage");
+ scope.Start();
+ try
+ {
+ var response = await _deviceRestClient.GenerateCapabilityImageAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false);
+ var operation = new SphereArmOperation(new SignedCapabilityImageResponseOperationSource(), _deviceClientDiagnostics, Pipeline, _deviceRestClient.CreateGenerateCapabilityImageRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product names to generate the image for a device that does not belong to a specific device group and product.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}/generateCapabilityImage
+ ///
+ /// -
+ /// Operation Id
+ /// Devices_GenerateCapabilityImage
+ ///
+ ///
+ ///
+ /// 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.
+ /// Generate capability image request body.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual ArmOperation GenerateCapabilityImage(WaitUntil waitUntil, GenerateCapabilityImageContent content, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = _deviceClientDiagnostics.CreateScope("DeviceResource.GenerateCapabilityImage");
+ scope.Start();
+ try
+ {
+ var response = _deviceRestClient.GenerateCapabilityImage(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken);
+ var operation = new SphereArmOperation(new SignedCapabilityImageResponseOperationSource(), _deviceClientDiagnostics, Pipeline, _deviceRestClient.CreateGenerateCapabilityImageRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs
new file mode 100644
index 000000000000..7d681f9f3e5b
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using Azure.Core;
+using Azure.ResourceManager;
+
+namespace Azure.ResourceManager.Sphere
+{
+ /// A class to add extension methods to ResourceGroupResource.
+ internal partial class ResourceGroupResourceExtensionClient : ArmResource
+ {
+ /// Initializes a new instance of the class for mocking.
+ protected ResourceGroupResourceExtensionClient()
+ {
+ }
+
+ /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ }
+
+ private string GetApiVersionOrNull(ResourceType resourceType)
+ {
+ TryGetApiVersion(resourceType, out string apiVersion);
+ return apiVersion;
+ }
+
+ /// Gets a collection of CatalogResources in the ResourceGroupResource.
+ /// An object representing collection of CatalogResources and their operations over a CatalogResource.
+ public virtual CatalogCollection GetCatalogs()
+ {
+ return GetCachedClient(Client => new CatalogCollection(Client, Id));
+ }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/SphereExtensions.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/SphereExtensions.cs
new file mode 100644
index 000000000000..ba28fe71b28f
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/SphereExtensions.cs
@@ -0,0 +1,283 @@
+// 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;
+using Azure.Core;
+using Azure.ResourceManager;
+using Azure.ResourceManager.Resources;
+
+namespace Azure.ResourceManager.Sphere
+{
+ /// A class to add extension methods to Azure.ResourceManager.Sphere.
+ public static partial class SphereExtensions
+ {
+ private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource)
+ {
+ return resource.GetCachedClient(client =>
+ {
+ return new ResourceGroupResourceExtensionClient(client, resource.Id);
+ });
+ }
+
+ private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope)
+ {
+ return client.GetResourceClient(() =>
+ {
+ return new ResourceGroupResourceExtensionClient(client, scope);
+ });
+ }
+
+ private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource)
+ {
+ return resource.GetCachedClient(client =>
+ {
+ return new SubscriptionResourceExtensionClient(client, resource.Id);
+ });
+ }
+
+ private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope)
+ {
+ return client.GetResourceClient(() =>
+ {
+ return new SubscriptionResourceExtensionClient(client, scope);
+ });
+ }
+ #region CatalogResource
+ ///
+ /// 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 instance the method will execute against.
+ /// The resource ID of the resource to get.
+ /// Returns a object.
+ public static CatalogResource GetCatalogResource(this ArmClient client, ResourceIdentifier id)
+ {
+ return client.GetResourceClient(() =>
+ {
+ CatalogResource.ValidateResourceId(id);
+ return new CatalogResource(client, id);
+ }
+ );
+ }
+ #endregion
+
+ #region CertificateResource
+ ///
+ /// 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 instance the method will execute against.
+ /// The resource ID of the resource to get.
+ /// Returns a object.
+ public static CertificateResource GetCertificateResource(this ArmClient client, ResourceIdentifier id)
+ {
+ return client.GetResourceClient(() =>
+ {
+ CertificateResource.ValidateResourceId(id);
+ return new CertificateResource(client, id);
+ }
+ );
+ }
+ #endregion
+
+ #region ImageResource
+ ///
+ /// Gets an object representing an along with the instance operations that can be performed on it but with no data.
+ /// You can use to create an from its components.
+ ///
+ /// The instance the method will execute against.
+ /// The resource ID of the resource to get.
+ /// Returns a object.
+ public static ImageResource GetImageResource(this ArmClient client, ResourceIdentifier id)
+ {
+ return client.GetResourceClient(() =>
+ {
+ ImageResource.ValidateResourceId(id);
+ return new ImageResource(client, id);
+ }
+ );
+ }
+ #endregion
+
+ #region ProductResource
+ ///
+ /// 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 instance the method will execute against.
+ /// The resource ID of the resource to get.
+ /// Returns a object.
+ public static ProductResource GetProductResource(this ArmClient client, ResourceIdentifier id)
+ {
+ return client.GetResourceClient(() =>
+ {
+ ProductResource.ValidateResourceId(id);
+ return new ProductResource(client, id);
+ }
+ );
+ }
+ #endregion
+
+ #region DeviceGroupResource
+ ///
+ /// 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 instance the method will execute against.
+ /// The resource ID of the resource to get.
+ /// Returns a object.
+ public static DeviceGroupResource GetDeviceGroupResource(this ArmClient client, ResourceIdentifier id)
+ {
+ return client.GetResourceClient(() =>
+ {
+ DeviceGroupResource.ValidateResourceId(id);
+ return new DeviceGroupResource(client, id);
+ }
+ );
+ }
+ #endregion
+
+ #region DeploymentResource
+ ///
+ /// 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 instance the method will execute against.
+ /// The resource ID of the resource to get.
+ /// Returns a object.
+ public static DeploymentResource GetDeploymentResource(this ArmClient client, ResourceIdentifier id)
+ {
+ return client.GetResourceClient(() =>
+ {
+ DeploymentResource.ValidateResourceId(id);
+ return new DeploymentResource(client, id);
+ }
+ );
+ }
+ #endregion
+
+ #region DeviceResource
+ ///
+ /// 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 instance the method will execute against.
+ /// The resource ID of the resource to get.
+ /// Returns a object.
+ public static DeviceResource GetDeviceResource(this ArmClient client, ResourceIdentifier id)
+ {
+ return client.GetResourceClient(() =>
+ {
+ DeviceResource.ValidateResourceId(id);
+ return new DeviceResource(client, id);
+ }
+ );
+ }
+ #endregion
+
+ /// Gets a collection of CatalogResources in the ResourceGroupResource.
+ /// The instance the method will execute against.
+ /// An object representing collection of CatalogResources and their operations over a CatalogResource.
+ public static CatalogCollection GetCatalogs(this ResourceGroupResource resourceGroupResource)
+ {
+ return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetCatalogs();
+ }
+
+ ///
+ /// Get a Catalog
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_Get
+ ///
+ ///
+ ///
+ /// The instance the method will execute against.
+ /// Name of catalog.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ [ForwardsClientCalls]
+ public static async Task> GetCatalogAsync(this ResourceGroupResource resourceGroupResource, string catalogName, CancellationToken cancellationToken = default)
+ {
+ return await resourceGroupResource.GetCatalogs().GetAsync(catalogName, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Get a Catalog
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_Get
+ ///
+ ///
+ ///
+ /// The instance the method will execute against.
+ /// Name of catalog.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ [ForwardsClientCalls]
+ public static Response GetCatalog(this ResourceGroupResource resourceGroupResource, string catalogName, CancellationToken cancellationToken = default)
+ {
+ return resourceGroupResource.GetCatalogs().Get(catalogName, cancellationToken);
+ }
+
+ ///
+ /// List Catalog resources by subscription ID
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.AzureSphere/catalogs
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_ListBySubscription
+ ///
+ ///
+ ///
+ /// The instance the method will execute against.
+ /// The cancellation token to use.
+ /// An async collection of that may take multiple service requests to iterate over.
+ public static AsyncPageable GetCatalogsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default)
+ {
+ return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCatalogsAsync(cancellationToken);
+ }
+
+ ///
+ /// List Catalog resources by subscription ID
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.AzureSphere/catalogs
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_ListBySubscription
+ ///
+ ///
+ ///
+ /// The instance the method will execute against.
+ /// The cancellation token to use.
+ /// A collection of that may take multiple service requests to iterate over.
+ public static Pageable GetCatalogs(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default)
+ {
+ return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCatalogs(cancellationToken);
+ }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs
new file mode 100644
index 000000000000..a2617db19922
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs
@@ -0,0 +1,87 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Threading;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager;
+
+namespace Azure.ResourceManager.Sphere
+{
+ /// A class to add extension methods to SubscriptionResource.
+ internal partial class SubscriptionResourceExtensionClient : ArmResource
+ {
+ private ClientDiagnostics _catalogClientDiagnostics;
+ private CatalogsRestOperations _catalogRestClient;
+
+ /// Initializes a new instance of the class for mocking.
+ protected SubscriptionResourceExtensionClient()
+ {
+ }
+
+ /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ }
+
+ private ClientDiagnostics CatalogClientDiagnostics => _catalogClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sphere", CatalogResource.ResourceType.Namespace, Diagnostics);
+ private CatalogsRestOperations CatalogRestClient => _catalogRestClient ??= new CatalogsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(CatalogResource.ResourceType));
+
+ private string GetApiVersionOrNull(ResourceType resourceType)
+ {
+ TryGetApiVersion(resourceType, out string apiVersion);
+ return apiVersion;
+ }
+
+ ///
+ /// List Catalog resources by subscription ID
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.AzureSphere/catalogs
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_ListBySubscription
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetCatalogsAsync(CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => CatalogRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CatalogRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId);
+ return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CatalogResource(Client, CatalogData.DeserializeCatalogData(e)), CatalogClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCatalogs", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// List Catalog resources by subscription ID
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.AzureSphere/catalogs
+ ///
+ /// -
+ /// Operation Id
+ /// Catalogs_ListBySubscription
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetCatalogs(CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => CatalogRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CatalogRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId);
+ return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CatalogResource(Client, CatalogData.DeserializeCatalogData(e)), CatalogClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCatalogs", "value", "nextLink", cancellationToken);
+ }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/ImageCollection.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/ImageCollection.cs
new file mode 100644
index 000000000000..732b0491d9eb
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/ImageCollection.cs
@@ -0,0 +1,348 @@
+// 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 Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager;
+
+namespace Azure.ResourceManager.Sphere
+{
+ ///
+ /// A class representing a collection of and their operations.
+ /// Each in the collection will belong to the same instance of .
+ /// To get an instance call the GetImages method from an instance of .
+ ///
+ public partial class ImageCollection : ArmCollection, IEnumerable, IAsyncEnumerable
+ {
+ private readonly ClientDiagnostics _imageClientDiagnostics;
+ private readonly ImagesRestOperations _imageRestClient;
+
+ /// Initializes a new instance of the class for mocking.
+ protected ImageCollection()
+ {
+ }
+
+ /// 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 ImageCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _imageClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sphere", ImageResource.ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(ImageResource.ResourceType, out string imageApiVersion);
+ _imageRestClient = new ImagesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, imageApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != CatalogResource.ResourceType)
+ throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CatalogResource.ResourceType), nameof(id));
+ }
+
+ ///
+ /// Create a Image
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}
+ ///
+ /// -
+ /// Operation Id
+ /// Images_CreateOrUpdate
+ ///
+ ///
+ ///
+ /// 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.
+ /// Image name. Use .default for image creation.
+ /// 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 imageName, ImageData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(imageName, nameof(imageName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _imageClientDiagnostics.CreateScope("ImageCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = await _imageRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, imageName, data, cancellationToken).ConfigureAwait(false);
+ var operation = new SphereArmOperation(new ImageOperationSource(Client), _imageClientDiagnostics, Pipeline, _imageRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, imageName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a Image
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}
+ ///
+ /// -
+ /// Operation Id
+ /// Images_CreateOrUpdate
+ ///
+ ///
+ ///
+ /// 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.
+ /// Image name. Use .default for image creation.
+ /// 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 imageName, ImageData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(imageName, nameof(imageName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _imageClientDiagnostics.CreateScope("ImageCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = _imageRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, imageName, data, cancellationToken);
+ var operation = new SphereArmOperation(new ImageOperationSource(Client), _imageClientDiagnostics, Pipeline, _imageRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, imageName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a Image
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}
+ ///
+ /// -
+ /// Operation Id
+ /// Images_Get
+ ///
+ ///
+ ///
+ /// Image name. Use .default for image creation.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetAsync(string imageName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(imageName, nameof(imageName));
+
+ using var scope = _imageClientDiagnostics.CreateScope("ImageCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = await _imageRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, imageName, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new ImageResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a Image
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}
+ ///
+ /// -
+ /// Operation Id
+ /// Images_Get
+ ///
+ ///
+ ///
+ /// Image name. Use .default for image creation.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Get(string imageName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(imageName, nameof(imageName));
+
+ using var scope = _imageClientDiagnostics.CreateScope("ImageCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = _imageRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, imageName, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new ImageResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// List Image resources by Catalog
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images
+ ///
+ /// -
+ /// Operation Id
+ /// Images_ListByCatalog
+ ///
+ ///
+ ///
+ /// Filter the result list using the given expression.
+ /// The number of result items to return.
+ /// The number of result items to skip.
+ /// The maximum number of result items per page.
+ /// The cancellation token to use.
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetAllAsync(string filter = null, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => _imageRestClient.CreateListByCatalogRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top, skip, pageSizeHint);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _imageRestClient.CreateListByCatalogNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top, skip, pageSizeHint);
+ return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ImageResource(Client, ImageData.DeserializeImageData(e)), _imageClientDiagnostics, Pipeline, "ImageCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// List Image resources by Catalog
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images
+ ///
+ /// -
+ /// Operation Id
+ /// Images_ListByCatalog
+ ///
+ ///
+ ///
+ /// Filter the result list using the given expression.
+ /// The number of result items to return.
+ /// The number of result items to skip.
+ /// The maximum number of result items per page.
+ /// The cancellation token to use.
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetAll(string filter = null, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => _imageRestClient.CreateListByCatalogRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top, skip, pageSizeHint);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _imageRestClient.CreateListByCatalogNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top, skip, pageSizeHint);
+ return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ImageResource(Client, ImageData.DeserializeImageData(e)), _imageClientDiagnostics, Pipeline, "ImageCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// Checks to see if the resource exists in azure.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}
+ ///
+ /// -
+ /// Operation Id
+ /// Images_Get
+ ///
+ ///
+ ///
+ /// Image name. Use .default for image creation.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> ExistsAsync(string imageName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(imageName, nameof(imageName));
+
+ using var scope = _imageClientDiagnostics.CreateScope("ImageCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = await _imageRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, imageName, 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.AzureSphere/catalogs/{catalogName}/images/{imageName}
+ ///
+ /// -
+ /// Operation Id
+ /// Images_Get
+ ///
+ ///
+ ///
+ /// Image name. Use .default for image creation.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Exists(string imageName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(imageName, nameof(imageName));
+
+ using var scope = _imageClientDiagnostics.CreateScope("ImageCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = _imageRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, imageName, cancellationToken: cancellationToken);
+ return Response.FromValue(response.Value != null, 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/sphere/Azure.ResourceManager.Sphere/src/Generated/ImageData.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/ImageData.cs
new file mode 100644
index 000000000000..63141e6b470c
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/ImageData.cs
@@ -0,0 +1,72 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using Azure.Core;
+using Azure.ResourceManager.Models;
+using Azure.ResourceManager.Sphere.Models;
+
+namespace Azure.ResourceManager.Sphere
+{
+ ///
+ /// A class representing the Image data model.
+ /// An image resource belonging to a catalog resource.
+ ///
+ public partial class ImageData : ResourceData
+ {
+ /// Initializes a new instance of ImageData.
+ public ImageData()
+ {
+ }
+
+ /// Initializes a new instance of ImageData.
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// Image as a UTF-8 encoded base 64 string on image create. This field contains the image URI on image reads.
+ /// Image ID.
+ /// Image name.
+ /// Regional data boundary for an image.
+ /// Location the image.
+ /// The image description.
+ /// The image component id.
+ /// The image type.
+ /// The status of the last operation.
+ internal ImageData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string image, string imageId, string imageName, RegionalDataBoundary? regionalDataBoundary, Uri uri, string description, string componentId, ImageType? imageType, ProvisioningState? provisioningState) : base(id, name, resourceType, systemData)
+ {
+ Image = image;
+ ImageId = imageId;
+ ImageName = imageName;
+ RegionalDataBoundary = regionalDataBoundary;
+ Uri = uri;
+ Description = description;
+ ComponentId = componentId;
+ ImageType = imageType;
+ ProvisioningState = provisioningState;
+ }
+
+ /// Image as a UTF-8 encoded base 64 string on image create. This field contains the image URI on image reads.
+ public string Image { get; set; }
+ /// Image ID.
+ public string ImageId { get; set; }
+ /// Image name.
+ public string ImageName { get; }
+ /// Regional data boundary for an image.
+ public RegionalDataBoundary? RegionalDataBoundary { get; set; }
+ /// Location the image.
+ public Uri Uri { get; }
+ /// The image description.
+ public string Description { get; }
+ /// The image component id.
+ public string ComponentId { get; }
+ /// The image type.
+ public ImageType? ImageType { get; }
+ /// The status of the last operation.
+ public ProvisioningState? ProvisioningState { get; }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/ImageResource.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/ImageResource.cs
new file mode 100644
index 000000000000..2c20325b27aa
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/ImageResource.cs
@@ -0,0 +1,297 @@
+// 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;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager;
+
+namespace Azure.ResourceManager.Sphere
+{
+ ///
+ /// A Class representing an Image along with the instance operations that can be performed on it.
+ /// If you have a you can construct an
+ /// from an instance of using the GetImageResource method.
+ /// Otherwise you can get one from its parent resource using the GetImage method.
+ ///
+ public partial class ImageResource : ArmResource
+ {
+ /// Generate the resource identifier of a instance.
+ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string catalogName, string imageName)
+ {
+ var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}";
+ return new ResourceIdentifier(resourceId);
+ }
+
+ private readonly ClientDiagnostics _imageClientDiagnostics;
+ private readonly ImagesRestOperations _imageRestClient;
+ private readonly ImageData _data;
+
+ /// Initializes a new instance of the class for mocking.
+ protected ImageResource()
+ {
+ }
+
+ /// Initializes a new instance of the class.
+ /// The client parameters to use in these operations.
+ /// The resource that is the target of operations.
+ internal ImageResource(ArmClient client, ImageData 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 ImageResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _imageClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sphere", ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(ResourceType, out string imageApiVersion);
+ _imageRestClient = new ImagesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, imageApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ /// Gets the resource type for the operations.
+ public static readonly ResourceType ResourceType = "Microsoft.AzureSphere/catalogs/images";
+
+ /// 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 ImageData 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 Image
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}
+ ///
+ /// -
+ /// Operation Id
+ /// Images_Get
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
+ {
+ using var scope = _imageClientDiagnostics.CreateScope("ImageResource.Get");
+ scope.Start();
+ try
+ {
+ var response = await _imageRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new ImageResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a Image
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}
+ ///
+ /// -
+ /// Operation Id
+ /// Images_Get
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual Response Get(CancellationToken cancellationToken = default)
+ {
+ using var scope = _imageClientDiagnostics.CreateScope("ImageResource.Get");
+ scope.Start();
+ try
+ {
+ var response = _imageRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new ImageResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a Image
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}
+ ///
+ /// -
+ /// Operation Id
+ /// Images_Delete
+ ///
+ ///
+ ///
+ /// 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 = _imageClientDiagnostics.CreateScope("ImageResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = await _imageRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ var operation = new SphereArmOperation(_imageClientDiagnostics, Pipeline, _imageRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a Image
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}
+ ///
+ /// -
+ /// Operation Id
+ /// Images_Delete
+ ///
+ ///
+ ///
+ /// 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 = _imageClientDiagnostics.CreateScope("ImageResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = _imageRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
+ var operation = new SphereArmOperation(_imageClientDiagnostics, Pipeline, _imageRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletionResponse(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a Image
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}
+ ///
+ /// -
+ /// Operation Id
+ /// Images_CreateOrUpdate
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task> UpdateAsync(WaitUntil waitUntil, ImageData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _imageClientDiagnostics.CreateScope("ImageResource.Update");
+ scope.Start();
+ try
+ {
+ var response = await _imageRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false);
+ var operation = new SphereArmOperation(new ImageOperationSource(Client), _imageClientDiagnostics, Pipeline, _imageRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a Image
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}
+ ///
+ /// -
+ /// Operation Id
+ /// Images_CreateOrUpdate
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual ArmOperation Update(WaitUntil waitUntil, ImageData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _imageClientDiagnostics.CreateScope("ImageResource.Update");
+ scope.Start();
+ try
+ {
+ var response = _imageRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken);
+ var operation = new SphereArmOperation(new ImageOperationSource(Client), _imageClientDiagnostics, Pipeline, _imageRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/CatalogOperationSource.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/CatalogOperationSource.cs
new file mode 100644
index 000000000000..96e2bc8a425a
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/CatalogOperationSource.cs
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.ResourceManager;
+
+namespace Azure.ResourceManager.Sphere
+{
+ internal class CatalogOperationSource : IOperationSource
+ {
+ private readonly ArmClient _client;
+
+ internal CatalogOperationSource(ArmClient client)
+ {
+ _client = client;
+ }
+
+ CatalogResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ using var document = JsonDocument.Parse(response.ContentStream);
+ var data = CatalogData.DeserializeCatalogData(document.RootElement);
+ return new CatalogResource(_client, data);
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ var data = CatalogData.DeserializeCatalogData(document.RootElement);
+ return new CatalogResource(_client, data);
+ }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/DeploymentOperationSource.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/DeploymentOperationSource.cs
new file mode 100644
index 000000000000..439fa463b116
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/DeploymentOperationSource.cs
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.ResourceManager;
+
+namespace Azure.ResourceManager.Sphere
+{
+ internal class DeploymentOperationSource : IOperationSource
+ {
+ private readonly ArmClient _client;
+
+ internal DeploymentOperationSource(ArmClient client)
+ {
+ _client = client;
+ }
+
+ DeploymentResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ using var document = JsonDocument.Parse(response.ContentStream);
+ var data = DeploymentData.DeserializeDeploymentData(document.RootElement);
+ return new DeploymentResource(_client, data);
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ var data = DeploymentData.DeserializeDeploymentData(document.RootElement);
+ return new DeploymentResource(_client, data);
+ }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/DeviceGroupOperationSource.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/DeviceGroupOperationSource.cs
new file mode 100644
index 000000000000..b288c9210a2c
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/DeviceGroupOperationSource.cs
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.ResourceManager;
+
+namespace Azure.ResourceManager.Sphere
+{
+ internal class DeviceGroupOperationSource : IOperationSource
+ {
+ private readonly ArmClient _client;
+
+ internal DeviceGroupOperationSource(ArmClient client)
+ {
+ _client = client;
+ }
+
+ DeviceGroupResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ using var document = JsonDocument.Parse(response.ContentStream);
+ var data = DeviceGroupData.DeserializeDeviceGroupData(document.RootElement);
+ return new DeviceGroupResource(_client, data);
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ var data = DeviceGroupData.DeserializeDeviceGroupData(document.RootElement);
+ return new DeviceGroupResource(_client, data);
+ }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/DeviceOperationSource.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/DeviceOperationSource.cs
new file mode 100644
index 000000000000..98b3fb7ab640
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/DeviceOperationSource.cs
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.ResourceManager;
+
+namespace Azure.ResourceManager.Sphere
+{
+ internal class DeviceOperationSource : IOperationSource
+ {
+ private readonly ArmClient _client;
+
+ internal DeviceOperationSource(ArmClient client)
+ {
+ _client = client;
+ }
+
+ DeviceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ using var document = JsonDocument.Parse(response.ContentStream);
+ var data = DeviceData.DeserializeDeviceData(document.RootElement);
+ return new DeviceResource(_client, data);
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ var data = DeviceData.DeserializeDeviceData(document.RootElement);
+ return new DeviceResource(_client, data);
+ }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/ImageOperationSource.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/ImageOperationSource.cs
new file mode 100644
index 000000000000..4a605883e93c
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/ImageOperationSource.cs
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.ResourceManager;
+
+namespace Azure.ResourceManager.Sphere
+{
+ internal class ImageOperationSource : IOperationSource
+ {
+ private readonly ArmClient _client;
+
+ internal ImageOperationSource(ArmClient client)
+ {
+ _client = client;
+ }
+
+ ImageResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ using var document = JsonDocument.Parse(response.ContentStream);
+ var data = ImageData.DeserializeImageData(document.RootElement);
+ return new ImageResource(_client, data);
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ var data = ImageData.DeserializeImageData(document.RootElement);
+ return new ImageResource(_client, data);
+ }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/ProductOperationSource.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/ProductOperationSource.cs
new file mode 100644
index 000000000000..c35279fa26c5
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/ProductOperationSource.cs
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.ResourceManager;
+
+namespace Azure.ResourceManager.Sphere
+{
+ internal class ProductOperationSource : IOperationSource
+ {
+ private readonly ArmClient _client;
+
+ internal ProductOperationSource(ArmClient client)
+ {
+ _client = client;
+ }
+
+ ProductResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ using var document = JsonDocument.Parse(response.ContentStream);
+ var data = ProductData.DeserializeProductData(document.RootElement);
+ return new ProductResource(_client, data);
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ var data = ProductData.DeserializeProductData(document.RootElement);
+ return new ProductResource(_client, data);
+ }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/SignedCapabilityImageResponseOperationSource.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/SignedCapabilityImageResponseOperationSource.cs
new file mode 100644
index 000000000000..970d900dddf7
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/SignedCapabilityImageResponseOperationSource.cs
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.ResourceManager.Sphere.Models;
+
+namespace Azure.ResourceManager.Sphere
+{
+ internal class SignedCapabilityImageResponseOperationSource : IOperationSource
+ {
+ SignedCapabilityImageResponse IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ using var document = JsonDocument.Parse(response.ContentStream);
+ return SignedCapabilityImageResponse.DeserializeSignedCapabilityImageResponse(document.RootElement);
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ return SignedCapabilityImageResponse.DeserializeSignedCapabilityImageResponse(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/SphereArmOperation.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/SphereArmOperation.cs
new file mode 100644
index 000000000000..e11ad0a12705
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/SphereArmOperation.cs
@@ -0,0 +1,70 @@
+// 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;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager;
+
+namespace Azure.ResourceManager.Sphere
+{
+#pragma warning disable SA1649 // File name should match first type name
+ internal class SphereArmOperation : ArmOperation
+#pragma warning restore SA1649 // File name should match first type name
+ {
+ private readonly OperationInternal _operation;
+
+ /// Initializes a new instance of SphereArmOperation for mocking.
+ protected SphereArmOperation()
+ {
+ }
+
+ internal SphereArmOperation(Response response)
+ {
+ _operation = OperationInternal.Succeeded(response);
+ }
+
+ internal SphereArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia)
+ {
+ var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia);
+ _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "SphereArmOperation", fallbackStrategy: new SequentialDelayStrategy());
+ }
+
+ ///
+#pragma warning disable CA1822
+ [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
+ public override string Id => throw new NotImplementedException();
+#pragma warning restore CA1822
+
+ ///
+ public override bool HasCompleted => _operation.HasCompleted;
+
+ ///
+ public override Response GetRawResponse() => _operation.RawResponse;
+
+ ///
+ public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken);
+
+ ///
+ public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken);
+
+ ///
+ public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken);
+
+ ///
+ public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken);
+
+ ///
+ public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken);
+
+ ///
+ public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken);
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/SphereArmOperationOfT.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/SphereArmOperationOfT.cs
new file mode 100644
index 000000000000..3bcd2ffcbb7d
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/LongRunningOperation/SphereArmOperationOfT.cs
@@ -0,0 +1,76 @@
+// 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;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager;
+
+namespace Azure.ResourceManager.Sphere
+{
+#pragma warning disable SA1649 // File name should match first type name
+ internal class SphereArmOperation : ArmOperation
+#pragma warning restore SA1649 // File name should match first type name
+ {
+ private readonly OperationInternal _operation;
+
+ /// Initializes a new instance of SphereArmOperation for mocking.
+ protected SphereArmOperation()
+ {
+ }
+
+ internal SphereArmOperation(Response response)
+ {
+ _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value);
+ }
+
+ internal SphereArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia)
+ {
+ var nextLinkOperation = NextLinkOperationImplementation.Create(source, pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia);
+ _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "SphereArmOperation", fallbackStrategy: new SequentialDelayStrategy());
+ }
+
+ ///
+#pragma warning disable CA1822
+ [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
+ public override string Id => throw new NotImplementedException();
+#pragma warning restore CA1822
+
+ ///
+ public override T Value => _operation.Value;
+
+ ///
+ public override bool HasValue => _operation.HasValue;
+
+ ///
+ public override bool HasCompleted => _operation.HasCompleted;
+
+ ///
+ public override Response GetRawResponse() => _operation.RawResponse;
+
+ ///
+ public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken);
+
+ ///
+ public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken);
+
+ ///
+ public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken);
+
+ ///
+ public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken);
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/AllowCrashDumpCollection.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/AllowCrashDumpCollection.cs
new file mode 100644
index 000000000000..4801cde753fc
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/AllowCrashDumpCollection.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.ResourceManager.Sphere.Models
+{
+ /// Allow crash dumps values.
+ public readonly partial struct AllowCrashDumpCollection : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public AllowCrashDumpCollection(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string EnabledValue = "Enabled";
+ private const string DisabledValue = "Disabled";
+
+ /// Enabled.
+ public static AllowCrashDumpCollection Enabled { get; } = new AllowCrashDumpCollection(EnabledValue);
+ /// Disabled.
+ public static AllowCrashDumpCollection Disabled { get; } = new AllowCrashDumpCollection(DisabledValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(AllowCrashDumpCollection left, AllowCrashDumpCollection right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(AllowCrashDumpCollection left, AllowCrashDumpCollection right) => !left.Equals(right);
+ /// Converts a string to a .
+ public static implicit operator AllowCrashDumpCollection(string value) => new AllowCrashDumpCollection(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is AllowCrashDumpCollection other && Equals(other);
+ ///
+ public bool Equals(AllowCrashDumpCollection other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value?.GetHashCode() ?? 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CapabilityType.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CapabilityType.cs
new file mode 100644
index 000000000000..7a1e86a4e92f
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CapabilityType.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.ResourceManager.Sphere.Models
+{
+ /// Capability image type.
+ public readonly partial struct CapabilityType : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public CapabilityType(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string ApplicationDevelopmentValue = "ApplicationDevelopment";
+ private const string FieldServicingValue = "FieldServicing";
+
+ /// ApplicationDevelopment.
+ public static CapabilityType ApplicationDevelopment { get; } = new CapabilityType(ApplicationDevelopmentValue);
+ /// FieldServicing.
+ public static CapabilityType FieldServicing { get; } = new CapabilityType(FieldServicingValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(CapabilityType left, CapabilityType right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(CapabilityType left, CapabilityType right) => !left.Equals(right);
+ /// Converts a string to a .
+ public static implicit operator CapabilityType(string value) => new CapabilityType(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is CapabilityType other && Equals(other);
+ ///
+ public bool Equals(CapabilityType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value?.GetHashCode() ?? 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CatalogData.Serialization.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CatalogData.Serialization.cs
new file mode 100644
index 000000000000..2745dc60f67d
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CatalogData.Serialization.cs
@@ -0,0 +1,123 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+using Azure.ResourceManager.Models;
+using Azure.ResourceManager.Sphere.Models;
+
+namespace Azure.ResourceManager.Sphere
+{
+ public partial class CatalogData : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ if (Optional.IsCollectionDefined(Tags))
+ {
+ writer.WritePropertyName("tags"u8);
+ writer.WriteStartObject();
+ foreach (var item in Tags)
+ {
+ writer.WritePropertyName(item.Key);
+ writer.WriteStringValue(item.Value);
+ }
+ writer.WriteEndObject();
+ }
+ writer.WritePropertyName("location"u8);
+ writer.WriteStringValue(Location);
+ writer.WritePropertyName("properties"u8);
+ writer.WriteStartObject();
+ writer.WriteEndObject();
+ writer.WriteEndObject();
+ }
+
+ internal static CatalogData DeserializeCatalogData(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ Optional> tags = default;
+ AzureLocation location = default;
+ ResourceIdentifier id = default;
+ string name = default;
+ ResourceType type = default;
+ Optional systemData = default;
+ Optional provisioningState = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("tags"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ Dictionary dictionary = new Dictionary();
+ foreach (var property0 in property.Value.EnumerateObject())
+ {
+ dictionary.Add(property0.Name, property0.Value.GetString());
+ }
+ tags = dictionary;
+ continue;
+ }
+ if (property.NameEquals("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 (property.NameEquals("properties"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ property.ThrowNonNullablePropertyIsNull();
+ continue;
+ }
+ foreach (var property0 in property.Value.EnumerateObject())
+ {
+ if (property0.NameEquals("provisioningState"u8))
+ {
+ if (property0.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ provisioningState = new ProvisioningState(property0.Value.GetString());
+ continue;
+ }
+ }
+ continue;
+ }
+ }
+ return new CatalogData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, Optional.ToNullable(provisioningState));
+ }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CatalogListResult.Serialization.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CatalogListResult.Serialization.cs
new file mode 100644
index 000000000000..5814c7c57b46
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CatalogListResult.Serialization.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+using Azure.ResourceManager.Sphere;
+
+namespace Azure.ResourceManager.Sphere.Models
+{
+ internal partial class CatalogListResult
+ {
+ internal static CatalogListResult DeserializeCatalogListResult(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ IReadOnlyList value = default;
+ Optional nextLink = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("value"u8))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(CatalogData.DeserializeCatalogData(item));
+ }
+ value = array;
+ continue;
+ }
+ if (property.NameEquals("nextLink"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ nextLink = new Uri(property.Value.GetString());
+ continue;
+ }
+ }
+ return new CatalogListResult(value, nextLink.Value);
+ }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CatalogListResult.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CatalogListResult.cs
new file mode 100644
index 000000000000..3dd1f8f2bdcc
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CatalogListResult.cs
@@ -0,0 +1,43 @@
+// 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.Sphere;
+
+namespace Azure.ResourceManager.Sphere.Models
+{
+ /// The response of a Catalog list operation.
+ internal partial class CatalogListResult
+ {
+ /// Initializes a new instance of CatalogListResult.
+ /// The Catalog items on this page.
+ /// is null.
+ internal CatalogListResult(IEnumerable value)
+ {
+ Argument.AssertNotNull(value, nameof(value));
+
+ Value = value.ToList();
+ }
+
+ /// Initializes a new instance of CatalogListResult.
+ /// The Catalog items on this page.
+ /// The link to the next page of items.
+ internal CatalogListResult(IReadOnlyList value, Uri nextLink)
+ {
+ Value = value;
+ NextLink = nextLink;
+ }
+
+ /// The Catalog items on this page.
+ public IReadOnlyList Value { get; }
+ /// The link to the next page of items.
+ public Uri NextLink { get; }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CatalogPatch.Serialization.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CatalogPatch.Serialization.cs
new file mode 100644
index 000000000000..afed483c6759
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CatalogPatch.Serialization.cs
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.ResourceManager.Sphere.Models
+{
+ public partial class CatalogPatch : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ if (Optional.IsCollectionDefined(Tags))
+ {
+ writer.WritePropertyName("tags"u8);
+ writer.WriteStartObject();
+ foreach (var item in Tags)
+ {
+ writer.WritePropertyName(item.Key);
+ writer.WriteStringValue(item.Value);
+ }
+ writer.WriteEndObject();
+ }
+ writer.WriteEndObject();
+ }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CatalogPatch.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CatalogPatch.cs
new file mode 100644
index 000000000000..f9be29af127d
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CatalogPatch.cs
@@ -0,0 +1,25 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+using Azure.Core;
+
+namespace Azure.ResourceManager.Sphere.Models
+{
+ /// The type used for update operations of the Catalog.
+ public partial class CatalogPatch
+ {
+ /// Initializes a new instance of CatalogPatch.
+ public CatalogPatch()
+ {
+ Tags = new ChangeTrackingDictionary();
+ }
+
+ /// Resource tags.
+ public IDictionary Tags { get; }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CertificateChainResponse.Serialization.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CertificateChainResponse.Serialization.cs
new file mode 100644
index 000000000000..012b97e3fe6d
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CertificateChainResponse.Serialization.cs
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.ResourceManager.Sphere.Models
+{
+ public partial class CertificateChainResponse
+ {
+ internal static CertificateChainResponse DeserializeCertificateChainResponse(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ Optional certificateChain = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("certificateChain"u8))
+ {
+ certificateChain = property.Value.GetString();
+ continue;
+ }
+ }
+ return new CertificateChainResponse(certificateChain.Value);
+ }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CertificateChainResponse.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CertificateChainResponse.cs
new file mode 100644
index 000000000000..f12eaa8f8192
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CertificateChainResponse.cs
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+namespace Azure.ResourceManager.Sphere.Models
+{
+ /// The certificate chain response.
+ public partial class CertificateChainResponse
+ {
+ /// Initializes a new instance of CertificateChainResponse.
+ internal CertificateChainResponse()
+ {
+ }
+
+ /// Initializes a new instance of CertificateChainResponse.
+ /// The certificate chain.
+ internal CertificateChainResponse(string certificateChain)
+ {
+ CertificateChain = certificateChain;
+ }
+
+ /// The certificate chain.
+ public string CertificateChain { get; }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CertificateData.Serialization.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CertificateData.Serialization.cs
new file mode 100644
index 000000000000..20ebd48b6533
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CertificateData.Serialization.cs
@@ -0,0 +1,137 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Text.Json;
+using Azure.Core;
+using Azure.ResourceManager.Models;
+using Azure.ResourceManager.Sphere.Models;
+
+namespace Azure.ResourceManager.Sphere
+{
+ public partial class CertificateData : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ writer.WritePropertyName("properties"u8);
+ writer.WriteStartObject();
+ writer.WriteEndObject();
+ writer.WriteEndObject();
+ }
+
+ internal static CertificateData DeserializeCertificateData(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ ResourceIdentifier id = default;
+ string name = default;
+ ResourceType type = default;
+ Optional systemData = default;
+ Optional certificate = default;
+ Optional status = default;
+ Optional subject = default;
+ Optional thumbprint = default;
+ Optional expiryUtc = default;
+ Optional notBeforeUtc = default;
+ Optional provisioningState = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ 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 (property.NameEquals("properties"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ property.ThrowNonNullablePropertyIsNull();
+ continue;
+ }
+ foreach (var property0 in property.Value.EnumerateObject())
+ {
+ if (property0.NameEquals("certificate"u8))
+ {
+ certificate = property0.Value.GetString();
+ continue;
+ }
+ if (property0.NameEquals("status"u8))
+ {
+ if (property0.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ status = new CertificateStatus(property0.Value.GetString());
+ continue;
+ }
+ if (property0.NameEquals("subject"u8))
+ {
+ subject = property0.Value.GetString();
+ continue;
+ }
+ if (property0.NameEquals("thumbprint"u8))
+ {
+ thumbprint = property0.Value.GetString();
+ continue;
+ }
+ if (property0.NameEquals("expiryUtc"u8))
+ {
+ if (property0.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ expiryUtc = property0.Value.GetDateTimeOffset("O");
+ continue;
+ }
+ if (property0.NameEquals("notBeforeUtc"u8))
+ {
+ if (property0.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ notBeforeUtc = property0.Value.GetDateTimeOffset("O");
+ continue;
+ }
+ if (property0.NameEquals("provisioningState"u8))
+ {
+ if (property0.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ provisioningState = new ProvisioningState(property0.Value.GetString());
+ continue;
+ }
+ }
+ continue;
+ }
+ }
+ return new CertificateData(id, name, type, systemData.Value, certificate.Value, Optional.ToNullable(status), subject.Value, thumbprint.Value, Optional.ToNullable(expiryUtc), Optional.ToNullable(notBeforeUtc), Optional.ToNullable(provisioningState));
+ }
+ }
+}
diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CertificateListResult.Serialization.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CertificateListResult.Serialization.cs
new file mode 100644
index 000000000000..b60792191474
--- /dev/null
+++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CertificateListResult.Serialization.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+using Azure.ResourceManager.Sphere;
+
+namespace Azure.ResourceManager.Sphere.Models
+{
+ internal partial class CertificateListResult
+ {
+ internal static CertificateListResult DeserializeCertificateListResult(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ IReadOnlyList value = default;
+ Optional nextLink = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("value"u8))
+ {
+ List