diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/ArmSiteManagerModelFactory.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/ArmSiteManagerModelFactory.cs
index 051854a8427c..8ec2c2d41568 100644
--- a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/ArmSiteManagerModelFactory.cs
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/ArmSiteManagerModelFactory.cs
@@ -8,42 +8,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using Azure;
using Azure.Core;
using Azure.ResourceManager.Models;
+using Azure.ResourceManager.SiteManager;
namespace Azure.ResourceManager.SiteManager.Models
{
- /// Model factory for models.
+ /// A factory class for creating instances of the models for mocking.
public static partial class ArmSiteManagerModelFactory
{
- /// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
+ /// Site as ARM Resource.
+ /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ /// The name of the resource.
+ /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
+ /// Azure Resource Manager metadata containing createdBy and modifiedBy information.
/// The resource-specific properties for this resource.
/// A new instance for mocking.
- public static EdgeSiteData EdgeSiteData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, EdgeSiteProperties properties = null)
+ public static EdgeSiteData EdgeSiteData(ResourceIdentifier id = default, string name = default, ResourceType resourceType = default, SystemData systemData = default, EdgeSiteProperties properties = default)
{
return new EdgeSiteData(
id,
name,
resourceType,
systemData,
- properties,
- serializedAdditionalRawData: null);
+ additionalBinaryDataProperties: null,
+ properties);
}
- /// Initializes a new instance of .
+ /// Site properties.
/// displayName of Site resource.
/// Description of Site resource.
/// Physical address of the site.
/// Key-value pairs for labeling the site resource.
/// Provisioning state of last operation.
/// A new instance for mocking.
- public static EdgeSiteProperties EdgeSiteProperties(string displayName = null, string description = null, EdgeSiteAddressProperties siteAddress = null, IDictionary labels = null, EdgeSiteProvisioningState? provisioningState = null)
+ public static EdgeSiteProperties EdgeSiteProperties(string displayName = default, string description = default, EdgeSiteAddressProperties siteAddress = default, IDictionary labels = default, EdgeSiteProvisioningState? provisioningState = default)
{
- labels ??= new Dictionary();
+ labels ??= new ChangeTrackingDictionary();
return new EdgeSiteProperties(
displayName,
@@ -51,7 +53,20 @@ public static EdgeSiteProperties EdgeSiteProperties(string displayName = null, s
siteAddress,
labels,
provisioningState,
- serializedAdditionalRawData: null);
+ additionalBinaryDataProperties: null);
+ }
+
+ /// The updatable properties of the Site.
+ /// displayName of Site resource.
+ /// Description of Site resource.
+ /// Physical address of the site.
+ /// Key-value pairs for labeling the site resource.
+ /// A new instance for mocking.
+ public static EdgeSitePatchProperties EdgeSitePatchProperties(string displayName = default, string description = default, EdgeSiteAddressProperties siteAddress = default, IDictionary labels = default)
+ {
+ labels ??= new ChangeTrackingDictionary();
+
+ return new EdgeSitePatchProperties(displayName, description, siteAddress, labels, additionalBinaryDataProperties: null);
}
}
}
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/CollectionResults/SitesByServiceGroupGetByServiceGroupAsyncCollectionResultOfT.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/CollectionResults/SitesByServiceGroupGetByServiceGroupAsyncCollectionResultOfT.cs
new file mode 100644
index 000000000000..985315fb2ddc
--- /dev/null
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/CollectionResults/SitesByServiceGroupGetByServiceGroupAsyncCollectionResultOfT.cs
@@ -0,0 +1,78 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.SiteManager.Models;
+
+namespace Azure.ResourceManager.SiteManager
+{
+ internal partial class SitesByServiceGroupGetByServiceGroupAsyncCollectionResultOfT : AsyncPageable
+ {
+ private readonly SitesByServiceGroup _client;
+ private readonly string _servicegroupName;
+ private readonly RequestContext _context;
+
+ /// Initializes a new instance of SitesByServiceGroupGetByServiceGroupAsyncCollectionResultOfT, which is used to iterate over the pages of a collection.
+ /// The SitesByServiceGroup client used to send requests.
+ /// The name of the service group.
+ /// The request options, which can override default behaviors of the client pipeline on a per-call basis.
+ public SitesByServiceGroupGetByServiceGroupAsyncCollectionResultOfT(SitesByServiceGroup client, string servicegroupName, RequestContext context) : base(context?.CancellationToken ?? default)
+ {
+ _client = client;
+ _servicegroupName = servicegroupName;
+ _context = context;
+ }
+
+ /// Gets the pages of SitesByServiceGroupGetByServiceGroupAsyncCollectionResultOfT as an enumerable collection.
+ /// A continuation token indicating where to resume paging.
+ /// The number of items per page.
+ /// The pages of SitesByServiceGroupGetByServiceGroupAsyncCollectionResultOfT as an enumerable collection.
+ public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint)
+ {
+ Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null;
+ while (true)
+ {
+ Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false);
+ if (response is null)
+ {
+ yield break;
+ }
+ SiteListResult result = SiteListResult.FromResponse(response);
+ yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response);
+ nextPage = result.NextLink;
+ if (nextPage == null)
+ {
+ yield break;
+ }
+ }
+ }
+
+ /// Get next page.
+ /// The number of items per page.
+ /// The next link to use for the next page of results.
+ private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink)
+ {
+ HttpMessage message = nextLink != null ? _client.CreateNextGetByServiceGroupRequest(nextLink, _servicegroupName, _context) : _client.CreateGetByServiceGroupRequest(_servicegroupName, _context);
+ using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableSiteManagerTenantResource.GetEdgeSites");
+ scope.Start();
+ try
+ {
+ return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/CollectionResults/SitesByServiceGroupGetByServiceGroupCollectionResultOfT.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/CollectionResults/SitesByServiceGroupGetByServiceGroupCollectionResultOfT.cs
new file mode 100644
index 000000000000..553c42ce42c6
--- /dev/null
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/CollectionResults/SitesByServiceGroupGetByServiceGroupCollectionResultOfT.cs
@@ -0,0 +1,77 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.SiteManager.Models;
+
+namespace Azure.ResourceManager.SiteManager
+{
+ internal partial class SitesByServiceGroupGetByServiceGroupCollectionResultOfT : Pageable
+ {
+ private readonly SitesByServiceGroup _client;
+ private readonly string _servicegroupName;
+ private readonly RequestContext _context;
+
+ /// Initializes a new instance of SitesByServiceGroupGetByServiceGroupCollectionResultOfT, which is used to iterate over the pages of a collection.
+ /// The SitesByServiceGroup client used to send requests.
+ /// The name of the service group.
+ /// The request options, which can override default behaviors of the client pipeline on a per-call basis.
+ public SitesByServiceGroupGetByServiceGroupCollectionResultOfT(SitesByServiceGroup client, string servicegroupName, RequestContext context) : base(context?.CancellationToken ?? default)
+ {
+ _client = client;
+ _servicegroupName = servicegroupName;
+ _context = context;
+ }
+
+ /// Gets the pages of SitesByServiceGroupGetByServiceGroupCollectionResultOfT as an enumerable collection.
+ /// A continuation token indicating where to resume paging.
+ /// The number of items per page.
+ /// The pages of SitesByServiceGroupGetByServiceGroupCollectionResultOfT as an enumerable collection.
+ public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint)
+ {
+ Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null;
+ while (true)
+ {
+ Response response = GetNextResponse(pageSizeHint, nextPage);
+ if (response is null)
+ {
+ yield break;
+ }
+ SiteListResult result = SiteListResult.FromResponse(response);
+ yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response);
+ nextPage = result.NextLink;
+ if (nextPage == null)
+ {
+ yield break;
+ }
+ }
+ }
+
+ /// Get next page.
+ /// The number of items per page.
+ /// The next link to use for the next page of results.
+ private Response GetNextResponse(int? pageSizeHint, Uri nextLink)
+ {
+ HttpMessage message = nextLink != null ? _client.CreateNextGetByServiceGroupRequest(nextLink, _servicegroupName, _context) : _client.CreateGetByServiceGroupRequest(_servicegroupName, _context);
+ using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableSiteManagerTenantResource.GetEdgeSites");
+ scope.Start();
+ try
+ {
+ return _client.Pipeline.ProcessMessage(message, _context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/CollectionResults/SitesBySubscriptionGetAllAsyncCollectionResultOfT.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/CollectionResults/SitesBySubscriptionGetAllAsyncCollectionResultOfT.cs
new file mode 100644
index 000000000000..3a2b791d760a
--- /dev/null
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/CollectionResults/SitesBySubscriptionGetAllAsyncCollectionResultOfT.cs
@@ -0,0 +1,78 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.SiteManager.Models;
+
+namespace Azure.ResourceManager.SiteManager
+{
+ internal partial class SitesBySubscriptionGetAllAsyncCollectionResultOfT : AsyncPageable
+ {
+ private readonly SitesBySubscription _client;
+ private readonly Guid _subscriptionId;
+ private readonly RequestContext _context;
+
+ /// Initializes a new instance of SitesBySubscriptionGetAllAsyncCollectionResultOfT, which is used to iterate over the pages of a collection.
+ /// The SitesBySubscription client used to send requests.
+ /// The ID of the target subscription. The value must be an UUID.
+ /// The request options, which can override default behaviors of the client pipeline on a per-call basis.
+ public SitesBySubscriptionGetAllAsyncCollectionResultOfT(SitesBySubscription client, Guid subscriptionId, RequestContext context) : base(context?.CancellationToken ?? default)
+ {
+ _client = client;
+ _subscriptionId = subscriptionId;
+ _context = context;
+ }
+
+ /// Gets the pages of SitesBySubscriptionGetAllAsyncCollectionResultOfT as an enumerable collection.
+ /// A continuation token indicating where to resume paging.
+ /// The number of items per page.
+ /// The pages of SitesBySubscriptionGetAllAsyncCollectionResultOfT as an enumerable collection.
+ public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint)
+ {
+ Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null;
+ while (true)
+ {
+ Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false);
+ if (response is null)
+ {
+ yield break;
+ }
+ SiteListResult result = SiteListResult.FromResponse(response);
+ yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response);
+ nextPage = result.NextLink;
+ if (nextPage == null)
+ {
+ yield break;
+ }
+ }
+ }
+
+ /// Get next page.
+ /// The number of items per page.
+ /// The next link to use for the next page of results.
+ private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink)
+ {
+ HttpMessage message = nextLink != null ? _client.CreateNextGetAllRequest(nextLink, _subscriptionId, _context) : _client.CreateGetAllRequest(_subscriptionId, _context);
+ using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableSiteManagerSubscriptionResource.GetEdgeSites");
+ scope.Start();
+ try
+ {
+ return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/CollectionResults/SitesBySubscriptionGetAllCollectionResultOfT.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/CollectionResults/SitesBySubscriptionGetAllCollectionResultOfT.cs
new file mode 100644
index 000000000000..315140dd8a5b
--- /dev/null
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/CollectionResults/SitesBySubscriptionGetAllCollectionResultOfT.cs
@@ -0,0 +1,77 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.SiteManager.Models;
+
+namespace Azure.ResourceManager.SiteManager
+{
+ internal partial class SitesBySubscriptionGetAllCollectionResultOfT : Pageable
+ {
+ private readonly SitesBySubscription _client;
+ private readonly Guid _subscriptionId;
+ private readonly RequestContext _context;
+
+ /// Initializes a new instance of SitesBySubscriptionGetAllCollectionResultOfT, which is used to iterate over the pages of a collection.
+ /// The SitesBySubscription client used to send requests.
+ /// The ID of the target subscription. The value must be an UUID.
+ /// The request options, which can override default behaviors of the client pipeline on a per-call basis.
+ public SitesBySubscriptionGetAllCollectionResultOfT(SitesBySubscription client, Guid subscriptionId, RequestContext context) : base(context?.CancellationToken ?? default)
+ {
+ _client = client;
+ _subscriptionId = subscriptionId;
+ _context = context;
+ }
+
+ /// Gets the pages of SitesBySubscriptionGetAllCollectionResultOfT as an enumerable collection.
+ /// A continuation token indicating where to resume paging.
+ /// The number of items per page.
+ /// The pages of SitesBySubscriptionGetAllCollectionResultOfT as an enumerable collection.
+ public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint)
+ {
+ Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null;
+ while (true)
+ {
+ Response response = GetNextResponse(pageSizeHint, nextPage);
+ if (response is null)
+ {
+ yield break;
+ }
+ SiteListResult result = SiteListResult.FromResponse(response);
+ yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response);
+ nextPage = result.NextLink;
+ if (nextPage == null)
+ {
+ yield break;
+ }
+ }
+ }
+
+ /// Get next page.
+ /// The number of items per page.
+ /// The next link to use for the next page of results.
+ private Response GetNextResponse(int? pageSizeHint, Uri nextLink)
+ {
+ HttpMessage message = nextLink != null ? _client.CreateNextGetAllRequest(nextLink, _subscriptionId, _context) : _client.CreateGetAllRequest(_subscriptionId, _context);
+ using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableSiteManagerSubscriptionResource.GetEdgeSites");
+ scope.Start();
+ try
+ {
+ return _client.Pipeline.ProcessMessage(message, _context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/CollectionResults/SitesGetByResourceGroupAsyncCollectionResultOfT.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/CollectionResults/SitesGetByResourceGroupAsyncCollectionResultOfT.cs
new file mode 100644
index 000000000000..10db5164cd0f
--- /dev/null
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/CollectionResults/SitesGetByResourceGroupAsyncCollectionResultOfT.cs
@@ -0,0 +1,81 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.SiteManager.Models;
+
+namespace Azure.ResourceManager.SiteManager
+{
+ internal partial class SitesGetByResourceGroupAsyncCollectionResultOfT : AsyncPageable
+ {
+ private readonly Sites _client;
+ private readonly Guid _subscriptionId;
+ private readonly string _resourceGroupName;
+ private readonly RequestContext _context;
+
+ /// Initializes a new instance of SitesGetByResourceGroupAsyncCollectionResultOfT, which is used to iterate over the pages of a collection.
+ /// The Sites client used to send requests.
+ /// The ID of the target subscription. The value must be an UUID.
+ /// The name of the resource group. The name is case insensitive.
+ /// The request options, which can override default behaviors of the client pipeline on a per-call basis.
+ public SitesGetByResourceGroupAsyncCollectionResultOfT(Sites client, Guid subscriptionId, string resourceGroupName, RequestContext context) : base(context?.CancellationToken ?? default)
+ {
+ _client = client;
+ _subscriptionId = subscriptionId;
+ _resourceGroupName = resourceGroupName;
+ _context = context;
+ }
+
+ /// Gets the pages of SitesGetByResourceGroupAsyncCollectionResultOfT as an enumerable collection.
+ /// A continuation token indicating where to resume paging.
+ /// The number of items per page.
+ /// The pages of SitesGetByResourceGroupAsyncCollectionResultOfT as an enumerable collection.
+ public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint)
+ {
+ Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null;
+ while (true)
+ {
+ Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false);
+ if (response is null)
+ {
+ yield break;
+ }
+ SiteListResult result = SiteListResult.FromResponse(response);
+ yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response);
+ nextPage = result.NextLink;
+ if (nextPage == null)
+ {
+ yield break;
+ }
+ }
+ }
+
+ /// Get next page.
+ /// The number of items per page.
+ /// The next link to use for the next page of results.
+ private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink)
+ {
+ HttpMessage message = nextLink != null ? _client.CreateNextGetByResourceGroupRequest(nextLink, _subscriptionId, _resourceGroupName, _context) : _client.CreateGetByResourceGroupRequest(_subscriptionId, _resourceGroupName, _context);
+ using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("EdgeSiteCollection.GetAll");
+ scope.Start();
+ try
+ {
+ return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/CollectionResults/SitesGetByResourceGroupCollectionResultOfT.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/CollectionResults/SitesGetByResourceGroupCollectionResultOfT.cs
new file mode 100644
index 000000000000..3c2e1113ec0a
--- /dev/null
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/CollectionResults/SitesGetByResourceGroupCollectionResultOfT.cs
@@ -0,0 +1,80 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.SiteManager.Models;
+
+namespace Azure.ResourceManager.SiteManager
+{
+ internal partial class SitesGetByResourceGroupCollectionResultOfT : Pageable
+ {
+ private readonly Sites _client;
+ private readonly Guid _subscriptionId;
+ private readonly string _resourceGroupName;
+ private readonly RequestContext _context;
+
+ /// Initializes a new instance of SitesGetByResourceGroupCollectionResultOfT, which is used to iterate over the pages of a collection.
+ /// The Sites client used to send requests.
+ /// The ID of the target subscription. The value must be an UUID.
+ /// The name of the resource group. The name is case insensitive.
+ /// The request options, which can override default behaviors of the client pipeline on a per-call basis.
+ public SitesGetByResourceGroupCollectionResultOfT(Sites client, Guid subscriptionId, string resourceGroupName, RequestContext context) : base(context?.CancellationToken ?? default)
+ {
+ _client = client;
+ _subscriptionId = subscriptionId;
+ _resourceGroupName = resourceGroupName;
+ _context = context;
+ }
+
+ /// Gets the pages of SitesGetByResourceGroupCollectionResultOfT as an enumerable collection.
+ /// A continuation token indicating where to resume paging.
+ /// The number of items per page.
+ /// The pages of SitesGetByResourceGroupCollectionResultOfT as an enumerable collection.
+ public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint)
+ {
+ Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null;
+ while (true)
+ {
+ Response response = GetNextResponse(pageSizeHint, nextPage);
+ if (response is null)
+ {
+ yield break;
+ }
+ SiteListResult result = SiteListResult.FromResponse(response);
+ yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response);
+ nextPage = result.NextLink;
+ if (nextPage == null)
+ {
+ yield break;
+ }
+ }
+ }
+
+ /// Get next page.
+ /// The number of items per page.
+ /// The next link to use for the next page of results.
+ private Response GetNextResponse(int? pageSizeHint, Uri nextLink)
+ {
+ HttpMessage message = nextLink != null ? _client.CreateNextGetByResourceGroupRequest(nextLink, _subscriptionId, _resourceGroupName, _context) : _client.CreateGetByResourceGroupRequest(_subscriptionId, _resourceGroupName, _context);
+ using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("EdgeSiteCollection.GetAll");
+ scope.Start();
+ try
+ {
+ return _client.Pipeline.ProcessMessage(message, _context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/EdgeSiteCollection.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/EdgeSiteCollection.cs
new file mode 100644
index 000000000000..0cad79273fa4
--- /dev/null
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/EdgeSiteCollection.cs
@@ -0,0 +1,588 @@
+// 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.Diagnostics;
+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.SiteManager
+{
+ ///
+ /// 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 GetEdgeSites method from an instance of .
+ ///
+ public partial class EdgeSiteCollection : ArmCollection, IEnumerable, IAsyncEnumerable
+ {
+ private readonly ClientDiagnostics _sitesClientDiagnostics;
+ private readonly Sites _sitesRestClient;
+ private readonly ClientDiagnostics _sitesBySubscriptionClientDiagnostics;
+ private readonly SitesBySubscription _sitesBySubscriptionRestClient;
+ private readonly ClientDiagnostics _sitesByServiceGroupClientDiagnostics;
+ private readonly SitesByServiceGroup _sitesByServiceGroupRestClient;
+
+ /// Initializes a new instance of EdgeSiteCollection for mocking.
+ protected EdgeSiteCollection()
+ {
+ }
+
+ /// Initializes a new instance of class.
+ /// The client parameters to use in these operations.
+ /// The identifier of the resource that is the target of operations.
+ internal EdgeSiteCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ TryGetApiVersion(EdgeSiteResource.ResourceType, out string edgeSiteApiVersion);
+ _sitesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SiteManager", EdgeSiteResource.ResourceType.Namespace, Diagnostics);
+ _sitesRestClient = new Sites(_sitesClientDiagnostics, Pipeline, Endpoint, edgeSiteApiVersion ?? "2025-06-01");
+ _sitesBySubscriptionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SiteManager", EdgeSiteResource.ResourceType.Namespace, Diagnostics);
+ _sitesBySubscriptionRestClient = new SitesBySubscription(_sitesBySubscriptionClientDiagnostics, Pipeline, Endpoint, edgeSiteApiVersion ?? "2025-06-01");
+ _sitesByServiceGroupClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SiteManager", EdgeSiteResource.ResourceType.Namespace, Diagnostics);
+ _sitesByServiceGroupRestClient = new SitesByServiceGroup(_sitesByServiceGroupClientDiagnostics, Pipeline, Endpoint, edgeSiteApiVersion ?? "2025-06-01");
+ ValidateResourceId(id);
+ }
+
+ ///
+ [Conditional("DEBUG")]
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != ResourceGroupResource.ResourceType)
+ {
+ throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), id);
+ }
+ }
+
+ ///
+ /// Create a Site
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// Sites_CreateOrUpdate.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The name of the Site.
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string siteName, EdgeSiteData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(siteName, nameof(siteName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using DiagnosticScope scope = _sitesClientDiagnostics.CreateScope("EdgeSiteCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, siteName, EdgeSiteData.ToRequestContent(data), context);
+ Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ SiteManagerArmOperation operation = new SiteManagerArmOperation(
+ new EdgeSiteOperationSource(Client),
+ _sitesClientDiagnostics,
+ Pipeline,
+ message.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 Site
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// Sites_CreateOrUpdate.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The name of the Site.
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string siteName, EdgeSiteData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(siteName, nameof(siteName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using DiagnosticScope scope = _sitesClientDiagnostics.CreateScope("EdgeSiteCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, siteName, EdgeSiteData.ToRequestContent(data), context);
+ Response response = Pipeline.ProcessMessage(message, context);
+ SiteManagerArmOperation operation = new SiteManagerArmOperation(
+ new EdgeSiteOperationSource(Client),
+ _sitesClientDiagnostics,
+ Pipeline,
+ message.Request,
+ response,
+ OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ {
+ operation.WaitForCompletion(cancellationToken);
+ }
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a Site
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// Sites_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ ///
+ ///
+ /// The name of the Site.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual async Task> GetAsync(string siteName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(siteName, nameof(siteName));
+
+ using DiagnosticScope scope = _sitesClientDiagnostics.CreateScope("EdgeSiteCollection.Get");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, siteName, context);
+ Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ Response response = Response.FromValue(EdgeSiteData.FromResponse(result), result);
+ if (response.Value == null)
+ {
+ throw new RequestFailedException(response.GetRawResponse());
+ }
+ return Response.FromValue(new EdgeSiteResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a Site
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// Sites_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ ///
+ ///
+ /// The name of the Site.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual Response Get(string siteName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(siteName, nameof(siteName));
+
+ using DiagnosticScope scope = _sitesClientDiagnostics.CreateScope("EdgeSiteCollection.Get");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, siteName, context);
+ Response result = Pipeline.ProcessMessage(message, context);
+ Response response = Response.FromValue(EdgeSiteData.FromResponse(result), result);
+ if (response.Value == null)
+ {
+ throw new RequestFailedException(response.GetRawResponse());
+ }
+ return Response.FromValue(new EdgeSiteResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// List a Site
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites.
+ ///
+ /// -
+ /// Operation Id.
+ /// Sites_ListByResourceGroup.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default)
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ return new AsyncPageableWrapper(new SitesGetByResourceGroupAsyncCollectionResultOfT(_sitesRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, context), data => new EdgeSiteResource(Client, data));
+ }
+
+ ///
+ /// List a Site
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites.
+ ///
+ /// -
+ /// Operation Id.
+ /// Sites_ListByResourceGroup.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetAll(CancellationToken cancellationToken = default)
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ return new PageableWrapper(new SitesGetByResourceGroupCollectionResultOfT(_sitesRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, context), data => new EdgeSiteResource(Client, data));
+ }
+
+ ///
+ /// Get a Site
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// Sites_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ ///
+ ///
+ /// The name of the Site.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual async Task> ExistsAsync(string siteName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(siteName, nameof(siteName));
+
+ using DiagnosticScope scope = _sitesClientDiagnostics.CreateScope("EdgeSiteCollection.Exists");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, siteName, context);
+ await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false);
+ Response result = message.Response;
+ Response response = default;
+ switch (result.Status)
+ {
+ case 200:
+ response = Response.FromValue(EdgeSiteData.FromResponse(result), result);
+ break;
+ case 404:
+ response = Response.FromValue((EdgeSiteData)null, result);
+ break;
+ default:
+ throw new RequestFailedException(result);
+ }
+ return Response.FromValue(response.Value != null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a Site
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// Sites_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ ///
+ ///
+ /// The name of the Site.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual Response Exists(string siteName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(siteName, nameof(siteName));
+
+ using DiagnosticScope scope = _sitesClientDiagnostics.CreateScope("EdgeSiteCollection.Exists");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, siteName, context);
+ Pipeline.Send(message, context.CancellationToken);
+ Response result = message.Response;
+ Response response = default;
+ switch (result.Status)
+ {
+ case 200:
+ response = Response.FromValue(EdgeSiteData.FromResponse(result), result);
+ break;
+ case 404:
+ response = Response.FromValue((EdgeSiteData)null, result);
+ break;
+ default:
+ throw new RequestFailedException(result);
+ }
+ return Response.FromValue(response.Value != null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a Site
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// Sites_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ ///
+ ///
+ /// The name of the Site.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual async Task> GetIfExistsAsync(string siteName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(siteName, nameof(siteName));
+
+ using DiagnosticScope scope = _sitesClientDiagnostics.CreateScope("EdgeSiteCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, siteName, context);
+ await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false);
+ Response result = message.Response;
+ Response response = default;
+ switch (result.Status)
+ {
+ case 200:
+ response = Response.FromValue(EdgeSiteData.FromResponse(result), result);
+ break;
+ case 404:
+ response = Response.FromValue((EdgeSiteData)null, result);
+ break;
+ default:
+ throw new RequestFailedException(result);
+ }
+ if (response.Value == null)
+ {
+ return new NoValueResponse(response.GetRawResponse());
+ }
+ return Response.FromValue(new EdgeSiteResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a Site
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// Sites_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ ///
+ ///
+ /// The name of the Site.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual NullableResponse GetIfExists(string siteName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(siteName, nameof(siteName));
+
+ using DiagnosticScope scope = _sitesClientDiagnostics.CreateScope("EdgeSiteCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, siteName, context);
+ Pipeline.Send(message, context.CancellationToken);
+ Response result = message.Response;
+ Response response = default;
+ switch (result.Status)
+ {
+ case 200:
+ response = Response.FromValue(EdgeSiteData.FromResponse(result), result);
+ break;
+ case 404:
+ response = Response.FromValue((EdgeSiteData)null, result);
+ break;
+ default:
+ throw new RequestFailedException(result);
+ }
+ if (response.Value == null)
+ {
+ return new NoValueResponse(response.GetRawResponse());
+ }
+ return Response.FromValue(new EdgeSiteResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetAll().GetEnumerator();
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetAll().GetEnumerator();
+ }
+
+ /// The cancellation token to use.
+ IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken)
+ {
+ return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken);
+ }
+ }
+}
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/EdgeSiteData.Serialization.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/EdgeSiteData.Serialization.cs
index f5fa730277ed..cc21e660035a 100644
--- a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/EdgeSiteData.Serialization.cs
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/EdgeSiteData.Serialization.cs
@@ -10,16 +10,18 @@
using System.Collections.Generic;
using System.Text;
using System.Text.Json;
+using Azure;
using Azure.Core;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.SiteManager.Models;
namespace Azure.ResourceManager.SiteManager
{
- public partial class EdgeSiteData : IUtf8JsonSerializable, IJsonModel
+ /// Site as ARM Resource.
+ public partial class EdgeSiteData : ResourceData, IJsonModel
{
- void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
-
+ /// The JSON writer.
+ /// The client options for reading and writing models.
void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
{
writer.WriteStartObject();
@@ -31,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti
/// The client options for reading and writing models.
protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
{
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
if (format != "J")
{
throw new FormatException($"The model {nameof(EdgeSiteData)} does not support writing '{format}' format.");
}
-
base.JsonModelWriteCore(writer, options);
if (Optional.IsDefined(Properties))
{
@@ -45,87 +46,101 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri
}
}
- EdgeSiteData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ /// The JSON reader.
+ /// The client options for reading and writing models.
+ EdgeSiteData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (EdgeSiteData)JsonModelCreateCore(ref reader, options);
+
+ /// The JSON reader.
+ /// The client options for reading and writing models.
+ protected virtual ResourceData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
{
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
if (format != "J")
{
throw new FormatException($"The model {nameof(EdgeSiteData)} does not support reading '{format}' format.");
}
-
using JsonDocument document = JsonDocument.ParseValue(ref reader);
return DeserializeEdgeSiteData(document.RootElement, options);
}
- internal static EdgeSiteData DeserializeEdgeSiteData(JsonElement element, ModelReaderWriterOptions options = null)
+ /// The JSON element to deserialize.
+ /// The client options for reading and writing models.
+ internal static EdgeSiteData DeserializeEdgeSiteData(JsonElement element, ModelReaderWriterOptions options)
{
- options ??= ModelSerializationExtensions.WireOptions;
-
if (element.ValueKind == JsonValueKind.Null)
{
return null;
}
- EdgeSiteProperties properties = default;
ResourceIdentifier id = default;
string name = default;
- ResourceType type = default;
+ ResourceType resourceType = default;
SystemData systemData = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
+ IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary();
+ EdgeSiteProperties properties = default;
+ foreach (var prop in element.EnumerateObject())
{
- if (property.NameEquals("properties"u8))
+ if (prop.NameEquals("id"u8))
{
- if (property.Value.ValueKind == JsonValueKind.Null)
+ if (prop.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
- properties = EdgeSiteProperties.DeserializeEdgeSiteProperties(property.Value, options);
+ id = new ResourceIdentifier(prop.Value.GetString());
continue;
}
- if (property.NameEquals("id"u8))
+ if (prop.NameEquals("name"u8))
{
- id = new ResourceIdentifier(property.Value.GetString());
+ name = prop.Value.GetString();
continue;
}
- if (property.NameEquals("name"u8))
+ if (prop.NameEquals("type"u8))
{
- name = property.Value.GetString();
+ if (prop.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ resourceType = new ResourceType(prop.Value.GetString());
continue;
}
- if (property.NameEquals("type"u8))
+ if (prop.NameEquals("systemData"u8))
{
- type = new ResourceType(property.Value.GetString());
+ if (prop.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerSiteManagerContext.Default);
continue;
}
- if (property.NameEquals("systemData"u8))
+ if (prop.NameEquals("properties"u8))
{
- if (property.Value.ValueKind == JsonValueKind.Null)
+ if (prop.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
- systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerSiteManagerContext.Default);
+ properties = EdgeSiteProperties.DeserializeEdgeSiteProperties(prop.Value, options);
continue;
}
if (options.Format != "W")
{
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText()));
}
}
- serializedAdditionalRawData = rawDataDictionary;
return new EdgeSiteData(
id,
name,
- type,
+ resourceType,
systemData,
- properties,
- serializedAdditionalRawData);
+ additionalBinaryDataProperties,
+ properties);
}
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ /// The client options for reading and writing models.
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options);
+ /// The client options for reading and writing models.
+ protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options)
+ {
+ string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
switch (format)
{
case "J":
@@ -135,15 +150,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions option
}
}
- EdgeSiteData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ /// The data to parse.
+ /// The client options for reading and writing models.
+ EdgeSiteData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (EdgeSiteData)PersistableModelCreateCore(data, options);
+ /// The data to parse.
+ /// The client options for reading and writing models.
+ protected virtual ResourceData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options)
+ {
+ string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
switch (format)
{
case "J":
+ using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions))
{
- using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
return DeserializeEdgeSiteData(document.RootElement, options);
}
default:
@@ -151,6 +171,26 @@ EdgeSiteData IPersistableModel.Create(BinaryData data, ModelReader
}
}
+ /// The client options for reading and writing models.
string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// The to serialize into .
+ internal static RequestContent ToRequestContent(EdgeSiteData edgeSiteData)
+ {
+ if (edgeSiteData == null)
+ {
+ return null;
+ }
+ Utf8JsonRequestContent content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(edgeSiteData, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+
+ /// The to deserialize the from.
+ internal static EdgeSiteData FromResponse(Response response)
+ {
+ using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeEdgeSiteData(document.RootElement, ModelSerializationExtensions.WireOptions);
+ }
}
}
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/EdgeSiteData.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/EdgeSiteData.cs
index 5de4183138ab..373b015a85ca 100644
--- a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/EdgeSiteData.cs
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/EdgeSiteData.cs
@@ -13,43 +13,11 @@
namespace Azure.ResourceManager.SiteManager
{
- ///
- /// A class representing the EdgeSite data model.
- /// Site as ARM Resource
- ///
+ /// Site as ARM Resource.
public partial class EdgeSiteData : ResourceData
{
- ///
- /// Keeps track of any properties unknown to the library.
- ///
- /// To assign an object to the value of this property use .
- ///
- ///
- /// To assign an already formatted json string to this property use .
- ///
- ///
- /// Examples:
- ///
- /// -
- /// BinaryData.FromObjectAsJson("foo")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromString("\"foo\"")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromObjectAsJson(new { key = "value" })
- /// Creates a payload of { "key": "value" }.
- ///
- /// -
- /// BinaryData.FromString("{\"key\": \"value\"}")
- /// Creates a payload of { "key": "value" }.
- ///
- ///
- ///
- ///
- private IDictionary _serializedAdditionalRawData;
+ /// Keeps track of any properties unknown to the library.
+ private protected readonly IDictionary _additionalBinaryDataProperties;
/// Initializes a new instance of .
public EdgeSiteData()
@@ -57,16 +25,16 @@ public EdgeSiteData()
}
/// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
+ /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ /// The name of the resource.
+ /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
+ /// Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ /// Keeps track of any properties unknown to the library.
/// The resource-specific properties for this resource.
- /// Keeps track of any properties unknown to the library.
- internal EdgeSiteData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, EdgeSiteProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData)
+ internal EdgeSiteData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary additionalBinaryDataProperties, EdgeSiteProperties properties) : base(id, name, resourceType, systemData)
{
+ _additionalBinaryDataProperties = additionalBinaryDataProperties;
Properties = properties;
- _serializedAdditionalRawData = serializedAdditionalRawData;
}
/// The resource-specific properties for this resource.
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/EdgeSiteResource.Serialization.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/EdgeSiteResource.Serialization.cs
new file mode 100644
index 000000000000..968868eb441a
--- /dev/null
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/EdgeSiteResource.Serialization.cs
@@ -0,0 +1,39 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Text.Json;
+
+namespace Azure.ResourceManager.SiteManager
+{
+ ///
+ public partial class EdgeSiteResource : IJsonModel
+ {
+ private static IJsonModel s_dataDeserializationInstance;
+
+ private static IJsonModel DataDeserializationInstance => s_dataDeserializationInstance ??= new EdgeSiteData();
+
+ /// The writer to serialize the model to.
+ /// The client options for reading and writing models.
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options);
+
+ /// The reader for deserializing the model.
+ /// The client options for reading and writing models.
+ EdgeSiteData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => DataDeserializationInstance.Create(ref reader, options);
+
+ /// The client options for reading and writing models.
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerSiteManagerContext.Default);
+
+ /// The binary data to be processed.
+ /// The client options for reading and writing models.
+ EdgeSiteData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerSiteManagerContext.Default);
+
+ /// The client options for reading and writing models.
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => DataDeserializationInstance.GetFormatFromOptions(options);
+ }
+}
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/EdgeSiteResource.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/EdgeSiteResource.cs
new file mode 100644
index 000000000000..6f031db10e23
--- /dev/null
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/EdgeSiteResource.cs
@@ -0,0 +1,1035 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Diagnostics;
+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.SiteManager.Models;
+
+namespace Azure.ResourceManager.SiteManager
+{
+ ///
+ /// A class representing a EdgeSite 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 GetResource method.
+ /// Otherwise you can get one from its parent resource using the GetEdgeSites method.
+ ///
+ public partial class EdgeSiteResource : ArmResource
+ {
+ private readonly ClientDiagnostics _sitesClientDiagnostics;
+ private readonly Sites _sitesRestClient;
+ private readonly ClientDiagnostics _sitesBySubscriptionClientDiagnostics;
+ private readonly SitesBySubscription _sitesBySubscriptionRestClient;
+ private readonly ClientDiagnostics _sitesByServiceGroupClientDiagnostics;
+ private readonly SitesByServiceGroup _sitesByServiceGroupRestClient;
+ private readonly EdgeSiteData _data;
+ /// Gets the resource type for the operations.
+ public static readonly ResourceType ResourceType = "Microsoft.Edge/sites";
+
+ /// Initializes a new instance of EdgeSiteResource for mocking.
+ protected EdgeSiteResource()
+ {
+ }
+
+ /// Initializes a new instance of class.
+ /// The client parameters to use in these operations.
+ /// The resource that is the target of operations.
+ internal EdgeSiteResource(ArmClient client, EdgeSiteData data) : this(client, data.Id)
+ {
+ HasData = true;
+ _data = data;
+ }
+
+ /// Initializes a new instance of class.
+ /// The client parameters to use in these operations.
+ /// The identifier of the resource that is the target of operations.
+ internal EdgeSiteResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ TryGetApiVersion(ResourceType, out string edgeSiteApiVersion);
+ _sitesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SiteManager", ResourceType.Namespace, Diagnostics);
+ _sitesRestClient = new Sites(_sitesClientDiagnostics, Pipeline, Endpoint, edgeSiteApiVersion ?? "2025-06-01");
+ _sitesBySubscriptionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SiteManager", ResourceType.Namespace, Diagnostics);
+ _sitesBySubscriptionRestClient = new SitesBySubscription(_sitesBySubscriptionClientDiagnostics, Pipeline, Endpoint, edgeSiteApiVersion ?? "2025-06-01");
+ _sitesByServiceGroupClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SiteManager", ResourceType.Namespace, Diagnostics);
+ _sitesByServiceGroupRestClient = new SitesByServiceGroup(_sitesByServiceGroupClientDiagnostics, Pipeline, Endpoint, edgeSiteApiVersion ?? "2025-06-01");
+ ValidateResourceId(id);
+ }
+
+ /// Gets whether or not the current instance has data.
+ public virtual bool HasData { get; }
+
+ /// Gets the data representing this Feature.
+ public virtual EdgeSiteData Data
+ {
+ get
+ {
+ if (!HasData)
+ {
+ throw new InvalidOperationException("The current instance does not have data, you must call Get first.");
+ }
+ return _data;
+ }
+ }
+
+ /// Generate the resource identifier for this resource.
+ /// The subscriptionId.
+ /// The resourceGroupName.
+ /// The siteName.
+ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string siteName)
+ {
+ string resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}";
+ return new ResourceIdentifier(resourceId);
+ }
+
+ ///
+ [Conditional("DEBUG")]
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != ResourceType)
+ {
+ throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), id);
+ }
+ }
+
+ ///
+ /// Get a Site
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// Sites_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
+ {
+ using DiagnosticScope scope = _sitesClientDiagnostics.CreateScope("EdgeSiteResource.Get");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context);
+ Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ Response response = Response.FromValue(EdgeSiteData.FromResponse(result), result);
+ if (response.Value == null)
+ {
+ throw new RequestFailedException(response.GetRawResponse());
+ }
+ return Response.FromValue(new EdgeSiteResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a Site
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// Sites_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual Response Get(CancellationToken cancellationToken = default)
+ {
+ using DiagnosticScope scope = _sitesClientDiagnostics.CreateScope("EdgeSiteResource.Get");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context);
+ Response result = Pipeline.ProcessMessage(message, context);
+ Response response = Response.FromValue(EdgeSiteData.FromResponse(result), result);
+ if (response.Value == null)
+ {
+ throw new RequestFailedException(response.GetRawResponse());
+ }
+ return Response.FromValue(new EdgeSiteResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Update a Site
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// Sites_Update.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task> UpdateAsync(EdgeSitePatch patch, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(patch, nameof(patch));
+
+ using DiagnosticScope scope = _sitesClientDiagnostics.CreateScope("EdgeSiteResource.Update");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesRestClient.CreateUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, EdgeSitePatch.ToRequestContent(patch), context);
+ Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ Response response = Response.FromValue(EdgeSiteData.FromResponse(result), result);
+ if (response.Value == null)
+ {
+ throw new RequestFailedException(response.GetRawResponse());
+ }
+ return Response.FromValue(new EdgeSiteResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Update a Site
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// Sites_Update.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual Response Update(EdgeSitePatch patch, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(patch, nameof(patch));
+
+ using DiagnosticScope scope = _sitesClientDiagnostics.CreateScope("EdgeSiteResource.Update");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesRestClient.CreateUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, EdgeSitePatch.ToRequestContent(patch), context);
+ Response result = Pipeline.ProcessMessage(message, context);
+ Response response = Response.FromValue(EdgeSiteData.FromResponse(result), result);
+ if (response.Value == null)
+ {
+ throw new RequestFailedException(response.GetRawResponse());
+ }
+ return Response.FromValue(new EdgeSiteResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a Site
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// Sites_Delete.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The cancellation token to use.
+ public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default)
+ {
+ using DiagnosticScope scope = _sitesClientDiagnostics.CreateScope("EdgeSiteResource.Delete");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context);
+ Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ RequestUriBuilder uri = message.Request.Uri;
+ RehydrationToken rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ SiteManagerArmOperation operation = new SiteManagerArmOperation(response, rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ {
+ await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
+ }
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a Site
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// Sites_Delete.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The cancellation token to use.
+ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default)
+ {
+ using DiagnosticScope scope = _sitesClientDiagnostics.CreateScope("EdgeSiteResource.Delete");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context);
+ Response response = Pipeline.ProcessMessage(message, context);
+ RequestUriBuilder uri = message.Request.Uri;
+ RehydrationToken rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ SiteManagerArmOperation operation = new SiteManagerArmOperation(response, rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ {
+ operation.WaitForCompletionResponse(cancellationToken);
+ }
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a Site
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// SitesBySubscription_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
+ {
+ using DiagnosticScope scope = _sitesBySubscriptionClientDiagnostics.CreateScope("EdgeSiteResource.Get");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesBySubscriptionRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.Name, context);
+ Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ Response response = Response.FromValue(EdgeSiteData.FromResponse(result), result);
+ if (response.Value == null)
+ {
+ throw new RequestFailedException(response.GetRawResponse());
+ }
+ return Response.FromValue(new EdgeSiteResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a Site
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// SitesBySubscription_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual Response Get(CancellationToken cancellationToken = default)
+ {
+ using DiagnosticScope scope = _sitesBySubscriptionClientDiagnostics.CreateScope("EdgeSiteResource.Get");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesBySubscriptionRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.Name, context);
+ Response result = Pipeline.ProcessMessage(message, context);
+ Response response = Response.FromValue(EdgeSiteData.FromResponse(result), result);
+ if (response.Value == null)
+ {
+ throw new RequestFailedException(response.GetRawResponse());
+ }
+ return Response.FromValue(new EdgeSiteResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Update a Site
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// SitesBySubscription_Update.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task> UpdateAsync(EdgeSitePatch patch, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(patch, nameof(patch));
+
+ using DiagnosticScope scope = _sitesBySubscriptionClientDiagnostics.CreateScope("EdgeSiteResource.Update");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesBySubscriptionRestClient.CreateUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.Name, EdgeSitePatch.ToRequestContent(patch), context);
+ Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ Response response = Response.FromValue(EdgeSiteData.FromResponse(result), result);
+ if (response.Value == null)
+ {
+ throw new RequestFailedException(response.GetRawResponse());
+ }
+ return Response.FromValue(new EdgeSiteResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Update a Site
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// SitesBySubscription_Update.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual Response Update(EdgeSitePatch patch, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(patch, nameof(patch));
+
+ using DiagnosticScope scope = _sitesBySubscriptionClientDiagnostics.CreateScope("EdgeSiteResource.Update");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesBySubscriptionRestClient.CreateUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.Name, EdgeSitePatch.ToRequestContent(patch), context);
+ Response result = Pipeline.ProcessMessage(message, context);
+ Response response = Response.FromValue(EdgeSiteData.FromResponse(result), result);
+ if (response.Value == null)
+ {
+ throw new RequestFailedException(response.GetRawResponse());
+ }
+ return Response.FromValue(new EdgeSiteResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a Site
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// SitesBySubscription_Delete.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The cancellation token to use.
+ public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default)
+ {
+ using DiagnosticScope scope = _sitesBySubscriptionClientDiagnostics.CreateScope("EdgeSiteResource.Delete");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesBySubscriptionRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.Name, context);
+ Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ RequestUriBuilder uri = message.Request.Uri;
+ RehydrationToken rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ SiteManagerArmOperation operation = new SiteManagerArmOperation(response, rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ {
+ await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
+ }
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a Site
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// SitesBySubscription_Delete.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The cancellation token to use.
+ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default)
+ {
+ using DiagnosticScope scope = _sitesBySubscriptionClientDiagnostics.CreateScope("EdgeSiteResource.Delete");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesBySubscriptionRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.Name, context);
+ Response response = Pipeline.ProcessMessage(message, context);
+ RequestUriBuilder uri = message.Request.Uri;
+ RehydrationToken rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ SiteManagerArmOperation operation = new SiteManagerArmOperation(response, rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ {
+ operation.WaitForCompletionResponse(cancellationToken);
+ }
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get Site at SG scope
+ ///
+ /// -
+ /// Request Path.
+ /// /providers/Microsoft.Management/serviceGroups/{servicegroupName}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// SitesByServiceGroup_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// The name of the service group.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual async Task> GetAsync(string servicegroupName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(servicegroupName, nameof(servicegroupName));
+
+ using DiagnosticScope scope = _sitesByServiceGroupClientDiagnostics.CreateScope("EdgeSiteResource.Get");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesByServiceGroupRestClient.CreateGetRequest(servicegroupName, Id.Name, context);
+ Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ Response response = Response.FromValue(EdgeSiteData.FromResponse(result), result);
+ if (response.Value == null)
+ {
+ throw new RequestFailedException(response.GetRawResponse());
+ }
+ return Response.FromValue(new EdgeSiteResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get Site at SG scope
+ ///
+ /// -
+ /// Request Path.
+ /// /providers/Microsoft.Management/serviceGroups/{servicegroupName}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// SitesByServiceGroup_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// The name of the service group.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual Response Get(string servicegroupName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(servicegroupName, nameof(servicegroupName));
+
+ using DiagnosticScope scope = _sitesByServiceGroupClientDiagnostics.CreateScope("EdgeSiteResource.Get");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesByServiceGroupRestClient.CreateGetRequest(servicegroupName, Id.Name, context);
+ Response result = Pipeline.ProcessMessage(message, context);
+ Response response = Response.FromValue(EdgeSiteData.FromResponse(result), result);
+ if (response.Value == null)
+ {
+ throw new RequestFailedException(response.GetRawResponse());
+ }
+ return Response.FromValue(new EdgeSiteResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// update Site at SG scope
+ ///
+ /// -
+ /// Request Path.
+ /// /providers/Microsoft.Management/serviceGroups/{servicegroupName}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// SitesByServiceGroup_Update.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// The name of the service group.
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual async Task> UpdateAsync(string servicegroupName, EdgeSitePatch patch, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(servicegroupName, nameof(servicegroupName));
+ Argument.AssertNotNull(patch, nameof(patch));
+
+ using DiagnosticScope scope = _sitesByServiceGroupClientDiagnostics.CreateScope("EdgeSiteResource.Update");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesByServiceGroupRestClient.CreateUpdateRequest(servicegroupName, Id.Name, EdgeSitePatch.ToRequestContent(patch), context);
+ Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ Response response = Response.FromValue(EdgeSiteData.FromResponse(result), result);
+ if (response.Value == null)
+ {
+ throw new RequestFailedException(response.GetRawResponse());
+ }
+ return Response.FromValue(new EdgeSiteResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// update Site at SG scope
+ ///
+ /// -
+ /// Request Path.
+ /// /providers/Microsoft.Management/serviceGroups/{servicegroupName}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// SitesByServiceGroup_Update.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// The name of the service group.
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual Response Update(string servicegroupName, EdgeSitePatch patch, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(servicegroupName, nameof(servicegroupName));
+ Argument.AssertNotNull(patch, nameof(patch));
+
+ using DiagnosticScope scope = _sitesByServiceGroupClientDiagnostics.CreateScope("EdgeSiteResource.Update");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesByServiceGroupRestClient.CreateUpdateRequest(servicegroupName, Id.Name, EdgeSitePatch.ToRequestContent(patch), context);
+ Response result = Pipeline.ProcessMessage(message, context);
+ Response response = Response.FromValue(EdgeSiteData.FromResponse(result), result);
+ if (response.Value == null)
+ {
+ throw new RequestFailedException(response.GetRawResponse());
+ }
+ return Response.FromValue(new EdgeSiteResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// delete Site at SG scope
+ ///
+ /// -
+ /// Request Path.
+ /// /providers/Microsoft.Management/serviceGroups/{servicegroupName}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// SitesByServiceGroup_Delete.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The name of the service group.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual async Task DeleteAsync(WaitUntil waitUntil, string servicegroupName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(servicegroupName, nameof(servicegroupName));
+
+ using DiagnosticScope scope = _sitesByServiceGroupClientDiagnostics.CreateScope("EdgeSiteResource.Delete");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesByServiceGroupRestClient.CreateDeleteRequest(servicegroupName, Id.Name, context);
+ Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ RequestUriBuilder uri = message.Request.Uri;
+ RehydrationToken rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ SiteManagerArmOperation operation = new SiteManagerArmOperation(response, rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ {
+ await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
+ }
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// delete Site at SG scope
+ ///
+ /// -
+ /// Request Path.
+ /// /providers/Microsoft.Management/serviceGroups/{servicegroupName}/providers/Microsoft.Edge/sites/{siteName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// SitesByServiceGroup_Delete.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The name of the service group.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual ArmOperation Delete(WaitUntil waitUntil, string servicegroupName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(servicegroupName, nameof(servicegroupName));
+
+ using DiagnosticScope scope = _sitesByServiceGroupClientDiagnostics.CreateScope("EdgeSiteResource.Delete");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _sitesByServiceGroupRestClient.CreateDeleteRequest(servicegroupName, Id.Name, context);
+ Response response = Pipeline.ProcessMessage(message, context);
+ RequestUriBuilder uri = message.Request.Uri;
+ RehydrationToken rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ SiteManagerArmOperation operation = new SiteManagerArmOperation(response, rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ {
+ operation.WaitForCompletionResponse(cancellationToken);
+ }
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Extensions/MockableSiteManagerArmClient.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Extensions/MockableSiteManagerArmClient.cs
index e59a3330f8df..93d6028618ef 100644
--- a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Extensions/MockableSiteManagerArmClient.cs
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Extensions/MockableSiteManagerArmClient.cs
@@ -5,148 +5,34 @@
#nullable disable
-using System;
-using System.Threading;
-using System.Threading.Tasks;
using Azure.Core;
+using Azure.ResourceManager;
+using Azure.ResourceManager.SiteManager;
namespace Azure.ResourceManager.SiteManager.Mocking
{
- /// A class to add extension methods to ArmClient.
+ /// A class to add extension methods to .
public partial class MockableSiteManagerArmClient : ArmResource
{
- /// Initializes a new instance of the class for mocking.
+ /// Initializes a new instance of MockableSiteManagerArmClient for mocking.
protected MockableSiteManagerArmClient()
{
}
- /// Initializes a new instance of the class.
+ /// Initializes a new instance of class.
/// The client parameters to use in these operations.
/// The identifier of the resource that is the target of operations.
internal MockableSiteManagerArmClient(ArmClient client, ResourceIdentifier id) : base(client, id)
{
}
- internal MockableSiteManagerArmClient(ArmClient client) : this(client, ResourceIdentifier.Root)
- {
- }
-
- private string GetApiVersionOrNull(ResourceType resourceType)
- {
- TryGetApiVersion(resourceType, out string apiVersion);
- return apiVersion;
- }
-
- /// Gets a collection of ServiceGroupEdgeSiteResources in the ArmClient.
- /// The scope that the resource will apply against.
- /// An object representing collection of ServiceGroupEdgeSiteResources and their operations over a ServiceGroupEdgeSiteResource.
- public virtual ServiceGroupEdgeSiteCollection GetServiceGroupEdgeSites(ResourceIdentifier scope)
- {
- if (!scope.ResourceType.Equals("Microsoft.Management/serviceGroups"))
- {
- throw new ArgumentException(string.Format("Invalid resource type {0}, expected Microsoft.Management/serviceGroups", scope.ResourceType));
- }
- return new ServiceGroupEdgeSiteCollection(Client, scope);
- }
-
- ///
- /// Get Site at SG scope
- ///
- /// -
- /// Request Path
- /// /providers/Microsoft.Management/serviceGroups/{servicegroupName}/providers/Microsoft.Edge/sites/{siteName}
- ///
- /// -
- /// Operation Id
- /// Site_Get
- ///
- /// -
- /// Default Api Version
- /// 2025-06-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The scope that the resource will apply against.
- /// The name of the Site.
- /// The cancellation token to use.
- /// is null.
- /// is an empty string, and was expected to be non-empty.
- [ForwardsClientCalls]
- public virtual async Task> GetServiceGroupEdgeSiteAsync(ResourceIdentifier scope, string siteName, CancellationToken cancellationToken = default)
- {
- return await GetServiceGroupEdgeSites(scope).GetAsync(siteName, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Get Site at SG scope
- ///
- /// -
- /// Request Path
- /// /providers/Microsoft.Management/serviceGroups/{servicegroupName}/providers/Microsoft.Edge/sites/{siteName}
- ///
- /// -
- /// Operation Id
- /// Site_Get
- ///
- /// -
- /// Default Api Version
- /// 2025-06-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The scope that the resource will apply against.
- /// The name of the Site.
- /// The cancellation token to use.
- /// is null.
- /// is an empty string, and was expected to be non-empty.
- [ForwardsClientCalls]
- public virtual Response GetServiceGroupEdgeSite(ResourceIdentifier scope, string siteName, CancellationToken cancellationToken = default)
- {
- return GetServiceGroupEdgeSites(scope).Get(siteName, cancellationToken);
- }
-
- ///
- /// Gets an object representing a along with the instance operations that can be performed on it but with no data.
- /// You can use to create a from its components.
- ///
- /// The resource ID of the resource to get.
- /// Returns a object.
- public virtual ResourceGroupEdgeSiteResource GetResourceGroupEdgeSiteResource(ResourceIdentifier id)
- {
- ResourceGroupEdgeSiteResource.ValidateResourceId(id);
- return new ResourceGroupEdgeSiteResource(Client, id);
- }
-
- ///
- /// Gets an object representing a along with the instance operations that can be performed on it but with no data.
- /// You can use to create a from its components.
- ///
- /// The resource ID of the resource to get.
- /// Returns a object.
- public virtual SubscriptionEdgeSiteResource GetSubscriptionEdgeSiteResource(ResourceIdentifier id)
- {
- SubscriptionEdgeSiteResource.ValidateResourceId(id);
- return new SubscriptionEdgeSiteResource(Client, id);
- }
-
- ///
- /// Gets an object representing a along with the instance operations that can be performed on it but with no data.
- /// You can use to create a from its components.
- ///
+ /// Gets an object representing a along with the instance operations that can be performed on it but with no data.
/// The resource ID of the resource to get.
- /// Returns a object.
- public virtual ServiceGroupEdgeSiteResource GetServiceGroupEdgeSiteResource(ResourceIdentifier id)
+ /// Returns a object.
+ public virtual EdgeSiteResource GetEdgeSiteResource(ResourceIdentifier id)
{
- ServiceGroupEdgeSiteResource.ValidateResourceId(id);
- return new ServiceGroupEdgeSiteResource(Client, id);
+ EdgeSiteResource.ValidateResourceId(id);
+ return new EdgeSiteResource(Client, id);
}
}
}
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Extensions/MockableSiteManagerResourceGroupResource.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Extensions/MockableSiteManagerResourceGroupResource.cs
index 97fc2f01139d..83247f0c5a04 100644
--- a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Extensions/MockableSiteManagerResourceGroupResource.cs
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Extensions/MockableSiteManagerResourceGroupResource.cs
@@ -8,56 +8,50 @@
using System;
using System.Threading;
using System.Threading.Tasks;
+using Azure;
using Azure.Core;
+using Azure.ResourceManager;
+using Azure.ResourceManager.Resources;
+using Azure.ResourceManager.SiteManager;
namespace Azure.ResourceManager.SiteManager.Mocking
{
- /// A class to add extension methods to ResourceGroupResource.
+ /// A class to add extension methods to .
public partial class MockableSiteManagerResourceGroupResource : ArmResource
{
- /// Initializes a new instance of the class for mocking.
+ /// Initializes a new instance of MockableSiteManagerResourceGroupResource for mocking.
protected MockableSiteManagerResourceGroupResource()
{
}
- /// Initializes a new instance of the class.
+ /// Initializes a new instance of class.
/// The client parameters to use in these operations.
/// The identifier of the resource that is the target of operations.
internal MockableSiteManagerResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id)
{
}
- private string GetApiVersionOrNull(ResourceType resourceType)
+ /// Gets a collection of EdgeSites in the .
+ /// An object representing collection of EdgeSites and their operations over a EdgeSiteResource.
+ public virtual EdgeSiteCollection GetEdgeSites()
{
- TryGetApiVersion(resourceType, out string apiVersion);
- return apiVersion;
- }
-
- /// Gets a collection of ResourceGroupEdgeSiteResources in the ResourceGroupResource.
- /// An object representing collection of ResourceGroupEdgeSiteResources and their operations over a ResourceGroupEdgeSiteResource.
- public virtual ResourceGroupEdgeSiteCollection GetResourceGroupEdgeSites()
- {
- return GetCachedClient(client => new ResourceGroupEdgeSiteCollection(client, Id));
+ return GetCachedClient(client => new EdgeSiteCollection(client, Id));
}
///
/// Get a Site
///
/// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}
- ///
- /// -
- /// Operation Id
- /// Site_Get
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}.
///
/// -
- /// Default Api Version
- /// 2025-06-01
+ /// Operation Id.
+ /// Sites_Get.
///
/// -
- /// Resource
- ///
+ /// Default Api Version.
+ /// 2025-06-01.
///
///
///
@@ -66,29 +60,27 @@ public virtual ResourceGroupEdgeSiteCollection GetResourceGroupEdgeSites()
/// is null.
/// is an empty string, and was expected to be non-empty.
[ForwardsClientCalls]
- public virtual async Task> GetResourceGroupEdgeSiteAsync(string siteName, CancellationToken cancellationToken = default)
+ public virtual async Task> GetEdgeSiteAsync(string siteName, CancellationToken cancellationToken = default)
{
- return await GetResourceGroupEdgeSites().GetAsync(siteName, cancellationToken).ConfigureAwait(false);
+ Argument.AssertNotNullOrEmpty(siteName, nameof(siteName));
+
+ return await GetEdgeSites().GetAsync(siteName, cancellationToken).ConfigureAwait(false);
}
///
/// Get a Site
///
/// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}
- ///
- /// -
- /// Operation Id
- /// Site_Get
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}.
///
/// -
- /// Default Api Version
- /// 2025-06-01
+ /// Operation Id.
+ /// Sites_Get.
///
/// -
- /// Resource
- ///
+ /// Default Api Version.
+ /// 2025-06-01.
///
///
///
@@ -97,9 +89,11 @@ public virtual async Task> GetResourceGr
/// is null.
/// is an empty string, and was expected to be non-empty.
[ForwardsClientCalls]
- public virtual Response GetResourceGroupEdgeSite(string siteName, CancellationToken cancellationToken = default)
+ public virtual Response GetEdgeSite(string siteName, CancellationToken cancellationToken = default)
{
- return GetResourceGroupEdgeSites().Get(siteName, cancellationToken);
+ Argument.AssertNotNullOrEmpty(siteName, nameof(siteName));
+
+ return GetEdgeSites().Get(siteName, cancellationToken);
}
}
}
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Extensions/MockableSiteManagerSubscriptionResource.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Extensions/MockableSiteManagerSubscriptionResource.cs
index 6ad1d47bfa8e..2f7c9a870d48 100644
--- a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Extensions/MockableSiteManagerSubscriptionResource.cs
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Extensions/MockableSiteManagerSubscriptionResource.cs
@@ -7,99 +7,91 @@
using System;
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.SiteManager;
namespace Azure.ResourceManager.SiteManager.Mocking
{
- /// A class to add extension methods to SubscriptionResource.
+ /// A class to add extension methods to .
public partial class MockableSiteManagerSubscriptionResource : ArmResource
{
- /// Initializes a new instance of the class for mocking.
+ private ClientDiagnostics _sitesBySubscriptionClientDiagnostics;
+ private SitesBySubscription _sitesBySubscriptionRestClient;
+
+ /// Initializes a new instance of MockableSiteManagerSubscriptionResource for mocking.
protected MockableSiteManagerSubscriptionResource()
{
}
- /// Initializes a new instance of the class.
+ /// Initializes a new instance of class.
/// The client parameters to use in these operations.
/// The identifier of the resource that is the target of operations.
internal MockableSiteManagerSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id)
{
}
- private string GetApiVersionOrNull(ResourceType resourceType)
- {
- TryGetApiVersion(resourceType, out string apiVersion);
- return apiVersion;
- }
+ private ClientDiagnostics SitesBySubscriptionClientDiagnostics => _sitesBySubscriptionClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SiteManager.Mocking", ProviderConstants.DefaultProviderNamespace, Diagnostics);
- /// Gets a collection of SubscriptionEdgeSiteResources in the SubscriptionResource.
- /// An object representing collection of SubscriptionEdgeSiteResources and their operations over a SubscriptionEdgeSiteResource.
- public virtual SubscriptionEdgeSiteCollection GetSubscriptionEdgeSites()
- {
- return GetCachedClient(client => new SubscriptionEdgeSiteCollection(client, Id));
- }
+ private SitesBySubscription SitesBySubscriptionRestClient => _sitesBySubscriptionRestClient ??= new SitesBySubscription(SitesBySubscriptionClientDiagnostics, Pipeline, Endpoint, "2025-06-01");
///
- /// Get a Site
+ /// List Site resources by subscription ID
///
/// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites/{siteName}
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites.
///
/// -
- /// Operation Id
- /// Site_Get
+ /// Operation Id.
+ /// SitesBySubscription_List.
///
/// -
- /// Default Api Version
- /// 2025-06-01
- ///
- /// -
- /// Resource
- ///
+ /// Default Api Version.
+ /// 2025-06-01.
///
///
///
- /// The name of the Site.
/// The cancellation token to use.
- /// is null.
- /// is an empty string, and was expected to be non-empty.
- [ForwardsClientCalls]
- public virtual async Task> GetSubscriptionEdgeSiteAsync(string siteName, CancellationToken cancellationToken = default)
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetEdgeSitesAsync(CancellationToken cancellationToken = default)
{
- return await GetSubscriptionEdgeSites().GetAsync(siteName, cancellationToken).ConfigureAwait(false);
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ return new AsyncPageableWrapper(new SitesBySubscriptionGetAllAsyncCollectionResultOfT(SitesBySubscriptionRestClient, Guid.Parse(Id.SubscriptionId), context), data => new EdgeSiteResource(Client, data));
}
///
- /// Get a Site
+ /// List Site resources by subscription ID
///
/// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites/{siteName}
- ///
- /// -
- /// Operation Id
- /// Site_Get
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites.
///
/// -
- /// Default Api Version
- /// 2025-06-01
+ /// Operation Id.
+ /// SitesBySubscription_List.
///
/// -
- /// Resource
- ///
+ /// Default Api Version.
+ /// 2025-06-01.
///
///
///
- /// The name of the Site.
/// The cancellation token to use.
- /// is null.
- /// is an empty string, and was expected to be non-empty.
- [ForwardsClientCalls]
- public virtual Response GetSubscriptionEdgeSite(string siteName, CancellationToken cancellationToken = default)
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetEdgeSites(CancellationToken cancellationToken = default)
{
- return GetSubscriptionEdgeSites().Get(siteName, cancellationToken);
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ return new PageableWrapper(new SitesBySubscriptionGetAllCollectionResultOfT(SitesBySubscriptionRestClient, Guid.Parse(Id.SubscriptionId), context), data => new EdgeSiteResource(Client, data));
}
}
}
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Extensions/MockableSiteManagerTenantResource.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Extensions/MockableSiteManagerTenantResource.cs
new file mode 100644
index 000000000000..c09d3d99b03b
--- /dev/null
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Extensions/MockableSiteManagerTenantResource.cs
@@ -0,0 +1,107 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager;
+using Azure.ResourceManager.Resources;
+using Azure.ResourceManager.SiteManager;
+
+namespace Azure.ResourceManager.SiteManager.Mocking
+{
+ /// A class to add extension methods to .
+ public partial class MockableSiteManagerTenantResource : ArmResource
+ {
+ private ClientDiagnostics _sitesByServiceGroupClientDiagnostics;
+ private SitesByServiceGroup _sitesByServiceGroupRestClient;
+
+ /// Initializes a new instance of MockableSiteManagerTenantResource for mocking.
+ protected MockableSiteManagerTenantResource()
+ {
+ }
+
+ /// Initializes a new instance of class.
+ /// The client parameters to use in these operations.
+ /// The identifier of the resource that is the target of operations.
+ internal MockableSiteManagerTenantResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ }
+
+ private ClientDiagnostics SitesByServiceGroupClientDiagnostics => _sitesByServiceGroupClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SiteManager.Mocking", ProviderConstants.DefaultProviderNamespace, Diagnostics);
+
+ private SitesByServiceGroup SitesByServiceGroupRestClient => _sitesByServiceGroupRestClient ??= new SitesByServiceGroup(SitesByServiceGroupClientDiagnostics, Pipeline, Endpoint, "2025-06-01");
+
+ ///
+ /// list Site at SG scope
+ ///
+ /// -
+ /// Request Path.
+ /// /providers/Microsoft.Management/serviceGroups/{servicegroupName}/providers/Microsoft.Edge/sites.
+ ///
+ /// -
+ /// Operation Id.
+ /// SitesByServiceGroup_ListByServiceGroup.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ ///
+ ///
+ /// The name of the service group.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetEdgeSitesAsync(string servicegroupName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(servicegroupName, nameof(servicegroupName));
+
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ return new AsyncPageableWrapper(new SitesByServiceGroupGetByServiceGroupAsyncCollectionResultOfT(SitesByServiceGroupRestClient, servicegroupName, context), data => new EdgeSiteResource(Client, data));
+ }
+
+ ///
+ /// list Site at SG scope
+ ///
+ /// -
+ /// Request Path.
+ /// /providers/Microsoft.Management/serviceGroups/{servicegroupName}/providers/Microsoft.Edge/sites.
+ ///
+ /// -
+ /// Operation Id.
+ /// SitesByServiceGroup_ListByServiceGroup.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-06-01.
+ ///
+ ///
+ ///
+ /// The name of the service group.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetEdgeSites(string servicegroupName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(servicegroupName, nameof(servicegroupName));
+
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ return new PageableWrapper(new SitesByServiceGroupGetByServiceGroupCollectionResultOfT(SitesByServiceGroupRestClient, servicegroupName, context), data => new EdgeSiteResource(Client, data));
+ }
+ }
+}
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Extensions/SiteManagerExtensions.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Extensions/SiteManagerExtensions.cs
index 9eed5159978e..e8ce94de1eb5 100644
--- a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Extensions/SiteManagerExtensions.cs
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Extensions/SiteManagerExtensions.cs
@@ -8,7 +8,9 @@
using System;
using System.Threading;
using System.Threading.Tasks;
+using Azure;
using Azure.Core;
+using Azure.ResourceManager;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.SiteManager.Mocking;
@@ -17,358 +19,175 @@ namespace Azure.ResourceManager.SiteManager
/// A class to add extension methods to Azure.ResourceManager.SiteManager.
public static partial class SiteManagerExtensions
{
+ ///
private static MockableSiteManagerArmClient GetMockableSiteManagerArmClient(ArmClient client)
{
- return client.GetCachedClient(client0 => new MockableSiteManagerArmClient(client0));
+ return client.GetCachedClient(client0 => new MockableSiteManagerArmClient(client0, ResourceIdentifier.Root));
}
- private static MockableSiteManagerResourceGroupResource GetMockableSiteManagerResourceGroupResource(ArmResource resource)
+ ///
+ private static MockableSiteManagerResourceGroupResource GetMockableSiteManagerResourceGroupResource(ResourceGroupResource resourceGroupResource)
{
- return resource.GetCachedClient(client => new MockableSiteManagerResourceGroupResource(client, resource.Id));
+ return resourceGroupResource.GetCachedClient(client => new MockableSiteManagerResourceGroupResource(client, resourceGroupResource.Id));
}
- private static MockableSiteManagerSubscriptionResource GetMockableSiteManagerSubscriptionResource(ArmResource resource)
+ ///
+ private static MockableSiteManagerSubscriptionResource GetMockableSiteManagerSubscriptionResource(SubscriptionResource subscriptionResource)
{
- return resource.GetCachedClient(client => new MockableSiteManagerSubscriptionResource(client, resource.Id));
+ return subscriptionResource.GetCachedClient(client => new MockableSiteManagerSubscriptionResource(client, subscriptionResource.Id));
}
- ///
- /// Gets a collection of ServiceGroupEdgeSiteResources in the ArmClient.
- /// -
- /// Mocking
- /// To mock this method, please mock instead.
- ///
- ///
- /// The instance the method will execute against.
- /// The scope that the resource will apply against. Expected resource type includes the following: Microsoft.Management/serviceGroups.
- /// is null.
- /// An object representing collection of ServiceGroupEdgeSiteResources and their operations over a ServiceGroupEdgeSiteResource.
- public static ServiceGroupEdgeSiteCollection GetServiceGroupEdgeSites(this ArmClient client, ResourceIdentifier scope)
- {
- Argument.AssertNotNull(client, nameof(client));
-
- return GetMockableSiteManagerArmClient(client).GetServiceGroupEdgeSites(scope);
- }
-
- ///
- /// Get Site at SG scope
- ///
- /// -
- /// Request Path
- /// /providers/Microsoft.Management/serviceGroups/{servicegroupName}/providers/Microsoft.Edge/sites/{siteName}
- ///
- /// -
- /// Operation Id
- /// Site_Get
- ///
- /// -
- /// Default Api Version
- /// 2025-06-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- /// -
- /// Mocking
- /// To mock this method, please mock instead.
- ///
- ///
- /// The instance the method will execute against.
- /// The scope that the resource will apply against. Expected resource type includes the following: Microsoft.Management/serviceGroups.
- /// The name of the Site.
- /// The cancellation token to use.
- /// or is null.
- /// is an empty string, and was expected to be non-empty.
- [ForwardsClientCalls]
- public static async Task> GetServiceGroupEdgeSiteAsync(this ArmClient client, ResourceIdentifier scope, string siteName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(client, nameof(client));
-
- return await GetMockableSiteManagerArmClient(client).GetServiceGroupEdgeSiteAsync(scope, siteName, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Get Site at SG scope
- ///
- /// -
- /// Request Path
- /// /providers/Microsoft.Management/serviceGroups/{servicegroupName}/providers/Microsoft.Edge/sites/{siteName}
- ///
- /// -
- /// Operation Id
- /// Site_Get
- ///
- /// -
- /// Default Api Version
- /// 2025-06-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- /// -
- /// Mocking
- /// To mock this method, please mock instead.
- ///
- ///
- /// The instance the method will execute against.
- /// The scope that the resource will apply against. Expected resource type includes the following: Microsoft.Management/serviceGroups.
- /// The name of the Site.
- /// The cancellation token to use.
- /// or is null.
- /// is an empty string, and was expected to be non-empty.
- [ForwardsClientCalls]
- public static Response GetServiceGroupEdgeSite(this ArmClient client, ResourceIdentifier scope, string siteName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(client, nameof(client));
-
- return GetMockableSiteManagerArmClient(client).GetServiceGroupEdgeSite(scope, siteName, cancellationToken);
- }
-
- ///
- /// Gets an object representing a along with the instance operations that can be performed on it but with no data.
- /// You can use to create a from its components.
- /// -
- /// Mocking
- /// To mock this method, please mock instead.
- ///
- ///
- /// The instance the method will execute against.
- /// The resource ID of the resource to get.
- /// is null.
- /// Returns a object.
- public static ResourceGroupEdgeSiteResource GetResourceGroupEdgeSiteResource(this ArmClient client, ResourceIdentifier id)
+ ///
+ private static MockableSiteManagerTenantResource GetMockableSiteManagerTenantResource(TenantResource tenantResource)
{
- Argument.AssertNotNull(client, nameof(client));
-
- return GetMockableSiteManagerArmClient(client).GetResourceGroupEdgeSiteResource(id);
+ return tenantResource.GetCachedClient(client => new MockableSiteManagerTenantResource(client, tenantResource.Id));
}
///
- /// Gets an object representing a along with the instance operations that can be performed on it but with no data.
- /// You can use to create a from its components.
+ /// Gets an object representing a along with the instance operations that can be performed on it but with no data.
/// -
- /// Mocking
- /// To mock this method, please mock instead.
+ /// Mocking.
+ /// To mock this method, please mock instead.
///
///
- /// The instance the method will execute against.
+ /// The the method will execute against.
/// The resource ID of the resource to get.
/// is null.
- /// Returns a object.
- public static SubscriptionEdgeSiteResource GetSubscriptionEdgeSiteResource(this ArmClient client, ResourceIdentifier id)
+ /// Returns a object.
+ public static EdgeSiteResource GetEdgeSiteResource(this ArmClient client, ResourceIdentifier id)
{
Argument.AssertNotNull(client, nameof(client));
- return GetMockableSiteManagerArmClient(client).GetSubscriptionEdgeSiteResource(id);
+ return GetMockableSiteManagerArmClient(client).GetEdgeSiteResource(id);
}
///
- /// Gets an object representing a along with the instance operations that can be performed on it but with no data.
- /// You can use to create a from its components.
+ /// Gets a collection of EdgeSites in the
/// -
- /// Mocking
- /// To mock this method, please mock instead.
+ /// Mocking.
+ /// To mock this method, please mock instead.
///
///
- /// The instance the method will execute against.
- /// The resource ID of the resource to get.
- /// is null.
- /// Returns a object.
- public static ServiceGroupEdgeSiteResource GetServiceGroupEdgeSiteResource(this ArmClient client, ResourceIdentifier id)
+ /// The the method will execute against.
+ /// is null.
+ /// An object representing collection of EdgeSites and their operations over a EdgeSiteResource.
+ public static EdgeSiteCollection GetEdgeSites(this ResourceGroupResource resourceGroupResource)
{
- Argument.AssertNotNull(client, nameof(client));
+ Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
- return GetMockableSiteManagerArmClient(client).GetServiceGroupEdgeSiteResource(id);
+ return GetMockableSiteManagerResourceGroupResource(resourceGroupResource).GetEdgeSites();
}
///
- /// Gets a collection of ResourceGroupEdgeSiteResources in the ResourceGroupResource.
+ /// Get a Site
/// -
- /// Mocking
- /// To mock this method, please mock instead.
+ /// Mocking.
+ /// To mock this method, please mock instead.
///
///
- /// The instance the method will execute against.
+ /// The the method will execute against.
+ /// The name of the Site.
+ /// The cancellation token to use.
/// is null.
- /// An object representing collection of ResourceGroupEdgeSiteResources and their operations over a ResourceGroupEdgeSiteResource.
- public static ResourceGroupEdgeSiteCollection GetResourceGroupEdgeSites(this ResourceGroupResource resourceGroupResource)
+ [ForwardsClientCalls]
+ public static async Task> GetEdgeSiteAsync(this ResourceGroupResource resourceGroupResource, string siteName, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
- return GetMockableSiteManagerResourceGroupResource(resourceGroupResource).GetResourceGroupEdgeSites();
+ return await GetMockableSiteManagerResourceGroupResource(resourceGroupResource).GetEdgeSiteAsync(siteName, cancellationToken).ConfigureAwait(false);
}
///
/// Get a Site
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}
- ///
- /// -
- /// Operation Id
- /// Site_Get
- ///
- /// -
- /// Default Api Version
- /// 2025-06-01
- ///
/// -
- /// Resource
- ///
- ///
- ///
- /// -
- /// Mocking
- /// To mock this method, please mock instead.
+ /// Mocking.
+ /// To mock this method, please mock instead.
///
///
- /// The instance the method will execute against.
+ /// The the method will execute against.
/// The name of the Site.
/// The cancellation token to use.
- /// or is null.
- /// is an empty string, and was expected to be non-empty.
+ /// is null.
[ForwardsClientCalls]
- public static async Task> GetResourceGroupEdgeSiteAsync(this ResourceGroupResource resourceGroupResource, string siteName, CancellationToken cancellationToken = default)
+ public static Response GetEdgeSite(this ResourceGroupResource resourceGroupResource, string siteName, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
- return await GetMockableSiteManagerResourceGroupResource(resourceGroupResource).GetResourceGroupEdgeSiteAsync(siteName, cancellationToken).ConfigureAwait(false);
+ return GetMockableSiteManagerResourceGroupResource(resourceGroupResource).GetEdgeSite(siteName, cancellationToken);
}
///
- /// Get a Site
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}
- ///
- /// -
- /// Operation Id
- /// Site_Get
- ///
- /// -
- /// Default Api Version
- /// 2025-06-01
- ///
+ /// List Site resources by subscription ID
/// -
- /// Resource
- ///
- ///
- ///
- /// -
- /// Mocking
- /// To mock this method, please mock instead.
+ /// Mocking.
+ /// To mock this method, please mock instead.
///
///
- /// The instance the method will execute against.
- /// The name of the Site.
+ /// The the method will execute against.
/// The cancellation token to use.
- /// or is null.
- /// is an empty string, and was expected to be non-empty.
- [ForwardsClientCalls]
- public static Response GetResourceGroupEdgeSite(this ResourceGroupResource resourceGroupResource, string siteName, CancellationToken cancellationToken = default)
+ /// is null.
+ /// A collection of that may take multiple service requests to iterate over.
+ public static AsyncPageable GetEdgeSitesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default)
{
- Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
+ Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource));
- return GetMockableSiteManagerResourceGroupResource(resourceGroupResource).GetResourceGroupEdgeSite(siteName, cancellationToken);
+ return GetMockableSiteManagerSubscriptionResource(subscriptionResource).GetEdgeSitesAsync(cancellationToken);
}
///
- /// Gets a collection of SubscriptionEdgeSiteResources in the SubscriptionResource.
+ /// List Site resources by subscription ID
/// -
- /// Mocking
- /// To mock this method, please mock instead.
+ /// Mocking.
+ /// To mock this method, please mock instead.
///
///
- /// The instance the method will execute against.
+ /// The the method will execute against.
+ /// The cancellation token to use.
/// is null.
- /// An object representing collection of SubscriptionEdgeSiteResources and their operations over a SubscriptionEdgeSiteResource.
- public static SubscriptionEdgeSiteCollection GetSubscriptionEdgeSites(this SubscriptionResource subscriptionResource)
+ /// A collection of that may take multiple service requests to iterate over.
+ public static Pageable GetEdgeSites(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource));
- return GetMockableSiteManagerSubscriptionResource(subscriptionResource).GetSubscriptionEdgeSites();
+ return GetMockableSiteManagerSubscriptionResource(subscriptionResource).GetEdgeSites(cancellationToken);
}
///
- /// Get a Site
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites/{siteName}
- ///
+ /// list Site at SG scope
/// -
- /// Operation Id
- /// Site_Get
- ///
- /// -
- /// Default Api Version
- /// 2025-06-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- /// -
- /// Mocking
- /// To mock this method, please mock instead.
+ /// Mocking.
+ /// To mock this method, please mock instead.
///
///
- /// The instance the method will execute against.
- /// The name of the Site.
+ /// The the method will execute against.
+ /// The name of the service group.
/// The cancellation token to use.
- /// or is null.
- /// is an empty string, and was expected to be non-empty.
- [ForwardsClientCalls]
- public static async Task> GetSubscriptionEdgeSiteAsync(this SubscriptionResource subscriptionResource, string siteName, CancellationToken cancellationToken = default)
+ /// is null.
+ /// A collection of that may take multiple service requests to iterate over.
+ public static AsyncPageable GetEdgeSitesAsync(this TenantResource tenantResource, string servicegroupName, CancellationToken cancellationToken = default)
{
- Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource));
+ Argument.AssertNotNull(tenantResource, nameof(tenantResource));
- return await GetMockableSiteManagerSubscriptionResource(subscriptionResource).GetSubscriptionEdgeSiteAsync(siteName, cancellationToken).ConfigureAwait(false);
+ return GetMockableSiteManagerTenantResource(tenantResource).GetEdgeSitesAsync(servicegroupName, cancellationToken);
}
///
- /// Get a Site
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites/{siteName}
- ///
- /// -
- /// Operation Id
- /// Site_Get
- ///
+ /// list Site at SG scope
/// -
- /// Default Api Version
- /// 2025-06-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- /// -
- /// Mocking
- /// To mock this method, please mock instead.
+ /// Mocking.
+ /// To mock this method, please mock instead.
///
///
- /// The instance the method will execute against.
- /// The name of the Site.
+ /// The the method will execute against.
+ /// The name of the service group.
/// The cancellation token to use.
- /// or is null.
- /// is an empty string, and was expected to be non-empty.
- [ForwardsClientCalls]
- public static Response GetSubscriptionEdgeSite(this SubscriptionResource subscriptionResource, string siteName, CancellationToken cancellationToken = default)
+ /// is null.
+ /// A collection of that may take multiple service requests to iterate over.
+ public static Pageable GetEdgeSites(this TenantResource tenantResource, string servicegroupName, CancellationToken cancellationToken = default)
{
- Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource));
+ Argument.AssertNotNull(tenantResource, nameof(tenantResource));
- return GetMockableSiteManagerSubscriptionResource(subscriptionResource).GetSubscriptionEdgeSite(siteName, cancellationToken);
+ return GetMockableSiteManagerTenantResource(tenantResource).GetEdgeSites(servicegroupName, cancellationToken);
}
}
}
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/Argument.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/Argument.cs
index a33cae7b9b4a..17963b14d1dd 100644
--- a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/Argument.cs
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/Argument.cs
@@ -11,8 +11,10 @@
namespace Azure.ResourceManager.SiteManager
{
- internal static class Argument
+ internal static partial class Argument
{
+ /// The value.
+ /// The name.
public static void AssertNotNull(T value, string name)
{
if (value is null)
@@ -21,8 +23,10 @@ public static void AssertNotNull(T value, string name)
}
}
+ /// The value.
+ /// The name.
public static void AssertNotNull(T? value, string name)
- where T : struct
+ where T : struct
{
if (!value.HasValue)
{
@@ -30,6 +34,8 @@ public static void AssertNotNull(T? value, string name)
}
}
+ /// The value.
+ /// The name.
public static void AssertNotNullOrEmpty(IEnumerable value, string name)
{
if (value is null)
@@ -51,6 +57,8 @@ public static void AssertNotNullOrEmpty(IEnumerable value, string name)
}
}
+ /// The value.
+ /// The name.
public static void AssertNotNullOrEmpty(string value, string name)
{
if (value is null)
@@ -62,68 +70,5 @@ public static void AssertNotNullOrEmpty(string value, string name)
throw new ArgumentException("Value cannot be an empty string.", name);
}
}
-
- public static void AssertNotNullOrWhiteSpace(string value, string name)
- {
- if (value is null)
- {
- throw new ArgumentNullException(name);
- }
- if (string.IsNullOrWhiteSpace(value))
- {
- throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name);
- }
- }
-
- public static void AssertNotDefault(ref T value, string name)
- where T : struct, IEquatable
- {
- if (value.Equals(default))
- {
- throw new ArgumentException("Value cannot be empty.", name);
- }
- }
-
- public static void AssertInRange(T value, T minimum, T maximum, string name)
- where T : notnull, IComparable
- {
- if (minimum.CompareTo(value) > 0)
- {
- throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed.");
- }
- if (maximum.CompareTo(value) < 0)
- {
- throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed.");
- }
- }
-
- public static void AssertEnumDefined(Type enumType, object value, string name)
- {
- if (!Enum.IsDefined(enumType, value))
- {
- throw new ArgumentException($"Value not defined for {enumType.FullName}.", name);
- }
- }
-
- public static T CheckNotNull(T value, string name)
- where T : class
- {
- AssertNotNull(value, name);
- return value;
- }
-
- public static string CheckNotNullOrEmpty(string value, string name)
- {
- AssertNotNullOrEmpty(value, name);
- return value;
- }
-
- public static void AssertNull(T value, string name, string message = null)
- {
- if (value != null)
- {
- throw new ArgumentException(message ?? "Value must be null.", name);
- }
- }
}
}
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/AsyncPageableWrapper.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/AsyncPageableWrapper.cs
new file mode 100644
index 000000000000..ac70ae40df18
--- /dev/null
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/AsyncPageableWrapper.cs
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Azure;
+
+namespace Azure.ResourceManager.SiteManager
+{
+ internal partial class AsyncPageableWrapper : AsyncPageable
+ {
+ /// The source async pageable value of type AsyncPageable<T>.
+ private AsyncPageable _source;
+ /// The converter function from T to U.
+ private Func _converter;
+
+ /// Initializes a new instance of the AsyncPageableWrapper class.
+ /// The source async pageable value of type AsyncPageable<T>.
+ /// The converter function from T to U.
+ public AsyncPageableWrapper(AsyncPageable source, Func converter)
+ {
+ _source = source;
+ _converter = converter;
+ }
+
+ /// Converts the pages from AsyncPageable to Page.
+ /// A continuation token from a previous response.
+ /// An optional hint to specify the desired size of each page.
+ /// An enumerable of pages containing converted items of type U.
+ public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint)
+ {
+ await foreach (Page page in _source.AsPages(continuationToken, pageSizeHint).ConfigureAwait(false))
+ {
+ List convertedItems = new List();
+ foreach (T item in page.Values)
+ {
+ convertedItems.Add(_converter.Invoke(item));
+ }
+ yield return Page.FromValues(convertedItems, page.ContinuationToken, page.GetRawResponse());
+ }
+ }
+ }
+}
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/ChangeTrackingDictionary.cs
index d1195c913a7f..05ba92deaba9 100644
--- a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/ChangeTrackingDictionary.cs
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/ChangeTrackingDictionary.cs
@@ -11,7 +11,8 @@
namespace Azure.ResourceManager.SiteManager
{
- internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull
+ internal partial class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary
+ where TKey : notnull
{
private IDictionary _innerDictionary;
@@ -19,6 +20,7 @@ public ChangeTrackingDictionary()
{
}
+ /// The inner dictionary.
public ChangeTrackingDictionary(IDictionary dictionary)
{
if (dictionary == null)
@@ -28,6 +30,7 @@ public ChangeTrackingDictionary(IDictionary dictionary)
_innerDictionary = new Dictionary(dictionary);
}
+ /// The inner dictionary.
public ChangeTrackingDictionary(IReadOnlyDictionary dictionary)
{
if (dictionary == null)
@@ -41,16 +44,22 @@ public ChangeTrackingDictionary(IReadOnlyDictionary dictionary)
}
}
+ /// Gets the IsUndefined.
public bool IsUndefined => _innerDictionary == null;
+ /// Gets the Count.
public int Count => IsUndefined ? 0 : EnsureDictionary().Count;
+ /// Gets the IsReadOnly.
public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly;
+ /// Gets the Keys.
public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys;
+ /// Gets the Values.
public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values;
+ /// Gets or sets the value associated with the specified key.
public TValue this[TKey key]
{
get
@@ -67,8 +76,10 @@ public TValue this[TKey key]
}
}
+ /// Gets the Keys.
IEnumerable IReadOnlyDictionary.Keys => Keys;
+ /// Gets the Values.
IEnumerable IReadOnlyDictionary.Values => Values;
public IEnumerator> GetEnumerator()
@@ -89,6 +100,7 @@ IEnumerator IEnumerable.GetEnumerator()
return GetEnumerator();
}
+ /// The item to add.
public void Add(KeyValuePair item)
{
EnsureDictionary().Add(item);
@@ -99,6 +111,7 @@ public void Clear()
EnsureDictionary().Clear();
}
+ /// The item to search for.
public bool Contains(KeyValuePair item)
{
if (IsUndefined)
@@ -108,6 +121,8 @@ public bool Contains(KeyValuePair item)
return EnsureDictionary().Contains(item);
}
+ /// The array to copy.
+ /// The index.
public void CopyTo(KeyValuePair[] array, int index)
{
if (IsUndefined)
@@ -117,6 +132,7 @@ public void CopyTo(KeyValuePair[] array, int index)
EnsureDictionary().CopyTo(array, index);
}
+ /// The item to remove.
public bool Remove(KeyValuePair item)
{
if (IsUndefined)
@@ -126,11 +142,14 @@ public bool Remove(KeyValuePair item)
return EnsureDictionary().Remove(item);
}
+ /// The key.
+ /// The value to add.
public void Add(TKey key, TValue value)
{
EnsureDictionary().Add(key, value);
}
+ /// The key to search for.
public bool ContainsKey(TKey key)
{
if (IsUndefined)
@@ -140,6 +159,7 @@ public bool ContainsKey(TKey key)
return EnsureDictionary().ContainsKey(key);
}
+ /// The key.
public bool Remove(TKey key)
{
if (IsUndefined)
@@ -149,6 +169,8 @@ public bool Remove(TKey key)
return EnsureDictionary().Remove(key);
}
+ /// The key to search for.
+ /// The value.
public bool TryGetValue(TKey key, out TValue value)
{
if (IsUndefined)
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/ChangeTrackingList.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/ChangeTrackingList.cs
index d7c37dce15ea..46e80e68c1f7 100644
--- a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/ChangeTrackingList.cs
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/ChangeTrackingList.cs
@@ -12,7 +12,7 @@
namespace Azure.ResourceManager.SiteManager
{
- internal class ChangeTrackingList : IList, IReadOnlyList
+ internal partial class ChangeTrackingList : IList, IReadOnlyList
{
private IList _innerList;
@@ -20,6 +20,7 @@ public ChangeTrackingList()
{
}
+ /// The inner list.
public ChangeTrackingList(IList innerList)
{
if (innerList != null)
@@ -28,6 +29,7 @@ public ChangeTrackingList(IList innerList)
}
}
+ /// The inner list.
public ChangeTrackingList(IReadOnlyList innerList)
{
if (innerList != null)
@@ -36,12 +38,16 @@ public ChangeTrackingList(IReadOnlyList innerList)
}
}
+ /// Gets the IsUndefined.
public bool IsUndefined => _innerList == null;
+ /// Gets the Count.
public int Count => IsUndefined ? 0 : EnsureList().Count;
+ /// Gets the IsReadOnly.
public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly;
+ /// Gets or sets the value associated with the specified key.
public T this[int index]
{
get
@@ -85,6 +91,7 @@ IEnumerator IEnumerable.GetEnumerator()
return GetEnumerator();
}
+ /// The item to add.
public void Add(T item)
{
EnsureList().Add(item);
@@ -95,6 +102,7 @@ public void Clear()
EnsureList().Clear();
}
+ /// The item.
public bool Contains(T item)
{
if (IsUndefined)
@@ -104,6 +112,8 @@ public bool Contains(T item)
return EnsureList().Contains(item);
}
+ /// The array to copy to.
+ /// The array index.
public void CopyTo(T[] array, int arrayIndex)
{
if (IsUndefined)
@@ -113,6 +123,7 @@ public void CopyTo(T[] array, int arrayIndex)
EnsureList().CopyTo(array, arrayIndex);
}
+ /// The item.
public bool Remove(T item)
{
if (IsUndefined)
@@ -122,6 +133,7 @@ public bool Remove(T item)
return EnsureList().Remove(item);
}
+ /// The item.
public int IndexOf(T item)
{
if (IsUndefined)
@@ -131,11 +143,14 @@ public int IndexOf(T item)
return EnsureList().IndexOf(item);
}
+ /// The inner list.
+ /// The item.
public void Insert(int index, T item)
{
EnsureList().Insert(index, item);
}
+ /// The inner list.
public void RemoveAt(int index)
{
if (IsUndefined)
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/ClientPipelineExtensions.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/ClientPipelineExtensions.cs
new file mode 100644
index 000000000000..3b04d8b280b0
--- /dev/null
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/ClientPipelineExtensions.cs
@@ -0,0 +1,72 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.SiteManager
+{
+ internal static partial class ClientPipelineExtensions
+ {
+ public static async ValueTask ProcessMessageAsync(this HttpPipeline pipeline, HttpMessage message, RequestContext context)
+ {
+ (CancellationToken userCancellationToken, ErrorOptions statusOption) = context.Parse();
+ await pipeline.SendAsync(message, userCancellationToken).ConfigureAwait(false);
+
+ if (message.Response.IsError && (context?.ErrorOptions & ErrorOptions.NoThrow) != ErrorOptions.NoThrow)
+ {
+ throw new RequestFailedException(message.Response);
+ }
+
+ return message.Response;
+ }
+
+ public static Response ProcessMessage(this HttpPipeline pipeline, HttpMessage message, RequestContext context)
+ {
+ (CancellationToken userCancellationToken, ErrorOptions statusOption) = context.Parse();
+ pipeline.Send(message, userCancellationToken);
+
+ if (message.Response.IsError && (context?.ErrorOptions & ErrorOptions.NoThrow) != ErrorOptions.NoThrow)
+ {
+ throw new RequestFailedException(message.Response);
+ }
+
+ return message.Response;
+ }
+
+ public static async ValueTask> ProcessHeadAsBoolMessageAsync(this HttpPipeline pipeline, HttpMessage message, RequestContext context)
+ {
+ Response response = await pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ switch (response.Status)
+ {
+ case >= 200 and < 300:
+ return Response.FromValue(true, response);
+ case >= 400 and < 500:
+ return Response.FromValue(false, response);
+ default:
+ return new ErrorResult(response, new RequestFailedException(response));
+ }
+ }
+
+ public static Response ProcessHeadAsBoolMessage(this HttpPipeline pipeline, HttpMessage message, RequestContext context)
+ {
+ Response response = pipeline.ProcessMessage(message, context);
+ switch (response.Status)
+ {
+ case >= 200 and < 300:
+ return Response.FromValue(true, response);
+ case >= 400 and < 500:
+ return Response.FromValue(false, response);
+ default:
+ return new ErrorResult(response, new RequestFailedException(response));
+ }
+ }
+ }
+}
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/CodeGenMemberAttribute.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/CodeGenMemberAttribute.cs
new file mode 100644
index 000000000000..2533ebf99637
--- /dev/null
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/CodeGenMemberAttribute.cs
@@ -0,0 +1,20 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+
+namespace Azure.ResourceManager.SiteManager
+{
+ [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))]
+ internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute
+ {
+ /// The original name of the member.
+ public CodeGenMemberAttribute(string originalName) : base(originalName)
+ {
+ }
+ }
+}
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/CodeGenSerializationAttribute.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/CodeGenSerializationAttribute.cs
new file mode 100644
index 000000000000..06584bbae07b
--- /dev/null
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/CodeGenSerializationAttribute.cs
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+
+namespace Azure.ResourceManager.SiteManager
+{
+ [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)]
+ internal partial class CodeGenSerializationAttribute : Attribute
+ {
+ /// The property name which these hooks apply to.
+ public CodeGenSerializationAttribute(string propertyName)
+ {
+ PropertyName = propertyName;
+ }
+
+ /// The property name which these hooks apply to.
+ /// The serialization name of the property.
+ public CodeGenSerializationAttribute(string propertyName, string serializationName)
+ {
+ PropertyName = propertyName;
+ SerializationName = serializationName;
+ }
+
+ /// Gets or sets the property name which these hooks should apply to.
+ public string PropertyName { get; }
+
+ /// Gets or sets the serialization name of the property.
+ public string SerializationName { get; set; }
+
+ ///
+ /// Gets or sets the method name to use when serializing the property value (property name excluded).
+ /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer);
+ ///
+ public string SerializationValueHook { get; set; }
+
+ ///
+ /// Gets or sets the method name to use when deserializing the property value from the JSON.
+ /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required
+ /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional
+ ///
+ public string DeserializationValueHook { get; set; }
+ }
+}
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/CodeGenSuppressAttribute.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/CodeGenSuppressAttribute.cs
new file mode 100644
index 000000000000..057b824d2ec3
--- /dev/null
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/CodeGenSuppressAttribute.cs
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+
+namespace Azure.ResourceManager.SiteManager
+{
+ [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)]
+ internal partial class CodeGenSuppressAttribute : Attribute
+ {
+ /// The member to suppress.
+ /// The types of the parameters of the member.
+ public CodeGenSuppressAttribute(string member, params Type[] parameters)
+ {
+ Member = member;
+ Parameters = parameters;
+ }
+
+ /// Gets the Member.
+ public string Member { get; }
+
+ /// Gets the Parameters.
+ public Type[] Parameters { get; }
+ }
+}
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/CodeGenTypeAttribute.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/CodeGenTypeAttribute.cs
new file mode 100644
index 000000000000..854c23271e62
--- /dev/null
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/CodeGenTypeAttribute.cs
@@ -0,0 +1,24 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+
+namespace Azure.ResourceManager.SiteManager
+{
+ [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct))]
+ internal partial class CodeGenTypeAttribute : Attribute
+ {
+ /// The original name of the type.
+ public CodeGenTypeAttribute(string originalName)
+ {
+ OriginalName = originalName;
+ }
+
+ /// Gets the OriginalName.
+ public string OriginalName { get; }
+ }
+}
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/ErrorResult.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/ErrorResult.cs
new file mode 100644
index 000000000000..59e7a920ce13
--- /dev/null
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/ErrorResult.cs
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using Azure;
+
+namespace Azure.ResourceManager.SiteManager
+{
+ internal partial class ErrorResult : Response
+ {
+ private readonly Response _response;
+ private readonly RequestFailedException _exception;
+
+ public ErrorResult(Response response, RequestFailedException exception)
+ {
+ _response = response;
+ _exception = exception;
+ }
+
+ /// Gets the Value.
+ public override T Value => throw _exception;
+
+ ///
+ public override Response GetRawResponse()
+ {
+ return _response;
+ }
+ }
+}
diff --git a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/ModelSerializationExtensions.cs
index ce0d722494ae..470fd0e1cc1d 100644
--- a/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/ModelSerializationExtensions.cs
+++ b/sdk/sitemanager/Azure.ResourceManager.SiteManager/src/Generated/Internal/ModelSerializationExtensions.cs
@@ -11,18 +11,16 @@
using System.Diagnostics;
using System.Globalization;
using System.Text.Json;
-using System.Xml;
-using Azure.Core;
namespace Azure.ResourceManager.SiteManager
{
- internal static class ModelSerializationExtensions
+ internal static partial class ModelSerializationExtensions
{
- internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions { MaxDepth = 256 };
internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W");
- internal static readonly ModelReaderWriterOptions WireV3Options = new ModelReaderWriterOptions("W|v3");
- internal static readonly ModelReaderWriterOptions JsonV3Options = new ModelReaderWriterOptions("J|v3");
- internal static readonly BinaryData SentinelValue = BinaryData.FromBytes("\"__EMPTY__\""u8.ToArray());
+ internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions
+ {
+ MaxDepth = 256
+ };
public static object GetObject(this JsonElement element)
{
@@ -48,14 +46,14 @@ public static object GetObject(this JsonElement element)
case JsonValueKind.Null:
return null;
case JsonValueKind.Object:
- var dictionary = new Dictionary();
+ Dictionary dictionary = new Dictionary();
foreach (var jsonProperty in element.EnumerateObject())
{
dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject());
}
return dictionary;
case JsonValueKind.Array:
- var list = new List